/* =============================================
   精灵 · 动机心理学AI伴侣 — 样式表
   设计语言：温暖、现代、不冰冷、不临床
   ============================================= */

:root {
    /* 主色调：温暖的琥珀金 */
    --primary: #D4A574;
    --primary-dark: #B8845A;
    --primary-light: #E8C4A0;
    --primary-glow: rgba(212, 165, 116, 0.3);

    /* 背景 — 暖白系 */
    --bg-main: #FFFFFF;
    --bg-primary: #FFFBF5;          /* 补齐：被 .input-area 引用 */
    --bg-sidebar: #FFF8F0;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-message-ling: #FFF8E8;
    --bg-message-user: rgba(212,165,116,0.10);

    /* 边框 — 补齐被 .voice-hint 等引用 */
    --border: rgba(212,165,116,0.20);
    --border-soft: rgba(212,165,116,0.12);

    /* 文字 — 暖棕系 */
    --text-primary: #3C2820;
    --text-secondary: #6B5040;
    --text-accent: #8B6914;
    --text-muted: #B09880;

    /* 安全/危机 */
    --crisis-red: #E74C3C;
    --crisis-red-bg: rgba(231, 76, 60, 0.15);
    --safe-green: #27AE60;

    /* 尺寸 */
    --sidebar-width: 320px;
    --message-max-width: 75%;
    --avatar-size: 36px;
    --radius: 12px;
    --radius-sm: 8px;

    /* 动画 */
    --transition: 0.3s ease;
}

/* ===== 浅紫藤主题（浅色·明亮） ===== */
[data-theme="dark"] {
    --primary: #8B7CF6;
    --primary-dark: #6E5FD4;
    --primary-light: #CECBF6;
    --primary-glow: rgba(139, 124, 246, 0.20);

    --bg-main: #FFFFFF;
    --bg-primary: #FCFAFF;
    --bg-sidebar: #F8F6FF;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-message-ling: #F8F6FF;
    --bg-message-user: #F0ECFE;

    --border: #D0C8F0;
    --border-soft: #E8E4F8;

    --text-primary: #3C2880;
    --text-secondary: #5C4080;
    --text-accent: #6E5FD4;
    --text-muted: #8B78C0;
}

/* ===== 墨水蓝主题（暗色·知性） ===== */
[data-theme="ink"] {
    --primary: #5B7DB1;
    --primary-dark: #4A6A9A;
    --primary-light: #7EA0CC;
    --primary-glow: rgba(91, 125, 177, 0.25);

    --bg-main: #1B1F2A;
    --bg-primary: #171B26;
    --bg-sidebar: #141822;
    --bg-card: #1E2230;
    --bg-input: #222638;
    --bg-message-ling: #1E2232;
    --bg-message-user: rgba(91, 125, 177, 0.10);

    --border: rgba(91, 125, 177, 0.20);
    --border-soft: rgba(91, 125, 177, 0.10);

    --text-primary: #E0E5ED;
    --text-secondary: #A0AFC0;
    --text-accent: #7EA0CC;
    --text-muted: #6B7D90;
}

/* 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* 无障碍：屏幕阅读器专用（视觉隐藏但键盘可达） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 全局隐藏工具类 */
.hidden {
    display: none !important;
}

/* 键盘焦点可见 */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

/* ===== 布局 ===== */
.app-container {
    display: flex;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #FFF8F0 0%, #FFEEDB 100%);
    border-right: 1px solid rgba(212,165,116,0.20);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    position: relative;
    text-align: center;
    margin-bottom: 28px;
    padding-top: 8px;
}

/* 右上角操作组（重新开始、主题切换） */
.sidebar-header-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 4px;
}

.ling-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    box-shadow: 0 0 16px var(--primary-glow);
    display: block;
}

/* ===== 头像下拉菜单 ===== */
.avatar-menu-wrapper {
    position: relative;
    display: inline-block;
}
.avatar-menu-wrapper .ling-logo {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.avatar-menu-wrapper .ling-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 24px var(--primary-glow);
}

.avatar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 12px;
    padding: 6px 0;
    min-width: 140px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 999;
    animation: dropdownIn 0.2s ease;
}
.avatar-dropdown.show {
    display: block;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.avatar-dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.avatar-dropdown-item:hover {
    background: rgba(212, 165, 116, 0.08);
}

.avatar-dropdown-item.logout-item {
    color: var(--text-muted);
}
.avatar-dropdown-item.logout-item:hover {
    color: var(--crisis-red);
    background: rgba(231, 76, 60, 0.06);
}

.avatar-dropdown-divider {
    height: 1px;
    background: rgba(212, 165, 116, 0.1);
    margin: 4px 0;
}

@media (max-width: 768px) {
    .avatar-dropdown {
        left: 0;
        transform: translateX(0);
        min-width: 130px;
    }
    .avatar-dropdown.show {
        animation: dropdownInMobile 0.2s ease;
    }
    @keyframes dropdownInMobile {
        from { opacity: 0; transform: translateX(0) translateY(-8px); }
        to { opacity: 1; transform: translateX(0) translateY(0); }
    }
}

.sidebar-header h1 {
    font-size: 28px;
    color: #8B6914;
    letter-spacing: 4px;
}

.subtitle {
    font-size: 15px;
    color: #A08060;
    margin-top: 6px;
    margin-bottom: 6px;
}

.ai-badge {
    display: inline-block;
    font-size: 11px;
    color: var(--text-accent);
    background: rgba(212, 165, 116, 0.12);
    border: 1px solid rgba(212, 165, 116, 0.25);
    border-radius: 10px;
    padding: 2px 10px;
    letter-spacing: 1px;
}

/* 状态卡片 */
.status-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

/* 状态行：当前状态 + 开始测试 并排 */
.status-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 16px;
}
.status-row .status-card {
    flex: 1;
    margin-bottom: 0;
}

