﻿﻿﻿﻿﻿﻿﻿﻿﻿/* static/css/style.css */

/* ========================================
   设计令牌 Design Tokens —— Ⓑ 暖阳棉布（被抱住的安全感）
   暖米白画布 + 陶土橘主色，禁用纯白/纯黑/纯灰
   ======================================== */
:root {
    /* 中性色：暖调，不用纯白纯黑 */
    --canvas: #FBF6EC;          /* 暖米白画布 */
    --surface: rgba(255, 253, 248, 0.72); /* 暖纸卡片 */
    --ink: #4A4038;             /* 深咖主文字（替代 #333） */
    --ink-soft: #A39684;        /* 次要文字 */
    --hairline: rgba(74, 64, 56, 0.08);   /* 柔和分隔线 */

    /* 主色：陶土橘（替代原商务紫 #C99C7E/#B78460） */
    --heal-primary: #C99C7E;
    --heal-primary-soft: rgba(201, 156, 126, 0.16);
    --heal-accent: #B78460;     /* 深陶土（CTA 强调） */

    /* 场景主题色（低饱和暖调）：进入场景时切换 data-theme */
    --scene-forest: #A8C686;    /* 森林·身体 */
    --scene-beach: #9CC4D8;     /* 海滩·情绪 */
    --scene-courtyard: #E8B88F; /* 庭院·意识 */
    --scene-mountain: #A8A3B8;  /* 山间·灵性 */

    /* 圆角：治愈系要大圆角 */
    --radius-card: 20px;
    --radius-cta: 999px;        /* 胶囊按钮 */

    /* 阴影：带色柔光，不用灰黑影 */
    --shadow-soft: 0 10px 36px rgba(74, 64, 56, 0.12);

    /* 系统化字阶（替代零散字号） */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.75rem;

    /* 慢动效：弱反馈、引导沉浸 */
    --ease-calm: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-slow: 0.6s;
}

/* 场景主题：给容器加 data-theme 即整体换肤 */
[data-theme="forest"]   { --heal-primary: var(--scene-forest); }
[data-theme="beach"]    { --heal-primary: var(--scene-beach); }
[data-theme="courtyard"]{ --heal-primary: var(--scene-courtyard); }
[data-theme="mountain"] { --heal-primary: var(--scene-mountain); }

/* 睡眠/夜间模式：深夜使用不刺眼 */
[data-mode="night"] {
    --canvas: #1B2038;
    --ink: #E8E4DC;
    --ink-soft: #A9A59C;
    --surface: rgba(255, 255, 255, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: '华文楷体', 'STKaiti', 'KaiTi', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-weight: 500;
    background: var(--canvas);
    color: var(--ink);
    line-height: 1.6;
    font-size: var(--fs-base);
}

/* 导航栏 - 暖米白磨砂（浅色化：文字随之转深咖） */
.navbar {
    background: rgba(251, 246, 236, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: calc(0.7rem + env(safe-area-inset-top, 0px)) 0 0.7rem;
    box-shadow: 0 2px 12px rgba(74, 64, 56, 0.06);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

/* 导航栏底部边框，确保两行时不透明 */
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--hairline);
}

/* 导航栏 - 居中对齐 */
.nav-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 2rem;
    flex-wrap: wrap;
    min-height: 50px;
}

/* Logo 位置调整 */
.nav-logo {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    text-decoration: none;
}

/* Logo 图片样式 */
.logo-img {
    height: clamp(48px, 7.2vh, 58px);
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    color: var(--ink);
    text-decoration: none;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--heal-accent);
}

