/* ============================================================
   心伴 - 情绪陪伴平台
   宁静 · 温暖 · 安全
   ============================================================ */

:root {
    /* 主色 - 浅蓝 */
    --blue-100: #D4F1F9;
    --blue-200: #B0E0E6;
    --blue-300: #7EC8D4;
    --blue-400: #5AB4C2;
    --blue-500: #3A9EAF;
    
    /* 中性色 - 米灰 */
    --warm-50: #FDFBF8;
    --warm-100: #F7F5F0;
    --warm-200: #EDEAE2;
    --warm-300: #DCD8CE;
    --warm-400: #C5C0B4;
    
    /* 白 */
    --white: #FFFFFF;
    
    /* 文字 */
    --text-dark: #2D3436;
    --text-mid: #565E60;
    --text-light: #8A9194;
    --text-placeholder: #B5BDC1;
    
    /* 功能色 - 低饱和 */
    --success: #7EC88E;
    --success-bg: #E8F5EB;
    --warning: #E6C06C;
    --warning-bg: #FDF5E3;
    
    /* 背景 */
    --bg-page: #F2F0EA;
    --bg-card: var(--white);
    --bg-warm: var(--warm-50);
    --bg-blue: var(--blue-100);
    
    /* 阴影 - 轻 */
    --shadow-soft: 0 2px 8px rgba(45,52,54,0.04);
    --shadow-card: 0 4px 16px rgba(45,52,54,0.06);
    --shadow-hover: 0 8px 24px rgba(45,52,54,0.08);
    
    /* 圆角 */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-full: 999px;
    
    /* 间距 */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-7: 32px;
    --s-8: 40px;
    --s-9: 48px;
    
    /* 字体 */
    --font: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', -apple-system, sans-serif;
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-base: 14px;
    --fs-md: 15px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-xxl: 22px;
    --fs-title: 26px;
    --fs-hero: 30px;
    
    /* 动效 */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 220ms;
}

/* ============================================================
   AI 生成声明 - 全局样式
   ============================================================ */
.ai-generated-notice {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    background: linear-gradient(135deg, #E8F4F8 0%, #F0F8FF 100%);
    border: 1px solid #B8E0F0;
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    color: #2C7A96;
    margin-bottom: var(--s-3);
    font-weight: 500;
}

.ai-generated-notice svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ai-generated-notice.notice-only {
    margin-bottom: 0;
}

.ai-content-wrapper {
    background: var(--warm-50);
    border-radius: var(--r-md);
    padding: var(--s-4);
    margin-top: var(--s-3);
    border-left: 3px solid var(--blue-300);
}

.ai-content-wrapper.ai-interpretation {
    background: linear-gradient(135deg, #FDFBF8 0%, #F8FBFF 100%);
}

.ai-content-wrapper.ai-suggestions {
    background: linear-gradient(135deg, #F8FBFF 0%, #FFFFFF 100%);
    border: 1px solid #E0F0FF;
}

.ai-suggestion-item {
    display: flex;
    gap: var(--s-3);
    padding: var(--s-3) 0;
    border-bottom: 1px solid var(--warm-100);
}

.ai-suggestion-item:last-child {
    border-bottom: none;
}

.ai-suggestion-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-100) 0%, var(--blue-50) 100%);
    color: var(--blue-500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.ai-suggestion-text {
    font-size: var(--fs-sm);
    line-height: 1.7;
    color: var(--text-dark);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: linear-gradient(180deg, var(--blue-100) 0%, var(--warm-50) 40%, var(--warm-50) 100%);
    background-size: 100% auto;
    background-repeat: repeat-y;
    min-height: 100vh;
    color: var(--text-dark);
    font-size: var(--fs-base);
    line-height: 1.75;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
}

/* ========== 布局 ========== */
.app {
    max-width: 400px;
    margin: 0 auto;
    min-height: 100vh;
}

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

/* 小屏手机 */
@media (max-width: 360px) {
    :root {
        --s-5: 16px;
        --s-6: 20px;
        --s-7: 24px;
        --s-8: 32px;
        --fs-hero: 24px;
        --fs-title: 22px;
        --fs-xxl: 18px;
    }

    .app {
        max-width: 100%;
    }

    .stat-row {
        gap: var(--s-2);
    }

    .stat-card {
        padding: var(--s-3) var(--s-1);
    }

    .stat-num {
        font-size: var(--fs-xl);
    }

    .card {
        padding: var(--s-4);
    }

    .brand {
        padding: var(--s-6) var(--s-4) var(--s-5);
    }

    .main {
        padding: var(--s-4);
    }

    .msg-bubble {
        max-width: 85%;
    }
}

/* 平板 */
@media (min-width: 768px) {
    .app {
        max-width: 520px;
        border-radius: var(--r-xl);
        margin-top: 24px;
        margin-bottom: 24px;
        box-shadow: 0 20px 60px rgba(45,52,54,0.1);
    }

    .brand {
        padding: var(--s-9) var(--s-7) var(--s-7);
        border-radius: var(--r-xl) var(--r-xl) 0 0;
    }

    .main {
        padding: var(--s-6) var(--s-6);
    }

    .brand-logo {
        width: 64px;
        height: 64px;
    }

    .brand-logo svg {
        width: 32px;
        height: 32px;
    }

    .brand-name {
        font-size: 34px;
    }

    .stat-row {
        gap: var(--s-4);
    }

    .stat-card {
        padding: var(--s-5) var(--s-3);
    }
}

/* 桌面端 */
@media (min-width: 1024px) {
    .app {
        max-width: 720px;
    }

    .side-nav {
        position: fixed;
        bottom: auto;
        top: 50%;
        right: 32px;
        transform: translateY(-50%);
        box-shadow: var(--shadow-card);
    }

    .brand {
        padding: var(--s-9) var(--s-8) var(--s-8);
    }

    .main {
        padding: var(--s-7) var(--s-7);
    }

    .chat-body {
        min-height: 450px;
    }

    .stat-row {
        gap: var(--s-5);
    }

    .doc-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--s-4);
    }
}

