@import url('../../../src/styles/tokens.css');

/* 一念 · 首页（起卦 + 卦象 + 解读 + 历史 + 设置等）样式表
 *
 * v6.7.2 架构重构：从 index.html 抽出来 (~2860 行)
 * 见 plan/v6-nianxin-upgrade/2026-05-12_architecture_audit.md Stage 1
 *
 * 内容：设计系统变量 + 起卦界面 + 卦象 + 解读面板 + 底部 nav + 起卦进度条 +
 *      模态 / 历史 / 设置 / 各种动画 / 移动端响应式 / app-page--dark 主题覆盖
 */

/* ============ app-page--dark：modular 页面用墨金主题（学堂/自我）============ */
/* v5: dark-panel override for modular pages (学堂 / 自我).

         Keeps the parchment look for legacy surfaces, switches new panels to 墨金 aesthetic. */
      .app-page.app-page--dark {
        background: linear-gradient(180deg, #08080c 0%, #0e0e14 40%, #0a0a10 100%) !important;
        color: #ebe4d8 !important;
      }
      .app-page.app-page--dark .page-header {
        background: rgba(10, 10, 15, 0.92) !important;
        border-bottom: 1px solid rgba(232, 200, 107, 0.12) !important;
      }
      .app-page.app-page--dark .page-header-title {
        color: #e8c86b !important;
        font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
        letter-spacing: 0.25em;
      }
      .app-page.app-page--dark .page-header-btn svg {
        stroke: rgba(232, 200, 107, 0.7);
        fill: none;
        stroke-width: 1.6;
      }
      .app-page.app-page--dark .page-body {
        background: transparent !important;
        /* v6：给底部 nav (60px + safe-area) 预留空间，否则吾身 tab 最底部的清除数据按钮划不到 */
        padding: 0 0 calc(80px + env(safe-area-inset-bottom, 0px)) 0 !important;
        overflow-y: auto;
        overflow-x: hidden;
      }


/* ============ 主样式表（起卦界面 / 卦象 / 解读 / nav / etc）============ */
        * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        /* 全局按钮防换行 + 溢出保护 + CJK 中文字符防断行 */
        button, .btn, [class*="-btn"], [class*="-cta"] {
            white-space: nowrap;
            word-break: keep-all;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
            min-width: fit-content;
        }
        /* iOS + Android 基础优化：
           - text-size-adjust 防止 iOS 在横屏时放大文本
           - tap-highlight 关掉默认灰色高亮
           - overscroll-behavior 防止 Android 滚到底时白色反弹
           - 全局 touch-action: manipulation 去掉 300ms tap 延迟（比 @media (hover: none) 更可靠） */
        html {
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
            scroll-behavior: smooth;
            overscroll-behavior-y: none;
            /* v6：跨设备鲁棒性 —— 任何元素意外溢出都不会产生横向滚动条或错位 */
            overflow-x: hidden;
            max-width: 100vw;
            /* 字号基线按视口温和缩放（仅 body rem 单位会跟；px 不变）
               iPhone SE 320px → 14px，iPhone 14 390px → ~16px，iPad → capped 17px */
            font-size: clamp(14px, calc(100vw / 26), 17px);
        }
        /* v6.6 性能：页面隐藏时（切 app / 锁屏 / 切 tab）暂停所有 CSS 动画 */
        html.yj-page-hidden *,
        html.yj-page-hidden *::before,
        html.yj-page-hidden *::after {
            animation-play-state: paused !important;
        }
        /* v6.7 发热修复（iPhone 17 Pro Max 用户反馈持续发热）：
           手机端激进关掉装饰性持续动画。50 岁用户对烟雾粒子/呼吸光晕没感觉，
           这些 infinite text-shadow/transform 动画却是 iPhone Safari 的发热大户。
           text-shadow 动画不能上 GPU 合成，强制每帧重绘文字栅格——CPU 持续高占用。 */
        @media (max-width: 820px) {
            /* 烟雾、粒子：装饰性，移动端直接关 */
            .smoke, .particle, .particle-container, .ambient-particle {
                display: none !important;
            }
            /* 标题呼吸光晕：保留一个静态的 text-shadow 即可，不让它每帧重绘 */
            .title {
                animation: none !important;
                text-shadow: 0 0 50px rgba(232, 200, 107, 0.28), 0 2px 4px rgba(0, 0, 0, 0.3) !important;
            }
            /* 太极背景呼吸：移动端只留静态背景，不让 transform 每帧合成 */
            .yarrow-stage::before {
                animation: none !important;
                opacity: 0.08 !important;
            }
            /* 念心入口按钮的循环光晕：移动端关 */
            .nianxin-enter-btn {
                animation: none !important;
            }
        }
        /* v6.6 性能：移动端 blur 降级（20px → 8px）→ Android GPU 负担 ↓ 60% */
        @media (max-width: 820px) {
            .bottom-nav, .retention-modal, .onboard-overlay,
            .question-overlay, .info-panel, .history-panel,
            .interpretation-panel, .chat-panel, .investor-welcome,
            .app-page {
                backdrop-filter: blur(8px) !important;
                -webkit-backdrop-filter: blur(8px) !important;
            }
        }
        /* 旧浏览器不支持 backdrop-filter 时用纯半透明兜底，防止透视穿透 */
        @supports not (backdrop-filter: blur(1px)) {
            .bottom-nav { background: rgba(10, 10, 15, 0.98) !important; }
        }
        body {
            overscroll-behavior-y: none;
            overflow-x: hidden;
            max-width: 100vw;
        }
        /* 图片默认不走形（没设 width/height 时按原比例显示） */
        img { max-width: 100%; height: auto; }
        button, [role="button"], .clickable, a, input[type="button"], input[type="submit"] {
            touch-action: manipulation;
        }
        /* iOS 输入框：16px 以下会触发自动 zoom，这里全局兜底 */
        input, textarea, select {
            font-size: 16px;
        }
        /* 触摸反馈基类 */
        .touch-feedback {
            transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease;
        }
        .touch-feedback:active { transform: scale(0.96); opacity: 0.9; }
        /* v6.7 统一字体系统（50 岁中年读者友好）
           三档：软笔书法 logo / 楷宋之间正文 / 累赘细节文字
           顺序写法：本地系统字体优先（macOS / iOS 自带的字体最锐利）→ Web Font → 通用回退 */
        /* v6.7 全局字号缩放：响应自我 tab 里的"字号"四档（小 / 中 / 大 / 特大）。
           ziwo/index.js applySettingsToDOM 会写 html[data-font-size="s|m|l|xl"]。
           所有用 var(--user-font-scale) 的尺寸都会一起缩放——chat bubble、面板、按钮 */
        body {
            /* 全局正文：楷宋之间。中年人读这种字体能稳坐三页不累。 */
            font-family: var(--font-body);
            background: linear-gradient(180deg, #08080c 0%, #0e0e14 40%, #0a0a10 100%);
            min-height: 100vh;   /* fallback */
            min-height: 100dvh;  /* 真实可视高度，避免浏览器 URL 栏下被「裁掉」 */
            overflow-x: hidden;
            color: var(--gold);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
            font-weight: 400;
            letter-spacing: 0.03em;
            /* 50 岁友好：基础字号 + 用户偏好缩放 */
            font-size: calc(clamp(15.5px, 100vw / 25, 17.5px) * var(--user-font-scale));
            line-height: 1.75;
        }
        .smoke-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: hidden; }
        .smoke { position: absolute; width: 200px; height: 200px; background: radial-gradient(ellipse at center, rgba(60,60,80,0.15) 0%, transparent 70%); border-radius: 50%; animation: float 20s infinite ease-in-out; }
        @keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; } 25% { transform: translate(50px, -30px) scale(1.2); opacity: 0.5; } 50% { transform: translate(-30px, -60px) scale(1.1); opacity: 0.4; } 75% { transform: translate(20px, -20px) scale(0.9); opacity: 0.3; } }
        .particle-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: hidden; }
        .particle { position: absolute; width: 3px; height: 3px; background: radial-gradient(circle, rgba(242,209,107,0.6) 0%, transparent 70%); border-radius: 50%; animation: particleFloat 8s infinite ease-in-out; }
        @keyframes particleFloat { 0% { transform: translateY(100vh) scale(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-20vh) scale(1); opacity: 0; } }
        /* 移动端关键修复：用 dvh（动态视口高度）替代 vh，并把 safe-area-inset-top 直接
           放入内边距，保证标题 / 问题行永远在浏览器 URL 栏以下、刘海以外。
           dvh 在所有主流移动浏览器都已支持（iOS Safari 15.4+、Chrome 108+）；
           不支持时自动回退到 100vh（上一行声明）。 */
        .app-container {
            position: relative;
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: calc(env(safe-area-inset-top) + clamp(12px, 3vw, 20px))
                     calc(env(safe-area-inset-right) + clamp(12px, 4vw, 20px))
                     calc(env(safe-area-inset-bottom) + clamp(16px, 4vw, 24px))
                     calc(env(safe-area-inset-left) + clamp(12px, 4vw, 20px));
            min-height: 100vh;        /* fallback */
            min-height: 100dvh;        /* 真实可视高度，随 URL 栏收放自动调整 */
        }
        .title {
            /* "一念" — 头部 logo 用软笔书法字体，配厚墨字距 */
            font-family: var(--font-brush);
            font-size: clamp(2.4rem, 1.6rem + 4.5vw, 3.4rem);
            font-weight: 400;
            color: var(--gold);
            text-shadow: 0 0 40px rgba(232, 200, 107, 0.2), 0 2px 4px rgba(0,0,0,0.3);
            /* v6.8.1：拉近顶部留白。
               原 clamp(60px,14vw,72px) 视觉上偏下；按钮区 top:safe-area+15px 高约 44px，
               留 4-6px 空隙就够，使主标题更靠近顶端，整体节奏更紧 */
            margin-top: clamp(48px, 11vw, 58px);
            letter-spacing: clamp(8px, 4vw, 20px);
            font-weight: 400;
            animation: titleBreath 4s ease-in-out infinite;
        }
        @keyframes titleBreath { 0%, 100% { text-shadow: 0 0 40px rgba(232, 200, 107, 0.2), 0 2px 4px rgba(0,0,0,0.3); } 50% { text-shadow: 0 0 60px rgba(232, 200, 107, 0.35), 0 2px 4px rgba(0,0,0,0.3); } }
        /* 问题显示区 - 标题下方核心位置（v6.5 重写：金线上下边、文字最多 3 行优雅断行） */
        .question-display {
            margin-top: 10px;
            min-height: 28px;
            max-width: min(420px, 92%);
            width: 100%;
            text-align: center;
            position: relative;
            /* 给两条金线留出垂直空间 */
            padding: 6px 14px 8px;
            opacity: 0;
            transition: opacity 0.4s var(--ease-out-expo);
        }
        .question-display.visible { opacity: 1; }
        /* 上金线 */
        .question-display::before {
            content: '';
            display: block;
            width: clamp(48px, 18vw, 88px);
            height: 1px;
            margin: 0 auto 8px;
            background: linear-gradient(90deg, transparent, var(--gold-dim) 50%, transparent);
            opacity: 0.55;
        }
        /* 下金线 */
        .question-display::after {
            content: '';
            display: block;
            width: clamp(48px, 18vw, 88px);
            height: 1px;
            margin: 8px auto 0;
            background: linear-gradient(90deg, transparent, var(--gold-dim) 50%, transparent);
            opacity: 0.55;
        }
        .question-display-text {
            font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
            font-size: var(--fs-md);
            color: var(--gold-light);
            letter-spacing: 0.06em;
            line-height: 1.7;
            font-weight: 400;
            /* CJK 必须能在词间断行，否则一长串就溢出 */
            word-break: normal;
            overflow-wrap: break-word;
            /* 最多 3 行，超出优雅截断 + 提示可点开 */
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            overflow: hidden;
            text-overflow: ellipsis;
            transform: translateY(-5px);
            transition: transform 0.4s var(--ease-out-expo);
            text-wrap: balance;
            cursor: default;
        }
        .question-display.visible .question-display-text {
            transform: translateY(0);
        }
        /* 截断时显示一个"展开看全文"的小提示，cursor pointer 暗示可点 */
        .question-display.is-clamped .question-display-text {
            cursor: pointer;
        }
        .question-display.is-clamped::after {
            background: linear-gradient(90deg, transparent, rgba(232, 200, 107, 0.5) 50%, transparent);
        }
        /* 截断时的可见"展开"提示 —— 触屏没有 cursor 反馈，必须有看得见的 affordance */
        .question-display-expand-hint {
            display: none;
            margin: 6px auto 0;
            font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
            font-size: 11px;
            letter-spacing: 0.24em;
            color: var(--gold-dim);
            opacity: 0.72;
            text-align: center;
            cursor: pointer;
            user-select: none;
        }
        .question-display.is-clamped .question-display-expand-hint {
            display: block;
        }
        /* 问题文字强调效果 */
        .question-display-text .q-text {
            color: var(--gold);
            text-shadow: 0 0 20px rgba(232, 200, 107, 0.3);
        }
        /* 长问题展开层：朱砂金墨极简覆盖 */
        .question-display-full {
            position: fixed;
            inset: 0;
            z-index: 200;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
            background: radial-gradient(ellipse at center, rgba(15, 12, 22, 0.92), rgba(8, 6, 14, 0.96));
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            opacity: 0;
            pointer-events: none;
            transition: opacity 220ms ease;
        }
        .question-display-full.visible {
            opacity: 1;
            pointer-events: auto;
        }
        .question-display-full-inner {
            max-width: min(540px, 92%);
            max-height: 60vh;
            overflow-y: auto;
            padding: 26px 30px;
            border: 0.5px solid rgba(232, 200, 107, 0.32);
            border-radius: 12px;
            background: rgba(20, 18, 28, 0.55);
            box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(232, 200, 107, 0.08);
            font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
            font-size: clamp(15px, 4vw, 17px);
            line-height: 2;
            color: var(--gold-light);
            letter-spacing: 0.06em;
            text-align: center;
            -webkit-overflow-scrolling: touch;
        }
        .question-display-full-inner {
            position: relative;
        }
        .question-display-full-inner::before {
            content: '一念所问';
            display: block;
            font-size: 11px;
            letter-spacing: 0.32em;
            color: var(--gold-dim);
            margin-bottom: 14px;
            opacity: 0.62;
        }
        /* 全文层右上角关闭按钮 —— 触屏用户必须有看得见的退出口 */
        .question-display-full-close {
            position: absolute;
            top: 8px;
            right: 10px;
            width: 32px;
            height: 32px;
            line-height: 30px;
            text-align: center;
            border: 0.5px solid rgba(232, 200, 107, 0.32);
            border-radius: 50%;
            background: rgba(20, 18, 28, 0.6);
            color: var(--gold-light);
            font-size: 20px;
            font-family: 'LXGW WenKai', serif;
            cursor: pointer;
            transition: background 160ms ease, color 160ms ease;
            -webkit-tap-highlight-color: transparent;
        }
        .question-display-full-close:hover,
        .question-display-full-close:active {
            background: rgba(232, 200, 107, 0.12);
            color: var(--gold);
        }
        .question-display-full-text {
            white-space: pre-wrap;
            overflow-wrap: break-word;
            word-break: normal;
        }
        .yarrow-stage { width: 100%; max-width: min(380px, 90vw); height: clamp(200px, 55vw, 280px); margin-top: clamp(12px, 4vw, 20px); position: relative; border-radius: 24px; background: radial-gradient(ellipse at 50% 30%, rgba(50, 45, 55, 0.6) 0%, rgba(25, 22, 32, 0.85) 40%, rgba(12, 12, 18, 0.95) 100%); backdrop-filter: blur(12px); overflow: hidden; touch-action: none; border: 1px solid rgba(232, 200, 107, 0.15); box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), inset 0 0 80px rgba(232, 200, 107, 0.05), 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0,0,0,0.3); }
        /* 太极图背景装饰 */
        .yarrow-stage::before { content: ''; position: absolute; top: 50%; left: 50%; width: 200px; height: 200px; transform: translate(-50%, -50%); background: url('taiji-bg.png') center/contain no-repeat; opacity: 0.08; pointer-events: none; animation: taijiBreathe 8s ease-in-out infinite; z-index: 0; }
        @keyframes taijiBreathe { 0%, 100% { opacity: 0.06; transform: translate(-50%, -50%) scale(1) rotate(0deg); } 50% { opacity: 0.12; transform: translate(-50%, -50%) scale(1.05) rotate(5deg); } }
        .yarrow-canvas { width: 100%; height: 100%; position: relative; z-index: 1; }
        .hexagram-display { display: flex; flex-direction: column-reverse; align-items: center; margin-top: clamp(14px, 5vw, 25px); gap: clamp(4px, 1.2vw, 6px); }
        .line-slot { width: clamp(80px, 24vw, 115px); height: clamp(14px, 4vw, 22px); display: flex; justify-content: center; align-items: center; gap: 16px; opacity: 0.25; transition: all var(--duration-slow) var(--ease-spring); }
        .line-slot.active { opacity: 1; animation: lineAppear 0.7s var(--ease-out-back); }
        @keyframes lineAppear { 0% { transform: scaleX(0) scaleY(0.3); opacity: 0; filter: blur(6px); } 40% { transform: scaleX(1.15) scaleY(1.1); filter: blur(0); } 70% { transform: scaleX(0.95) scaleY(1); } 100% { transform: scaleX(1) scaleY(1); opacity: 1; filter: blur(0); } }
        .line-slot.locked { opacity: 0.15; }
        .line-segment { height: 5px; background: #f2d16b; border-radius: 3px; transition: all 0.3s ease; }
        .line-yang { width: 100%; }
        .line-yin { width: 38%; }
        .line-slot.changing .line-segment { background: linear-gradient(90deg, #ff6b35, #f2d16b, #ff6b35); background-size: 200% 100%; animation: changingGlow 1.5s ease-in-out infinite, changingShimmer 2s linear infinite; box-shadow: 0 0 20px rgba(255, 107, 53, 0.6), 0 0 40px rgba(255, 107, 53, 0.3); }
        @keyframes changingGlow { 0%, 100% { filter: brightness(1); box-shadow: 0 0 15px rgba(255, 107, 53, 0.5); } 50% { filter: brightness(1.4); box-shadow: 0 0 30px rgba(255, 107, 53, 0.8); } }
        @keyframes changingShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
        .status-text { margin-top: clamp(14px, 5vw, 28px); font-size: clamp(0.88rem, 0.8rem + 0.6vw, 1.05rem); color: var(--text-secondary); text-align: center; min-height: 50px; line-height: 1.7; white-space: pre-line; transition: all 0.3s ease; font-weight: 300; }
        .interpretation-panel { position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100dvh; background: rgba(10, 10, 15, 0.98); z-index: 100; display: none; flex-direction: column; overflow-y: auto; padding: clamp(16px, 5vw, 25px) clamp(14px, 4vw, 20px); padding-bottom: calc(clamp(16px, 5vw, 25px) + env(safe-area-inset-bottom)); }
        .interpretation-panel.visible { display: flex; animation: slideUpPanel 0.4s cubic-bezier(0.32, 0.72, 0, 1); }
        /* 八卦图背景装饰 */
        .interpretation-panel::before { content: ''; position: fixed; top: 50%; left: 50%; width: 400px; height: 400px; transform: translate(-50%, -50%); background: url('bagua-bg.png') center/contain no-repeat; opacity: 0.04; pointer-events: none; z-index: -1; }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes slideUpPanel { 0% { opacity: 0; transform: translateY(50px); } 60% { transform: translateY(-8px); } 100% { opacity: 1; transform: translateY(0); } }
        .interp-header { text-align: center; margin-bottom: 25px; padding-top: 15px; position: relative; }
        /* 祥云装饰 - 修复右侧显示 */
        .interp-header::before, .interp-header::after {
            content: '';
            position: absolute;
            width: 100px;
            height: 55px;
            background: url('cloud-decor.png') no-repeat;
            background-size: contain;
            opacity: 0.15;
            pointer-events: none;
        }
        .interp-header::before {
            top: -5px;
            left: 0;
            background-position: left center;
        }
        .interp-header::after {
            top: -5px;
            right: 0;
            background-position: left center;
            transform: scaleX(-1);
        }
        .interp-hexagram-visual { display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; margin-bottom: 20px; }
        .interp-hex-line { display: flex; justify-content: center; align-items: center; gap: 12px; height: 8px; }
        .interp-hex-segment { height: 6px; background: #f2d16b; border-radius: 3px; }
        .interp-hex-segment.yang { width: 60px; }
        .interp-hex-segment.yin { width: 24px; }
        .interp-hex-line.changing .interp-hex-segment { background: linear-gradient(90deg, #ff6b35, #f2d16b, #ff6b35); box-shadow: 0 0 12px rgba(255, 107, 53, 0.6); animation: pulse-glow 1.5s infinite; }
        .interp-hexagram-name { font-size: clamp(1.5rem, 1.1rem + 2vw, 2rem); color: #f2d16b; margin-top: 10px; }
        .interp-hexagram-full { font-size: var(--fs-md); color: #8b7355; margin-top: 5px; }
        .interp-section { background: linear-gradient(135deg, rgba(40, 35, 28, 0.7) 0%, rgba(30, 26, 20, 0.6) 100%); border-radius: 16px; padding: clamp(14px, 4vw, 20px); margin-bottom: clamp(10px, 3vw, 16px); border: 1px solid rgba(232, 200, 107, 0.1); }
        .interp-section-title { font-size: var(--fs-md); color: var(--gold); margin-bottom: clamp(8px, 2.5vw, 12px); display: flex; align-items: center; gap: clamp(6px, 2vw, 10px); font-weight: 500; letter-spacing: 1px; white-space: nowrap; }
        .interp-section-content { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.9; white-space: pre-line; font-weight: 300; }
        .deep-layer-toggle { background: rgba(242, 209, 107, 0.1); border: 1px solid rgba(242, 209, 107, 0.3); color: #f2d16b; padding: clamp(8px, 2.5vw, 12px) clamp(16px, 5vw, 24px); border-radius: 8px; font-size: clamp(0.78rem, 0.7rem + 0.4vw, 0.88rem); cursor: pointer; margin: 15px auto; display: block; transition: all 0.3s ease; width: auto; max-width: none; overflow: visible; }
        .deep-layer-toggle:hover { background: rgba(242, 209, 107, 0.2); }
        .deep-layer { display: none; }
        .deep-layer.visible { display: block; animation: slideDown 0.3s ease; }
        @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

        /* 念心解读 */
        .nianxin-section { background: linear-gradient(145deg, rgba(55, 48, 38, 0.7) 0%, rgba(35, 30, 25, 0.6) 100%); border: 1px solid rgba(232, 200, 107, 0.2); border-radius: 20px; padding: 22px; margin: 24px 0; position: relative; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
        .nianxin-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent 10%, rgba(232, 200, 107, 0.4) 50%, transparent 90%); }
        .nianxin-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
        .nianxin-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #f2d16b, #c9a227); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
        .nianxin-name { color: #f2d16b; font-size: 1rem; font-weight: 500; }
        .nianxin-badge { background: rgba(242, 209, 107, 0.2); color: #f2d16b; font-size: 0.65rem; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }
        .nianxin-content { color: #e0d5c5; font-size: 0.95rem; line-height: 1.9; white-space: pre-line; min-height: 60px; }
        .nianxin-content.loading { color: #8b7355; }
        .nianxin-loading-dots { display: inline-flex; gap: 4px; }
        .nianxin-loading-dots span { width: 6px; height: 6px; background: #f2d16b; border-radius: 50%; animation: nianxinDotPulse 1.4s infinite; }
        .nianxin-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
        .nianxin-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes nianxinDotPulse { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
        .nianxin-disclaimer { font-size: 0.75rem; color: #6b5d4d; text-align: center; margin-top: 15px; line-height: 1.5; padding-top: 12px; border-top: 1px solid rgba(242, 209, 107, 0.1); }
        .nianxin-followup { display: flex; gap: clamp(6px, 2vw, 10px); margin-top: 15px; padding: clamp(10px, 3vw, 15px); background: rgba(30, 25, 20, 0.5); border-radius: 12px; }
        .nianxin-followup-input { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(242, 209, 107, 0.2); border-radius: 20px; padding: clamp(8px, 2vw, 10px) clamp(10px, 3vw, 16px); color: #e0d5c5; font-size: 16px; outline: none; transition: all 0.3s ease; }
        .nianxin-followup-input:focus { border-color: rgba(242, 209, 107, 0.5); background: rgba(255, 255, 255, 0.08); }
        .nianxin-followup-input::placeholder { color: #6b5d4d; }
        .nianxin-followup-btn { background: linear-gradient(135deg, #f2d16b, #c9a227); border: none; color: #1a1a25; padding: clamp(8px, 2vw, 10px) clamp(14px, 4vw, 20px); border-radius: 20px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: all 0.3s ease; white-space: nowrap; flex-shrink: 0; }
        .nianxin-followup-btn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(242, 209, 107, 0.3); }
        .nianxin-followup-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
        @keyframes nianxinTyping { from { opacity: 0.5; } to { opacity: 1; } }
        .nianxin-typing-cursor { display: inline-block; width: 2px; height: 1em; background: #f2d16b; margin-left: 2px; animation: nianxinTyping 0.5s infinite alternate; vertical-align: text-bottom; }

        /* 念心入口按钮 */
        .nianxin-enter-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; background: linear-gradient(145deg, rgba(232, 200, 107, 0.12) 0%, rgba(180, 150, 60, 0.08) 100%); border: 1px solid rgba(232, 200, 107, 0.22); border-radius: 18px; padding: 20px 22px; margin: 24px 0; cursor: pointer; transition: all var(--duration-normal) var(--ease-spring); animation: btnGlow 4s ease-in-out infinite; backdrop-filter: blur(4px); }
        @keyframes btnGlow { 0%, 100% { box-shadow: 0 4px 20px rgba(232, 200, 107, 0.1); border-color: rgba(232, 200, 107, 0.22); } 50% { box-shadow: 0 6px 35px rgba(232, 200, 107, 0.22); border-color: rgba(232, 200, 107, 0.35); } }
        .nianxin-enter-btn:hover { background: linear-gradient(145deg, rgba(232, 200, 107, 0.22) 0%, rgba(180, 150, 60, 0.16) 100%); transform: translateY(-4px) scale(1.01); box-shadow: 0 15px 45px rgba(232, 200, 107, 0.25); }
        .nianxin-enter-btn:active { transform: translateY(-1px) scale(0.98); transition-duration: 0.1s; }
        .nianxin-enter-icon { font-size: 1.4rem; opacity: 0.9; }
        .nianxin-enter-text { color: var(--gold); font-size: 0.98rem; flex: 1; text-align: left; margin-left: 14px; letter-spacing: 0.5px; }
        .nianxin-enter-arrow { color: var(--gold); font-size: 1.1rem; opacity: 0.6; }

        /* ========== 微信风格聊天面板 ========== */
        .chat-panel {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            /* 关键：用 100dvh 而不是 100%，保证在 iOS Safari / Android Chrome 地址栏收放时
               聊天面板始终贴到真正的可视底部，不再出现输入栏下方的「空隙」 */
            height: 100vh;      /* fallback */
            height: 100dvh;
            background: #0a0a0f;
            z-index: 400;
            display: none;
            flex-direction: column;
        }
        .chat-panel.visible { display: flex; animation: chatSlideIn 0.3s ease-out; }
        @keyframes chatSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

        /* 顶部导航栏 - 简洁风格 */
        .chat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            padding-top: calc(12px + env(safe-area-inset-top));
            background: #0f0f15;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }
        .chat-back-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            background: none;
            border: none;
            color: var(--gold);
            cursor: pointer;
            border-radius: 50%;
            transition: background 0.2s;
        }
        .chat-back-btn:active { background: rgba(255, 255, 255, 0.08); }
        .chat-title { flex: 1; text-align: center; }
        .chat-name {
            color: var(--text-primary);
            font-size: 1.05rem;
            font-weight: 500;
            letter-spacing: 1px;
        }
        .chat-header-more {
            width: 36px;
            display: flex;
            justify-content: center;
        }
        .chat-status-dot {
            width: 8px;
            height: 8px;
            background: #4ade80;
            border-radius: 50%;
            box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
        }

        /* 消息列表区域 */
        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            background:
                /* 深色墨纱，保证字清晰 */
                linear-gradient(180deg, rgba(10,10,15,0.82) 0%, rgba(13,13,20,0.88) 100%),
                /* 淡山水，与算卦页呼应 —— 用 WebP (14KB) 替代 JPG (304KB) */
                image-set(url('assets/stitch/ink-mountain-dark.webp') type('image/webp') 1x, url('assets/stitch/ink-mountain-dark.jpg') type('image/jpeg') 1x) center/cover no-repeat;
            background-attachment: local, local;
            -webkit-overflow-scrolling: touch;
            position: relative;
        }
        .chat-messages::before {
            content: '';
            position: fixed;
            inset: 0;
            pointer-events: none;
            background:
                radial-gradient(ellipse at 20% 0%, rgba(232,200,107,0.045), transparent 60%),
                radial-gradient(ellipse at 80% 100%, rgba(232,200,107,0.035), transparent 55%);
            z-index: 0;
        }
        .chat-messages > * { position: relative; z-index: 1; }

        /* 消息气泡 - 微信风格 */
        .chat-message {
            display: flex;
            gap: 10px;
            max-width: 80%;
            animation: msgFadeIn 0.25s ease-out;
        }
        @keyframes msgFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        .chat-message.user { align-self: flex-end; flex-direction: row-reverse; }

        /* 头像 */
        .chat-message-avatar {
            width: 40px;
            height: 40px;
            border-radius: 6px;
            background: linear-gradient(135deg, rgba(232, 200, 107, 0.2), rgba(180, 150, 60, 0.15));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            flex-shrink: 0;
        }
        img.chat-message-avatar { object-fit: cover; }
        .chat-message-avatar--ai,
        .chat-message-avatar--me-img {
            padding: 0;
            overflow: hidden;
            background: #1a1510;
            border: 1px solid rgba(232, 200, 107, 0.35);
            border-radius: 50%;
        }
        .chat-message-avatar--ai > img,
        .chat-message-avatar--me-img > img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .chat-message.user .chat-message-avatar,
        .chat-message-avatar--me {
            background: linear-gradient(135deg, #3a3a45, #2a2a35);
        }
        .chat-message-avatar--me-img {
            background: transparent;
            border-color: rgba(160, 160, 180, 0.35);
        }

        /* 气泡内容 - 带小尾巴 */
        .chat-message-content {
            position: relative;
            background: #1a1a22;
            border-radius: 4px 18px 18px 18px;
            padding: 12px 16px;
            color: var(--text-primary);
            font-size: 0.95rem;
            line-height: 1.7;
            max-width: 100%;
            word-wrap: break-word;
        }
        .chat-message-content::before {
            content: '';
            position: absolute;
            left: -6px;
            top: 0;
            border: 6px solid transparent;
            border-right-color: #1a1a22;
            border-top-color: #1a1a22;
        }
        .chat-message.user .chat-message-content {
            background: linear-gradient(135deg, rgba(232, 200, 107, 0.9), rgba(200, 170, 80, 0.9));
            border-radius: 18px 4px 18px 18px;
            color: #1a1a20;
        }
        .chat-message.user .chat-message-content::before {
            left: auto;
            right: -6px;
            border-left-color: rgba(232, 200, 107, 0.9);
            border-right-color: transparent;
            border-top-color: rgba(232, 200, 107, 0.9);
        }

        /* 加载动画 */
        .chat-message-loading {
            display: flex;
            gap: 5px;
            padding: 12px 16px;
        }
        .chat-message-loading span {
            width: 6px;
            height: 6px;
            background: var(--gold);
            border-radius: 50%;
            animation: typingDot 1.2s infinite;
        }
        .chat-message-loading span:nth-child(2) { animation-delay: 0.15s; }
        .chat-message-loading span:nth-child(3) { animation-delay: 0.3s; }
        @keyframes typingDot {
            0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
            30% { transform: translateY(-6px); opacity: 1; }
        }

        /* 底部输入区域 */
        .chat-input-area {
            /* 粘在 flex 容器底部；padding-bottom 吃掉 safe-area，但不再有多余的 margin
               之前用户看到「发送栏上方和底部都有一点空白」就是 margin 遗留 */
            flex-shrink: 0;
            margin: 0;
            padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) 12px;
            background: #0f0f15;
            border-top: 1px solid rgba(255, 255, 255, 0.04);
        }
        .chat-input-wrapper {
            display: flex;
            gap: 10px;
            align-items: center;
            background: #1a1a22;
            border-radius: 22px;
            padding: 4px 4px 4px 16px;
        }
        .chat-input {
            flex: 1;
            min-width: 0;
            background: transparent;
            border: none;
            padding: 10px 0;
            color: var(--text-primary);
            font-size: 16px;
            outline: none;
        }
        .chat-input::placeholder { color: #5a5a6a; }
        .chat-send-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, var(--gold), var(--gold-dim));
            border: none;
            border-radius: 50%;
            color: #1a1a20;
            cursor: pointer;
            transition: transform 0.15s, opacity 0.15s;
            flex-shrink: 0;
        }
        .chat-send-btn:active { transform: scale(0.92); }
        .chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

        .close-btn { position: fixed; top: 15px; right: 15px; width: 42px; height: 42px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-full); color: var(--gold); font-size: 1.3rem; cursor: pointer; z-index: 101; transition: all 0.25s ease; backdrop-filter: blur(4px); }
        .close-btn:hover { background: rgba(255,255,255,0.1); }
        .close-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.15); }
        .ssr-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; opacity: 0; }
        .ssr-overlay.active { animation: ssrFlash 2s ease-out; }
        @keyframes ssrFlash { 0% { opacity: 1; background: radial-gradient(circle at center, rgba(255,200,100,0.8), transparent 70%); } 20% { opacity: 0.8; background: radial-gradient(circle at center, rgba(255,100,50,0.6), transparent 80%); } 100% { opacity: 0; } }
        .shake { animation: shake 0.5s ease-out; }
        @keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); } 20%, 40%, 60%, 80% { transform: translateX(5px); } }
        .retention-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: linear-gradient(180deg, #1a1a25 0%, #12121a 100%); border: 1px solid rgba(242, 209, 107, 0.3); border-radius: 20px; padding: clamp(22px, 7vw, 35px) clamp(16px, 5vw, 25px); text-align: center; z-index: 200; display: none; max-width: min(300px, 88vw); width: 90%; }
        .retention-modal.visible { display: block; animation: modalPop 0.45s var(--ease-out-back); }
        @keyframes modalPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85) translateY(20px); } 60% { transform: translate(-50%, -50%) scale(1.02) translateY(-5px); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1) translateY(0); } }
        .retention-title { font-size: 1.2rem; color: #f2d16b; margin-bottom: 18px; }
        .retention-message { font-size: 0.95rem; color: #c9b896; line-height: 1.8; margin-bottom: 20px; }
        .retention-time { font-size: 0.85rem; color: #6b5d4d; margin-bottom: 18px; }
        .retention-divider { width: 60%; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 200, 107, 0.3), transparent); margin: 20px auto; }
        .retention-vip-hint { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 15px; line-height: 1.5; }
        .retention-vip-btn { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 1.5vw, 8px); width: 100%; background: linear-gradient(135deg, rgba(232, 200, 107, 0.15), rgba(180, 150, 60, 0.1)); border: 1px solid rgba(232, 200, 107, 0.4); color: var(--gold); padding: clamp(10px, 3vw, 14px) clamp(16px, 5vw, 24px); border-radius: 25px; font-size: var(--fs-md); font-weight: 500; cursor: pointer; margin-bottom: 12px; transition: all 0.3s ease; }
        .retention-vip-btn:hover { background: linear-gradient(135deg, rgba(232, 200, 107, 0.25), rgba(180, 150, 60, 0.2)); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(232, 200, 107, 0.2); }
        .retention-vip-btn .vip-icon { font-size: 1.2rem; }
        .retention-btn { background: transparent; border: 1px solid rgba(232, 200, 107, 0.25); color: var(--text-muted); padding: 10px 25px; border-radius: 25px; font-size: 0.88rem; cursor: pointer; transition: all 0.2s ease; }
        .retention-btn:hover { border-color: rgba(232, 200, 107, 0.4); color: var(--text-secondary); }
        .retention-btn-secondary { width: 100%; }
        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0); z-index: 199; display: none; transition: background var(--duration-normal) ease; }
        .modal-overlay.visible { display: block; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); animation: overlayFadeIn var(--duration-normal) ease; }
        @keyframes overlayFadeIn { from { background: rgba(0,0,0,0); backdrop-filter: blur(0); } to { background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); } }
        .progress-dots { display: flex; gap: 10px; margin-top: 18px; }
        .progress-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(242, 209, 107, 0.2); transition: all var(--duration-normal) var(--ease-spring); position: relative; }
        .progress-dot.completed { background: var(--gold); transform: scale(1); animation: dotComplete 0.5s var(--ease-out-back); }
        .progress-dot.current { background: var(--gold); box-shadow: 0 0 12px rgba(232, 200, 107, 0.6), 0 0 24px rgba(232, 200, 107, 0.3); animation: dotPulse 1.5s ease-in-out infinite; }
        .progress-dot.locked { background: rgba(100, 80, 60, 0.25); }
        @keyframes dotPulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(232, 200, 107, 0.6); } 50% { transform: scale(1.4); box-shadow: 0 0 20px rgba(232, 200, 107, 0.8); } }
        @keyframes dotComplete { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.5); } 100% { transform: scale(1); opacity: 1; } }
        /* 重新开始按钮 - 顶栏内 */
        .restart-btn-new { }
        .restart-btn-new:hover { transform: rotate(-180deg) scale(1.1); }
        .restart-btn-new:active { transform: rotate(-180deg) scale(0.95); }
        .vip-toggle { position: fixed; top: 15px; right: 15px; display: flex; align-items: center; gap: clamp(4px, 1.5vw, 8px); background: rgba(255,255,255,0.04); border: 1px solid rgba(232, 200, 107, 0.25); padding: clamp(6px, 2vw, 9px) clamp(10px, 3vw, 16px); border-radius: 22px; cursor: pointer; z-index: 10; transition: all var(--duration-normal) var(--ease-spring); backdrop-filter: blur(4px); }
        .vip-toggle:hover { background: rgba(232, 200, 107, 0.1); border-color: rgba(232, 200, 107, 0.4); transform: scale(1.03); }
        .vip-toggle:active { transform: scale(0.97); }
        .vip-toggle.active { background: linear-gradient(135deg, rgba(232, 200, 107, 0.25), rgba(180, 150, 60, 0.18)); box-shadow: 0 0 25px rgba(232, 200, 107, 0.3); animation: vipGlow 2s ease-in-out infinite; }
        @keyframes vipGlow { 0%, 100% { box-shadow: 0 0 20px rgba(232, 200, 107, 0.25); } 50% { box-shadow: 0 0 35px rgba(232, 200, 107, 0.4); } }
        .vip-icon { font-size: 1rem; }
        .vip-label { font-size: 0.75rem; color: #ffd700; letter-spacing: 1px; }
        .vip-status { font-size: 0.65rem; color: #b8860b; margin-left: 4px; }
        .vip-badge { position: absolute; top: -5px; right: -5px; background: #ff4757; color: white; font-size: 0.5rem; padding: 2px 5px; border-radius: 8px; }
        /* ========== 沉浸式引导提示系统 (修复transform冲突) ========== */
        /* 使用flexbox居中代替transform，避免动画冲突 */
        .gesture-hint {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            opacity: 0;
            z-index: 5;
        }
        .gesture-hint.visible { animation: hintFadeInOut 2.5s ease-in-out infinite; }
        @keyframes hintFadeInOut { 0%, 100% { opacity: 0; } 20%, 80% { opacity: 0.9; } }

        /* 首次引导提示容器 - flexbox居中 */
        .first-time-hint {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            z-index: 10;
        }
        .first-time-hint.hidden { display: none; }

        /* 点击聚策提示 */
        .hint-tap {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        .hint-tap-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 80px;
            height: 80px;
            margin-bottom: 15px;
            background: radial-gradient(circle, rgba(232, 200, 107, 0.15) 0%, transparent 70%);
            border-radius: 50%;
            box-shadow: 0 0 30px rgba(232, 200, 107, 0.3);
            animation: tapIconPulse 2s ease-in-out infinite;
        }
        .hint-tap-icon svg {
            width: 44px;
            height: 44px;
            stroke: var(--gold);
            stroke-width: 1.5;
            fill: none;
        }
        .hint-tap-text {
            font-size: 1rem;
            color: var(--gold);
            letter-spacing: 3px;
            background: rgba(15, 12, 20, 0.9);
            border: 1px solid rgba(232, 200, 107, 0.3);
            padding: 12px 24px;
            border-radius: 25px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
            white-space: nowrap;
        }
        @keyframes tapIconPulse {
            0%, 100% { opacity: 0.85; box-shadow: 0 0 30px rgba(232, 200, 107, 0.3); }
            50% { opacity: 1; box-shadow: 0 0 50px rgba(232, 200, 107, 0.5); }
        }

        /* 向上滑动分策提示 */
        .hint-swipe {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        .hint-swipe-arrow {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 12px;
            animation: swipeArrowFloat 1.8s ease-in-out infinite;
        }
        .hint-swipe-icon {
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: radial-gradient(circle, rgba(232, 200, 107, 0.2) 0%, transparent 70%);
            border-radius: 50%;
            box-shadow: 0 0 20px rgba(232, 200, 107, 0.3);
        }
        .hint-swipe-icon svg {
            width: 32px;
            height: 32px;
            stroke: var(--gold);
            stroke-width: 2.5;
            fill: none;
        }
        /* 使用margin-top动画代替transform，避免冲突 */
        @keyframes swipeArrowFloat {
            0%, 100% { margin-top: 20px; opacity: 0.5; }
            50% { margin-top: -10px; opacity: 1; }
        }

        /* 非首次的滑动提示 */
        .gesture-arrow {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }
        .gesture-arrow-icon {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .gesture-arrow-icon svg {
            width: 100%;
            height: 100%;
            stroke: var(--gold);
            stroke-width: 2;
            fill: none;
            animation: arrowBounce 1.5s ease-in-out infinite;
        }
        @keyframes arrowBounce {
            0%, 100% { opacity: 0.6; }
            50% { opacity: 1; }
        }
        .gesture-text {
            font-size: 0.8rem;
            color: var(--gold);
            letter-spacing: 2px;
            white-space: nowrap;
            opacity: 0.9;
            animation: textPulse 1.5s ease-in-out infinite;
        }
        @keyframes textPulse {
            0%, 100% { opacity: 0.7; }
            50% { opacity: 1; }
        }

        /* 分策线 */
        .split-line { position: absolute; left: 8%; right: 8%; height: 2px; background: linear-gradient(90deg, transparent 0%, rgba(232, 200, 107, 0.7) 30%, rgba(232, 200, 107, 0.7) 70%, transparent 100%); pointer-events: none; opacity: 0; transition: opacity 0.3s ease; box-shadow: 0 0 15px rgba(232, 200, 107, 0.4); }
        .split-line.visible { opacity: 1; }

        /* ========== 顶栏按钮组 ========== */
        .top-bar-left { position: fixed; top: 15px; left: 15px; display: flex; gap: 10px; z-index: 10; }

        /* 任何全屏 panel（念心聊天、卦象解读、关于一念、历史）打开时，
           隐藏所有主屏顶层悬浮按钮，避免与 panel 自己的 header 按钮视觉重叠。
           这些按钮在 panel 关闭时会自动恢复。
           用三层属性兜底（display + visibility + opacity），防止用户拖过 BGM 之后
           inline style 或特异性高的规则把 display:none 吃掉。 */
        body.yj-overlay-open .top-bar-left,
        body.yj-overlay-open .vip-toggle,
        body.yj-overlay-open .yn-bgm-btn,
        body.yj-overlay-open .yj-theme-toggle {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }

        /* v6 性能优化：任何 overlay 打开时，暂停主屏的持续动画（烟雾、粒子、太极呼吸）
           —— 这些只是装饰，overlay 覆盖它们后没人看，但 GPU 仍在跑。暂停节省电量 + 减少发热。 */
        body.yj-overlay-open .smoke-container,
        body.yj-overlay-open .particle-container {
            display: none !important;
        }
        body.yj-overlay-open .yarrow-stage::before {
            animation-play-state: paused !important;
        }
        .top-bar-btn { width: 36px; height: 36px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(232, 200, 107, 0.2); border-radius: 50%; color: var(--gold); font-size: 0.9rem; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
        .top-bar-btn:hover { background: rgba(232, 200, 107, 0.12); transform: scale(1.08); border-color: rgba(232, 200, 107, 0.35); }
        .top-bar-btn:active { transform: scale(0.95); }
        .top-bar-btn svg { width: 18px; height: 18px; stroke: var(--gold); fill: none; stroke-width: 1.8; }
        /* Info Button */
        .info-btn { font-style: italic; font-family: Georgia, serif; font-size: 0.95rem; }

        /* Info Panel */
        .info-panel { position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100dvh; background: rgba(10, 10, 15, 0.98); z-index: 300; display: none; flex-direction: column; overflow-y: auto; padding: calc(60px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom)); }
        .info-panel.visible { display: flex; animation: slideUp 0.4s ease; }
        @keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .info-close { position: fixed; top: 15px; right: 15px; width: 36px; height: 36px; background: rgba(255,255,255,0.1); border: none; border-radius: 50%; color: #f2d16b; font-size: 1.3rem; cursor: pointer; z-index: 301; }
        .info-title { font-size: 1.5rem; color: #f2d16b; text-align: center; margin-bottom: 25px; letter-spacing: 4px; }
        .info-tagline { text-align: center; font-size: 1rem; color: #c9b896; margin-bottom: 30px; line-height: 1.8; }
        .info-section { background: rgba(40, 35, 30, 0.5); border-radius: 12px; padding: 18px; margin-bottom: 15px; }
        .info-section-title { font-size: 1rem; color: #f2d16b; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
        .info-section-content { font-size: 0.9rem; color: #c9b896; line-height: 1.9; }
        .info-section-content p { margin-bottom: 12px; }
        .info-section-content p:last-child { margin-bottom: 0; }
        .prob-table { width: 100%; border-collapse: collapse; margin: 15px 0; }
        .prob-table th, .prob-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid rgba(242, 209, 107, 0.2); }
        .prob-table th { color: #f2d16b; font-weight: normal; }
        .prob-table td { color: #c9b896; }
        .prob-table tr:last-child td { border-bottom: none; }
        .highlight { color: #ff6b35; }
        .gold { color: #f2d16b; }

        /* Onboarding */
        .onboard-overlay { position: fixed; inset: 0; background: rgba(5,5,8,0.92); backdrop-filter: blur(8px); z-index: 250; display: none; align-items: flex-start; justify-content: center; padding: calc(env(safe-area-inset-top, 0px) + clamp(16px, 5vh, 40px)) clamp(12px, 4vw, 20px) calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 4vh, 32px)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
        .onboard-overlay.visible { display: flex; animation: overlayFadeIn 0.4s ease; }
        .onboard-card { background: linear-gradient(180deg, rgba(28,28,40,0.98) 0%, rgba(18,18,26,0.98) 100%); border: 1px solid rgba(232, 200, 107, 0.2); border-radius: 28px; padding: 36px 28px; text-align: center; max-width: 350px; width: 92%; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - clamp(32px, 10vh, 80px)); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 25px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05); animation: cardSlideUp 0.5s var(--ease-out-back) 0.1s both; margin: auto 0; }
        @keyframes cardSlideUp { 0% { opacity: 0; transform: translateY(40px) scale(0.95); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
        .onboard-title { font-size: 1.4rem; color: var(--gold); margin-bottom: 10px; font-weight: 500; letter-spacing: 3px; }
        .onboard-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 28px; font-weight: 300; letter-spacing: 1px; }
        .onboard-steps { text-align: left; margin: 20px 0; }
        .onboard-step { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; padding: 12px; background: rgba(242, 209, 107, 0.05); border-radius: 12px; transition: all var(--duration-normal) var(--ease-spring); animation: stepFadeIn 0.4s var(--ease-out-expo) both; }
        .onboard-step:nth-child(1) { animation-delay: 0.2s; }
        .onboard-step:nth-child(2) { animation-delay: 0.3s; }
        .onboard-step:nth-child(3) { animation-delay: 0.4s; }
        .onboard-step:nth-child(4) { animation-delay: 0.5s; }
        @keyframes stepFadeIn { 0% { opacity: 0; transform: translateX(-15px); } 100% { opacity: 1; transform: translateX(0); } }
        .onboard-step:hover { background: rgba(242, 209, 107, 0.1); transform: translateX(4px); }
        .onboard-step-num { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(255,255,255,0.05); border-radius: 10px; }
        .onboard-step-num svg { width: 22px; height: 22px; stroke: rgba(255,255,255,0.85); }
        .onboard-step-content { display: flex; flex-direction: column; gap: 4px; }
        .onboard-step-content strong { color: #f2d16b; font-size: 0.95rem; }
        .onboard-step-desc { color: #8b7355; font-size: 0.8rem; line-height: 1.4; }
        .onboard-btn { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%); border: none; color: #1a1a20; padding: clamp(12px, 3.5vw, 15px) clamp(20px, 7vw, 32px); border-radius: 28px; font-size: var(--fs-md); font-weight: 600; cursor: pointer; margin-top: 20px; width: 100%; box-shadow: 0 6px 24px rgba(232, 200, 107, 0.25), inset 0 1px 0 rgba(255,255,255,0.2); transition: all 0.3s ease; letter-spacing: 1px; }
        .onboard-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(232, 200, 107, 0.35); }

        /* Counting animation */
        .count-display { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); font-size: 0.85rem; color: rgba(242, 209, 107, 0.95); opacity: 0; transition: opacity 0.3s ease; z-index: 20; background: rgba(10, 10, 15, 0.85); padding: 8px 18px; border-radius: 20px; border: 1px solid rgba(232, 200, 107, 0.25); backdrop-filter: blur(6px); text-shadow: 0 0 10px rgba(232, 200, 107, 0.5); }
        .count-display.visible { opacity: 1; animation: countPulse 0.3s ease-out; }
        @keyframes countPulse { 0% { transform: translateX(-50%) scale(0.9); } 50% { transform: translateX(-50%) scale(1.05); } 100% { transform: translateX(-50%) scale(1); } }

        /* Minimal Zen Dot */
        .zen-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(242, 209, 107, 0.4); margin: 0 auto 25px; }

        /* Question Input Modal */
        /*
         * Question overlay sizing rules — the earlier max-height: 90vh +
         * align-items: center combo caused the top of the card (including
         * the "一念起卦" / "你想问什么" title) to be clipped behind the
         * mobile browser chrome and notch, because on iOS/Android `vh`
         * is the *layout* viewport, not the visible area. Using 100dvh
         * (dynamic viewport height) and flex-start alignment keeps the
         * title anchored below the safe-area inset.
         */
        .question-overlay { position: fixed; inset: 0; background: rgba(5,5,10,0.94); backdrop-filter: blur(8px); z-index: 260; display: none; align-items: flex-start; justify-content: center; padding: calc(env(safe-area-inset-top, 0px) + clamp(16px, 5vh, 40px)) clamp(12px, 4vw, 20px) calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 4vh, 32px)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
        .question-overlay.visible { display: flex; animation: fadeIn 0.5s ease; }
        .question-card { background: linear-gradient(180deg, rgba(28,28,38,0.97) 0%, rgba(15,15,22,0.98) 100%); border: 1px solid rgba(232, 200, 107, 0.18); border-radius: clamp(18px, 6vw, 28px); padding: clamp(18px, 6vw, 28px) clamp(16px, 5vw, 22px); text-align: center; max-width: min(360px, 92vw); width: 100%; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - clamp(32px, 10vh, 80px)); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 25px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04); margin: auto 0; }
        .question-title { font-size: clamp(1.05rem, 0.9rem + 0.9vw, 1.25rem); color: var(--gold); margin-bottom: 8px; letter-spacing: clamp(2px, 1.2vw, 5px); font-weight: 400; white-space: nowrap; }
        .question-subtitle { font-size: var(--fs-sm); color: #8b7355; margin-bottom: clamp(12px, 4vw, 20px); line-height: 1.6; }
        .question-input { width: 100%; background: rgba(242, 209, 107, 0.05); border: 1px solid rgba(242, 209, 107, 0.25); border-radius: 14px; padding: clamp(10px, 3vw, 14px); color: #f2d16b; font-size: 16px; font-family: inherit; resize: none; min-height: 70px; margin-bottom: 4px; }
        .question-input::placeholder { color: rgba(242, 209, 107, 0.35); }
        .question-input:focus { outline: none; border-color: rgba(242, 209, 107, 0.5); background: rgba(242, 209, 107, 0.08); }
        .question-counter { font-size: 0.72rem; color: rgba(242, 209, 107, 0.45); text-align: right; letter-spacing: 0.05em; margin-bottom: clamp(10px, 3vw, 14px); font-variant-numeric: tabular-nums; transition: color 0.2s ease; }
        .question-counter.is-warning { color: rgba(232, 140, 80, 0.8); }
        .question-counter.is-limit   { color: rgba(232, 80, 80, 0.9); }
        /* 问题按钮区 */
        .question-btns { display: flex; flex-direction: column; gap: clamp(8px, 2vw, 10px); }
        .question-btn { padding: clamp(11px, 3vw, 14px) clamp(16px, 5vw, 24px); border-radius: 14px; font-size: var(--fs-md); cursor: pointer; transition: all var(--duration-normal) var(--ease-spring); letter-spacing: 0.5px; width: 100%; white-space: nowrap; }
        .question-btn-primary { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%); border: none; color: #1a1a20; font-weight: 600; box-shadow: 0 6px 20px rgba(232, 200, 107, 0.25), inset 0 1px 0 rgba(255,255,255,0.2); }
        .question-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(232, 200, 107, 0.35); }
        .question-btn-skip { background: transparent; border: 1px dashed rgba(232, 200, 107, 0.3); color: var(--text-muted); font-size: var(--fs-sm); }
        .question-btn-skip:hover { border-color: rgba(232, 200, 107, 0.5); color: var(--gold); background: rgba(232, 200, 107, 0.05); }
        .question-tip { margin-top: clamp(12px, 4vw, 18px); font-size: var(--fs-xs); color: var(--text-muted); letter-spacing: 1px; opacity: 0.7; }


        /* Answer section in interpretation */
        .answer-section { background: linear-gradient(135deg, rgba(242, 209, 107, 0.15), rgba(255, 107, 53, 0.1)); border: 1px solid rgba(242, 209, 107, 0.4); border-radius: 15px; padding: 16px 20px 18px; margin-bottom: 20px; text-align: center; }
        .answer-question { font-size: 0.88rem; color: #c9b896; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(242, 209, 107, 0.2); line-height: 1.5; }
        .answer-direction { font-size: 1.4rem; color: #f2d16b; margin-bottom: 6px; font-weight: 500; }
        .answer-direction.positive { color: #4ade80; }
        .answer-direction.negative { color: #f87171; }
        .answer-direction.neutral { color: #fbbf24; }
        .answer-explanation { font-size: 0.88rem; color: #c9b896; line-height: 1.6; margin-top: 2px; }

        /* ===== 全面移动端优化 v2.0 ===== */

        /* 基础移动端优化 */
        html {
            /* 防止iOS滚动回弹导致的布局问题 */
            overflow: hidden;
            height: 100%;
        }
        body {
            height: 100%;
            overflow-y: auto;
            overflow-x: hidden;
            /* 优化文字渲染 */
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }

        /* iOS 安全区域适配 - 增强版 */
        @supports (padding-top: env(safe-area-inset-top)) {
            body {
                padding-top: env(safe-area-inset-top);
                padding-bottom: env(safe-area-inset-bottom);
                padding-left: env(safe-area-inset-left);
                padding-right: env(safe-area-inset-right);
            }
            .app-container {
                padding-top: calc(20px + env(safe-area-inset-top));
                padding-bottom: calc(100px + env(safe-area-inset-bottom));
                min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
                min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
            }
            .divination-progress { bottom: calc(25px + env(safe-area-inset-bottom)); }
            .top-bar-left { top: calc(15px + env(safe-area-inset-top)); }
            .vip-toggle { top: calc(15px + env(safe-area-inset-top)); }
            .investor-welcome { padding-top: env(safe-area-inset-top); }
            /* .question-overlay handles safe-area via its own padding
               shorthand above — no override needed here. */
            .onboard-overlay { padding-top: calc(env(safe-area-inset-top) + clamp(16px, 5vh, 40px)); padding-bottom: calc(env(safe-area-inset-bottom) + clamp(16px, 4vh, 32px)); align-items: flex-start; }
        }

        /* ========== 流式响应布局（替代逐设备适配） ========== */
        /* 所有尺寸通过 clamp() 在 CSS 变量和关键属性中自动插值 */
        /* 以下仅保留必要的结构性断点 */

        /* 安全区域适配（刘海屏/挖孔屏/药丸屏通用） */
        .top-bar-left { left: max(15px, env(safe-area-inset-left, 15px)); }
        .vip-toggle { right: max(15px, env(safe-area-inset-right, 15px)); }

        /* 极短屏幕（iPhone SE 等 < 670px 高度） */
        @media screen and (max-height: 670px) {
            .question-display { margin-top: 4px; min-height: 22px; }
            .progress-dots { margin-top: 8px; }
            .progress-dot { width: 6px; height: 6px; }
            .top-bar-left { gap: 6px; }
            .top-bar-btn { width: 32px; height: 32px; }
        }

        /* 大屏/平板（>= 768px 宽度） */
        @media screen and (min-width: 768px) {
            .app-container { max-width: 500px; margin: 0 auto; }
            .yarrow-stage { max-width: 450px; height: 320px; }
        }

        /* 横屏模式 */
        @media screen and (orientation: landscape) and (max-height: 500px) {
            .app-container {
                flex-direction: row;
                flex-wrap: wrap;
                justify-content: center;
                padding: 10px 20px;
                padding-left: max(20px, env(safe-area-inset-left));
                padding-right: max(20px, env(safe-area-inset-right));
            }
            .title { width: 100%; text-align: center; }
            .question-display { display: none; }
            .yarrow-stage { height: 200px; width: 45%; margin: 10px; }
            .hexagram-display { width: 45%; flex-direction: column-reverse; margin: 10px; }
            .status-text { width: 100%; }
            .progress-dots { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); }
            .top-bar-left { top: 8px; left: max(8px, env(safe-area-inset-left)); }
            .vip-toggle { top: 8px; right: max(8px, env(safe-area-inset-right)); }
        }

        /* 聊天面板 - 流式适配 */
        .chat-message { max-width: clamp(78%, 75% + 2vw, 85%); }
        .chat-message-avatar { width: clamp(32px, 8vw, 40px); height: clamp(32px, 8vw, 40px); }
        .chat-message-content { padding: clamp(8px, 2.5vw, 12px) clamp(12px, 3.5vw, 16px); font-size: var(--fs-md); }

        /* ========== 安卓浏览器兼容性修复 ========== */

        /* 安卓Chrome/WebView fixed定位优化 */
        @supports (-webkit-touch-callout: none) or (not (-webkit-touch-callout: none)) {
            .divination-progress,
            .top-bar-left,
            .vip-toggle,
            .watermark {
                /* 强制GPU层以避免安卓上的渲染问题 */
                -webkit-backface-visibility: hidden;
                backface-visibility: hidden;
            }
        }

        /* 安卓字体渲染优化 */
        @supports not (-webkit-touch-callout: none) {
            body {
                /* 安卓特定字体回退 - 优先思源宋体 */
                font-family: 'LXGW WenKai', 'Noto Serif SC', 'Source Han Serif CN', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
            }
            .title, .question-display-text {
                /* 防止安卓文字溢出 */
                word-break: keep-all;
                overflow-wrap: break-word;
            }
        }

        /* 分享按钮 - 现在在顶栏组内 */

        /* 历史记录按钮样式 */
        .history-btn svg { stroke-width: 1.6; }

        /* 分享提示 */
        .share-toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: rgba(242, 209, 107, 0.9); color: #1a1a25; padding: 12px 24px; border-radius: 25px; font-size: 0.9rem; z-index: 500; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
        .share-toast.visible { opacity: 1; }
        /* 进度提示 */
        .progress-toast { position: fixed; top: 120px; left: 50%; transform: translateX(-50%); background: rgba(20, 18, 25, 0.95); border: 1px solid rgba(232, 200, 107, 0.4); color: var(--gold); padding: 10px 20px; border-radius: 20px; font-size: 0.85rem; z-index: 25; opacity: 0; transition: all 0.4s ease; pointer-events: none; backdrop-filter: blur(8px); }
        .progress-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); animation: toastBounce 0.5s ease; }
        @keyframes toastBounce { 0% { transform: translateX(-50%) translateY(-10px) scale(0.9); } 50% { transform: translateX(-50%) translateY(3px) scale(1.02); } 100% { transform: translateX(-50%) translateY(0) scale(1); } }

        /* ========== 移动端触摸增强 v2.0 ========== */

        /* 蓍草区域触摸反馈 */
        .yarrow-stage {
            transition: transform 0.15s ease, box-shadow 0.2s ease;
            /* 防止触摸时出现意外选择 */
            -webkit-user-select: none;
            user-select: none;
            /* 触摸流畅性 */
            touch-action: manipulation;
        }
        .yarrow-stage:active {
            transform: scale(0.98);
            box-shadow: 0 0 35px rgba(242, 209, 107, 0.2);
        }

        /* 所有按钮触摸态统一 */
        .onboard-btn:active, .question-btn-primary:active, .retention-btn:active,
        .conclusion-cta:active, .save-reading-submit:active, .investor-enter-btn:active,
        .nianxin-enter-btn:active, .chat-send-btn:active, .quick-question:active {
            transform: scale(0.95);
            opacity: 0.9;
            transition-duration: 0.08s;
        }

        /* 顶栏按钮触摸态 */
        .top-bar-btn:active {
            transform: scale(0.88);
            background: rgba(232, 200, 107, 0.2);
        }

        /* 卦象爻线动画 - 移动端优化 */
        .line-slot.active {
            animation: lineAppearClean 0.5s var(--ease-out-back);
        }
        @keyframes lineAppearClean {
            0% { transform: scaleX(0) scaleY(0.5); opacity: 0; }
            60% { transform: scaleX(1.08) scaleY(1.02); }
            100% { transform: scaleX(1) scaleY(1); opacity: 1; }
        }

        /* 移动端触摸目标尺寸 - 符合WCAG标准 */
        @media (hover: none) and (pointer: coarse) {
            /* 基础触摸目标 */
            .top-bar-btn {
                min-width: 44px;
                min-height: 44px;
                padding: 8px;
            }
            .save-choice-btn { min-height: 50px; }
            .save-reading-submit { min-height: 48px; }
            .quick-question { min-height: 52px; }
            .chat-send-btn { min-width: 44px; min-height: 44px; }
            .history-action-btn { min-height: 36px; padding: 8px 14px; }

            /* 滚动优化 */
            .interpretation-panel,
            .chat-messages,
            .history-list,
            .history-content,
            .history-detail-content {
                -webkit-overflow-scrolling: touch;
                overscroll-behavior: contain;
            }

            /* 输入框优化 */
            .question-input,
            .chat-input,
            .save-reading-input {
                font-size: 16px; /* 防止iOS自动缩放 */
            }
        }

        /* 低性能设备优化 */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
            .smoke, .particle, .ambient-particle { display: none !important; }
            .title { animation: none !important; }
            .yarrow-stage::before { animation: none !important; }
        }

        /* 移动端性能优化 */
        @media screen and (max-width: 768px) {
            /* 减少烟雾动画复杂度 */
            .smoke { animation-duration: 30s; }
            /* 精简粒子，避免主线程/GPU 长时间忙碌 */
            .particle-container .particle:nth-child(n+6)   { display: none; }
            .particle-container .ambient-particle:nth-child(n+4) { display: none; }
            /* GPU 加速关键元素 */
            .yarrow-stage,
            .hexagram-display,
            .divination-progress,
            .chat-panel,
            .interpretation-panel {
                will-change: auto;
                contain: layout style;
            }
        }

        /* 超低端移动端（窄屏 + 非 hover）进一步降级：
           backdrop-filter 对旧 Android / 低端 iPhone 是 GPU 杀手，整体关掉。 */
        @media screen and (max-width: 480px) and (hover: none) {
            .smoke-container, .particle-container { display: none !important; }
            /* 只保留 modal / overlay 上的 blur，其余装饰性 blur 全部关掉 */
            .top-bar-btn,
            .vip-toggle,
            .close-btn,
            .nianxin-enter-btn,
            .investor-enter-btn,
            .count-display,
            .progress-toast {
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
            }
        }

        /* 深色模式强制保持 */
        @media (prefers-color-scheme: light) {
            body { background: linear-gradient(180deg, #0a0a0f 0%, #12121a 50%, #0a0a0f 100%); }
        }

        /* 版权水印 - 移动端适配 */
        .watermark {
            position: fixed;
            bottom: 5px;
            left: 10px;
            font-size: 0.6rem;
            color: rgba(242, 209, 107, 0.2);
            pointer-events: none;
            z-index: 1;
            letter-spacing: 1px;
        }
        @supports (padding-bottom: env(safe-area-inset-bottom)) {
            .watermark {
                bottom: calc(5px + env(safe-area-inset-bottom));
                left: calc(10px + env(safe-area-inset-left));
            }
        }

        /* ========== 输入框焦点状态优化 ========== */
        .question-input:focus,
        .chat-input:focus,
        .save-reading-input:focus {
            outline: none;
            border-color: var(--gold);
            box-shadow: 0 0 0 3px rgba(232, 200, 107, 0.15);
        }

        /* ========== 虚拟键盘弹出时的布局适配 ========== */
        @media screen and (max-height: 450px) and (orientation: portrait) {
            .chat-panel .chat-header {
                padding-top: 8px;
                padding-bottom: 8px;
            }
            .chat-input-area {
                padding: 6px 10px;
            }
        }

        /* ========== 历史记录面板 ========== */
        .history-panel { position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100dvh; background: rgba(10, 10, 15, 0.98); z-index: 300; display: none; flex-direction: column; }
        .history-panel.visible { display: flex; animation: slideUp 0.4s ease; }
        .history-header { padding: 15px 20px; padding-top: calc(15px + env(safe-area-inset-top)); background: rgba(18, 16, 25, 0.96); border-bottom: 1px solid rgba(232, 200, 107, 0.12); display: flex; align-items: center; justify-content: space-between; }
        .history-title { font-size: 1.1rem; color: var(--gold); letter-spacing: 2px; }
        .history-header-actions { display: flex; align-items: center; gap: 10px; }
        .history-clear-btn { background: none; border: 1px solid rgba(255, 100, 100, 0.3); color: #ff9999; font-size: 0.72rem; padding: 5px 10px; border-radius: 12px; cursor: pointer; }
        .history-clear-btn:hover { background: rgba(255, 100, 100, 0.15); }
        .history-close { width: 32px; height: 32px; background: rgba(255,255,255,0.08); border: none; border-radius: 50%; color: var(--gold); font-size: 1.1rem; cursor: pointer; }
        .history-content { flex: 1; padding: 15px; overflow-y: auto; }
        .history-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
        .history-empty-icon { font-size: 3rem; margin-bottom: 15px; opacity: 0.3; }
        .history-empty-text { font-size: 0.9rem; line-height: 1.8; }
        .history-item { background: rgba(35, 30, 25, 0.6); border: 1px solid rgba(232, 200, 107, 0.15); border-radius: 14px; padding: 14px; margin-bottom: 12px; transition: all 0.3s ease; }
        .history-item:hover { background: rgba(45, 40, 32, 0.8); border-color: rgba(232, 200, 107, 0.25); }
        .history-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
        .history-item-hexagram { font-size: 1rem; color: var(--gold); }
        .history-item-date { font-size: 0.7rem; color: var(--text-muted); }
        .history-item-question { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .history-item-footer { display: flex; justify-content: space-between; align-items: center; }
        .history-item-meta { font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
        .history-item-meta svg { width: 12px; height: 12px; stroke: var(--text-muted); }
        .history-item-actions { display: flex; gap: 6px; }
        .history-action-btn { background: rgba(232, 200, 107, 0.1); border: 1px solid rgba(232, 200, 107, 0.2); color: var(--gold); font-size: 0.7rem; padding: 4px 10px; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
        .history-action-btn:hover { background: rgba(232, 200, 107, 0.2); }
        .history-action-btn.delete { background: rgba(255, 100, 100, 0.1); border-color: rgba(255, 100, 100, 0.2); color: #ff9999; }
        .history-action-btn.delete:hover { background: rgba(255, 100, 100, 0.2); }
        /* 历史详情面板 */
        .history-detail { position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100dvh; background: rgba(10, 10, 15, 0.98); z-index: 310; display: none; flex-direction: column; }
        .history-detail.visible { display: flex; animation: slideUp 0.3s ease; }
        .history-detail-header { padding: 15px 20px; padding-top: calc(15px + env(safe-area-inset-top)); border-bottom: 1px solid rgba(232, 200, 107, 0.12); display: flex; align-items: center; gap: 15px; }
        .history-detail-back { background: none; border: none; color: var(--gold); font-size: 1.2rem; cursor: pointer; padding: 5px; }
        .history-detail-title { font-size: 1.05rem; color: var(--gold); }
        .history-detail-content { flex: 1; padding: 15px; overflow-y: auto; }
        .history-detail-section { background: rgba(35, 30, 25, 0.6); border-radius: 14px; padding: 14px; margin-bottom: 12px; border: 1px solid rgba(232, 200, 107, 0.1); }
        .history-detail-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 1px; }
        .history-detail-value { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }
        .history-chat-list { max-height: 300px; overflow-y: auto; }
        .history-chat-item { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
        .history-chat-item:last-child { border-bottom: none; }
        .history-chat-role { font-size: 0.72rem; color: var(--gold); margin-bottom: 4px; }
        .history-chat-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
        .history-detail-actions { padding: 15px; padding-bottom: calc(15px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(232, 200, 107, 0.1); }
        .history-continue-btn { width: 100%; background: linear-gradient(135deg, var(--gold), var(--gold-dim)); border: none; color: #1a1a20; padding: 14px; border-radius: 14px; font-size: 0.92rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }

        /* ========== 念心入口增强 ========== */
        .nianxin-enter-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; background: linear-gradient(145deg, rgba(232, 200, 107, 0.18) 0%, rgba(180, 150, 60, 0.12) 100%); border: 1px solid rgba(232, 200, 107, 0.35); border-radius: 20px; padding: 22px 24px; margin: 24px 0; cursor: pointer; transition: all var(--duration-normal) var(--ease-spring); animation: nianxinEntrancePulse 3s ease-in-out infinite; backdrop-filter: blur(4px); position: relative; overflow: hidden; }
        @keyframes nianxinEntrancePulse { 0%, 100% { box-shadow: 0 4px 25px rgba(232, 200, 107, 0.15), inset 0 0 30px rgba(232, 200, 107, 0.05); border-color: rgba(232, 200, 107, 0.35); } 50% { box-shadow: 0 8px 40px rgba(232, 200, 107, 0.3), inset 0 0 50px rgba(232, 200, 107, 0.1); border-color: rgba(232, 200, 107, 0.5); } }
        .nianxin-enter-btn::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent, rgba(232, 200, 107, 0.1), transparent); animation: nianxinShimmer 4s linear infinite; }
        @keyframes nianxinShimmer { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        .nianxin-enter-btn:hover { background: linear-gradient(145deg, rgba(232, 200, 107, 0.28) 0%, rgba(180, 150, 60, 0.2) 100%); transform: translateY(-4px) scale(1.02); box-shadow: 0 15px 50px rgba(232, 200, 107, 0.3); }
        .nianxin-enter-btn:active { transform: translateY(-1px) scale(0.98); transition-duration: 0.1s; }
        .nianxin-enter-icon { font-size: 1.5rem; opacity: 0.95; animation: nianxinIconFloat 2s ease-in-out infinite; }
        @keyframes nianxinIconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
        .nianxin-enter-text { color: var(--gold); font-size: 1rem; flex: 1; text-align: left; margin-left: 14px; letter-spacing: 0.5px; font-weight: 500; }
        .nianxin-enter-arrow { color: var(--gold); font-size: 1.2rem; opacity: 0.7; animation: nianxinArrowBounce 1.5s ease-in-out infinite; }
        @keyframes nianxinArrowBounce { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
        /* 念心入口引导气泡 */
        .nianxin-guide-bubble { position: absolute; top: -45px; left: 50%; transform: translateX(-50%); background: rgba(232, 200, 107, 0.95); color: #1a1a20; padding: 8px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 500; white-space: nowrap; animation: guideBubbleBounce 2s ease-in-out infinite; box-shadow: 0 4px 15px rgba(232, 200, 107, 0.4); }
        .nianxin-guide-bubble::after { content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-top-color: rgba(232, 200, 107, 0.95); }
        @keyframes guideBubbleBounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-5px); } }
        .nianxin-guide-bubble.hidden { display: none; }

        /* ========== 轻量信息收集 - 保存卦象 ========== */
        .save-reading-section {
            margin: 20px 0;
            border-radius: 16px;
            overflow: hidden;
            background: linear-gradient(135deg, rgba(232, 200, 107, 0.08) 0%, rgba(180, 150, 60, 0.04) 100%);
            border: 1px solid rgba(232, 200, 107, 0.15);
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .save-reading-section:hover { border-color: rgba(232, 200, 107, 0.3); }
        .save-reading-collapsed {
            display: flex;
            align-items: center;
            padding: 16px 18px;
            cursor: pointer;
            transition: background 0.3s ease;
        }
        .save-reading-collapsed:hover { background: rgba(232, 200, 107, 0.05); }
        .save-reading-collapsed.hidden { display: none; }
        .save-reading-icon { font-size: 1.2rem; margin-right: 10px; animation: iconFloat 2.5s ease-in-out infinite; }
        @keyframes iconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
        .save-reading-text { flex: 1; font-size: var(--fs-sm); color: var(--text-muted); letter-spacing: 0.5px; word-break: keep-all; }
        .save-reading-arrow { color: var(--gold); font-size: 1.1rem; opacity: 0.6; transition: transform 0.3s ease; }
        .save-reading-collapsed:hover .save-reading-arrow { transform: translateX(3px); opacity: 1; }

        .save-reading-expanded { padding: 20px; animation: expandIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
        .save-reading-expanded.hidden { display: none; }
        @keyframes expandIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
        .save-reading-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
        .save-reading-title { font-size: 1rem; color: var(--gold); letter-spacing: 1px; }
        .save-reading-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 0 5px; transition: color 0.2s; }
        .save-reading-close:hover { color: var(--gold); }

        .save-reading-choice { display: flex; gap: 10px; margin-bottom: 14px; }
        .save-choice-btn {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 12px;
            background: rgba(232, 200, 107, 0.05);
            border: 1px solid rgba(232, 200, 107, 0.2);
            border-radius: 12px;
            color: var(--text-muted);
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .save-choice-btn:hover { background: rgba(232, 200, 107, 0.1); }
        .save-choice-btn.active {
            background: linear-gradient(135deg, rgba(232, 200, 107, 0.2), rgba(180, 150, 60, 0.15));
            border-color: var(--gold);
            color: var(--gold);
            box-shadow: 0 2px 15px rgba(232, 200, 107, 0.2);
        }
        .choice-icon { font-size: 1.1rem; }

        .save-reading-input-wrapper { display: flex; gap: 10px; margin-bottom: 14px; }
        .save-reading-input {
            flex: 1;
            background: rgba(10, 10, 15, 0.6);
            border: 1px solid rgba(232, 200, 107, 0.25);
            border-radius: 12px;
            padding: 12px 16px;
            color: var(--gold);
            font-size: 0.95rem;
            transition: all 0.3s ease;
        }
        .save-reading-input::placeholder { color: rgba(232, 200, 107, 0.35); }
        .save-reading-input:focus { outline: none; border-color: var(--gold); background: rgba(232, 200, 107, 0.08); box-shadow: 0 0 15px rgba(232, 200, 107, 0.15); }
        .save-reading-submit {
            background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
            border: none;
            color: #1a1a20;
            padding: 12px 24px;
            border-radius: 12px;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .save-reading-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(232, 200, 107, 0.35); }
        .save-reading-submit:active { transform: translateY(0) scale(0.98); }

        .save-reading-benefits {
            display: flex;
            flex-wrap: wrap;
            gap: 8px 12px;
            font-size: 0.75rem;
            color: var(--text-muted);
            opacity: 0.8;
        }
        .save-reading-benefits span { display: flex; align-items: center; gap: 4px; }

        .save-reading-success {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 20px;
            animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .save-reading-success.hidden { display: none; }
        @keyframes successPop { 0% { opacity: 0; transform: scale(0.8); } 50% { transform: scale(1.05); } 100% { opacity: 1; transform: scale(1); } }
        .success-icon { font-size: 1.5rem; animation: successBounce 0.6s ease-out; }
        @keyframes successBounce { 0% { transform: scale(0); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
        .success-text { color: #4ade80; font-size: 0.95rem; letter-spacing: 0.5px; }

        /* 解卦页面底部固定念心入口 */
        .interp-nianxin-fixed { position: sticky; bottom: 0; left: 0; right: 0; padding: 15px 20px; padding-bottom: calc(15px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(10, 10, 15, 1) 0%, rgba(10, 10, 15, 0.95) 80%, transparent 100%); margin-top: 20px; }

        /* 投资人专属欢迎页 */
        /* v6.8.1：欢迎页对小空白的修复 ——
           原 justify-content:center + 30px+safe-area top padding 在某些手机上
           整体被推得偏下，视觉上"顶上一截空白"。
           改：justify-content 偏上 + 上下 padding 收紧，视觉更紧凑、品牌 logo 更靠近顶端 */
        .investor-welcome { position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100dvh; background: radial-gradient(ellipse at center, #15121a 0%, #0a0a0f 60%, #050508 100%); z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: calc(8vh + env(safe-area-inset-top)) 30px calc(20px + env(safe-area-inset-bottom)); text-align: center; overflow: hidden; }
        .investor-welcome::before { content: ''; position: absolute; top: 50%; left: 50%; width: 150%; height: 150%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgba(242, 209, 107, 0.03) 0%, transparent 50%); pointer-events: none; }
        /* "念"字印章装饰 */
        .investor-welcome::after { content: ''; position: absolute; bottom: 15%; right: 10%; width: 100px; height: 100px; background: url('nian-seal.png') center/contain no-repeat; opacity: 0.06; pointer-events: none; animation: sealFloat 6s ease-in-out infinite; }
        @keyframes sealFloat { 0%, 100% { opacity: 0.05; transform: rotate(-5deg); } 50% { opacity: 0.08; transform: rotate(5deg); } }
        .investor-welcome.hidden { display: none; }
        .welcome-logo-wrapper { position: relative; width: 72%; max-width: 360px; margin-bottom: 30px; }
        .welcome-logo { width: 100%; animation: logoFloat 5s ease-in-out infinite; -webkit-mask-image: radial-gradient(ellipse 85% 80% at center, black 40%, transparent 75%); mask-image: radial-gradient(ellipse 85% 80% at center, black 40%, transparent 75%); }
        @keyframes logoFloat { 0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 25px rgba(242, 209, 107, 0.2)); } 50% { transform: translateY(-6px) scale(1.01); filter: drop-shadow(0 0 45px rgba(242, 209, 107, 0.35)); } }
        .welcome-desc { color: #a99a7a; font-size: var(--fs-md); line-height: 1.9; margin-bottom: clamp(20px, 7vw, 35px); letter-spacing: clamp(1.5px, 0.8vw, 3px); text-shadow: 0 0 30px rgba(0,0,0,0.8); }
        .investor-enter-btn { background: linear-gradient(135deg, rgba(242, 209, 107, 0.12) 0%, rgba(242, 209, 107, 0.03) 100%); border: 1px solid rgba(242, 209, 107, 0.5); color: #f2d16b; padding: clamp(14px, 4vw, 20px) clamp(40px, 15vw, 70px); border-radius: 40px; font-size: clamp(1rem, 0.85rem + 0.9vw, 1.2rem); font-weight: 400; cursor: pointer; transition: all 0.4s ease; letter-spacing: clamp(6px, 2.5vw, 12px); text-indent: clamp(6px, 2.5vw, 12px); backdrop-filter: blur(10px); white-space: nowrap; max-width: 90vw; }
        .investor-enter-btn:hover { background: linear-gradient(135deg, rgba(242, 209, 107, 0.2) 0%, rgba(242, 209, 107, 0.08) 100%); border-color: rgba(242, 209, 107, 0.8); transform: scale(1.03); box-shadow: 0 0 50px rgba(242, 209, 107, 0.25), inset 0 0 20px rgba(242, 209, 107, 0.05); }
        .investor-version { position: absolute; bottom: 30px; font-size: 0.8rem; color: #8b7355; letter-spacing: 2px; }

        /* 淡出动画 */
        @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
        @keyframes splashEntrance {
            0% { opacity: 0; transform: scale(1.1); }
            100% { opacity: 1; transform: scale(1); }
        }

        /* ========== 高级动画系统 ========== */

        /* 蓍草聚散 - 涟漪效果 */
        .gather-ripple {
            position: absolute;
            border-radius: 50%;
            border: 2px solid rgba(232, 200, 107, 0.6);
            pointer-events: none;
            animation: rippleExpand 1s ease-out forwards;
        }
        @keyframes rippleExpand {
            0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
            100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
        }

        /* 金光汇聚粒子 */
        .golden-particle {
            position: absolute;
            width: 4px;
            height: 4px;
            background: radial-gradient(circle, #f5dfa0 0%, rgba(232, 200, 107, 0) 70%);
            border-radius: 50%;
            pointer-events: none;
            animation: particleConverge 0.8s ease-in forwards;
        }
        @keyframes particleConverge {
            0% { opacity: 1; transform: scale(1.5); }
            100% { opacity: 0; transform: scale(0); }
        }

        /* 分策散射粒子 */
        .scatter-particle {
            position: absolute;
            width: 3px;
            height: 3px;
            background: rgba(232, 200, 107, 0.8);
            border-radius: 50%;
            pointer-events: none;
            animation: particleScatter 0.6s ease-out forwards;
        }
        @keyframes particleScatter {
            0% { opacity: 1; transform: scale(1); }
            100% { opacity: 0; transform: scale(0.5); }
        }

        /* 爻线生成动画增强 */
        .line-slot.active {
            animation: lineAppearEnhanced 0.8s var(--ease-out-back);
        }
        @keyframes lineAppearEnhanced {
            0% {
                transform: scaleX(0) scaleY(0.3);
                opacity: 0;
                filter: blur(8px) brightness(2);
            }
            30% {
                transform: scaleX(1.2) scaleY(1.15);
                filter: blur(0) brightness(1.5);
            }
            50% {
                transform: scaleX(0.95) scaleY(1);
            }
            70% {
                transform: scaleX(1.05) scaleY(1);
            }
            100% {
                transform: scaleX(1) scaleY(1);
                opacity: 1;
                filter: blur(0) brightness(1);
            }
        }

        /* 爻线生成时的光芒爆发 */
        .line-burst {
            position: absolute;
            width: 120px;
            height: 40px;
            left: 50%;
            transform: translateX(-50%);
            pointer-events: none;
            animation: lineBurst 0.6s ease-out forwards;
            background: radial-gradient(ellipse at center, rgba(232, 200, 107, 0.8) 0%, transparent 70%);
        }
        @keyframes lineBurst {
            0% { opacity: 1; transform: translateX(-50%) scale(0.5); }
            100% { opacity: 0; transform: translateX(-50%) scale(2); }
        }

        /* 变爻火焰效果增强 */
        .line-slot.changing .line-segment {
            background: linear-gradient(90deg, #ff4500, #ff6b35, #f2d16b, #ff6b35, #ff4500);
            background-size: 300% 100%;
            animation: changingGlow 1.2s ease-in-out infinite, changingShimmer 1.5s linear infinite, changingFlame 0.3s ease-in-out infinite;
            box-shadow:
                0 0 25px rgba(255, 69, 0, 0.7),
                0 0 50px rgba(255, 107, 53, 0.4),
                0 -10px 30px rgba(255, 165, 0, 0.3);
        }
        @keyframes changingFlame {
            0%, 100% { transform: scaleY(1) translateY(0); }
            50% { transform: scaleY(1.05) translateY(-1px); }
        }

        /* 六爻完成神光 */
        .hexagram-complete-glow {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 200px;
            height: 200px;
            transform: translate(-50%, -50%);
            pointer-events: none;
            background: radial-gradient(circle, rgba(232, 200, 107, 0.4) 0%, transparent 60%);
            animation: divineGlow 2s ease-out forwards;
        }
        @keyframes divineGlow {
            0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
            30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
            100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
        }

        /* 页面过渡 - 卷轴展开效果 */
        .interpretation-panel.scroll-unfold {
            animation: scrollUnfold 0.6s var(--ease-out-expo);
        }
        @keyframes scrollUnfold {
            0% {
                opacity: 0;
                clip-path: inset(50% 0 50% 0);
                transform: scaleY(0.8);
            }
            50% {
                clip-path: inset(20% 0 20% 0);
            }
            100% {
                opacity: 1;
                clip-path: inset(0 0 0 0);
                transform: scaleY(1);
            }
        }

        /* 页面过渡 - 墨染扩散效果 */
        .ink-spread-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 99;
            background: radial-gradient(circle at center, transparent 0%, rgba(10, 10, 15, 0.98) 100%);
            animation: inkSpread 0.5s ease-out forwards;
        }
        @keyframes inkSpread {
            0% {
                background: radial-gradient(circle at center, transparent 0%, rgba(10, 10, 15, 0.98) 0%);
            }
            100% {
                background: radial-gradient(circle at center, transparent 100%, rgba(10, 10, 15, 0.98) 100%);
            }
        }

        /* 按钮涟漪点击效果 */
        .btn-ripple {
            position: absolute;
            border-radius: 50%;
            background: rgba(232, 200, 107, 0.4);
            transform: scale(0);
            animation: btnRipple 0.6s ease-out forwards;
            pointer-events: none;
        }
        @keyframes btnRipple {
            to { transform: scale(4); opacity: 0; }
        }

        /* 微交互 - 按钮悬停光晕 */
        .top-bar-btn::after {
            content: '';
            position: absolute;
            inset: -3px;
            border-radius: inherit;
            background: radial-gradient(circle at center, rgba(232, 200, 107, 0.3) 0%, transparent 70%);
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }
        .top-bar-btn:hover::after {
            opacity: 1;
        }

        /* 环境粒子 - 更丰富的漂浮效果 */
        .ambient-particle {
            position: absolute;
            width: 2px;
            height: 2px;
            background: rgba(232, 200, 107, 0.5);
            border-radius: 50%;
            pointer-events: none;
            animation: ambientFloat 12s infinite ease-in-out;
        }
        @keyframes ambientFloat {
            0%, 100% {
                transform: translateY(0) translateX(0) scale(1);
                opacity: 0.3;
            }
            25% {
                transform: translateY(-30px) translateX(15px) scale(1.2);
                opacity: 0.6;
            }
            50% {
                transform: translateY(-60px) translateX(-10px) scale(0.8);
                opacity: 0.4;
            }
            75% {
                transform: translateY(-30px) translateX(20px) scale(1.1);
                opacity: 0.5;
            }
        }

        /* 卦象显示容器动画 */
        .hexagram-display {
            transition: transform 0.3s var(--ease-spring);
        }
        .hexagram-display.pulse {
            animation: hexPulse 0.5s ease-out;
        }
        @keyframes hexPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        /* 解卦区块入场动画 */
        .interp-section {
            opacity: 0;
            transform: translateY(20px);
            animation: sectionFadeIn 0.5s var(--ease-out-expo) forwards;
        }
        .interp-section:nth-child(1) { animation-delay: 0.1s; }
        .interp-section:nth-child(2) { animation-delay: 0.2s; }
        .interp-section:nth-child(3) { animation-delay: 0.3s; }
        .interp-section:nth-child(4) { animation-delay: 0.4s; }
        .interp-section:nth-child(5) { animation-delay: 0.5s; }
        @keyframes sectionFadeIn {
            to { opacity: 1; transform: translateY(0); }
        }

        /* 状态文字切换动画 */
        .status-text {
            transition: opacity 0.3s ease, transform 0.3s ease;
        }
        .status-text.changing {
            animation: statusChange 0.4s ease-out;
        }
        @keyframes statusChange {
            0% { opacity: 0; transform: translateY(10px); }
            100% { opacity: 1; transform: translateY(0); }
        }

        /* 进度点完成脉冲增强 */
        @keyframes dotCompleteEnhanced {
            0% {
                transform: scale(0);
                opacity: 0;
                box-shadow: 0 0 0 0 rgba(232, 200, 107, 0.8);
            }
            50% {
                transform: scale(1.8);
                box-shadow: 0 0 20px 5px rgba(232, 200, 107, 0.5);
            }
            100% {
                transform: scale(1);
                opacity: 1;
                box-shadow: 0 0 8px 2px rgba(232, 200, 107, 0.3);
            }
        }
        .progress-dot.completed {
            animation: dotCompleteEnhanced 0.6s var(--ease-out-back);
        }

        /* 蓍草区域呼吸光效 */
        .yarrow-stage::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 24px;
            pointer-events: none;
            box-shadow: inset 0 0 60px rgba(232, 200, 107, 0.05);
            animation: stageBreathe 4s ease-in-out infinite;
        }
        @keyframes stageBreathe {
            0%, 100% { box-shadow: inset 0 0 60px rgba(232, 200, 107, 0.03); }
            50% { box-shadow: inset 0 0 80px rgba(232, 200, 107, 0.08); }
        }

        /* 聊天消息入场增强 */
        .chat-message {
            animation: messageSlideIn 0.4s var(--ease-out-back);
        }
        @keyframes messageSlideIn {
            0% {
                opacity: 0;
                transform: translateY(20px) scale(0.95);
            }
            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* 加载骨架屏闪烁 */
        .skeleton-shimmer {
            background: linear-gradient(90deg,
                rgba(232, 200, 107, 0.05) 25%,
                rgba(232, 200, 107, 0.15) 50%,
                rgba(232, 200, 107, 0.05) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
        }
        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* 解卦标题入场 */
        .interp-header {
            animation: headerReveal 0.6s var(--ease-out-expo);
        }
        @keyframes headerReveal {
            0% {
                opacity: 0;
                transform: translateY(-20px) scale(0.9);
                filter: blur(10px);
            }
            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
                filter: blur(0);
            }
        }

        /* 爻线视觉卦象入场 */
        .interp-hexagram-visual {
            animation: hexVisualReveal 0.8s var(--ease-spring);
        }
        @keyframes hexVisualReveal {
            0% {
                opacity: 0;
                transform: scale(0.7) rotateX(30deg);
            }
            50% {
                transform: scale(1.05) rotateX(-5deg);
            }
            100% {
                opacity: 1;
                transform: scale(1) rotateX(0);
            }
        }

        /* 解卦视觉爻线依次出现 */
        .interp-hex-line {
            opacity: 0;
            animation: interpLineAppear 0.4s var(--ease-out-back) forwards;
        }
        .interp-hex-line:nth-child(1) { animation-delay: 0.1s; }
        .interp-hex-line:nth-child(2) { animation-delay: 0.2s; }
        .interp-hex-line:nth-child(3) { animation-delay: 0.3s; }
        .interp-hex-line:nth-child(4) { animation-delay: 0.4s; }
        .interp-hex-line:nth-child(5) { animation-delay: 0.5s; }
        .interp-hex-line:nth-child(6) { animation-delay: 0.6s; }
        @keyframes interpLineAppear {
            0% {
                opacity: 0;
                transform: scaleX(0);
            }
            100% {
                opacity: 1;
                transform: scaleX(1);
            }
        }

        /* ========== P0 新功能样式 ========== */

        /* A2: 起卦进度指示器 - 稳定居中布局(避免transform冲突) */
        .divination-progress {
            position: fixed;
            bottom: 25px;
            left: 0;
            right: 0;
            margin-left: auto;
            margin-right: auto;
            width: fit-content;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            z-index: 5;
            opacity: 0;
            transition: opacity 0.4s ease;
            pointer-events: none;
            /* 防止安卓渲染问题 */
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
        .divination-progress.visible { opacity: 1; }
        .progress-yao-num {
            font-size: var(--fs-lg);
            font-weight: 500;
            color: var(--gold);
        }
        .progress-text {
            font-size: var(--fs-sm);
            color: var(--text-muted);
            letter-spacing: clamp(1px, 0.5vw, 2px);
        }
        .progress-action {
            color: var(--gold);
            opacity: 0.9;
        }
        /* yj-reset-fab 已下线：由 #restartBtn（顶栏左侧）接管重启功能，避免双入口 */

        /* 极简提问 - 快速选择 */
        .quick-questions {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }
        .quick-question {
            display: flex;
            align-items: center;
            gap: clamp(8px, 2.5vw, 12px);
            background: rgba(232, 200, 107, 0.06);
            border: 1px solid rgba(232, 200, 107, 0.15);
            border-radius: 14px;
            padding: clamp(10px, 3vw, 14px) clamp(12px, 3.5vw, 16px);
            color: var(--text-secondary);
            font-size: var(--fs-sm);
            cursor: pointer;
            transition: all 0.25s ease;
            text-align: left;
            word-break: keep-all;
        }
        .quick-question:hover {
            background: rgba(232, 200, 107, 0.12);
            border-color: rgba(232, 200, 107, 0.3);
            color: var(--gold);
            transform: translateX(4px);
        }
        .quick-question:active {
            transform: scale(0.98);
        }
        .quick-icon {
            font-size: 1.2rem;
            flex-shrink: 0;
        }
        .question-divider {
            display: flex;
            align-items: center;
            gap: 15px;
            margin: 15px 0;
            color: var(--text-muted);
            font-size: 0.8rem;
        }
        .question-divider::before,
        .question-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: rgba(232, 200, 107, 0.15);
        }

        /* 念心入口卡片。卦象名称之后的主转化入口，强调可继续深聊。
           使用呼吸光、身份徽章和明确的操作按钮。 */
        .nianxin-entry-card {
            margin: 18px 0 14px;
            padding: 0;
        }
        .nianxin-hero {
            display: grid;
            grid-template-columns: auto 1fr;
            grid-template-rows: auto auto auto;
            column-gap: clamp(14px, 4vw, 20px);
            row-gap: 8px;
            align-items: center;
            width: 100%;
            background: linear-gradient(135deg, #1b1611 0%, #2a2014 62%, #5b3d17 100%);
            border: 1px solid rgba(245, 223, 160, 0.48);
            border-radius: 22px;
            padding: clamp(18px, 5.2vw, 26px) clamp(18px, 5vw, 24px);
            cursor: pointer;
            position: relative;
            overflow: hidden;
            box-shadow:
                0 20px 48px rgba(27, 22, 17, 0.22),
                0 0 0 1px rgba(245, 223, 160, 0.06) inset;
            transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
            animation: nianxinHeroBreath 3.6s ease-in-out infinite;
            -webkit-tap-highlight-color: transparent;
        }
        @keyframes nianxinHeroBreath {
            0%, 100% { box-shadow: 0 20px 48px rgba(27, 22, 17, 0.22), 0 0 0 1px rgba(245, 223, 160, 0.06) inset, 0 0 0 0 rgba(245, 223, 160, 0); }
            50%      { box-shadow: 0 22px 54px rgba(27, 22, 17, 0.30), 0 0 0 1px rgba(245, 223, 160, 0.14) inset, 0 0 24px 6px rgba(245, 223, 160, 0.10); }
        }
        @media (prefers-reduced-motion: reduce) {
            .nianxin-hero { animation: none; }
        }
        .nianxin-hero:active { transform: scale(0.985); }
        /* 墨金光弧流过（装饰 ::after） */
        .nianxin-hero::after {
            content: '';
            position: absolute;
            top: 0; right: -30%;
            width: 60%; height: 100%;
            background: linear-gradient(75deg, transparent 30%, rgba(245, 223, 160, 0.14) 50%, transparent 70%);
            transform: translateX(0);
            pointer-events: none;
            animation: nianxinShimmer 6s ease-in-out infinite;
        }
        @keyframes nianxinShimmer {
            0%   { transform: translateX(0); opacity: 0; }
            40%  { opacity: 1; }
            60%  { transform: translateX(-160%); opacity: 0; }
            100% { transform: translateX(-160%); opacity: 0; }
        }
        @media (prefers-reduced-motion: reduce) {
            .nianxin-hero::after { animation: none; display: none; }
        }

        .nianxin-hero-badge {
            grid-column: 1 / -1;
            justify-self: start;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
            font-size: 0.72rem;
            font-style: italic;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: #f5dfa0;
            background: rgba(245, 223, 160, 0.1);
            border: 0.5px solid rgba(245, 223, 160, 0.35);
            border-radius: 999px;
            position: relative;
            z-index: 1;
        }
        .nianxin-hero-avatar {
            grid-row: 2;
            grid-column: 1;
            width: clamp(52px, 14vw, 64px) !important;
            height: clamp(52px, 14vw, 64px) !important;
            border-radius: 50%;
            overflow: hidden;
            background: #1a1510;
            border: 1.5px solid rgba(245, 223, 160, 0.55);
            box-shadow: 0 0 22px rgba(245, 223, 160, 0.22);
            flex-shrink: 0;
            display: inline-block;
            position: relative;
            z-index: 1;
        }
        .nianxin-hero-avatar > img { width: 100%; height: 100%; object-fit: cover; display: block; }
        .nianxin-hero-content {
            grid-row: 2;
            grid-column: 2;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
            position: relative;
            z-index: 1;
        }
        .nianxin-hero-title {
            font-family: 'LXGW WenKai', 'Noto Serif SC', 'STKaiti', serif;
            font-size: clamp(1.08rem, 0.92rem + 1.1vw, 1.3rem);
            font-weight: 600;
            color: #f5dfa0;
            letter-spacing: 0.04em;
            line-height: 1.35;
            white-space: normal;
            overflow-wrap: anywhere;
            word-break: keep-all;
            text-shadow: 0 0 16px rgba(245, 223, 160, 0.15);
        }
        .nianxin-hero-desc {
            font-size: clamp(0.78rem, 0.7rem + 0.4vw, 0.88rem);
            color: rgba(245, 223, 160, 0.7);
            letter-spacing: 0.02em;
            line-height: 1.5;
        }
        .nianxin-hero-cta-row {
            grid-column: 1 / -1;
            grid-row: 3;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-top: 6px;
            padding: 10px 20px;
            background: linear-gradient(135deg, #f5dfa0, #e0bd5c);
            border-radius: 999px;
            color: #1b1611;
            font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
            font-size: 0.92rem;
            font-weight: 600;
            letter-spacing: 0.14em;
            box-shadow: 0 6px 20px rgba(245, 223, 160, 0.26);
            position: relative;
            z-index: 1;
        }
        .nianxin-hero-cta-arrow {
            stroke: #1b1611;
            flex-shrink: 0;
        }
        .nianxin-hero:active .nianxin-hero-cta-row {
            transform: scale(0.97);
        }
        /* 窄屏：CTA 行 full-width，更易点 */
        @media (max-width: 380px) {
            .nianxin-hero-title { font-size: 1.02rem; letter-spacing: 0.02em; }
            .nianxin-hero-desc  { font-size: 0.76rem; }
        }

        /* 旧 nianxin-entry-card 样式（保留，用于向后兼容的非 hero 场景） */
        .nianxin-entry-inner {
            display: grid;
            grid-template-columns: auto 1fr auto;
            align-items: center;
            column-gap: clamp(12px, 3.6vw, 18px);
            row-gap: 6px;
            background: linear-gradient(145deg, rgba(18, 16, 14, 0.97) 0%, rgba(34, 26, 18, 0.96) 58%, rgba(68, 48, 20, 0.92) 100%);
            border: 1px solid rgba(245, 223, 160, 0.52);
            border-radius: 20px;
            padding: clamp(14px, 4.2vw, 18px) clamp(16px, 4.8vw, 22px);
            cursor: pointer;
            transition: transform 0.28s var(--ease-spring), box-shadow 0.28s ease, border-color 0.28s ease;
            position: relative;
            overflow: hidden;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255,255,255,0.03) inset;
            min-width: 0;
        }
        .nianxin-entry-inner::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 3px;
            background: linear-gradient(90deg, transparent, rgba(245, 223, 160, 0.15), var(--gold-bright), rgba(245, 223, 160, 0.15), transparent);
        }
        .nianxin-entry-inner:hover {
            transform: translateY(-3px) scale(1.01);
            box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42), 0 10px 28px rgba(232, 200, 107, 0.16);
        }
        .nianxin-entry-inner:active {
            transform: translateY(0) scale(0.995);
            transition-duration: 0.12s;
        }
        .nianxin-entry-avatar {
            width: clamp(44px, 11.5vw, 54px);
            height: clamp(44px, 11.5vw, 54px);
            border-radius: 50%;
            flex-shrink: 0;
            overflow: hidden;
            display: inline-block;
            box-shadow: 0 0 16px rgba(232, 200, 107, 0.22);
        }
        .nianxin-entry-avatar > img,
        .nianxin-entry-avatar > svg { display: block; width: 100%; height: 100%; object-fit: cover; }
        .nianxin-entry-content {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }
        /* CJK 标题允许换行，避免 ellipsis 在窄屏截掉最后一两字
           "深入聊聊此卦象" 在 iPhone SE 下必须整行完整展示，否则读起来像不完整的句子。 */
        .nianxin-entry-title {
            overflow-wrap: anywhere;
            word-break: keep-all;
            white-space: normal;
            line-height: 1.35;
        }
        .nianxin-entry-desc {
            overflow-wrap: anywhere;
            word-break: keep-all;
            white-space: normal;
            line-height: 1.45;
        }
        .nianxin-entry-arrow {
            flex-shrink: 0;
            color: var(--gold);
            opacity: 0.85;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px; height: 26px;
        }
        @media (max-width: 380px) {
            .nianxin-entry-inner {
                /* 窄屏：缩小 padding 与 letter-spacing，给标题留足空间 */
                padding: 14px 16px !important;
                column-gap: 12px !important;
            }
            .nianxin-entry-title { font-size: 0.96rem !important; letter-spacing: 0.3px !important; }
            .nianxin-entry-desc  { font-size: 0.76rem !important; }
            .nianxin-entry-arrow { width: 20px !important; height: 20px !important; }
        }
        .nianxin-entry-content {
            flex: 1;
        }
        .nianxin-entry-title {
            font-size: clamp(0.95rem, 0.8rem + 0.8vw, 1.1rem);
            color: var(--text-primary);
            font-weight: 600;
            margin-bottom: 4px;
            letter-spacing: 0.6px; /* 原 1px 在窄屏上累计过多导致标题撞上箭头 */
            text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
        }
        .nianxin-entry-desc {
            font-size: var(--fs-sm);
            color: rgba(235, 228, 216, 0.86);
            letter-spacing: 0.5px;
            line-height: 1.55;
        }
        .nianxin-entry-arrow {
            color: var(--gold-bright);
            opacity: 1;
            flex-shrink: 0;
            animation: nianxinArrowBounce 1.5s ease-in-out infinite;
            filter: drop-shadow(0 0 8px rgba(232, 200, 107, 0.18));
        }
        @keyframes nianxinArrowBounce { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
        .conclusion-share-btn {
            background: rgba(232, 200, 107, 0.12);
            border: 1px solid rgba(232, 200, 107, 0.3);
            color: var(--gold);
            padding: clamp(10px, 3vw, 14px) clamp(12px, 3.5vw, 16px);
            border-radius: 12px;
            font-size: var(--fs-sm);
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
        }
        .conclusion-share-btn:hover { background: rgba(232, 200, 107, 0.2); }

        /* D1: 天时弹窗增强 - 倒计时 */
        .retention-countdown {
            font-size: 1.8rem;
            color: var(--gold-bright);
            font-weight: 600;
            margin: 15px 0;
            font-family: 'Courier New', monospace;
            letter-spacing: 3px;
        }
        .retention-explain {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-bottom: 15px;
            cursor: pointer;
            text-decoration: underline;
            text-underline-offset: 3px;
        }
        .retention-explain-content {
            display: none;
            font-size: 0.8rem;
            color: var(--text-secondary);
            background: rgba(35, 30, 25, 0.6);
            padding: 12px;
            border-radius: 10px;
            margin-bottom: 15px;
            line-height: 1.6;
            text-align: left;
        }
        .retention-explain-content.visible { display: block; }
        .retention-alternatives {
            display: flex;
            flex-direction: column;
            gap: 10px;
            width: 100%;
            margin-bottom: 15px;
        }
        .retention-alt-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 14px;
            border-radius: 12px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .retention-alt-preview {
            background: rgba(232, 200, 107, 0.1);
            border: 1px solid rgba(232, 200, 107, 0.25);
            color: var(--gold);
        }
        .retention-alt-preview:hover { background: rgba(232, 200, 107, 0.2); }
        .retention-alt-unlock {
            background: linear-gradient(135deg, rgba(232, 200, 107, 0.2), rgba(180, 150, 60, 0.15));
            border: 1px solid rgba(232, 200, 107, 0.4);
            color: var(--gold-bright);
        }
        .retention-alt-unlock:hover { background: linear-gradient(135deg, rgba(232, 200, 107, 0.3), rgba(180, 150, 60, 0.25)); }

        /* D2: 付费墙面板 */
        .paywall-panel {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(10, 10, 15, 0.98);
            z-index: 350;
            display: none;
            flex-direction: column;
            overflow-y: auto;
            padding: 60px 20px 30px;
        }
        .paywall-panel.visible { display: flex; animation: slideUp 0.4s ease; }
        .paywall-close {
            position: fixed;
            top: 15px;
            right: 15px;
            width: 36px;
            height: 36px;
            background: rgba(255,255,255,0.1);
            border: none;
            border-radius: 50%;
            color: var(--gold);
            font-size: 1.3rem;
            cursor: pointer;
            z-index: 351;
        }
        .paywall-header {
            text-align: center;
            margin-bottom: 30px;
        }
        .paywall-icon { font-size: 3rem; margin-bottom: 15px; }
        .paywall-title { font-size: 1.5rem; color: var(--gold); margin-bottom: 8px; }
        .paywall-subtitle { font-size: 0.9rem; color: var(--text-muted); }
        .paywall-benefits {
            background: rgba(35, 30, 25, 0.6);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 25px;
        }
        .paywall-benefit {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid rgba(232, 200, 107, 0.1);
        }
        .paywall-benefit:last-child { border-bottom: none; }
        .paywall-benefit-icon { font-size: 1.2rem; }
        .paywall-benefit-text { color: var(--text-secondary); font-size: 0.9rem; }
        .paywall-code-section {
            background: rgba(232, 200, 107, 0.08);
            border: 1px solid rgba(232, 200, 107, 0.2);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 20px;
        }
        .paywall-code-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
        .paywall-code-input {
            width: 100%;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(232, 200, 107, 0.3);
            border-radius: 10px;
            padding: 12px;
            color: var(--gold);
            font-size: 1rem;
            text-align: center;
            letter-spacing: 3px;
        }
        .paywall-code-input::placeholder { color: var(--text-muted); letter-spacing: 1px; }
        .paywall-code-btn {
            width: 100%;
            background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
            border: none;
            color: #1a1a20;
            padding: 14px;
            border-radius: 12px;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            margin-top: 10px;
        }
        .paywall-code-error {
            color: #ff6b6b;
            font-size: 0.8rem;
            margin-top: 8px;
            display: none;
        }
        .paywall-code-error.visible { display: block; }
        .paywall-status {
            text-align: center;
            padding: 20px;
            background: rgba(100, 200, 100, 0.1);
            border: 1px solid rgba(100, 200, 100, 0.3);
            border-radius: 12px;
            margin-bottom: 20px;
            display: none;
        }
        .paywall-status.visible { display: block; }
        .paywall-status-icon { font-size: 2rem; margin-bottom: 10px; }
        .paywall-status-text { color: #90ee90; font-size: 0.95rem; }

        /* E1: 隐私设置面板 */
        .privacy-section {
            background: rgba(35, 30, 25, 0.6);
            border-radius: 12px;
            padding: 18px;
            margin-top: 20px;
        }
        .privacy-title { font-size: 0.9rem; color: var(--gold); margin-bottom: 12px; }
        .privacy-link {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-secondary);
            font-size: 0.85rem;
            padding: 10px 0;
            cursor: pointer;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .privacy-link:hover { color: var(--gold); }
        .privacy-link:last-child { border-bottom: none; }
        .clear-data-btn {
            width: 100%;
            background: rgba(255, 100, 100, 0.1);
            border: 1px solid rgba(255, 100, 100, 0.25);
            color: #ffaaaa;
            padding: 12px;
            border-radius: 10px;
            font-size: 0.85rem;
            cursor: pointer;
            margin-top: 12px;
            transition: all 0.2s ease;
        }
        .clear-data-btn:hover { background: rgba(255, 100, 100, 0.2); }

        /* 隐私说明弹窗 */
        .privacy-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(10, 10, 15, 0.98);
            z-index: 400;
            display: none;
            flex-direction: column;
            overflow-y: auto;
            padding: 60px 20px 30px;
        }
        .privacy-modal.visible { display: flex; animation: slideUp 0.4s ease; }
        .privacy-modal-close {
            position: fixed;
            top: 15px;
            right: 15px;
            width: 36px;
            height: 36px;
            background: rgba(255,255,255,0.1);
            border: none;
            border-radius: 50%;
            color: var(--gold);
            font-size: 1.3rem;
            cursor: pointer;
            z-index: 401;
        }
        .privacy-modal-title { font-size: 1.3rem; color: var(--gold); text-align: center; margin-bottom: 25px; }
        .privacy-modal-content { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.8; }
        .privacy-modal-content h4 { color: var(--gold); font-size: 1rem; margin: 20px 0 10px; }
        .privacy-modal-content p { margin-bottom: 12px; }

        /* ================================================================
           底部导航 & 应用页面 — 学堂 / 我的
        ================================================================ */

        /* ── Bottom nav bar ── */
        .bottom-nav {
            position: fixed;
            bottom: 0; left: 0; right: 0;
            z-index: 150;
            display: flex;
            align-items: stretch;
            /* v6：从 54 提到 60，给激活态 scale(1.1) 的 icon 留上下呼吸空间 */
            height: calc(60px + env(safe-area-inset-bottom));
            padding-bottom: env(safe-area-inset-bottom);
            background: rgba(10, 10, 15, 0.97);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-top: 1px solid rgba(232, 200, 107, 0.1);
        }
        .bottom-nav-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 3px;
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        .bottom-nav-item .nav-glyph {
            font-size: 1.3rem;
            line-height: 1;
            color: rgba(232, 200, 107, 0.35);
            transition: color 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        /* v6.7：手绘中国风图标——稍大、毛笔感（stroke 端点圆、stroke 渐进）。
           color 用 currentColor，让单图标也能同时控制 stroke 和 fill 的金墨色调。 */
        .bottom-nav-item .nav-icon {
            width: 24px; height: 24px;
            stroke: currentColor;
            fill: none;
            color: rgba(232, 200, 107, 0.40);
            stroke-width: 1.4;
            stroke-linecap: round;
            stroke-linejoin: round;
            transition: color 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                        filter 0.3s ease;
        }
        /* fill 的小圆点必须跟 currentColor 同步（如果将来 SVG 内有 fill 元素） */
        .bottom-nav-item .nav-icon [fill="currentColor"] { fill: currentColor; }

        .bottom-nav-item .nav-label {
            /* v6.7：用全局软笔书法 brush 链路 → 与 logo 字体语言一致 */
            font-family: var(--font-brush, 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'Noto Serif SC', serif);
            /* v6.7：12-14px；软笔体字本身宽厚，比 Noto Serif 同字号视觉更大 */
            font-size: clamp(12px, 3.2vw, 14px);
            letter-spacing: 0.18em;
            color: rgba(232, 200, 107, 0.40);
            transition: color 0.25s ease;
            font-weight: 400;
            /* 软笔字体的字形高度比 sans-serif 矮，需要轻微 line-height */
            line-height: 1.1;
        }
        /* v6.7：active 状态——图标用金色 + 微妙发光（毛笔墨色发亮感） */
        .bottom-nav-item.active .nav-glyph,
        .bottom-nav-item.active .nav-icon  {
            color: #e8c86b;
            transform: scale(1.08) translateY(-1px);
            filter: drop-shadow(0 0 4px rgba(232, 200, 107, 0.28));
        }
        .bottom-nav-item.active .nav-label { color: #e8c86b; }
        .bottom-nav-item:active .nav-glyph,
        .bottom-nav-item:active .nav-icon  {
            transform: scale(0.9);
            filter: none;
        }

        /* Push divination progress above the nav bar (higher specificity, no !important) */
        body .divination-progress { bottom: calc(64px + env(safe-area-inset-bottom)); }

        /* Main app content clears the nav bar */
        #app { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

        /* ── Full-screen page panels ── */
        .app-page {
            position: fixed;
            inset: 0;
            z-index: 140;
            display: none;
            flex-direction: column;
            overflow: hidden;
            /* Parchment surface design tokens, scoped to panels */
            --page-bg:       #fdfae9;
            --page-bg-mid:   #f1eede;
            --page-bg-deep:  #ebe8d9;
            --page-ink:      #1c1c13;
            --page-ink-soft: #444748;
            --page-ink-dim:  #747878;
            --page-border:   rgba(196, 199, 199, 0.2);
            --page-gold:     #6f5d00;
            --page-accent:   #fddf55;
            --page-seal:     #ba1a1a;
            font-family: 'Noto Serif SC', serif;
            color: var(--page-ink);
            background: var(--page-bg);
        }
        .app-page.active {
            display: flex;
            animation: pageEnter 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }
        @keyframes pageEnter {
            from { opacity: 0; transform: translateY(14px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* v6.7.2 Stage 4：原闪现修复的 CSS 兜底已废弃——Router 在 onLeave('home') 时
           直接 #app.style.display='none'，结构性消除漏底，无需 CSS 旁路。
           仅保留 pageEnter 动画轻量化（14px→6px translate）。 */
        @keyframes pageEnter {
            from { opacity: 0; transform: translateY(6px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* ── Shared page header ── */
        .page-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: calc(env(safe-area-inset-top) + 12px) 18px 12px;
            background: linear-gradient(to bottom, var(--page-bg), var(--page-bg-mid));
            border-bottom: 1px solid var(--page-border);
            position: sticky; top: 0; z-index: 5;
            flex-shrink: 0;
        }
        /* 无左右按钮的版本：标题水平绝对居中 */
        .page-header--clean {
            justify-content: center;
        }
        .page-header-title {
            font-size: 1.15rem; font-weight: 700;
            letter-spacing: 0.38em; color: var(--page-ink);
        }
        .page-header-btn {
            width: 36px; height: 36px;
            display: flex; align-items: center; justify-content: center;
            background: none; border: none; cursor: pointer;
            color: var(--page-ink-soft);
            -webkit-tap-highlight-color: transparent;
        }
        .page-header-btn svg {
            width: 20px; height: 20px;
            stroke: currentColor; fill: none;
            stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
        }

        /* ── Scrollable body ── */
        .page-body {
            flex: 1 1 0%;
            /* 关键：flex 纵向列里，子项 min-height 默认为 auto（=内容高），会撑高到内容、
               不收缩 → iOS Safari 下 overflow-y:auto 失效、内容被父级 .app-page(overflow:hidden) 裁掉，
               于是吾身底部按钮(设置/关于/隐私/反馈…)在 iPhone 上"消失"且滚不到。
               min-height:0 让它能收缩到容器高度，内部正常滚动。这是 iOS flexbox 滚动的必备约束。 */
            min-height: 0;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            padding-bottom: calc(66px + env(safe-area-inset-bottom));
        }

        /* ================================================================
           学堂 — The Scholars' Forum
        ================================================================ */

        .xuetang-hero {
            padding: 24px 20px 18px;
            background:
                radial-gradient(ellipse at 12% 45%, rgba(0,0,0,0.022) 0%, transparent 50%),
                radial-gradient(ellipse at 88% 70%, rgba(0,0,0,0.016) 0%, transparent 55%),
                var(--page-bg);
        }
        .xuetang-hero h2 {
            font-size: 1.85rem; font-weight: 700;
            letter-spacing: 0.3em; color: var(--page-ink);
            border-left: 3px solid var(--page-accent);
            padding-left: 14px; line-height: 1.2;
            margin-bottom: 6px;
        }
        .xuetang-hero p {
            font-size: 0.68rem; letter-spacing: 0.32em;
            color: var(--page-ink-dim); padding-left: 17px;
        }

        .post-feed { display: flex; flex-direction: column; }
        .post-card {
            background: var(--page-bg);
            padding: 18px 20px;
            border-bottom: 1px solid var(--page-border);
            transition: background 0.25s ease;
        }
        .post-card:active { background: var(--page-bg-mid); }

        .post-card-meta {
            display: flex; align-items: center;
            justify-content: space-between; margin-bottom: 12px;
        }
        .post-author-row { display: flex; align-items: center; gap: 10px; }
        .post-avatar {
            width: 40px; height: 40px; flex-shrink: 0;
            background: var(--page-bg-mid);
            border-radius: 4px;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.1rem;
        }
        .post-author-name { font-size: 0.9rem; font-weight: 600; color: var(--page-ink); }
        .post-author-time {
            font-size: 0.68rem; color: var(--page-ink-dim);
            margin-top: 2px; letter-spacing: 0.02em;
        }
        .post-tag {
            background: var(--page-accent); color: #5c4a00;
            font-size: 0.68rem; font-weight: 700;
            padding: 3px 10px; border-radius: 9999px;
            letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0;
        }

        .post-title {
            font-size: 1.05rem; font-weight: 700;
            color: var(--page-ink); line-height: 1.55;
            letter-spacing: 0.03em; margin-bottom: 8px;
        }
        .post-excerpt {
            font-size: 0.88rem; color: var(--page-ink-soft);
            line-height: 1.85; margin-bottom: 14px;
        }
        .post-actions {
            display: flex; align-items: center; justify-content: space-between;
            padding-top: 12px; border-top: 1px solid var(--page-border);
        }
        .post-action-group { display: flex; gap: 16px; }
        .post-action-btn {
            display: flex; align-items: center; gap: 5px;
            background: none; border: none;
            color: var(--page-ink-soft); font-size: 0.82rem;
            cursor: pointer; padding: 4px 0;
            font-family: 'Noto Serif SC', serif;
            -webkit-tap-highlight-color: transparent;
            transition: color 0.2s ease;
        }
        .post-action-btn:active { color: var(--page-gold); }
        .post-action-btn svg {
            width: 16px; height: 16px;
            stroke: currentColor; fill: none;
            stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
        }
        .xuetang-footer {
            padding: 40px 20px 20px;
            text-align: center; color: var(--page-ink-dim);
            font-size: 0.75rem; letter-spacing: 0.18em;
        }

        /* ================================================================
           我的 — Personal Cultivation Centre
        ================================================================ */

        .wode-profile-section {
            display: flex; flex-direction: column; align-items: center;
            padding: 32px 20px 24px;
            background:
                radial-gradient(ellipse at 75% 20%, rgba(0,0,0,0.018) 0%, transparent 60%),
                var(--page-bg);
        }
        .wode-avatar-wrap {
            position: relative; width: 88px; height: 88px;
            margin-bottom: 16px;
        }
        .wode-avatar-circle {
            width: 100%; height: 100%; border-radius: 50%;
            background: linear-gradient(145deg, var(--page-bg-mid), var(--page-bg-deep));
            border: 2px solid var(--page-border);
            display: flex; align-items: center; justify-content: center;
            font-size: 2.2rem;
        }
        .wode-seal-badge {
            position: absolute; bottom: -2px; right: -2px;
            width: 28px; height: 28px; border-radius: 3px;
            background: var(--page-seal);
            display: flex; align-items: center; justify-content: center;
            color: #fff; font-size: 0.78rem; font-weight: 700;
            box-shadow: 0 2px 6px rgba(186, 26, 26, 0.38);
        }
        .wode-user-name {
            font-size: 1.4rem; font-weight: 700;
            letter-spacing: 0.25em; color: var(--page-ink);
            margin-bottom: 5px;
        }
        .wode-user-tier {
            font-size: 0.67rem; letter-spacing: 0.2em; color: var(--page-ink-dim);
        }

        .wode-stats-row {
            display: grid; grid-template-columns: repeat(3, 1fr);
            border-top: 1px solid var(--page-border);
            border-bottom: 1px solid var(--page-border);
            margin-bottom: 32px;
        }
        .wode-stat-cell { padding: 18px 8px; text-align: center; }
        .wode-stat-cell + .wode-stat-cell { border-left: 1px solid var(--page-border); }
        .wode-stat-num {
            display: block; font-size: 1.5rem; font-weight: 700;
            color: var(--page-ink); line-height: 1; margin-bottom: 5px;
        }
        .wode-stat-label { font-size: 0.62rem; letter-spacing: 0.07em; color: var(--page-ink-dim); }

        .wode-menu-section { padding: 0 20px; margin-bottom: 28px; }
        .wode-menu-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 15px 0;
            border-bottom: 1px solid var(--page-border);
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
            transition: opacity 0.2s ease;
        }
        .wode-menu-item:last-child { border-bottom: none; }
        .wode-menu-item:active { opacity: 0.55; }
        .wode-menu-item-left { display: flex; align-items: center; gap: 16px; }
        .wode-menu-icon { color: var(--page-ink-soft); display: flex; align-items: center; }
        .wode-menu-icon svg {
            width: 19px; height: 19px;
            stroke: currentColor; fill: none;
            stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
        }
        .wode-menu-label { font-size: 1rem; letter-spacing: 0.08em; color: var(--page-ink); }
        .wode-menu-chevron svg {
            width: 16px; height: 16px;
            stroke: var(--page-ink-dim); fill: none;
            stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
        }

        .wode-footer-area { padding: 28px 20px 20px; text-align: center; }
        .wode-clear-btn {
            padding: 11px 40px;
            border: 1px solid var(--page-border); border-radius: 9999px;
            background: none; color: var(--page-ink-dim);
            font-family: 'Noto Serif SC', serif;
            font-size: 0.8rem; letter-spacing: 0.15em;
            cursor: pointer; -webkit-tap-highlight-color: transparent;
            transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
        }
        .wode-clear-btn:active { background: var(--page-bg-mid); border-color: rgba(111, 93, 0, 0.3); color: var(--page-gold); }
        .wode-version-line {
            margin-top: 14px; font-size: 0.6rem;
            letter-spacing: 0.22em; color: rgba(196, 199, 199, 0.55);
        }