/* 用户导航区域 - 跟随导航真实高度垂直居中 */
.nav-user {
    position: absolute;
    right: 2rem;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.user-info {
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-btn,
.logout-btn {
    color: var(--ink);
    text-decoration: none;
    padding: 0.34rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    background: #E8A05E;
    border: 1px solid #E8A05E;
    box-shadow: 0 4px 14px rgba(232, 160, 94, 0.35);
    transition: all 0.3s ease;
}

.login-btn:hover,
.logout-btn:hover {
    background: #D98E48;
    border-color: #D98E48;
    color: var(--ink);
}

/* ===== 用户名下拉菜单（修改密码/注销/退出收纳，注销降误触） ===== */
.user-menu-wrap { position: relative; display: inline-flex; align-items: center; }
.user-trigger { cursor: pointer; user-select: none; padding: 0.3rem 0.8rem; border-radius: 999px; background: #E8A05E; border: 1px solid #E8A05E; color: var(--ink); box-shadow: 0 4px 14px rgba(232, 160, 94, 0.35); transition: background .25s; }
.user-trigger:hover { background: #D98E48; }
.user-trigger .caret { font-size: 0.7rem; margin-left: 2px; }
.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 150px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 6px 0;
    display: none;
    z-index: 1100;
}
.user-menu.open { display: block; }
.user-menu::before {
    content: '';
    position: absolute;
    top: -6px; right: 16px;
    width: 12px; height: 12px;
    background: #fff;
    transform: rotate(45deg);
}
.user-menu a {
    display: block;
    padding: 9px 16px;
    color: #444;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    transition: background .2s;
}
.user-menu a:hover { background: #f3f4fb; }
.user-menu a.danger { color: #e74c3c; }
.user-menu a.danger:hover { background: #fff5f5; }
.user-menu .quota-line {
    padding: 9px 16px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
}
@media (max-width: 768px) {
    .user-menu a { font-size: 0.8rem; padding: 8px 14px; }
}

/* 页脚 - 深棕收口（替代紫渐变） */
.footer {
    background: #574A40;
    color: #EADFD2;
    text-align: center;
    padding: 0.5rem;
    margin-top: 0;
}

.footer p {
    font-size: 0.75rem;
    margin: 0;
}

/* 首页 - 暖阳棉布：米色暖底 + 顶部一抹光 */
.home-container {
    min-height: 100vh;
    padding-top: 60px;
    position: relative;
    background:
        radial-gradient(120% 60% at 50% -10%, rgba(255, 228, 188, 0.7) 0%, rgba(246, 237, 223, 0) 65%),
        linear-gradient(180deg, #F7EEDF 0%, #F1E4D0 100%);
}

/* Hero 区域唯美背景图 */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 280px;
    background: url('https://images.unsplash.com/photo-1518173946687-a4c036bc9f02?w=1920&q=80') center/cover no-repeat;
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(201, 156, 126, 0.3) 0%,
        rgba(183, 132, 96, 0.2) 50%,
        rgba(255, 255, 255, 0.95) 100%
    );
}

/* 首页 Hero 区域 - 紧凑版 */
.hero {
    position: relative;
    z-index: 1;
    padding: 1.5rem 2rem 0.5rem;
    text-align: center;
}

.hero h1 {
    font-family: '华文楷体', 'STKaiti', 'KaiTi', serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
    letter-spacing: 0.03em;
}

.subtitle {
    font-family: '华文楷体', 'STKaiti', 'KaiTi', serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

/* 疗愈空间横向长方形布局 */
/* ========================================
   P1: 首页疗愈空间布局 - 紧凑2列
   ======================================== */

/* 所有屏幕 - 紧凑2列布局 */
.spaces-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
}

.spaces-row {
    display: contents;
}

.space-card {
    width: calc(50% - 0.6rem);
    min-height: 280px;
    max-width: 420px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none;
    display: block;
    flex-shrink: 0;
}

.space-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.5s ease;
}

.space-card:hover .space-bg {
    transform: scale(1.05);
}

.space-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.1) 0%,
        rgba(0,0,0,0.3) 50%,
        rgba(0,0,0,0.6) 100%
    );
    transition: background 0.3s ease;
}

.space-card:hover .space-overlay {
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.1) 0%,
        rgba(0,0,0,0.4) 50%,
        rgba(0,0,0,0.7) 100%
    );
}