/* 大屏桌面 */
@media (min-width: 1440px) {
    .app {
        max-width: 880px;
    }

    :root {
        --fs-base: 15px;
    }

    .doc-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 横屏模式 */
@media (max-height: 600px) and (orientation: landscape) {
    .brand {
        padding: var(--s-5) var(--s-5) var(--s-4);
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        margin-bottom: var(--s-2);
    }

    .brand-logo svg {
        width: 20px;
        height: 20px;
    }

    .brand-name {
        font-size: var(--fs-xl);
        margin-bottom: 0;
    }

    .brand-tagline {
        display: none;
    }

    .main {
        padding: var(--s-3) var(--s-4);
    }

    .tab-bar {
        margin-bottom: var(--s-3);
    }

    .card {
        padding: var(--s-4);
        margin-bottom: var(--s-3);
    }

    .form-group {
        margin-bottom: var(--s-3);
    }

    .action-btn {
        height: 46px;
    }

    .text-input {
        height: 44px;
    }

    .chat-body {
        min-height: 200px;
    }

    .stat-row {
        margin: var(--s-3) 0;
    }

    .side-nav {
        bottom: 8px;
        right: 8px;
    }
}

/* 打印 */
@media print {
    .side-nav { display: none; }

    .app {
        max-width: 100%;
        margin: 0;
        box-shadow: none;
    }

    .brand {
        background: none;
        border-bottom: 1px solid #ddd;
    }
}

/* ========== 顶部品牌 ========== */
.brand {
    padding: var(--s-8) var(--s-5) var(--s-6);
    text-align: center;
    transition: all var(--duration) var(--ease);
}

body.chat-mode .brand {
    display: none;
}

.brand-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto var(--s-3);
    background: var(--white);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
}

.brand-logo svg {
    width: 26px;
    height: 26px;
    stroke: var(--blue-400);
    stroke-width: 1.8;
    fill: none;
}

.brand-name {
    font-size: var(--fs-hero);
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.04em;
    margin-bottom: var(--s-1);
}

.brand-tagline {
    font-size: var(--fs-sm);
    color: var(--text-light);
    font-weight: 400;
}

/* ========== 内容区 ========== */
.main {
    padding: var(--s-5);
}

/* ========== 标签栏 ========== */
.tab-bar {
    display: flex;
    background: var(--warm-100);
    border-radius: var(--r-md);
    padding: 3px;
    margin-bottom: var(--s-6);
}

.tab-btn {
    flex: 1;
    padding: 11px var(--s-3);
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: var(--fs-base);
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: all var(--duration) var(--ease);
}

.tab-btn.active {
    background: var(--white);
    color: var(--blue-500);
    font-weight: 600;
    box-shadow: var(--shadow-soft);
}