/* 开始测试按钮（状态行右侧） */
.start-test-btn {
    flex-shrink: 0;
    width: 90px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #FF8C42, #FF6B1A);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    color: #fff;
    box-shadow: 0 2px 12px rgba(255,107,26,0.3);
}
.start-test-btn:hover {
    background: linear-gradient(135deg, #E87530, #E55A0A);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,107,26,0.4);
}
.start-test-btn.active {
    background: linear-gradient(135deg, #CC5500, #FF6B1A);
    box-shadow: 0 0 8px rgba(255,107,26,0.35);
}
.start-test-icon { font-size: 20px; }
.start-test-label { font-size: 12px; font-weight: 600; color: #fff; }
.start-test-arrow { font-size: 9px; color: rgba(255,255,255,0.7); transition: transform 0.2s; }
.start-test-btn.active .start-test-arrow { transform: rotate(180deg); }

.status-label {
    font-size: 15px;
    color: #A08060;
    margin-bottom: 6px;
}

.status-value {
    font-size: 15px;
    color: var(--text-accent);
    font-weight: 500;
}

/* 侧边栏暖色主题 */
.sidebar .status-card,
.sidebar .profile-card,
.sidebar .q-progress,
.sidebar .sidebar-modules,
.sidebar .sidebar-decision {
    background: rgba(255,248,240,0.80);
    border: 0.5px solid rgba(212,165,116,0.20);
}
.sidebar .status-label { color: #A08060; }
.sidebar .status-value { color: #8B6914; }
.sidebar .profile-card h3 { color: #8B6914; font-size: 15px; }
.sidebar .profile-type { color: #5C4033; font-size: 15px; }
.sidebar .profile-details { color: #6B5040; }
.sidebar .q-progress h4 { color: #A08060; }
.sidebar .progress-bar { background: rgba(212,165,116,0.15); }
.sidebar .progress-bar span { color: #5C4033; }
.sidebar .action-btn.secondary {
    background: rgba(255,255,255,0.7);
    color: #5C4033;
    border: 0.5px solid rgba(212,165,116,0.20);
}
.sidebar .action-btn.secondary:hover {
    background: rgba(255,255,255,0.9);
    color: #3C2820;
}
.sidebar .contact-btn {
    background: rgba(212,165,116,0.15);
    color: #8B6914;
    border-color: rgba(212,165,116,0.25);
}
.sidebar .modules-title,
.sidebar .decision-header {
    color: #8B6914;
}
.sidebar .module-btn {
    background: rgba(255,255,255,0.70);
    border-color: rgba(212,165,116,0.12);
}
.sidebar .module-btn:hover {
    background: rgba(255,255,255,0.90);
    border-color: rgba(212,165,116,0.30);
}
.sidebar .module-btn-label { color: #5C4033; }
.sidebar .decision-btn {
    background: rgba(255,255,255,0.50);
    color: #5C4033;
    border-color: rgba(212,165,116,0.12);
}
.sidebar .decision-btn:hover {
    background: rgba(255,255,255,0.75);
    border-color: rgba(212,165,116,0.30);
}
.sidebar .auth-link-btn { color: #8B6914; }
.sidebar .auth-username { color: #5C4033; }
.sidebar .disclaimer small { color: #C0A080; }
.sidebar .btn-start-cta {
    background: linear-gradient(135deg, #F5A623, #E8912A) !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(245,166,35,0.30);
}

/* 进度条 */
.progress-bar {
    height: 24px;
    background: rgba(60,40,32,0.06);
    border-radius: 12px;
    position: relative;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    transition: width var(--transition);
    width: 0%;
}

.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
}

/* 动机图谱卡片 */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    max-height: 50vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,105,20,0.25) transparent;
}

.profile-card h3 {
    font-size: 15px;
    color: var(--text-accent);
    margin-bottom: 8px;
}

.profile-type {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    margin-bottom: 8px;
    min-height: 0;
}

.profile-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, #CC6E20, #E8943A);
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(204, 110, 32, 0.2);
}

/* 侧边栏雷达图上方：个性描述文字 */
.profile-summary {
    font-size: 13px;
    color: #5C3D2E;
    line-height: 1.8;
    padding: 10px 12px;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFFBF5 100%);
    border-left: 3px solid #CC6E20;
    border-radius: 0 8px 8px 0;
    margin: 8px 0;
}
.profile-summary p {
    margin: 6px 0;
}

.profile-details {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.profile-details .top-motive {
    color: var(--crisis-red);
    font-weight: 500;
}

.profile-details .bottom-motive {
    color: #4FC3F7;
    font-weight: 500;
}

/* 问卷进度 */
.q-progress h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* 进度光环+进度条并排 */
.q-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.q-progress-ring {
    flex-shrink: 0;
}
.q-progress-ring circle {
    transition: stroke-dashoffset 0.4s ease;
}
#q-progress-bar {
    flex: 1;
}

/* 侧边栏按钮 */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.action-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.action-btn.secondary {
    background: rgba(60,40,32,0.06);
    color: var(--text-secondary);
}

.action-btn.secondary:hover {
    background: rgba(60,40,32,0.12);
    color: var(--text-primary);
}

/* 测一测 底部CTA黄色醒目按钮 */
.btn-start-cta {
    background: linear-gradient(135deg, #F5A623, #E8912A) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 20px;
    border-radius: 10px;
    margin: 10px 0;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(245, 166, 35, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.btn-start-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(245, 166, 35, 0.4);
}

@media (min-width: 769px) {
    #btn-start-questionnaire.btn-start-cta { display: flex !important; }
}

/* 联系我们按钮 */
.contact-btn {
    background: rgba(91, 79, 255, 0.12);
    color: var(--primary);
    border: 1.5px solid rgba(91, 79, 255, 0.2);
}
.contact-btn:hover {
    background: rgba(91, 79, 255, 0.22);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ===== 侧边栏领域模块 ===== */
.sidebar-modules {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 12px;
    margin-bottom: 16px;
}

.modules-title {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-weight: 400;
    opacity: 0.7;
}

.modules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

.module-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
}

.module-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid rgba(212, 165, 116, 0.15);
    background: rgba(212, 165, 116, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 56px;
    position: relative;
}

.module-btn:hover {
    background: rgba(212, 165, 116, 0.15);
    border-color: rgba(212, 165, 116, 0.35);
}

.module-btn:active {
    opacity: 0.8;
}

.module-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.module-btn-label {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
}

.module-expand {
    position: absolute;
    right: 2px;
    top: 2px;
    font-size: 8px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.module-btn:hover .module-expand {
    opacity: 1;
}

.module-tags-area {
    display: none;
    padding: 6px 4px 2px;
}
.module-tags-area .area-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}

.area-tag {
    font-size: 10px;
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    border: 0.5px solid rgba(212,165,116,0.12);
    transition: all 0.15s ease;
    line-height: 1.6;
}
.area-tag:hover {
    background: rgba(212,165,116,0.12);
    border-color: rgba(212,165,116,0.3);
}

/* ===== 侧边栏新设计：长条模块版（无左侧色条） ===== */
.sidebar-bars {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
    border: 0.5px solid rgba(180,160,140,0.15);
}
.bar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* 图标与文字间距 */
    position: relative;
    padding: 18px 14px;
    border-bottom: 1px solid rgba(180,160,140,0.18);
    border-left: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    user-select: none;
}
.bar-item:last-child { border-bottom: none; }
.bar-item:hover { background: rgba(212,165,116,0.06); }
.bar-item:active { background: rgba(212,165,116,0.1); }
/* 透明彩色背景（无左侧色条） */
.bar-about { background: rgba(212,165,116,0.08); }
.bar-school { background: rgba(232,160,176,0.08); }
.bar-explore { background: rgba(232,147,10,0.08); }
.bar-decision { background: rgba(232,144,144,0.08); }
.bar-contact { background: rgba(133,193,233,0.08); }
.bar-label {
    flex: none; /* 文字不拉伸，真正居中 */
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #A08060; /* 与 subtitle 一致 */
    letter-spacing: 0.5px;
}
.bar-arrow {
    font-size: 11px;
    color: #B09880;
    flex-shrink: 0;
    position: absolute; /* 绝对定位不挤文字 */
    right: 14px;
    margin-left: 0;
    transition: transform 0.2s ease;
}
.bar-arrow.open {
    transform: rotate(90deg);
    color: var(--primary-dark);
}
.bar-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.sidebar-tools {
    margin-bottom: 10px;
}

/* ===== 侧边栏三宫格 + 抽屉 ===== */
.sidebar-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}
.tool-grid-item {
    border-radius: 12px;
    padding: 14px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    background: var(--bg-card);
    border: 1px solid rgba(180,160,140,0.15);
}
.tool-grid-item:hover { background: rgba(212,165,116,0.06); }
.tool-grid-primary {
    background: linear-gradient(135deg, #D4A574, #B8860B);
    border: none;
}
.tool-grid-primary:hover { background: linear-gradient(135deg, #C49460, #A0750A); }
.tool-grid-primary .tool-grid-label { color: #fff; font-weight: 600; }
.tool-grid-primary.active { background: linear-gradient(135deg, #906608, #B8860B); box-shadow: 0 0 8px rgba(212,165,116,0.3); }
.tool-grid-icon { font-size: 18px; }
.tool-grid-label { font-size: 12px; font-weight: 500; color: #3C2820; white-space: nowrap; }

/* 二级抽屉：横向标签式布局 */
.test-drawer {
    margin-top: 0;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid rgba(212,165,116,0.12);
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
}
.test-drawer:not(.hidden) {
    animation: drawerIn 0.2s ease;
}
.test-drawer.hidden {
    display: none !important;
}
@keyframes drawerIn {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 400px; }
}
.test-drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 12px 8px;
    cursor: pointer;
    transition: background 0.12s, transform 0.1s;
    border-radius: 10px;
    flex: 1;
    min-width: 0;
}
.test-drawer-item:last-child { border-bottom: none; }
.test-drawer-item:hover { background: rgba(212,165,116,0.08); transform: translateY(-1px); }
.test-drawer-item:active { transform: scale(0.96); }
.drawer-icon { font-size: 20px; line-height: 1; }
.drawer-label { font-size: 12px; font-weight: 500; color: var(--text-primary); white-space: nowrap; text-align: center; flex-shrink: 0; }
.drawer-hint { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* 动物世界弹窗 */
.animal-modal-content {
    max-width: 420px;
    padding: 20px;
    text-align: center;
}
.animal-header { margin-bottom: 16px; }
.animal-header h2 { color: #D4A574; font-size: 20px; margin: 0 0 4px; }
.animal-subtitle { font-size: 13px; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.animal-image-wrapper { margin: 0 auto; }
.animal-footnote { font-size: 12px; color: var(--text-muted); margin: 12px 0; font-style: italic; }

/* 移动端 */
@media (max-width: 768px) {
    .sidebar-tools-grid { gap: 4px; }
    .tool-grid-item { padding: 12px 2px; }
    .tool-grid-icon { font-size: 16px; }
    .tool-grid-label { font-size: 11px; }
    .test-drawer-item { padding: 10px 8px; }
    .drawer-icon { font-size: 17px; }
    .drawer-label { font-size: 12px; }
    /* 移动端：状态行变为全宽开始测试按钮 + 横向标签 */
    .status-row { margin-bottom: 8px; }
    .status-row .status-card { display: none; }
    .start-test-btn {
        width: 100%;
        flex-direction: row;
        gap: 8px;
        padding: 12px 16px;
    }
    .start-test-icon { font-size: 18px; }
    .start-test-label { font-size: 14px; }
    .test-drawer { padding: 6px; gap: 4px; }
    .test-drawer-item { padding: 8px 6px 6px; min-width: 60px; flex: 1 1 0; }
    .drawer-icon { font-size: 17px; }
    .drawer-label { font-size: 11px; }
    .drawer-hint { font-size: 9px; }
}

/* 导入报告 — 次要按钮 */
.tool-import {
    border-radius: 10px;
    padding: 13px 8px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    background: rgba(255,255,255,0.65);
    border: 1px dashed rgba(212,165,116,0.25);
}
.tool-import:hover {
    background: rgba(212,165,116,0.08);
    border-color: rgba(212,165,116,0.4);
}
.tool-import:active { background: rgba(212,165,116,0.12); }
.tool-import .tool-label {
    font-size: 13px;
    font-weight: 500;
    color: #8B6914;
}
.tool-import .tool-icon {
    font-size: 15px;
}

/* 免费体验 — 探索入口 */
.tool-trial {
    border-radius: 10px;
    padding: 13px 8px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    background: rgba(39,174,96,0.06);
    border: 1.5px solid rgba(39,174,96,0.20);
}
.tool-trial:hover {
    background: rgba(39,174,96,0.12);
    border-color: rgba(39,174,96,0.35);
}
.tool-trial:active { background: rgba(39,174,96,0.18); }
.tool-trial .tool-label {
    font-size: 13px;
    font-weight: 500;
    color: #27813C;
}
.tool-trial .tool-icon {
    font-size: 15px;
}

#secondary-pages { margin-bottom: 10px; }
.secondary-page {
    background: #fff;
    border-radius: 14px;
    border: 0.5px solid rgba(180,160,140,0.3);
    padding: 14px;
}
.page-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(180,160,140,0.12);
}
.page-icon { font-size: 16px; }
.page-title { font-size: 13px; font-weight: 600; color: #3C2820; }
.page-back { font-size: 11px; color: #B09880; margin-left: auto; cursor: pointer; }
.page-back:hover { color: #8B6914; }
.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.page-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.explore-item {
    background: rgba(245,166,35,0.08);
    border-radius: 10px;
    padding: 10px 4px;
    text-align: center;
    border: 0.5px solid rgba(245,166,35,0.2);
    cursor: pointer;
    transition: background 0.2s;
}
.explore-item:active { background: rgba(245,166,35,0.15); }
.explore-item-locked {
    background: rgba(150,150,150,0.06);
    border-color: rgba(150,150,150,0.15);
    cursor: not-allowed;
    opacity: 0.55;
}
.explore-item-icon { font-size: 18px; }
.explore-item-label { font-size: 10px; font-weight: 600; color: #3C2820; margin-top: 3px; }
.decision-item {
    background: rgba(212,165,116,0.1);
    border-radius: 10px;
    padding: 10px 8px;
    border: 0.5px solid rgba(212,165,116,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.decision-item:active { background: rgba(212,165,116,0.18); }
.decision-item-icon { font-size: 16px; }
.decision-item-label { font-size: 11px; font-weight: 600; color: #3C2820; }
.decision-item-warn .decision-item-label { color: #A04040; }

/* ===== 测评完成 → 选3个场景卡片 ===== */
.scenario-picker {
    background: linear-gradient(135deg, rgba(255,248,240,0.95), rgba(255,252,247,0.9));
    border: 1.5px solid rgba(212,165,116,0.3);
    border-radius: 14px;
    padding: 18px 16px 14px;
    margin: 8px 0;
    box-shadow: 0 2px 16px rgba(212,165,116,0.1);
}
.scenario-picker-header {
    text-align: center;
    margin-bottom: 14px;
}
.scenario-picker-gift {
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
}
.scenario-picker-title {
    font-size: 14px;
    font-weight: 600;
    color: #5C3D2E;
    line-height: 1.6;
}
.scenario-picker-subtitle {
    font-size: 12px;
    color: #8B7355;
    margin-top: 2px;
}
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.scenario-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 12px 6px 10px;
    background: #fff;
    border: 1.5px solid rgba(212,165,116,0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    position: relative;
}
.scenario-chip:hover {
    border-color: #D4A574;
    background: rgba(212,165,116,0.06);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(212,165,116,0.15);
}
.scenario-chip.selected {
    border-color: #D4A574;
    background: linear-gradient(135deg, rgba(212,165,116,0.12), rgba(212,165,116,0.06));
    box-shadow: 0 0 0 2px rgba(212,165,116,0.25);
}
.scenario-chip.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: #D4A574;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.scenario-chip-icon { font-size: 22px; line-height: 1; }
.scenario-chip-label { font-size: 12px; font-weight: 500; color: #3D2B1F; white-space: nowrap; }

/* 免费/付费徽章 */
.scenario-chip-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
    font-weight: 500;
}
.scenario-chip-badge.free {
    background: rgba(76, 175, 80, 0.12);
    color: #2E7D32;
}
.scenario-chip-badge.locked {
    background: rgba(158, 158, 158, 0.12);
    color: #757575;
}

/* 锁定状态卡片 */
.scenario-chip.locked {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.4);
    background: #fafaf8;
    border-color: rgba(0,0,0,0.06);
}
.scenario-chip.locked:hover {
    transform: none;
    border-color: rgba(0,0,0,0.06);
    background: #fafaf8;
    box-shadow: none;
}
.scenario-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}
.scenario-count {
    font-size: 12px;
    color: #8B7355;
}
.scenario-count strong { color: #D4A574; font-size: 15px; }
.scenario-explore-btn {
    background: linear-gradient(135deg, #D4A574, #B8860B);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    opacity: 0.4;
    pointer-events: none;
}
.scenario-explore-btn.active {
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 3px 12px rgba(212,165,116,0.35);
}
.scenario-explore-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212,165,116,0.45);
}

/* 场景卡片移动端适配 */
@media (max-width: 768px) {
    .scenario-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .scenario-chip { padding: 10px 4px 8px; }
    .scenario-chip-icon { font-size: 18px; }
    .scenario-chip-label { font-size: 10px; }
    .scenario-picker { padding: 14px 10px 12px; }
    .scenario-picker-title { font-size: 13px; }
}
@media (max-width: 480px) {
    .scenario-grid { gap: 4px; }
    .scenario-chip { padding: 8px 3px 6px; }
    .scenario-chip-icon { font-size: 16px; }
    .scenario-chip-label { font-size: 9px; }
    .scenario-chip.selected::after { width: 14px; height: 14px; font-size: 9px; top: 4px; right: 4px; }
}

/* 手机端适配 */
@media (max-width: 768px) {
    .square-btn { padding: 10px 12px; }
    .square-label { font-size: 10px; }
    .sidebar-tools-grid { gap: 4px; }
    .explore-grid { gap: 4px; }
    .explore-item { padding: 8px 2px; }
    .explore-item-icon { font-size: 15px; }
    .explore-item-label { font-size: 9px; }
    .decision-item { padding: 8px 6px; }
    .decision-item-label { font-size: 10px; }
}

@media (max-width: 480px) {
    .sidebar-tools-grid { gap: 3px; }
    .tool-grid-item { padding: 10px 1px; }
    .tool-grid-icon { font-size: 15px; }
    .tool-grid-label { font-size: 10px; }
    .test-drawer-item { padding: 6px 4px 5px; min-width: 52px; }
    .drawer-icon { font-size: 15px; }
    .drawer-label { font-size: 10px; }
    .drawer-hint { font-size: 8px; display: none; }
    .start-test-btn { padding: 10px 12px; }
    .start-test-icon { font-size: 16px; }
    .start-test-label { font-size: 13px; }
}

/* 决策评估指导（旧样式保留以防引用） */
.sidebar-decision {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.decision-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    user-select: none;
    transition: background 0.15s;
    position: relative;
}
.decision-header:hover {
    background: rgba(212,165,116,0.06);
}
.decision-arrow {
    font-size: 9px;
    color: var(--text-muted);
    transition: transform 0.2s;
    margin-top: 1px;
}
.decision-body {
    padding: 0 12px 14px;
}
.decision-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.decision-btn {
    background: rgba(126,87,194,0.08);
    border: 0.5px solid rgba(126,87,194,0.2);
    border-radius: 6px;
    padding: 6px 4px;
    font-size: 11px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: center;
}
.decision-btn:hover {
    background: rgba(126,87,194,0.15);
    border-color: rgba(126,87,194,0.35);
}

.disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    border-top: 1px solid rgba(60,40,32,0.04);
    padding-top: 12px;
}

/* 可折叠免责声明（手机端合规：不可 display:none） */
.disclaimer-collapsible summary {
    font-size: 11px;
    color: var(--text-accent);
    cursor: pointer;
    list-style: none;
    padding: 4px 0;
    font-weight: 500;
}
.disclaimer-collapsible summary::-webkit-details-marker { display: none; }
.disclaimer-collapsible summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.2s;
}
.disclaimer-collapsible[open] summary::before {
    transform: rotate(90deg);
}
.disclaimer-collapsible[open] summary {
    margin-bottom: 4px;
}

/* 侧边栏暖色 - 覆盖灰色文字和边框 */
.sidebar .disclaimer {
    color: #C0A080;
    border-top-color: rgba(212,165,116,0.15);
}
.sidebar .auth-user {
    background: rgba(255,255,255,0.55);
    border: 0.5px solid rgba(212,165,116,0.20);
}
.sidebar .auth-username { color: #5C4033; }

/* ===== 侧边栏用户认证 ===== */
.auth-section {
    margin-bottom: 12px;
}

/* 桌面端隐藏底部按钮（已在头像下拉菜单中） */
.hidden-on-desktop {
    display: block;
}
@media (min-width: 769px) {
    .hidden-on-desktop {
        display: none !important;
    }
}

.auth-buttons {
    display: flex;
    gap: 6px;
}

.auth-user {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.auth-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.auth-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.auth-username {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.auth-user-actions {
    display: flex;
    gap: 6px;
}

.auth-link-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #A08060;
    padding: 5px 10px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    flex: 1;
}

.auth-link-btn:hover {
    background: rgba(60,40,32,0.06);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
}

/* 手机端认证区紧凑 */
@media (max-width: 768px) {
    .auth-section {
        margin-bottom: 6px;
    }
    .auth-user {
        padding: 6px 8px;
    }
    .auth-username {
        font-size: 11px;
    }
    .auth-link-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* ===== 对话区域 ===== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

/* 桌面端默认隐藏 chat-profile-card，避免启动时遮挡聊天区 */
.chat-profile-card {
    display: none;
}
.chat-profile-card.visible {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
    border: 0.5px solid rgba(212,165,116,0.15);
    max-height: 55vh;
    overflow-y: auto;
}

.messages-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* 消息样式 */
.message {
    display: flex;
    gap: 12px;
    max-width: var(--message-max-width);
    animation: fadeIn 0.4s ease;
}

/* 手机端：消息气泡适配 */
@media (max-width: 768px) {
    .message-content {
        max-width: 100%;
        padding: 12px 16px;
        font-size: 16px;
        line-height: 1.8;
    }
    /* P0修复: 移动端气泡全宽化（之前78%/88%硬限制导致文字频繁换行） */
    .user-message .message-content {
        max-width: 100%;
    }
    .ling-message .message-content {
        max-width: 100%;
    }
    /* 手机端：消息行内 avatar 缩小，留更多空间给气泡 */
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .message {
        gap: 8px;
    }
}

/* ===== 桌面端：全宽化对话区域 ===== */
@media (min-width: 769px) {
    .messages-container {
        padding: 24px 32px;
        gap: 14px;
        max-width: 1280px;
        width: 100%;
        margin: 0 auto;
    }
    .message {
        max-width: 100%;
        width: 100%;
    }
    .ling-message .message-content {
        max-width: 760px;
    }
    .user-message .message-content {
        max-width: 540px;
    }
}
@media (min-width: 1600px) {
    .messages-container {
        max-width: 1080px;
        padding: 32px 40px;
    }
}

.ling-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* 修复：用户消息气泡用 inline-block 后，用 wrap 让它自然贴右 */
.user-message {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.message-avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--primary-dark);
    font-size: 14px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.message-content {
    background: var(--bg-message-ling);
    border-radius: var(--radius);
    padding: 12px 14px;
    line-height: 1.7;
    font-size: 14px;
    color: var(--text-primary);
    white-space: pre-line;
    /* 修复：让气泡按内容收缩，避免短文本被 max-width 撑开后因 padding 挤断换行 */
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    vertical-align: top;
}

.user-message .message-content {
    background: var(--bg-message-user);
    border-radius: var(--radius);
    /* 用户消息在右侧，需要单独设置 margin-left auto 让气泡贴右 */
    margin-left: 0;
}

/* 用户消息的内层 flex 容器也要贴右 */
.user-message > div:not(.message-avatar) {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
    flex: 0 1 auto;
}

.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: var(--text-accent);
}

/* 流式回复光标 */
.streaming-cursor::after {
    content: '▊';
    color: var(--text-accent);
    animation: blink 0.8s infinite;
}

/* 输入区域 */
.input-area {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(255,248,240,0.60);
    border-top: 1px solid rgba(212,165,116,0.12);
    align-items: flex-end;
    position: relative;
}

.input-area textarea {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    transition: border-color var(--transition);
}

.input-area textarea:focus {
    border-color: var(--primary);
}

/* ─── 对话模式切换横条 (P0参考设计: 极简胶囊+圆点，置于输入框上方) ─── */
.mode-chips {
    display: flex;
    gap: 10px;
    padding: 12px 16px 4px;
    background: transparent;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #8B7355);
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(212,165,116,0.20);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.2;
    min-height: 32px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mode-chip:hover {
    border-color: rgba(212,165,116,0.45);
    background: rgba(212,165,116,0.06);
}

.mode-chip:active {
    transform: scale(0.96);
}

/* 未激活态：灰圆点+淡灰文字 */
.mode-chip:not(.active) .chip-dot {
    background: #B4B2A9;
    opacity: 0.85;
}

/* 激活态：彩色背景+纯色圆点+加粗 */
.mode-chip.active {
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* 轻松聊 — 绿色 */
.mode-chip.active[data-mode="casual"] {
    color: #085041;
    background: #E1F5EE;
}

/* 专家聊 — 紫色 */
.mode-chip.active[data-mode="expert"] {
    color: #26215C;
    background: #EEEDFE;
}

/* 训练营 — 橙色 */
.mode-chip.active[data-mode="camp"] {
    color: #633806;
    background: #FAEEDA;
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    transition: background 0.2s;
}

.mode-chip.active .chip-dot { background: currentColor; }

/* 移动端：紧凑布局，触摸目标保持 */
@media (max-width: 640px) {
    .mode-chips {
        gap: 8px;
        padding: 10px 12px 4px;
    }
    .mode-chip {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 30px;
    }
    .chip-dot {
        width: 7px;
        height: 7px;
    }
}

.input-area textarea::placeholder {
    color: var(--text-muted);
}

#send-btn {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

#send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* 图片上传按钮 */
.input-action-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(60,40,32,0.10);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.input-action-btn:hover {
    background: rgba(60,40,32,0.06);
    color: var(--text-primary);
    border-color: rgba(60,40,32,0.18);
}

/* 语音输入按钮 - 录音状态 */
#voice-btn.recording {
    background: var(--crisis-red, #E74C3C);
    border-color: var(--crisis-red, #E74C3C);
    color: #fff;
    animation: voice-pulse 1s ease-in-out infinite;
}

@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

/* 语音状态提示 */
.voice-hint {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-bottom: 8px;
    z-index: 10;
}
.voice-hint.show { display: block; }

/* 移动端语音按钮调整 */
@media (max-width: 768px) {
    #voice-btn { width: 38px; height: 38px; }
    #voice-btn svg { width: 18px; height: 18px; }
}

/* 聊天中的图片 */
.chat-image {
    max-width: 280px;
    max-height: 280px;
    border-radius: 12px;
    margin: 4px 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-image:hover {
    transform: scale(1.02);
}

/* 图片预览在大图模式 */
.image-preview-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-preview-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

#send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 思考指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 24px;
}

.typing-indicator-text {
    margin-right: 2px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 60%, 100% {
        transform: scale(0.6);
        opacity: 0.3;
    }
    30% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* 思考文字省略号动画 */
.typing-indicator .typing-text::after {
    content: '';
    display: inline-block;
    width: 1.2em;
    text-align: left;
    animation: typingEllipsis 1.5s steps(4, end) infinite;
}

@keyframes typingEllipsis {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* ===== 问卷模式 ===== */
.questionnaire-area {
    padding: 20px 24px;
    background: rgba(255,248,240,0.60);
    border-top: 1px solid rgba(212,165,116,0.12);
    flex-shrink: 0;
    max-height: 55vh;
    overflow-y: auto;
}

.q-question {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.6;
    text-align: center;
}

.q-scenario {
    font-size: 13px;
    color: var(--text-accent);
    margin: 4px auto 16px auto;
    text-align: center;
    line-height: 1.9;
    max-width: 520px;
    padding: 0 8px;
}

.q-options {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 8px 4px 48px;
    justify-content: center;
    gap: 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.q-options::-webkit-scrollbar { display: none; }

.likert-btn {
    background: #FFFFFF;
    border: 2px solid var(--primary);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    color: #3C2820;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    font-family: inherit;
    line-height: 40px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    scroll-snap-align: center;
    flex-shrink: 0;
    position: relative;
}
.likert-btn::after {
    content: attr(data-label);
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 500;
    color: #6B5040;
    white-space: nowrap;
    margin-top: 8px;
    line-height: 1.3;
}
.likert-btn:hover {
    border-color: #D4A574;
    background: rgba(212, 165, 116, 0.18);
    color: #C0762A;
}
.likert-btn:active,
.likert-btn.selected {
    transform: scale(1.05);
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 12px var(--primary-glow);
}

.q-option {
    background: #FFFFFF;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    color: #3C2820;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    min-width: 80px;
}

.q-option:hover {
    border-color: #D4A574;
    background: rgba(212, 165, 116, 0.10);
}

.q-option.selected {
    border-color: #D4A574;
    background: rgba(212, 165, 116, 0.25);
    color: #8B6914;
    font-weight: 500;
}

.message-actions {
    display: none !important;
}

/* ===== 选择按钮区（领域选择 + 模式选择） ===== */
.choice-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    margin: 4px 0 12px 52px;
    max-width: 85%;
}

/* P0补丁：隐藏问候语下方的"快捷提问建议"5个chip（来自后端/api/greet动态注入）
   类名常见命名约定全部兜底——不知道确切class名时通配覆盖 */
.messages-container .quick-reply,
.messages-container .quick-replies,
.messages-container .greeting-chips,
.messages-container .greeting-chip-row,
.messages-container .topic-chips,
.messages-container .topic-chip-row,
.messages-container .chip-row,
.messages-container .suggestion-chips,
.messages-container .suggestion-row,
.messages-container .topic-suggestions,
.messages-container [class*="greeting"][class*="chip"],
.messages-container [class*="quick"][class*="reply"],
.messages-container [class*="topic"][class*="suggest"],
.messages-container [data-quick-reply],
.messages-container [data-suggested-topic],
.messages-container [data-greeting-chips] {
    display: none !important;
}

.choice-btn {
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 20px;
    color: var(--text-primary);
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.choice-btn:hover {
    background: rgba(212, 165, 116, 0.25);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.choice-btn.primary {
    background: var(--primary);
    color: #1A1A2E;
    font-weight: 600;
    border-color: var(--primary);
}

.choice-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ===== 危机遮罩（带平滑过渡动画） ===== */
/* 注意：HTML中使用id="crisis-overlay"，这里用ID选择器 + visible类控制显示 */
#crisis-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 初始隐藏状态 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(0,0,0,0);
    transition: opacity 0.35s ease,
                visibility 0.35s ease,
                background 0.35s ease;
    will-change: opacity, visibility;
}

/* 显示状态 */
#crisis-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(0,0,0,0.85);
}

/* 危机卡片入场动画（弹性缩放） */
#crisis-overlay .crisis-card {
    transform: scale(0.85) translateY(30px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
}

#crisis-overlay.visible .crisis-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.crisis-card {
    background: #FFFFFF;
    border: 2px solid var(--crisis-red);
    border-radius: 20px;
    padding: 40px;
    max-width: 480px;
    text-align: center;
}

.crisis-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.crisis-card h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.crisis-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.crisis-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.crisis-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.hotline-btn {
    background: var(--crisis-red);
    color: #fff;
    border: none;
}

.hotline-btn:hover {
    background: #C0392B;
}

.hotline-btn small {
    font-size: 12px;
    margin-top: 4px;
}

.consultant-btn {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
}

.consultant-btn:hover {
    background: rgba(255,255,255,0.2);
}

.crisis-note {
    font-size: 13px;
    color: var(--text-accent);
}

/* 移动端危机遮罩适配 */
@media (max-width: 768px) {
    .crisis-card {
        padding: 28px 20px;
        max-width: 92vw;
        border-radius: 16px;
    }
    .crisis-icon {
        font-size: 42px;
        margin-bottom: 12px;
    }
    .crisis-card h2 {
        font-size: 18px;
    }
    .crisis-text {
        font-size: 14px;
        margin-bottom: 18px;
    }
    .crisis-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== 弹窗 ===== */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(212,165,116,0.15);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 560px;
    width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

.modal-close {
    display: block;
    margin: 20px auto 0;
    padding: 10px 28px;
    background: rgba(60,40,32,0.06);
    border: 1px solid rgba(60,40,32,0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.modal-close:hover {
    background: rgba(60,40,32,0.12);
    color: var(--text-primary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 手机端弹窗 */
@media (max-width: 768px) {
    .modal-content {
        border-radius: 12px;
        padding: 22px 16px;
        max-height: 90vh;
    }
}

/* 汉堡菜单按钮 */
.hamburger-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1500;
    display: none;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid rgba(212,165,116,0.15);
    border-radius: 10px;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* P0修复: 移动端浮动触发器（脱离 sidebar transform 影响） */
.mobile-overlay-trigger {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1500;
    display: none;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid rgba(212,165,116,0.15);
    border-radius: 10px;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    /* hamburger-btn 在 sidebar 内部，受 transform 影响无法正常显示，移动端隐藏它 */
    .hamburger-btn { display: none !important; }
    .mobile-overlay-trigger { display: flex; }
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 1400;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    }
    /* P0修复: collapsed状态隐藏侧边栏内部元素 */
    .sidebar.collapsed .sidebar-bars,
    .sidebar.collapsed .sidebar-tools,
    .sidebar.collapsed .sidebar-pair,
    .sidebar.collapsed .profile-card,
    .sidebar.collapsed .auth-section,
    .sidebar.collapsed .status-card,
    .sidebar.collapsed .q-progress,
    .sidebar.collapsed .disclaimer,
    .sidebar.collapsed .sidebar-actions,
    .sidebar.collapsed #secondary-pages {
        display: none !important;
    }
    .sidebar.collapsed {
        max-height: none;
        min-height: auto;
        padding: 6px 12px;
    }
    .app-container { position: relative; }
}

/* P0修复: sidebar遮罩层 */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1399;
}
.sidebar-backdrop.show {
    display: block;
}

/* 头像菜单 */
.ling-logo { cursor: pointer; }

/* 主题切换按钮 */
.refresh-chat-btn,
.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(212,165,116,0.2);
    background: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin: 0 2px;
}

.refresh-chat-btn:hover,
.theme-toggle-btn:hover {
    background: rgba(212,165,116,0.12);
    border-color: rgba(212,165,116,0.35);
}

/* 统一联系 */
.uc-tab { transition: all .2s; }
.uc-tab:hover { color: #6C5CE7 !important; }

/* 预约表单 */
#booking-form input,
#booking-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-main);
    border: 1px solid rgba(212,165,116,0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    margin-bottom: 10px;
}
#booking-form input:focus,
#booking-form textarea:focus {
    border-color: #D4A574;
}
#booking-form textarea {
    resize: vertical;
    min-height: 60px;
}

/* 同意通知 */
.consent-notice {
    background: rgba(255,248,240,0.60);
    border: 1px dashed rgba(212,165,116,0.25);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0;
    font-size: 12px;
    color: var(--text-secondary);
}
.consent-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.consent-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #D4A574;
    cursor: pointer;
}

/* ===== 中心锚定柱状图（用于16维度展示）——精致版 ===== */
.chart-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 0 4px 0;
    margin: 0 0 4px 48px;
    border-bottom: 1px solid rgba(160,128,96,0.12);
}
.tick-label {
    font-size: 11px;
    color: rgba(107,80,64,0.45);
    flex-shrink: 0;
    text-align: center;
    min-width: 0;
}
.bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    min-height: 18px;
}
.bar-label {
    font-size: 12px;
    color: #5C4033;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
    font-weight: 500;
}
.bar-track {
    flex: 1;
    height: 7px;
    position: relative;
    border-radius: 3.5px;
    overflow: visible;
    background: rgba(200,190,180,0.20);
}
.bar-fill {
    position: absolute;
    top: 0;
    height: 100%;
    transition: width 0.8s cubic-bezier(0.25,0.1,0.25,1);
    opacity: 0.90;
    border-radius: 3.5px;
}
.bar-pos { border-radius: 3.5px; }
.bar-neg { border-radius: 3.5px; }
.bar-center-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(160,128,96,0.20);
    z-index: 1;
}
.bar-value {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 2;
    line-height: 1;
}
.bar-zone { display: none; }

/* ===== 人口分布参考图（钟形曲线） ===== */
.chart-distribution {
    width: 100%;
    max-width: 500px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.chart-distribution svg { width: 100%; height: auto; display: block; }
.dist-title {
    font-size: 10px;
    color: rgba(0,0,0,0.40);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.dist-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    margin-top: 2px;
}
.dist-label { font-size: 9px; text-align: center; flex: 1; font-weight: 500; }
.dist-label-label { font-size: 9px; text-align: center; flex: 1; color: rgba(0,0,0,0.30); margin-top: -2px; }
.dist-band-rect { opacity: 0.25; }

/* ===== 7大力模块卡片（生活场景综合解读） ===== */
.module-card {
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: background 0.2s;
}
.module-card:hover { background: rgba(255,255,255,0.07); }
.module-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.module-icon { font-size: 18px; flex-shrink: 0; }
.module-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.module-label {
    font-size: 10px; font-weight: 500; padding: 2px 10px; border-radius: 10px;
    margin-left: auto; white-space: nowrap;
}
.module-dims { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.module-dim {
    font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 4px;
    background: rgba(255,255,255,0.04);
}
.module-desc { font-size: 12px; line-height: 1.7; color: var(--text-secondary); }

/* =============================================
   会员中心 & 付费流程（Phase 2）
   ============================================= */
.membership-modal-content { max-width: 600px; max-height: 80vh; overflow-y: auto; }
.membership-header {
    display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
    padding-bottom: 16px; border-bottom: 1px solid rgba(212,165,116,0.15);
}
.membership-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff; flex-shrink: 0;
}
.membership-avatar.free { background: linear-gradient(135deg, #A0A0B0, #808090); }
.membership-avatar.premium { background: linear-gradient(135deg, #D4A574, #B8845A); box-shadow: 0 0 16px var(--primary-glow); }
.membership-user-info { flex: 1; min-width: 0; }
.membership-user-name { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.membership-plan-badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 10px; border-radius: 10px; margin-top: 2px; }
.membership-plan-badge.free { background: rgba(160,160,176,0.15); color: #808090; border: 1px solid rgba(160,160,176,0.25); }
.membership-plan-badge.premium { background: linear-gradient(135deg, rgba(212,165,116,0.15), rgba(184,132,90,0.15)); color: var(--text-accent); border: 1px solid rgba(212,165,116,0.3); }
.membership-expiry { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.membership-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.membership-stat-card {
    background: linear-gradient(135deg, rgba(255,248,240,0.45), rgba(255,255,255,0.3));
    border: 1px solid rgba(212,165,116,0.12); border-radius: var(--radius-sm); padding: 16px; text-align: center;
}
.membership-stat-value { font-size: 24px; font-weight: 700; color: var(--text-accent); margin-bottom: 4px; }
.membership-stat-label { font-size: 12px; color: var(--text-secondary); }
.membership-features { margin-bottom: 20px; }
.membership-features-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.feature-list { display: flex; flex-direction: column; gap: 8px; }
.feature-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: rgba(255,255,255,0.4); border-radius: 8px; border: 1px solid rgba(212,165,116,0.08);
}
.feature-item-icon { font-size: 18px; flex-shrink: 0; width: 28px; text-align: center; }
.feature-item-text { flex: 1; font-size: 13px; color: var(--text-primary); }
.feature-item-status { font-size: 11px; font-weight: 500; flex-shrink: 0; }
.feature-item-status.enabled { color: var(--safe-green); }
.feature-item-status.locked { color: var(--text-muted); }
.membership-upgrade-section { text-align: center; padding-top: 16px; border-top: 1px solid rgba(212,165,116,0.12); }
.upgrade-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px;
    background: linear-gradient(135deg, #F5A623, #E8912A); color: #fff; border: none;
    border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; box-shadow: 0 4px 16px rgba(245,166,35,0.3); font-family: inherit;
}
.upgrade-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(245,166,35,0.4); }
.upgrade-btn.secondary { background: rgba(212,165,116,0.1); color: var(--text-accent); border: 1px solid rgba(212,165,116,0.25); box-shadow: none; }
.plans-modal-content { max-width: 680px; max-height: 85vh; overflow-y: auto; }
.plans-header { text-align: center; margin-bottom: 24px; }
.plans-header h2 { font-size: 22px; margin-bottom: 4px; }
.plans-header .plans-subtitle { font-size: 13px; color: var(--text-secondary); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.plan-card {
    background: var(--bg-card); border: 2px solid rgba(212,165,116,0.12); border-radius: 14px;
    padding: 24px 16px; text-align: center; cursor: pointer; transition: all 0.2s;
    position: relative; overflow: hidden; font-family: inherit; width: 100%;
}
.plan-card:hover { border-color: rgba(212,165,116,0.3); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(212,165,116,0.12); }
.plan-card.recommended { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan-card.recommended::before {
    content: '推荐'; position: absolute; top: 10px; right: -28px;
    background: linear-gradient(135deg, #F5A623, #E8912A); color: #fff;
    font-size: 10px; font-weight: 600; padding: 2px 32px; transform: rotate(45deg);
}
.plan-name { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.plan-price { font-size: 32px; font-weight: 700; color: var(--text-accent); margin-bottom: 2px; }
.plan-price .currency { font-size: 16px; vertical-align: top; margin-right: 2px; }
.plan-price .period { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.plan-original-price { font-size: 12px; color: var(--text-muted); text-decoration: line-through; margin-bottom: 10px; }
.plan-features { text-align: left; margin: 12px 0; }
.plan-feature-item { font-size: 12px; color: var(--text-secondary); padding: 3px 0; display: flex; align-items: center; gap: 6px; }
.plan-feature-item::before { content: '✓'; color: var(--safe-green); font-weight: 600; flex-shrink: 0; }
.plan-select-btn {
    display: block; width: 100%; padding: 10px; border-radius: 8px;
    border: 1px solid var(--primary); background: rgba(212,165,116,0.1);
    color: var(--text-accent); font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all 0.2s; margin-top: 12px; font-family: inherit;
}
.plan-select-btn:hover { background: var(--primary); color: #fff; }
.plan-select-btn.current { background: rgba(39,174,96,0.1); border-color: var(--safe-green); color: var(--safe-green); }

.payment-methods { display: flex; gap: 12px; margin-bottom: 20px; }
.payment-method-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px; border: 2px solid rgba(212,165,116,0.15); border-radius: 10px;
    background: var(--bg-card); cursor: pointer; transition: all 0.2s;
    font-size: 14px; color: var(--text-primary); font-family: inherit;
}
.payment-method-btn:hover { border-color: rgba(212,165,116,0.35); background: rgba(255,248,240,0.5); }
.payment-method-btn.selected { border-color: var(--primary); background: rgba(212,165,116,0.08); color: var(--text-accent); }
.payment-method-icon { font-size: 20px; }
.payment-qr-modal-content { max-width: 420px; text-align: center; }
.payment-qr-title { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.payment-qr-amount { font-size: 28px; font-weight: 700; color: var(--text-accent); margin-bottom: 16px; }
.payment-qr-amount .currency { font-size: 16px; }
.payment-qr-image {
    width: 220px; height: 220px; margin: 0 auto 16px; border-radius: 12px;
    border: 1px solid rgba(212,165,116,0.15); display: flex; align-items: center;
    justify-content: center; background: #fff;
}
.payment-qr-image img { width: 200px; height: 200px; }
.payment-qr-image .qr-loading { font-size: 13px; color: var(--text-muted); }
.payment-qr-tip { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.6; }
.payment-qr-status { font-size: 13px; color: var(--text-muted); margin-top: 12px; padding: 8px; background: rgba(255,248,240,0.5); border-radius: 8px; }
.payment-qr-status.success { color: var(--safe-green); background: rgba(39,174,96,0.08); }
.payment-qr-status.expired { color: var(--crisis-red); background: rgba(231,76,60,0.08); }
.feature-locked { position: relative; cursor: not-allowed; }
.feature-locked::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.5); border-radius: inherit; pointer-events: none;
}
.feature-locked .locked-badge {
    position: absolute; top: 4px; right: 4px; font-size: 10px;
    background: rgba(160,160,176,0.8); color: #fff; padding: 1px 6px; border-radius: 4px; z-index: 1;
}
.premium-feature-tooltip { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; cursor: help; }
.sidebar-member-entry { margin-bottom: 10px; }
.member-entry-btn {
    display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 14px;
    border: 1px solid rgba(212,165,116,0.18);
    background: linear-gradient(135deg, rgba(212,165,116,0.08), rgba(184,132,90,0.04));
    cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.member-entry-btn:hover { background: rgba(212,165,116,0.12); border-color: rgba(212,165,116,0.3); }
.member-entry-icon { font-size: 14px; flex-shrink: 0; }
.member-entry-text { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-primary); }
.member-entry-badge { font-size: 10px; padding: 1px 8px; border-radius: 8px; font-weight: 500; flex-shrink: 0; }
.member-entry-badge.free { background: rgba(160,160,176,0.15); color: #808090; }
.member-entry-badge.premium { background: linear-gradient(135deg, rgba(245,166,35,0.15), rgba(232,145,42,0.15)); color: #D4A574; }
.order-summary { background: rgba(255,248,240,0.5); border-radius: 10px; padding: 16px; margin-bottom: 20px; border: 1px solid rgba(212,165,116,0.1); }
.order-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--text-secondary); }
.order-summary-row.total { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(212,165,116,0.15); font-size: 16px; font-weight: 700; color: var(--text-accent); }

.payment-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: var(--bg-card); border: 1px solid var(--primary); border-radius: 10px;
    padding: 12px 24px; font-size: 14px; color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(212,165,116,0.15); z-index: 10000;
    animation: toastIn 0.3s ease; text-align: center;
}
.payment-toast.success { border-color: var(--safe-green); }
.payment-toast.error { border-color: var(--crisis-red); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 768px) {
    .membership-cards { grid-template-columns: 1fr; }
    .plans-grid { grid-template-columns: 1fr; gap: 12px; }
    .plan-card { padding: 16px 12px; }
    .plan-price { font-size: 26px; }
    .plan-card.recommended::before { right: -36px; font-size: 9px; padding: 2px 36px; }
    .payment-methods { gap: 8px; }
    .payment-method-btn { padding: 10px; font-size: 13px; }
    .payment-qr-image { width: 180px; height: 180px; }
    .payment-qr-image img { width: 160px; height: 160px; }
    .membership-header { gap: 12px; }
    .membership-avatar { width: 44px; height: 44px; font-size: 18px; }
    .membership-user-name { font-size: 15px; }
    .member-entry-btn { padding: 4px 8px; font-size: 11px; gap: 3px; }
    .member-entry-icon { font-size: 12px; }
    .member-entry-text { font-size: 11px; }
}
@media (max-width: 480px) {
    .payment-methods { flex-direction: column; }
    .plans-grid { gap: 8px; }
    .plan-card { padding: 14px 10px; }
    .plan-name { font-size: 14px; }
    .plan-price { font-size: 22px; }
    .upgrade-btn { width: 100%; justify-content: center; padding: 12px 24px; font-size: 14px; }
}

.trust-anchors {
    background: linear-gradient(135deg, rgba(212,165,116,0.06), rgba(184,132,90,0.04));
    border: 1px solid rgba(212,165,116,0.15); border-radius: 12px; padding: 16px 20px;
    margin-bottom: 20px; text-align: center;
}
.trust-header { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.trust-icon { font-size: 18px; }
.trust-title { font-size: 14px; font-weight: 600; color: var(--text-accent); letter-spacing: 0.5px; }
.trust-stats { display: flex; align-items: center; justify-content: center; gap: 20px; }
.trust-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.trust-stat-num { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.trust-stat-label { font-size: 11px; color: var(--text-muted); }
.trust-stat-divider { width: 1px; height: 36px; background: rgba(212,165,116,0.2); }
.iceberg-card {
    background: linear-gradient(135deg, rgba(212,165,116,0.06), rgba(255,248,240,0.3));
    border: 1.5px dashed rgba(212,165,116,0.25); border-radius: 14px; padding: 20px 18px;
    margin: 12px 0; text-align: center; cursor: pointer; transition: all 0.25s ease;
    animation: icebergPulse 3s ease-in-out infinite;
}
.iceberg-card:hover { border-color: var(--primary); background: rgba(212,165,116,0.1); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,165,116,0.12); }
@keyframes icebergPulse { 0%, 100% { border-color: rgba(212,165,116,0.25); } 50% { border-color: rgba(212,165,116,0.45); } }
.iceberg-icon { font-size: 32px; margin-bottom: 8px; display: block; }
.iceberg-title { font-size: 15px; font-weight: 600; color: var(--text-accent); margin-bottom: 6px; line-height: 1.5; }
.iceberg-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 8px; }
.iceberg-lu-note { font-size: 12px; color: var(--text-muted); font-style: italic; line-height: 1.6; }
.iceberg-arrow { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--primary); font-weight: 500; }
@media (max-width: 768px) {
    .trust-anchors { padding: 12px 14px; margin-bottom: 16px; }
    .trust-stat-num { font-size: 18px; }
    .trust-stats { gap: 14px; }
    .iceberg-card { padding: 16px 14px; }
    .iceberg-title { font-size: 14px; }
}

/* ===== 意见反馈 ===== */
.feedback-modal-content { max-width: 480px; padding: 24px; }
.feedback-header { text-align: center; margin-bottom: 16px; }
.feedback-header h2 { color: #D4A574; margin: 0 0 4px; font-size: 20px; }
.feedback-subtitle { font-size: 13px; color: var(--text-secondary); margin: 0; }
.feedback-category { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.feedback-cat-label {
    flex: 1; min-width: 70px; padding: 8px 4px; text-align: center;
    background: var(--bg-card); border: 1px solid rgba(212,165,116,0.15);
    border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary); transition: all 0.15s;
}
.feedback-cat-label.selected { background: rgba(212,165,116,0.15); border-color: #D4A574; color: #D4A574; font-weight: 500; }
.feedback-textarea, .feedback-input {
    width: 100%; box-sizing: border-box; background: var(--bg-main);
    border: 1px solid rgba(212,165,116,0.2); border-radius: 10px; padding: 12px;
    font-size: 14px; color: var(--text-primary); font-family: inherit; outline: none; margin-bottom: 10px; resize: vertical;
}
.feedback-textarea:focus, .feedback-input:focus { border-color: #D4A574; }
.feedback-input { margin-bottom: 16px; }
.feedback-submit {
    width: 100%; padding: 14px; background: linear-gradient(135deg, #D4A574, #B8860B);
    color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.feedback-submit:hover { background: linear-gradient(135deg, #C49460, #A0750A); }
.feedback-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.feedback-status { margin-top: 12px; text-align: center; font-size: 13px; min-height: 20px; }
.feedback-status.success { color: #27AE60; }
.feedback-status.error { color: #E74C3C; }
.tool-feedback { margin-top: 6px; }

/* ===== 海报分享 ===== */
.poster-modal-content { max-width: 400px; padding: 20px; text-align: center; }
.poster-image-wrapper { margin: 0 auto; max-width: 375px; }
.poster-download-btn {
    display: inline-block; margin-top: 12px; padding: 12px 32px;
    background: linear-gradient(135deg, #D4A574, #B8860B); color: #fff;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.poster-download-btn:hover { background: linear-gradient(135deg, #C49460, #A0750A); }
.followup-btn.poster-btn { background: linear-gradient(135deg, #D4A574, #B8860B); color: #fff; border: none; }
.followup-btn.poster-btn:hover { background: linear-gradient(135deg, #C49460, #A0750A); }
.about-slogan-box { text-align: center; padding: 16px; background: linear-gradient(135deg, rgba(79,179,191,0.08), rgba(232,168,56,0.05)); border-radius: 12px; margin-bottom: 20px; }
.about-slogan { font-size: 14px; color: #D4A574; margin: 0; font-style: italic; white-space: nowrap; }
@media (max-width: 480px) { .about-slogan { font-size: 12.5px; letter-spacing: -0.3px; white-space: nowrap; } }

/* ===== 匹配报告 ===== */
.matching-modal-content { max-width: 680px; max-height: 85vh; overflow-y: auto; padding: 24px 28px; }
.matching-header { text-align: center; margin-bottom: 20px; }
.matching-header h2 { color: #D4A574; margin: 0 0 4px; font-size: 20px; }
.matching-subtitle { font-size: 13px; color: var(--text-secondary); margin: 0; }
.matching-pair { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 20px; }
.matching-person { flex: 1; max-width: 220px; padding: 16px; background: var(--bg-card); border-radius: 12px; text-align: center; }
.matching-person-label { font-weight: 600; color: var(--text-primary); margin-bottom: 6px; font-size: 14px; }
.matching-person-status { font-size: 12px; color: var(--text-muted); }
.matching-vs { font-size: 20px; font-weight: 700; color: #D4A574; background: rgba(212,165,116,0.1); width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.matching-input-section { margin-bottom: 16px; }
.matching-input-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; }
.matching-form-row { display: flex; gap: 8px; margin-bottom: 8px; }
.matching-form-row input { background: var(--bg-main); border: 1px solid rgba(212,165,116,0.2); border-radius: 8px; padding: 10px 14px; font-size: 14px; color: var(--text-primary); outline: none; }
.matching-form-row input:focus { border-color: #D4A574; }
.matching-dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 280px; overflow-y: auto; padding: 4px; }
.matching-dim-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--bg-main); border-radius: 6px; font-size: 12px; }
.matching-dim-label { font-weight: 500; color: #D4A574; min-width: 32px; }
.matching-dim-my-score { color: var(--text-secondary); font-size: 11px; min-width: 45px; text-align: right; }
.matching-dim-input { flex: 1; min-width: 0; background: var(--bg-card); border: 1px solid rgba(255,255,255,0.08); border-radius: 4px; padding: 4px 8px; font-size: 12px; color: var(--text-primary); outline: none; }
.matching-dim-input:focus { border-color: #D4A574; }
.matching-dim-input::placeholder { font-size: 10px; color: var(--text-muted); opacity: 0.6; }
.matching-cta { display: block; width: 100%; padding: 14px; background: linear-gradient(135deg, #D4A574, #B8860B); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 12px; font-family: inherit; letter-spacing: 0.5px; }
.matching-cta:hover { background: linear-gradient(135deg, #C49460, #A0750A); }
.matching-cta:disabled { opacity: 0.4; cursor: not-allowed; }
.matching-cta.secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid rgba(212,165,116,0.2); }
.matching-cta.secondary:hover { background: rgba(212,165,116,0.08); }
.matching-scene-tabs { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(212,165,116,0.15); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.matching-scene-label { font-size: 12px; color: var(--text-muted); margin-right: 4px; }
.matching-scene-tab { padding: 6px 14px; border-radius: 16px; border: 1px solid transparent; background: var(--bg-card); color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all 0.2s ease; }
.matching-scene-tab[data-scene="intimate"] { border-color: rgba(232, 145, 126, 0.45); color: #D4687C; }
.matching-scene-tab[data-scene="intimate"]:hover { background: rgba(232, 145, 126, 0.1); border-color: #E8917E; }
.matching-scene-tab[data-scene="intimate"].active { background: linear-gradient(135deg, #E8917E, #D4687C); color: #fff; border-color: #E8917E; box-shadow: 0 2px 8px rgba(232, 145, 126, 0.3); }
.matching-scene-tab[data-scene="workplace"] { border-color: rgba(91, 155, 213, 0.4); color: #4A8BC2; }
.matching-scene-tab[data-scene="workplace"]:hover { background: rgba(91, 155, 213, 0.08); border-color: #5B9BD5; }
.matching-scene-tab[data-scene="workplace"].active { background: #5B9BD5; color: #fff; border-color: #5B9BD5; }
.matching-scene-tab[data-scene="parent-child"] { border-color: rgba(232, 183, 48, 0.5); color: #C89820; }
.matching-scene-tab[data-scene="parent-child"]:hover { background: rgba(232, 183, 48, 0.08); border-color: #E8B730; }
.matching-scene-tab[data-scene="parent-child"].active { background: #E8B730; color: #fff; border-color: #E8B730; }
.matching-score-section { text-align: center; padding: 20px; margin-bottom: 20px; }
.matching-big-score { font-size: 56px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.matching-score-unit { font-size: 24px; font-weight: 400; }
.matching-score-label { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.matching-score-sub { font-size: 13px; color: var(--text-muted); }
.matching-narrative { margin-bottom: 20px; }
.matching-narrative-p { font-size: 14px; line-height: 1.8; color: var(--text-primary); margin: 0 0 12px; }
.matching-dim-compare { max-height: 300px; overflow-y: auto; }
.matching-dim-compare h4 { color: #D4A574; font-size: 14px; margin: 0 0 8px; }
.matching-dim-compare-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; margin-bottom: 3px; font-size: 12px; background: var(--bg-main); }
.matching-dim-compare-row.moderate-diff { background: rgba(245,166,35,0.06); }
.matching-dim-compare-row.huge-diff { background: rgba(231,76,60,0.06); border-left: 2px solid rgba(231,76,60,0.3); }
.mc-name { font-weight: 500; color: var(--text-primary); min-width: 36px; }
.mc-val { color: var(--text-secondary); }
.mc-sep { color: rgba(212,165,116,0.3); }
.mc-diff { color: var(--text-muted); font-size: 10px; }
@media (max-width: 768px) { .matching-modal-content { padding: 16px; } .matching-dim-grid { grid-template-columns: 1fr; } .matching-pair { flex-direction: column; gap: 8px; } .matching-person { max-width: 100%; } .matching-big-score { font-size: 42px; } }
@media (max-width: 768px) { .typing-indicator { padding: 10px 16px; margin-left: 16px; font-size: 13px; gap: 5px; } .typing-indicator .dot { width: 7px; height: 7px; } }

/* ===== V3 匹配报告卡片 ===== */
.match-score-big { font-size: 40px; font-weight: 600; color: var(--text-primary); text-align: center; line-height: 1; }
.match-score-big small { font-size: 16px; color: var(--text-secondary); font-weight: 400; }
.match-score-type { text-align: center; font-size: 14px; color: #185FA5; margin-top: 4px; font-weight: 500; }
.match-stats-row { display: flex; gap: 8px; margin: 10px 0; justify-content: center; }
.match-stat { flex: 0 0 auto; padding: 8px 16px; border-radius: 8px; text-align: center; min-width: 80px; }
.match-stat.green { background: rgba(99,153,34,0.08); }
.match-stat.blue { background: rgba(24,95,165,0.08); }
.match-stat.red { background: rgba(163,45,45,0.08); }
.ms-num { font-size: 20px; font-weight: 500; display: block; }
.match-stat.green .ms-num { color: #639922; }
.match-stat.blue .ms-num { color: #185FA5; }
.match-stat.red .ms-num { color: #A32D2D; }
.ms-lbl { font-size: 11px; color: var(--text-tertiary); }
.match-radar-svg { width: 100%; max-width: 340px; height: auto; }
.match-card { background: var(--bg-secondary); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.match-card-head { display: flex; align-items: center; padding: 10px 14px; background: var(--bg-primary); gap: 8px; border-bottom: 0.5px solid var(--border-tertiary); }
.match-card-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.match-type-tag { font-size: 9px; padding: 2px 8px; border-radius: 10px; }
.match-type-green { background: rgba(99,153,34,0.10); color: #639922; }
.match-type-blue { background: rgba(24,95,165,0.10); color: #185FA5; }
.match-type-red { background: rgba(163,45,45,0.10); color: #A32D2D; }
.match-card-body { padding: 10px 14px; }
.match-tags { font-size: 12px; color: var(--text-secondary); margin: 0 0 6px; font-weight: 500; }
.match-text { font-size: 11px; color: var(--text-secondary); line-height: 1.7; margin: 0; }
.match-intimacy-rows { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10px; color: var(--text-secondary); line-height: 1.6; }
.match-intimacy-row b { color: var(--text-primary); }
.match-intimacy-row i { font-size: 9px; opacity: 0.7; font-style: normal; }
.blindspot-card { border: 0.5px solid rgba(163,45,45,0.15); }
.match-tips { display: flex; gap: 8px; flex-wrap: wrap; }
.match-tip { flex: 1 1 auto; padding: 6px 10px; background: var(--bg-primary); border-radius: 6px; font-size: 11px; color: var(--text-secondary); text-align: center; min-width: 120px; }

.uc-tab { transition: all .2s; }
.uc-tab:hover { color: #6C5CE7 !important; }

/* ===== P0: 匹配度圆形仪表 ===== */
.match-gauge-wrap { display: flex; flex-direction: column; align-items: center; padding: 24px 0 16px; }
.match-gauge-svg { width: 160px; height: 160px; }
.match-gauge-pct { font-size: 32px; font-weight: 600; fill: #3C2820; text-anchor: middle; }
.match-gauge-label { font-size: 12px; fill: #9A8B7A; text-anchor: middle; }
.match-relation-tag { display: inline-block; padding: 4px 16px; border-radius: 16px; font-size: 12px; font-weight: 500; margin-top: 8px; }
.match-relation-tag.soulmate { background: rgba(212,165,116,0.15); color: #8B6914; }
.match-relation-tag.good { background: rgba(123,141,110,0.12); color: #5C6B3C; }
.match-relation-tag.normal { background: rgba(91,155,213,0.1); color: #4A8BC2; }
.match-relation-tag.caution { background: rgba(245,166,35,0.12); color: #B87A0A; }

/* ===== P0: 关系速查表 ===== */
.match-table-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.match-table-card { background: var(--bg-secondary); border-radius: 10px; padding: 14px; }
.match-table-card.best { border-left: 3px solid #639922; }
.match-table-card.caution { border-left: 3px solid #E8917E; }
.match-table-title { font-size: 13px; font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.match-table-card.best .match-table-title { color: #639922; }
.match-table-card.caution .match-table-title { color: #D4687C; }
.match-table-item { font-size: 11px; color: var(--text-secondary); padding: 4px 0; line-height: 1.5; }
.match-table-item strong { color: var(--text-primary); font-size: 12px; display: block; margin-bottom: 2px; }

/* ===== P1: 人格名片分享 ===== */
.share-card-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; background: linear-gradient(135deg, #D4A574, #8B6914); color: #fff; border: none; border-radius: 24px; font-size: 14px; font-weight: 500; cursor: pointer; margin: 8px 0; box-shadow: 0 3px 12px rgba(139,105,20,0.2); }
.share-card-btn:active { transform: scale(0.97); }
.share-card-preview { max-width: 320px; margin: 12px auto; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.1); display: none; }
.share-card-preview.show { display: block; }

/* ===== P2: 排行榜 ===== */
.rank-section { background: var(--bg-secondary); border-radius: 12px; padding: 16px; margin: 16px 0; }
.rank-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-primary); border-radius: 8px; font-size: 13px; }
.rank-item.me { background: rgba(212,165,116,0.10); border: 1px solid rgba(212,165,116,0.2); }
.rank-num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.rank-num.gold { background: #EF9F27; color: #fff; }
.rank-num.silver { background: #B4B2A9; color: #fff; }
.rank-num.bronze { background: #D85A30; color: #fff; }
.rank-num.normal { background: var(--bg-secondary); color: var(--text-secondary); }
.rank-name { font-weight: 500; color: var(--text-primary); flex: 1; }
.rank-dim { font-size: 10px; color: #D4A574; background: rgba(212,165,116,0.1); padding: 2px 8px; border-radius: 10px; }
.rank-score { font-weight: 600; color: var(--text-primary); font-size: 14px; }
.rank-cta { display: block; width: 100%; padding: 10px; margin-top: 10px; background: var(--bg-primary); border: 1px solid rgba(212,165,116,0.3); border-radius: 8px; font-size: 13px; color: #8B6914; cursor: pointer; text-align: center; font-weight: 500; }
.rank-cta:hover { background: rgba(212,165,116,0.08); }
.rank-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }

/* ===== PK 对比条 ===== */
.pk-bar-wrap { margin: 6px 0; }
.pk-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 11px; }
.pk-bar-label { width: 40px; text-align: right; color: var(--text-secondary); flex-shrink: 0; }
.pk-bar-track { flex: 1; height: 8px; background: var(--bg-primary); border-radius: 4px; overflow: hidden; position: relative; }
.pk-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.pk-bar-fill.a { background: #D4A574; }
.pk-bar-fill.b { background: #7B8D6E; }
.pk-bar-val { width: 32px; font-weight: 600; font-size: 11px; flex-shrink: 0; }
.pk-bar-val.a { color: #8B6914; }
.pk-bar-val.b { color: #5C6B3C; }
.pk-result-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 500; margin-left: 4px; }
.pk-result-tag.win { background: rgba(99,153,34,0.1); color: #639922; }
.pk-result-tag.lose { background: rgba(163,45,45,0.1); color: #A32D2D; }
.pk-result-tag.tie { background: rgba(91,155,213,0.1); color: #4A8BC2; }