.space-card:active {
    transform: none;
}

/* 卡片内容 */
.space-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    z-index: 1;
}

.space-content h2 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: #ffffff;
}

.space-content p {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0.2rem;
    color: #ffffff;
}

.enter-btn {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.3);
}

.space-card:hover .enter-btn {
    background: rgba(255,255,255,0.4);
    color: #ffffff;
    border-color: rgba(255,255,255,0.5);
}

/* 功能特性区域 */
/* ========================================
   功能特性区域 - 紧凑版
   ======================================== */
.features {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0.5rem 1rem;
    text-align: center;
}

.features h2 {
    display: none;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.features-grid a.feature-item {
    text-decoration: none;
    display: block;
    color: inherit;
}

.features-grid a.feature-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(201, 156, 126, 0.5);
    box-shadow: 0 12px 30px rgba(201, 156, 126, 0.2);
}

.feature-item {
    padding: 0.5rem 0.5rem;
    min-height: 70px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(201, 156, 126, 0.4);
    box-shadow: 0 10px 25px rgba(201, 156, 126, 0.15);
}

.feature-icon {
    display: none;
}

.feature-item h3 {
    font-family: '华文楷体', 'STKaiti', 'KaiTi', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.2rem;
    letter-spacing: 0.05em;
}

.feature-item p {
    font-size: 0.7rem;
    color: #5d6d7e;
    line-height: 1.4;
}

/* ========================================
   响应式断点
   ======================================== */

/* iPad (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 500px;
    }
}

/* 手机 (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .feature-item {
        min-height: 60px;
        padding: 0.4rem 0.5rem;
    }

    .feature-item h3 {
        font-size: 0.8rem;
    }

    .feature-item p {
        font-size: 0.65rem;
    }
}

/* 小手机 (<576px) */
@media (max-width: 575px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0 0.5rem;
    }

    .feature-item {
        min-height: 50px;
        padding: 0.3rem 0.4rem;
    }

    .feature-item h3 {
        font-size: 0.7rem;
    }

    .feature-item p {
        font-size: 0.6rem;
        display: none;
    }
}

/* 疗愈空间页面 */
/* ========================================
   疗愈空间页面 - 固定视口布局
   ======================================== */

/* 整个页面固定在视口 */
.healing-space {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 60px;  /* 添加顶部间距 */
}

/* 背景图固定 */
.space-background {
    position: fixed;
    inset: 0;
    background: center/cover fixed no-repeat;
    z-index: -1;
}

.space-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(251, 246, 236, 0.55) 0%,
        rgba(251, 246, 236, 0.15) 26%,
        rgba(251, 246, 236, 0) 50%);
}

/* 头部导航栏 - 三列布局，暖沙底（比画布米色深一档，显层次并托出透明把手） */
.space-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0.5rem 1.5rem;
    margin-top: 0;
    min-height: 50px;
    background: rgba(233, 219, 196, 0.95);
    box-shadow: 0 2px 12px rgba(74, 64, 56, 0.10);
    border: 1px solid rgba(183, 132, 96, 0.20);
    flex-shrink: 0;
    flex-wrap: nowrap;
    position: relative;
}

/* 隐藏疗愈空间标题 */
.space-header h1 {
    display: none;
}

.back-btn {
    color: #B78460;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 0.5rem;
    position: relative;
    z-index: 1;
}

.header-right {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 1rem;
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
}

.report-btn {
    display: inline-block;
    padding: 4px 10px;
    background: #4a5568;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-right: 10px;
}

.report-btn:hover {
    background: #2d3748;
}

.timer-display {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 0.9rem;
    text-align: right;
    font-family: '华文楷体', 'STKaiti', 'KaiTi', sans-serif;
    white-space: nowrap;
}