/* ========== 卡片 ========== */
.card {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    margin-bottom: var(--s-4);
    box-shadow: var(--shadow-soft);
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: var(--s-5);
}

.form-label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-mid);
    margin-bottom: var(--s-2);
}

.input-box {
    position: relative;
}

.input-icon {
    position: absolute;
    left: var(--s-3);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-placeholder);
    stroke-width: 1.8;
    fill: none;
}

.text-input {
    width: 100%;
    height: 52px;
    padding: 0 var(--s-4) 0 var(--s-9);
    border: none;
    border-radius: var(--r-md);
    background: var(--warm-100);
    font-size: var(--fs-md);
    font-family: var(--font);
    color: var(--text-dark);
    line-height: 1.6;
    transition: all var(--duration) var(--ease);
    outline: none;
}

.text-input:focus {
    background: var(--blue-100);
}

.text-input::placeholder {
    color: var(--text-placeholder);
}

select.text-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B5BDC1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--s-3) center;
    padding-right: var(--s-8);
}

textarea.text-input {
    height: auto;
    padding: var(--s-3) var(--s-4);
    resize: none;
}

/* ========== 按钮 ========== */
.action-btn {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: var(--r-md);
    font-size: var(--fs-lg);
    font-weight: 600;
    font-family: var(--font);
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    line-height: 1;
}

.action-btn-primary {
    background: var(--blue-400);
    color: var(--white);
}

.action-btn-primary:hover {
    background: var(--blue-500);
}

.action-btn-primary:disabled {
    background: var(--warm-300);
    color: var(--warm-100);
    cursor: not-allowed;
}

.action-btn-ghost {
    background: transparent;
    color: var(--text-light);
    margin-top: var(--s-2);
}

.action-btn-ghost:hover {
    color: var(--text-mid);
}

/* ========== 复选框 ========== */
.check-row {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    margin: var(--s-5) 0;
    cursor: pointer;
}

.check-row input { display: none; }

.check-icon {
    width: 22px;
    height: 22px;
    border-radius: var(--r-sm);
    background: var(--warm-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--duration) var(--ease);
}

.check-icon svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 2.5;
    fill: none;
    opacity: 0;
}

.check-row input:checked ~ .check-icon {
    background: var(--blue-400);
}

.check-row input:checked ~ .check-icon svg {
    opacity: 1;
}

.check-label {
    font-size: var(--fs-sm);
    color: var(--text-mid);
    line-height: 1.6;
    padding-top: 2px;
}

/* ========== 提示 ========== */
.tip {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--text-light);
    margin-top: var(--s-6);
    line-height: 1.8;
}

.tip strong {
    color: var(--blue-400);
    font-weight: 600;
}

/* ========== 协议列表 ========== */
.doc-grid {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
}

.doc-card {
    background: var(--white);
    border-radius: var(--r-md);
    padding: var(--s-4);
    box-shadow: var(--shadow-soft);
}

.doc-name {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--s-2);
}

.doc-note {
    font-size: var(--fs-sm);
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: var(--s-3);
}

.doc-action {
    display: inline-block;
    padding: 7px var(--s-4);
    background: var(--blue-100);
    color: var(--blue-500);
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}

.doc-action:hover {
    background: var(--blue-400);
    color: var(--white);
}

/* ========== 警告 ========== */
.warm-alert {
    background: linear-gradient(180deg, var(--warning-bg) 0%, var(--warm-50) 100%);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    text-align: center;
    margin-bottom: var(--s-5);
}

.warm-alert-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto var(--s-3);
    background: var(--warning);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.warm-alert-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--white);
    stroke-width: 2;
    fill: none;
}

.warm-alert-title {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--s-1);
}

.warm-alert-desc {
    font-size: var(--fs-sm);
    color: var(--text-mid);
    line-height: 1.8;
}

/* ========== 热线 ========== */
.help-line {
    background: var(--white);
    border-radius: var(--r-md);
    padding: var(--s-4);
    margin-bottom: var(--s-3);
    display: flex;
    align-items: center;
    gap: var(--s-4);
    box-shadow: var(--shadow-soft);
}

.help-line-icon {
    width: 40px;
    height: 40px;
    background: var(--success-bg);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.help-line-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--success);
    stroke-width: 2;
    fill: none;
}

.help-line-info { flex: 1; }
.help-line-label { font-size: var(--fs-xs); color: var(--text-light); margin-bottom: 2px; }
.help-line-num { font-size: var(--fs-lg); font-weight: 700; color: var(--text-dark); letter-spacing: 0.5px; }

