/* ===========================================================
   吉风羽跃 · 时光浮窗助手样式表
   科技几何风 · 浮动气泡 + 聊天对话框
   =========================================================== */

/* ---------- 基础重置 ---------- */
.hermes-widget *,
.hermes-widget *::before,
.hermes-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hermes-widget {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ===========================================================
   浮动按钮 — 科技几何圆圈
   =========================================================== */

.hermes-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 999999;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hermes-btn:hover {
    transform: scale(1.08);
}

.hermes-btn:active {
    transform: scale(0.95);
}

/* 外圈发光环 */
.hermes-btn-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        rgba(0, 180, 255, 0.6),
        rgba(120, 80, 255, 0.4),
        rgba(0, 255, 200, 0.5),
        rgba(0, 180, 255, 0.6)
    );
    animation: hermes-ring-spin 4s linear infinite;
    mask: radial-gradient(circle, transparent 58%, black 62%);
    -webkit-mask: radial-gradient(circle, transparent 58%, black 62%);
}

@keyframes hermes-ring-spin {
    to { transform: rotate(360deg); }
}

/* 按钮主体 — 深色半透明 */
.hermes-btn-body {
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(16, 24, 48, 0.95),
        rgba(8, 12, 30, 0.98)
    );
    border: 1.5px solid rgba(0, 200, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ===== 几何图案：六边形 + 三角 ===== */

/* 中央六边形 */
.hermes-btn-hex {
    position: absolute;
    width: 28px;
    height: 32px;
    background: rgba(0, 180, 255, 0.15);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(0, 200, 255, 0.4);
    animation: hermes-hex-float 3s ease-in-out infinite;
}

@keyframes hermes-hex-float {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.1) rotate(30deg); opacity: 1; }
}

/* 内层小六边形 */
.hermes-btn-hex-inner {
    position: absolute;
    width: 16px;
    height: 18px;
    background: rgba(0, 220, 255, 0.2);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(0, 220, 255, 0.5);
    animation: hermes-hex-inner-spin 4s linear infinite;
}

@keyframes hermes-hex-inner-spin {
    to { transform: rotate(360deg); }
}

/* 四个小三角点缀 */
.hermes-btn-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(0, 200, 255, 0.6);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.hermes-btn-dot:nth-child(4) { top: 8px; left: 50%; transform: translateX(-50%); }
.hermes-btn-dot:nth-child(5) { bottom: 8px; left: 50%; transform: translateX(-50%) rotate(180deg); }
.hermes-btn-dot:nth-child(6) { top: 50%; left: 10px; transform: translateY(-50%) rotate(-90deg); }
.hermes-btn-dot:nth-child(7) { top: 50%; right: 10px; transform: translateY(-50%) rotate(90deg); }

/* 电路线 — 细微的科技感线条 */
.hermes-btn-line {
    position: absolute;
    background: rgba(0, 200, 255, 0.15);
}

.hermes-btn-line:nth-child(8) {
    top: 20px; left: 6px;
    width: 12px; height: 1px;
}

.hermes-btn-line:nth-child(9) {
    top: 20px; left: 6px;
    width: 1px; height: 10px;
}

.hermes-btn-line:nth-child(10) {
    bottom: 18px; right: 8px;
    width: 14px; height: 1px;
}

.hermes-btn-line:nth-child(11) {
    bottom: 18px; right: 8px;
    width: 1px; height: 8px;
}

/* 闪烁光点 */
.hermes-btn-glow {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #00d4ff;
    box-shadow: 0 0 6px #00d4ff, 0 0 12px rgba(0, 212, 255, 0.3);
    animation: hermes-glow-pulse 2s ease-in-out infinite;
}

.hermes-btn-glow:nth-child(12) { top: 12px; right: 12px; animation-delay: 0s; }
.hermes-btn-glow:nth-child(13) { bottom: 14px; left: 14px; animation-delay: 1s; }

@keyframes hermes-glow-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* 呼吸光晕 */
.hermes-btn-glow-bg {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(0, 180, 255, 0.08) 0%,
        transparent 70%
    );
    animation: hermes-breath 3s ease-in-out infinite;
}

@keyframes hermes-breath {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===========================================================
   聊天对话框
   =========================================================== */

.hermes-chat {
    position: fixed;
    bottom: 104px;
    right: 30px;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 140px);
    background: rgba(11, 16, 35, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 180, 255, 0.15);
    border-radius: 18px;
    z-index: 999998;
    display: none;
    flex-direction: column;
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 60px rgba(0, 180, 255, 0.03);
    overflow: hidden;
    animation: hermes-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hermes-chat.open {
    display: flex;
}

@keyframes hermes-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ----- 头部 ----- */
.hermes-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.08);
    flex-shrink: 0;
}