#timer {
    font-size: 0.8rem;
    color: #888888;
    font-weight: normal;
}

/* #9：撤下空间页"剩余对话次数"倒计时胶囊（额度移到导航用户菜单）；元素保留在 DOM 供 JS 安全更新，仅视觉隐藏 */
.timer-label,
.timer-value,
.trial-badge {
    display: none;
}

/* 聊天容器 - 固定尺寸自适应（宽 min(640px,92%)、高撑满剩余视口）· A 通透优先：暖纱 + 轻模糊 */
.chat-container {
    width: min(640px, 92%);
    align-self: center;
    flex: 1;
    min-height: 0;
    margin-bottom: 1rem;
    background: rgba(255, 253, 248, 0.18);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 253, 248, 0.55);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 桌面端拖拽把手：叼着面板放任意位置（手机端隐藏、不可拖） */
.drag-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    color: rgba(74, 64, 56, 0.35);
    background: rgba(255, 253, 248, 0.25);
    user-select: none;
    -webkit-user-select: none;
}

.drag-bar:active {
    cursor: grabbing;
}

.drag-bar::before {
    content: '';
    width: 44px;
    height: 4px;
    border-radius: 2px;
    background: rgba(74, 64, 56, 0.22);
}

@media (max-width: 768px) {
    .drag-bar {
        display: none;
    }
}

/* 聊天消息区域 - 可滚动 */
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

/* 自定义滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(201, 156, 126,0.4);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 156, 126,0.6);
}

/* 欢迎消息和普通消息 */
.welcome-message, .message {
    display: flex;
    gap: 0.8rem;
    animation: fadeIn 0.3s ease;
}

.message.user-message {
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    background: rgba(255, 253, 248, 0.72);
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    max-width: 70%;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    border: 1px solid rgba(255, 253, 248, 0.6);
    box-shadow: 0 3px 10px rgba(74, 64, 56, 0.08);
}

.message.user-message .message-content {
    background: #B78460;
    color: white;
    font-size: 1rem;
    border: 1px solid rgba(169, 113, 74, 0.9);
    box-shadow: 0 3px 10px rgba(183, 132, 96, 0.25);
}

/* 用户气泡内的时间戳：更具体选择器 + 暖白，深陶土底上清晰可读 */
.message.user-message .message-content .message-time {
    color: #F6E7D8;
}

.message-time {
    display: block;
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.3rem;
}

/* 输入区域 */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.9);
    border-top: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.input-tools {
    display: flex;
    gap: 0.3rem;
}

.tool-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(201, 156, 126,0.1);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: rgba(201, 156, 126,0.2);
}

.tool-btn.active {
    background: rgba(201, 156, 126,0.3);
}

/* 【语音转文字】录音中状态：暖陶土实心 + 柔和呼吸圈（不用促销红，保持低刺激） */
.tool-btn.recording {
    background: linear-gradient(135deg, #C99C7E 0%, #B78460 100%);
    color: #fff;
    animation: voicePulse 1.4s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(183, 132, 96, 0.45); }
    50%      { box-shadow: 0 0 0 8px rgba(183, 132, 96, 0); }
}

/* 【语音转文字】提示条：说清"识别后需确认再发送" */
.voice-hint {
    display: none;
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #4A4038;
    background: rgba(233, 219, 196, 0.95);
    border-top: 1px solid rgba(183, 132, 96, 0.35);
    flex-shrink: 0;
}

/* 尊重系统的"减弱动效"偏好（PRD §7 硬约束） */
@media (prefers-reduced-motion: reduce) {
    .tool-btn.recording { animation: none; }
}

/* 【适老化】发送按钮 · 紫色渐变胶囊按钮 · 与 .payment-btn 同风格 · 华文楷体 */
.send-btn {
    height: 40px;
    min-width: 80px;
    padding: 0 1.2rem;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #C99C7E 0%, #B78460 100%);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    font-family: '华文楷体', 'STKaiti', 'KaiTi', serif;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(201, 156, 126, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 156, 126, 0.5);
}