.help-line-btn {
    padding: 8px var(--s-4);
    background: var(--success-bg);
    color: var(--success);
    border: none;
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
}

/* ========== 评测 ========== */
.quiz {
    background: var(--white);
    border-radius: var(--r-md);
    padding: var(--s-5);
    margin-bottom: var(--s-3);
    box-shadow: var(--shadow-soft);
}

.quiz-label {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: var(--s-2);
}

.quiz-text {
    font-size: var(--fs-lg);
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: var(--s-4);
    line-height: 1.7;
}

.quiz-opts {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.quiz-opt {
    padding: 13px var(--s-4);
    background: var(--warm-50);
    border: none;
    border-radius: var(--r-md);
    font-size: var(--fs-md);
    font-family: var(--font);
    color: var(--text-mid);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-align: left;
}

.quiz-opt:hover {
    background: var(--blue-100);
}

.quiz-opt.on {
    background: var(--blue-100);
    color: var(--blue-500);
    font-weight: 500;
}

.quiz-opt.warn {
    background: var(--warning-bg);
}

.quiz-opt.warn.on {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ========== 进度 ========== */
.bar {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
}

.bar-track {
    flex: 1;
    height: 5px;
    background: var(--warm-200);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--blue-300);
    border-radius: 3px;
    transition: width 0.3s var(--ease);
}

.bar-text {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-light);
}

/* ========== 排队 ========== */
.spin {
    width: 28px;
    height: 28px;
    margin: 0 auto var(--s-3);
    border: 2.5px solid var(--warm-200);
    border-top-color: var(--blue-300);
    border-radius: var(--r-full);
    animation: turn 0.8s linear infinite;
}

@keyframes turn {
    to { transform: rotate(360deg); }
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-3);
    margin: var(--s-6) 0;
}

.stat-card {
    background: var(--white);
    border-radius: var(--r-md);
    padding: var(--s-4) var(--s-2);
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.stat-num {
    font-size: var(--fs-xxl);
    font-weight: 700;
    color: var(--blue-400);
    margin-bottom: var(--s-1);
}

.stat-note {
    font-size: var(--fs-xs);
    color: var(--text-light);
}

/* ========== 聊天 ========== */
.chat-page-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
}

.chat-bar {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: var(--s-3);
    margin-bottom: var(--s-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.chat-user {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: var(--blue-100);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-400);
    font-weight: 600;
    font-size: var(--fs-md);
}

.chat-name { font-weight: 600; font-size: var(--fs-md); }
.chat-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: var(--r-full);
    margin-right: 4px;
}
.chat-on { font-size: var(--fs-xs); color: var(--success); }

.chat-end {
    padding: 8px 18px;
    background: var(--blue-200);
    color: var(--blue-500);
    border: none;
    border-radius: var(--r-md);
    font-size: var(--fs-base);
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(58, 158, 175, 0.2);
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}

.chat-end:hover {
    background: var(--blue-300);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(58, 158, 175, 0.3);
    transform: translateY(-1px);
}

.chat-end:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(58, 158, 175, 0.2);
}