.hermes-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hermes-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.2), rgba(120, 80, 255, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 200, 255, 0.2);
    font-size: 16px;
}

.hermes-chat-title {
    color: rgba(220, 235, 255, 0.9);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hermes-chat-status {
    color: rgba(100, 200, 255, 0.5);
    font-size: 11px;
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hermes-chat-status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #00d484;
    animation: hermes-dot-pulse 2s ease-in-out infinite;
}

@keyframes hermes-dot-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.hermes-chat-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(180, 200, 230, 0.4);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.hermes-chat-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(180, 200, 230, 0.8);
}

/* ----- 角色标签（游客/队员） ----- */
.hermes-chat-mode {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.hermes-chat-mode.visitor {
    background: rgba(255, 180, 60, 0.1);
    color: rgba(255, 180, 60, 0.7);
    border: 1px solid rgba(255, 180, 60, 0.15);
}

.hermes-chat-mode.member {
    background: rgba(0, 212, 255, 0.1);
    color: rgba(0, 212, 255, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

/* ----- 消息区域 ----- */
.hermes-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 8px;
    scroll-behavior: smooth;
}

.hermes-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.hermes-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.hermes-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 255, 0.15);
    border-radius: 2px;
}

/* 消息气泡 */
.hermes-msg {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    animation: hermes-msg-in 0.25s ease-out;
}

@keyframes hermes-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hermes-msg.bot {
    align-items: flex-start;
}

.hermes-msg.user {
    align-items: flex-end;
    flex-direction: row-reverse;
}

.hermes-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.hermes-msg.bot .hermes-msg-avatar {
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.15), rgba(120, 80, 255, 0.15));
    border: 1px solid rgba(0, 200, 255, 0.15);
    font-size: 14px;
}

.hermes-msg.user .hermes-msg-avatar {
    background: linear-gradient(135deg, rgba(0, 212, 132, 0.15), rgba(0, 180, 200, 0.15));
    border: 1px solid rgba(0, 212, 132, 0.2);
    font-size: 13px;
}

.hermes-msg-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(210, 225, 245, 0.9);
    white-space: pre-wrap;
    word-break: break-word;
}

.hermes-msg.bot .hermes-msg-content {
    background: rgba(30, 50, 90, 0.4);
    border: 1px solid rgba(0, 180, 255, 0.06);
    border-bottom-left-radius: 4px;
}

.hermes-msg.user .hermes-msg-content {
    background: rgba(0, 150, 255, 0.12);
    border: 1px solid rgba(0, 180, 255, 0.1);
    border-bottom-right-radius: 4px;
    color: rgba(220, 235, 255, 0.95);
}

/* 快速提问按钮 */
.hermes-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 0 16px 8px;
    flex-shrink: 0;
}

.hermes-quick-btn {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid rgba(0, 180, 255, 0.12);
    background: rgba(0, 180, 255, 0.04);
    color: rgba(160, 200, 240, 0.7);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.hermes-quick-btn:hover {
    background: rgba(0, 180, 255, 0.1);
    border-color: rgba(0, 180, 255, 0.25);
    color: rgba(200, 225, 255, 0.9);
}

/* ----- 输入区域 ----- */
.hermes-chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 14px;
    border-top: 1px solid rgba(0, 180, 255, 0.06);
    flex-shrink: 0;
}

.hermes-chat-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 20px;
    border: 1px solid rgba(0, 180, 255, 0.1);
    background: rgba(20, 30, 60, 0.5);
    color: rgba(210, 225, 245, 0.9);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.hermes-chat-input::placeholder {
    color: rgba(140, 170, 210, 0.3);
}

.hermes-chat-input:focus {
    border-color: rgba(0, 180, 255, 0.3);
    background: rgba(20, 30, 60, 0.7);
}

.hermes-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.2), rgba(0, 120, 200, 0.2));
    color: rgba(160, 215, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hermes-chat-send:hover {
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.35), rgba(0, 120, 200, 0.35));
    color: rgba(200, 230, 255, 0.95);
}

.hermes-chat-send:active {
    transform: scale(0.92);
}

/* 输入中指示 */
.hermes-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: rgba(30, 50, 90, 0.3);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    border: 1px solid rgba(0, 180, 255, 0.06);
}

.hermes-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 180, 255, 0.4);
    animation: hermes-typing-bounce 1.4s ease-in-out infinite;
}

.hermes-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.hermes-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes hermes-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* ===========================================================
   响应式适配
   =========================================================== */

@media (max-width: 480px) {
    .hermes-chat {
        right: 10px;
        bottom: 90px;
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        border-radius: 14px;
        max-height: none;
    }

    .hermes-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}