.send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(201, 156, 126, 0.4);
}

#messageInput {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(201, 156, 126,0.3);
    border-radius: 20px;
    font-size: 1.05rem;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 100px;
}

#messageInput:focus {
    border-color: #C99C7E;
    box-shadow: 0 0 0 3px rgba(201, 156, 126,0.1);
}

/* 音乐控制按钮 */
.music-control {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 100;
}

.music-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

.music-toggle:hover {
    background: white;
    transform: scale(1.1);
}

/* 支付弹窗样式 */
.payment-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.payment-modal {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.payment-modal h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.payment-modal p {
    margin-bottom: 0.5rem;
    color: #666;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.payment-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #C99C7E 0%, #B78460 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: '华文楷体', 'STKaiti', 'KaiTi', serif;
}

.payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(201, 156, 126, 0.4);
}

/* ============ 加载动画样式 - 疗愈师思考中的三个小气泡 ============ */
.loading-content {
    padding: 0.6rem 1rem !important;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.loading-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #C99C7E;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 拖拽功能首次提示气泡 */
.drag-tip {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(74, 64, 56, 0.88);
    color: #FBF6EC;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    z-index: 1200;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(74, 64, 56, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    white-space: nowrap;
}

.drag-tip.show {
    opacity: 1;
    pointer-events: auto;
}

@keyframes dragBarPulse {
    0%, 100% { background: rgba(255, 253, 248, 0.25); }
    50% { background: rgba(201, 156, 126, 0.45); }
}

.drag-bar.pulse {
    animation: dragBarPulse 1.2s ease 3;
}

/* ========================================
   响应式断点
   ======================================== */

/* 手机端 */
@media (max-width: 768px) {
    .navbar {
        padding: 0.45rem 0;
    }

    .nav-container {
        min-height: 52px;
        padding: 0 0.8rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 0.9rem;
        order: 1;
    }

    .nav-links a {
        font-size: 0.78rem;
        margin-left: 0;
    }

    .nav-logo {
        left: 0.8rem;
        top: 0.5rem;
        transform: none;
    }

    .logo-img {
        height: 32px;
    }

    .nav-user {
        right: 0.8rem;
        top: auto;
        bottom: 0.4rem;
        transform: none;
    }

    .user-info {
        font-size: 0.7rem;
        max-width: 96px;
    }

    .user-trigger {
        padding: 0.2rem 0.6rem;
    }

    .login-btn, .logout-btn {
        font-size: 0.72rem;
        padding: 0.2rem 0.6rem;
    }
}

/* 手机端疗愈空间头部 */
@media (max-width: 768px) {
    .healing-space {
        padding-top: 70px;   /* 越过两行导航（链接+用户名胶囊）；仍被压再加、露背景再减 */
    }

    .space-header {
        padding: 0.4rem 0.8rem;
        min-height: 46px;
        align-items: flex-end;
        flex-wrap: nowrap;
        gap: 0.4rem;
        background: #FFFDF8;
    }

    .back-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        height: auto;
        align-self: flex-end;
    }

    .header-right {
        width: auto;
        align-items: flex-end;
        justify-content: flex-end;
    }
}