.chat-body {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    margin-bottom: var(--s-2);
    box-shadow: var(--shadow-soft);
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

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

.chat-body::-webkit-scrollbar-thumb {
    background: var(--warm-300);
    border-radius: var(--r-full);
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: var(--warm-400);
}

.chat-notice {
    text-align: center;
    padding: var(--s-2) var(--s-4);
    background: var(--blue-100);
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    color: var(--blue-500);
    margin-bottom: var(--s-5);
}

.msg-row {
    margin-bottom: var(--s-4);
    display: flex;
}

.msg-row.me { justify-content: flex-end; }
.msg-row.them { justify-content: flex-start; }

.msg-bubble {
    max-width: 78%;
    padding: 12px var(--s-4);
    border-radius: var(--r-md);
    font-size: var(--fs-md);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-sender {
    font-size: var(--fs-xs);
    font-weight: 600;
    opacity: 0.8;
}

.msg-row.me .msg-bubble {
    background: var(--blue-400);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.msg-row.them .msg-bubble {
    background: var(--warm-100);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
}

.chat-foot {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: var(--s-2);
    display: flex;
    gap: var(--s-2);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    height: 46px;
    padding: 0 var(--s-3);
    border: none;
    background: var(--warm-100);
    border-radius: var(--r-md);
    font-size: var(--fs-md);
    font-family: var(--font);
    outline: none;
}

.chat-go {
    padding: 0 var(--s-5);
    background: var(--blue-400);
    color: var(--white);
    border: none;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: var(--fs-base);
    font-family: var(--font);
    cursor: pointer;
}

/* ========== 仪表盘 ========== */
.dash-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--s-7);
    padding-top: var(--s-2);
}

.dash-hello {
    font-size: var(--fs-xxl);
    font-weight: 600;
    margin-bottom: var(--s-1);
}

.dash-sub {
    font-size: var(--fs-sm);
    color: var(--text-light);
}

.logout-btn {
    padding: 6px var(--s-3);
    background: var(--warm-100);
    border: none;
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: 500;
    font-family: var(--font);
    color: var(--text-mid);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.logout-btn:hover {
    background: var(--warm-200);
}

.dash-out {
    padding: 8px var(--s-3);
    background: var(--warm-100);
    border: none;
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: 500;
    font-family: var(--font);
    color: var(--text-light);
    cursor: pointer;
}

.dash-go {
    background: linear-gradient(180deg, var(--blue-200) 0%, var(--blue-100) 100%);
    padding: var(--s-5);
    border-radius: var(--r-lg);
    margin-bottom: var(--s-5);
}

.dash-go h3 {
    font-size: var(--fs-lg);
    font-weight: 600;
    margin-bottom: var(--s-1);
}

.dash-go p {
    font-size: var(--fs-sm);
    color: var(--text-mid);
    margin-bottom: var(--s-4);
    line-height: 1.7;
}

.dash-go-btn {
    padding: 11px var(--s-5);
    background: var(--white);
    color: var(--blue-500);
    border: none;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: var(--fs-sm);
    font-family: var(--font);
    cursor: pointer;
}

.dash-section-title {
    font-size: var(--fs-base);
    font-weight: 600;
    margin-bottom: var(--s-3);
    color: var(--text-dark);
}

.dash-section-title-with-more {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-more-btn {
    background: transparent;
    color: var(--blue-500);
    border: none;
    font-size: var(--fs-xs);
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    padding: 4px var(--s-2);
    border-radius: var(--r-sm);
    transition: all var(--duration) var(--ease);
}

.dash-more-btn:hover {
    background: var(--blue-100);
}

/* ========== 聊天记录卡片 ========== */
.dash-chat-preview {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    margin-top: var(--s-2);
}

.dash-chat-msg {
    padding: 8px var(--s-3);
    border-radius: var(--r-md);
    font-size: var(--fs-xs);
    line-height: 1.6;
    max-width: 90%;
}

.dash-chat-msg.me {
    background: var(--blue-100);
    color: var(--text-mid);
    align-self: flex-end;
}

.dash-chat-msg.them {
    background: var(--warm-100);
    color: var(--text-mid);
    align-self: flex-start;
}

.dash-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--s-2);
    padding: 6px var(--s-3);
    background: transparent;
    border: 1px dashed var(--warm-300);
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    color: var(--text-light);
    font-family: var(--font);
    cursor: pointer;
    width: 100%;
    transition: all var(--duration) var(--ease);
}

.dash-expand-btn:hover {
    background: var(--warm-50);
    border-color: var(--blue-300);
    color: var(--blue-500);
}

.dash-expand-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform var(--duration) var(--ease);
}

.dash-expand-btn.expanded svg {
    transform: rotate(180deg);
}

.dash-chat-full {
    margin-top: var(--s-2);
    padding: var(--s-3);
    background: var(--warm-50);
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.dash-item {
    background: var(--white);
    border-radius: var(--r-md);
    padding: var(--s-4);
    margin-bottom: var(--s-3);
    box-shadow: var(--shadow-soft);
}

.dash-item-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--s-1);
}

.dash-item-name {
    font-size: var(--fs-sm);
    font-weight: 600;
}

.dash-item-time {
    font-size: var(--fs-xs);
    color: var(--text-light);
}

.dash-item-tag {
    display: inline-block;
    padding: 2px var(--s-2);
    background: var(--success-bg);
    color: var(--success);
    border-radius: 4px;
    font-size: var(--fs-xs);
    font-weight: 500;
}

.dash-item-desc {
    font-size: var(--fs-xs);
    color: var(--text-light);
    line-height: 1.6;
}

/* ========== 志愿者回复 ========== */
.dash-volunteer-reply {
    margin-top: var(--s-2);
    padding: var(--s-3);
    background: var(--blue-100);
    border-radius: var(--r-md);
    display: flex;
    gap: var(--s-2);
    align-items: flex-start;
}

.dash-volunteer-avatar {
    width: 32px;
    height: 32px;
    background: var(--white);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--blue-500);
    flex-shrink: 0;
}

.dash-volunteer-msg {
    flex: 1;
    font-size: var(--fs-xs);
    color: var(--text-mid);
    line-height: 1.6;
}

.dash-volunteer-name {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--blue-600);
    margin-bottom: 4px;
}

/* ========== 仪表盘情绪趋势图 ========== */
.dash-trend-card {
    margin-bottom: var(--s-5);
    padding: var(--s-5);
    background: linear-gradient(135deg, var(--white) 0%, #fafbfc 100%);
    box-shadow: var(--shadow-soft);
}

.dash-trend-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
}

.dash-trend-header-left {
    flex: 1;
    min-width: 0;
}

.dash-trend-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--s-1);
}

.dash-trend-desc {
    font-size: var(--fs-xs);
    color: var(--text-light);
    line-height: 1.5;
}

.dash-trend-legend {
    display: flex;
    gap: var(--s-2);
    align-items: center;
}

.dash-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
}

.dash-legend-phq9 {
    background: rgba(79, 140, 255, 0.08);
    color: #4f8cff;
}

.dash-legend-gad7 {
    background: rgba(82, 196, 26, 0.08);
    color: #52c41a;
}

.dash-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
}

.dash-legend-phq9 .dash-legend-dot {
    background: #4f8cff;
}

.dash-legend-gad7 .dash-legend-dot {
    background: #52c41a;
}

/* 评分等级参考图例 */
.dash-chart-legend {
    background: var(--warm-50);
    border-radius: var(--r-sm);
    padding: var(--s-2) var(--s-3);
    margin-bottom: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.dash-scale-row {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: var(--fs-xs);
}

.dash-scale-label {
    color: var(--text-light);
    white-space: nowrap;
    font-weight: 500;
}

.dash-scale-bar {
    flex: 1;
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.dash-scale-segment {
    height: 100%;
}

.dash-scale-normal {
    flex: 5;
    background: rgba(76, 175, 80, 0.2);
}

.dash-scale-mild {
    flex: 5;
    background: rgba(139, 195, 74, 0.2);
}

.dash-scale-moderate {
    flex: 5;
    background: rgba(255, 235, 59, 0.25);
}

.dash-scale-severe {
    flex: 5;
    background: rgba(255, 152, 0, 0.25);
}

.dash-scale-extreme {
    flex: 8;
    background: rgba(244, 67, 54, 0.25);
}

.dash-scale-range {
    color: var(--text-light);
    font-size: var(--fs-xs);
    white-space: nowrap;
    min-width: 40px;
    text-align: right;
}

/* 图表容器 */
.dash-canvas-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* ========== 页面 ========== */
.page { display: none; }
.page.show { display: block; animation: up 200ms var(--ease); }

@keyframes up {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 导航 ========== */
.side-nav {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: var(--white);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
    padding: var(--s-2);
    z-index: 100;
}

.side-nav-title {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: var(--s-2);
    text-align: center;
}

.side-btn {
    display: block;
    width: 100%;
    padding: 6px var(--s-3);
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: var(--fs-xs);
    font-weight: 500;
    font-family: var(--font);
    border-radius: var(--r-sm);
    cursor: pointer;
    text-align: left;
    margin-bottom: 1px;
}

.side-btn:hover { background: var(--warm-100); }
.side-btn.on { background: var(--blue-100); color: var(--blue-500); font-weight: 600; }

/* ========== 协议页头部按钮 ========== */
.agreement-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--s-4);
}

/* ========== 仪表盘个人资料链接 ========== */
.dash-hello {
    font-size: var(--fs-xxl);
    font-weight: 600;
    margin-bottom: var(--s-1);
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
}

.dash-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    color: var(--blue-500);
    border: 1px solid var(--blue-200);
    padding: 4px var(--s-2);
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.dash-profile-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.dash-profile-link:hover {
    background: var(--blue-100);
    border-color: var(--blue-300);
}

.dash-sub {
    font-size: var(--fs-sm);
    color: var(--text-light);
}

/* ========== 聊天状态徽章 ========== */
.chat-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px var(--s-2);
    background: var(--success-bg);
    color: var(--success);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: 500;
    margin-right: var(--s-2);
}