/* 手机端音乐按钮位置调整 - 避免遮挡输入栏 */
@media (max-width: 768px) {
    .music-control {
        bottom: 4.5rem;
        right: 0.5rem;
    }

    .music-toggle {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* 手机 */
@media (max-width: 768px) {
    .chat-container {
        width: 88%;
        max-width: 88%;
        margin: 0.5rem auto;
        border-radius: 14px;
        background: rgba(255, 253, 248, 0.10);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .chat-messages {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .message-content {
        max-width: 80%;
        font-size: 0.95rem;
        padding: 0.5rem 0.7rem;
    }

    .avatar {
        width: 35px;
        height: 35px;
    }

    .tool-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .send-btn {
        height: 36px;
        min-width: 64px;
        padding: 0 0.9rem;
        font-size: 0.9rem;
        border-radius: 18px;
    }

    #messageInput {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
}

/* 小手机 */
@media (max-width: 480px) {
    .space-header h1 {
        font-size: 0.9rem;
    }

    .back-btn {
        font-size: 0.7rem;
    }

    .timer-display {
        font-size: 0.7rem;
    }

    .report-btn {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .chat-container {
        margin: 0.5rem auto;
    }
}

/* 【适老化·输入区】工具按钮独占一行，输入框拿回全部宽度（原先被挤到约 122px） */
.chat-input-area {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem calc(0.5rem + env(safe-area-inset-bottom));
}

.input-tools {
    width: 100%;
    order: -1;              /* 工具行上移，输入框独占第二行 */
    gap: 0.35rem;
}

.tool-btn {
    width: 40px;             /* 触控区 ≥40px，老人不易误触 */
    height: 40px;
    font-size: 1rem;
}

.send-btn {
    height: 40px;            /* 保持 40px 触控区，老人不易点空；比 44px 更省横向空间 */
    min-width: 56px;
    padding: 0 0.5rem;
    font-size: 12px;          /* 与 .report-btn 字号一致 */
    border-radius: 20px;
}

#messageInput {
    flex: 1 1 0;
    min-width: 0;            /* 允许 flex 收缩，避免被挤成一条缝 */
    min-height: 44px;
    font-size: 1rem;         /* 移动端不再压到 0.9rem */
    line-height: 1.6;
    padding: 0.6rem 0.9rem;
    max-height: 140px;
    overflow-y: auto;
}

/* 【适老化·输入区】小屏再收紧一档 */
@media (max-width: 768px) {
    .chat-container {
        margin: 0.5rem auto;
    }

    /* 小屏输入区再收紧一档 */
    .chat-input-area {
        gap: 0.35rem;
        padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
    }

    .send-btn {
        min-width: 52px;
        padding: 0 0.4rem;
    }

    #messageInput {
        padding: 0.55rem 0.8rem;
    }
}

/* ========================================
   关于我们页面样式 - 简化版
   ======================================== */

/* 关于我们背景图片 */
.about-bg {
    background: url('/static/pics/prairie-sunset.jpg') center/cover no-repeat fixed;
    min-height: 100vh;
}

.about-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 1rem 1.5rem;
}

/* 内容区域 - 紧凑版 */
.about-section {
    margin-bottom: 1rem;
}

.about-section h2 {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 0.6rem;
    font-family: '华文楷体', 'STKaiti', 'KaiTi', serif;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.about-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
    font-family: '华文楷体', 'STKaiti', 'KaiTi', serif;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.8rem 1rem;
    border-radius: 10px;
}

/* 联系方式 - 紧凑版，白色字体 */
.contact-list {
    list-style: none;
    margin-top: 0.8rem;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.contact-list li {
    font-size: 0.95rem;
    color: #ffffff;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-family: '华文楷体', 'STKaiti', 'KaiTi', serif;
}

.contact-list li:last-child {
    border-bottom: none;
}

/* 手机端响应式 - 更紧凑 */
@media (max-width: 768px) {
    .about-container {
        padding: 70px 0.8rem 1rem;
    }

    .about-section h2 {
        font-size: 1.1rem;
    }

    .about-section p {
        font-size: 0.9rem;
        padding: 0.7rem 0.8rem;
    }

    .contact-list li {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
}

/* 小手机 */
@media (max-width: 480px) {
    .about-container {
        padding: 60px 0.6rem 1rem;
    }

    .about-section h2 {
        font-size: 1rem;
    }

    .about-section p {
        font-size: 0.85rem;
    }
}