.chat-status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: var(--r-full);
}

/* ========== 正在输入指示器 ========== */
.typing-indicator {
    display: none;
    padding: var(--s-1) var(--s-4);
    font-size: var(--fs-xs);
    color: var(--text-light);
    font-style: italic;
    flex-shrink: 0;
}

.typing-indicator.show {
    display: block;
    animation: fadeIn var(--duration) var(--ease);
}

/* ========== 聊天输入框 (textarea) ========== */
.chat-textarea {
    flex: 1;
    min-height: 46px;
    max-height: 120px;
    padding: var(--s-2) var(--s-3);
    border: none;
    background: var(--warm-100);
    border-radius: var(--r-md);
    font-size: var(--fs-md);
    font-family: var(--font);
    outline: none;
    resize: none;
    line-height: 1.6;
}

.chat-textarea:focus {
    background: var(--blue-100);
}

.chat-textarea::placeholder {
    color: var(--text-placeholder);
}

/* ========== 聊天结束页 ========== */
.end-page {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: var(--s-7);
    text-align: center;
}

.end-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--s-5);
    background: linear-gradient(135deg, var(--blue-200), var(--blue-100));
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.end-icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--blue-500);
    stroke-width: 1.5;
    fill: none;
}

.end-title {
    font-size: var(--fs-title);
    font-weight: 700;
    margin-bottom: var(--s-1);
    color: var(--text-dark);
}

.end-subtitle {
    font-size: var(--fs-base);
    color: var(--text-light);
    margin-bottom: var(--s-6);
}

.end-message {
    padding: var(--s-4);
    background: var(--warm-100);
    border-radius: var(--r-md);
    margin-bottom: var(--s-6);
}

.end-message p {
    font-size: var(--fs-base);
    color: var(--text-mid);
}

/* ========== 评价区域 ========== */
.rating-section {
    margin: var(--s-6) 0;
    padding: var(--s-5);
    background: var(--warm-50);
    border-radius: var(--r-lg);
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: var(--s-1);
    margin-bottom: var(--s-4);
}

.star {
    font-size: var(--fs-xxl);
    color: var(--warm-300);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    user-select: none;
}

.star:hover,
.star.selected {
    color: var(--warning);
    transform: scale(1.1);
}

/* ========== 帮助资源区域 ========== */
.resource-section {
    margin: var(--s-6) 0;
    text-align: left;
}

.resource-list {
    background: var(--warm-50);
    border-radius: var(--r-lg);
    padding: var(--s-4);
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s-2) 0;
    border-bottom: 1px solid var(--warm-200);
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-label {
    font-size: var(--fs-sm);
    color: var(--text-mid);
}

.resource-num {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--blue-500);
}

/* ========== 捐赠区域 ========== */
.donation-section {
    margin: var(--s-6) 0;
    padding: var(--s-5);
    background: var(--warm-50);
    border-radius: var(--r-lg);
}

.donation-hint {
    font-size: var(--fs-sm);
    color: var(--text-light);
    margin-bottom: var(--s-3);
    text-align: center;
}

/* ========== 广告区域 ========== */
.ad-section {
    margin: var(--s-5) 0;
    padding: var(--s-4);
    background: var(--blue-100);
    border-radius: var(--r-md);
}

.ad-hint {
    font-size: var(--fs-sm);
    color: var(--blue-500);
    margin-bottom: var(--s-1);
    font-weight: 500;
}

.ad-section p {
    font-size: var(--fs-sm);
    color: var(--text-mid);
}

/* ========== 热线引导页 ========== */
.hotline-page {
    text-align: center;
}

.hotline-title {
    font-size: var(--fs-title);
    font-weight: 700;
    margin-bottom: var(--s-2);
    color: var(--text-dark);
}

.hotline-subtitle {
    font-size: var(--fs-base);
    color: var(--text-light);
    margin-bottom: var(--s-6);
}

.hotline-encourage {
    margin-top: var(--s-6);
    padding: var(--s-4);
    background: var(--warm-50);
    border-radius: var(--r-lg);
    font-size: var(--fs-sm);
    color: var(--text-mid);
    line-height: 1.7;
}

/* ========== 忘记密码表单 ========== */
.forgot-form {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}

.form-hint-text {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-light);
    margin-top: var(--s-1);
}

#forgot-question-group,
#forgot-answer-group,
#forgot-newpwd-group {
    margin-top: var(--s-4);
}

/* ========== 心理评测 ========== */
.section-header {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-dark);
    margin: var(--s-5) 0 var(--s-3);
    padding-bottom: var(--s-2);
    border-bottom: 2px solid var(--blue-100);
}

/* ========== 个人信息页 ========== */
.profile-info-form {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}

/* ========== 响应式 - 小屏幕 ========== */
@media (max-width: 480px) {
    .agreement-header {
        flex-direction: column;
        gap: var(--s-2);
    }

    .profile-btn,
    .logout-btn {
        width: 100%;
    }

    .chat-bar {
        flex-wrap: wrap;
    }

    .chat-status-badge {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: var(--s-2);
    }

    .end-page {
        padding: var(--s-5) var(--s-3);
    }

    .resource-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s-1);
    }
}

/* ========== 反馈弹窗 ========== */
.modal { position:fixed; top:0; left:0; width:100%; height:100%; z-index:1000; display:flex; align-items:center; justify-content:center; }
.modal-overlay { position:absolute; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); }
.modal-content { position:relative; background:#fff; border-radius:16px; padding:24px; max-width:400px; width:90%; z-index:1; }
.modal-content h3 { font-size:var(--fs-lg); font-weight:700; margin-bottom:var(--s-2); }
.modal-content .form-group { margin-bottom:var(--s-3); }
.modal-content .form-group label { display:block; font-size:var(--fs-sm); font-weight:500; margin-bottom:var(--s-1); color:var(--text-dark); }

/* ========== 仪表盘反馈卡片 ========== */
.dash-card { background:var(--white); border-radius:var(--r-lg); padding:var(--s-5); box-shadow:var(--shadow-soft); text-align:center; transition:all var(--duration) var(--ease); }
.dash-card:hover { box-shadow:var(--shadow-card); transform:translateY(-2px); }
.dash-card-icon { font-size:32px; margin-bottom:var(--s-2); }
.dash-card-title { font-size:var(--fs-base); font-weight:600; color:var(--text-dark); margin-bottom:var(--s-1); }
.dash-card-desc { font-size:var(--fs-xs); color:var(--text-light); }
.dash-card-feedback .dash-card-icon svg { width: 24px; height: 24px; stroke: var(--text-light); }

/* Notification bell styles */
.dash-top-right {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.vol-notification-wrapper {
    padding: 8px var(--s-3);
    background: var(--warm-50);
    border: 1px solid var(--warm-200);
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: 500;
    font-family: var(--font);
    color: var(--text-mid);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    position: relative;
}
.vol-notification-wrapper:hover {
    background: var(--warm-200);
}
.vol-notification-icon {
    width: 16px;
    height: 16px;
    stroke: var(--text-mid);
}
.vol-notification-label {
    font-size: var(--fs-xs);
    color: var(--text-mid);
    font-weight: 500;
}
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--warning);
    color: var(--white);
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: var(--r-full);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 600;
    line-height: 1;
}
.notification-panel {
    display: none;
    position: absolute;
    top: calc(100% + var(--s-2));
    right: 0;
    width: 320px;
    max-height: 400px;
    background: var(--white);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
    z-index: 100;
    overflow: hidden;
}
.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--warm-200);
}
.notification-panel-header h4 { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-dark); }
.notification-mark-all { background: none; border: none; color: var(--blue-500); cursor: pointer; font-size: var(--fs-xs); font-family: var(--font); }
.notification-mark-all:hover { text-decoration: underline; }
.notification-list { max-height: 340px; overflow-y: auto; }
.notification-empty { text-align: center; color: var(--text-light); padding: var(--s-7) var(--s-3); font-size: var(--fs-sm); }
.notification-item { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--warm-100); cursor: pointer; transition: background var(--duration) var(--ease); }
.notification-item:hover { background: var(--warm-50); }
.notification-item.unread { background: var(--blue-100); }
.notification-item-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-dark); margin-bottom: 2px; }
.notification-item-content { font-size: var(--fs-xs); color: var(--text-mid); line-height: 1.4; }
.notification-item-time { font-size: var(--fs-xs); color: var(--text-light); margin-top: 2px; }

/* Modal styles */
.modal { position:fixed; top:0; left:0; width:100%; height:100%; z-index:1000; display:flex; align-items:center; justify-content:center; }
.modal-overlay { position:absolute; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); }
.modal-content { position:relative; background:var(--white); border-radius:var(--r-lg); padding:var(--s-6); max-width:400px; width:90%; z-index:1; }
