        /* ===== 全局重置 & 基础 ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        html, body {
            /* 需求修复：底部 TabBar 偶发错位（刷新才恢复）。
               根因：body 可滚动 + 移动端橡皮筋/回弹后滚动位置残留，页面整体被「顶起」，
               视觉上 TabBar 不贴底；锁定 html/body 高度并禁止滚动与回弹后消除。 */
            height: 100%;
            overscroll-behavior: none;
        }

        body {
            font-family: 'PingFang SC', 'Segoe UI', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
            background: #f0ebe6;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            /* 动态视口（dvh）：移动端地址栏收起/展开时不产生溢出 */
            min-height: 100dvh;
            overflow: hidden; /* 页面内滚动全部发生在 .page 内部，body 不滚动 */
            padding: 20px;
            /* 刘海屏/手势条底部安全区 */
            padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
            margin: 0;
            background-image: radial-gradient(circle at 20% 30%, #fde8e0 0%, #f5d6d0 100%);
        }

        .phone {
            width: 380px;
            max-width: 100%;
            height: 780px;
            /* 扣除 body 上下留白，保证底部 TabBar 永远完整可见（修复小屏溢出） */
            max-height: calc(100vh - 40px - env(safe-area-inset-bottom, 0px));
            max-height: calc(100dvh - 40px - env(safe-area-inset-bottom, 0px));
            background: #ffffff;
            border-radius: 44px;
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18), 0 10px 30px rgba(0, 0, 0, 0.08), inset 0 0 0 2px rgba(255, 255, 255, 0.5);
            overflow: hidden;
            position: relative;
            display: flex;
            flex-direction: column;
        }

        .notch {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 150px;
            height: 30px;
            background: #1a1a1a;
            border-radius: 0 0 20px 20px;
            z-index: 100;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .notch .cam {
            width: 10px;
            height: 10px;
            background: #2a2a3a;
            border-radius: 50%;
            border: 1px solid #3a3a4a;
        }
        .notch .speaker {
            width: 50px;
            height: 6px;
            background: #2a2a3a;
            border-radius: 10px;
        }

        .app {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
            background: linear-gradient(165deg, #fff5f0 0%, #ffe8e0 40%, #ffddd5 100%);
            border-radius: 44px;
            padding-top: 38px;
        }

        .page {
            display: none;
            flex-direction: column;
            flex: 1;
            /* 需求修复：flex 子项默认 min-height:auto，内容超长（历史/结果页）时 page 被内容
               撑到超过可用空间，把底部 tabbar 顶出 .app 裁剪区外（表现为「底部菜单超出底部栏
               背景、刷新后正常」——刷新回到短内容页故看似恢复）。min-height:0 允许收缩，
               page 高度严格等于剩余空间，内容内部滚动。 */
            min-height: 0;
            padding: 16px 20px 20px;
            overflow-y: auto;
            scroll-behavior: smooth;
            animation: fadeSlide 0.45s cubic-bezier(0.23, 1, 0.32, 1) forwards;
        }
        .page.active {
            display: flex;
        }

        @keyframes fadeSlide {
            0% {
                opacity: 0;
                transform: translateY(18px) scale(0.97);
            }
            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .page::-webkit-scrollbar {
            width: 0;
            background: transparent;
        }

        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 4px 0 14px;
            flex-shrink: 0;
        }
        .top-bar .left {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .top-bar .back-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.7);
            border: none;
            font-size: 22px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            transition: all 0.2s;
            color: #5a4a42;
        }
        .top-bar .back-btn:active {
            transform: scale(0.90);
            background: rgba(255, 255, 255, 0.9);
        }
        .top-bar .brand {
            font-size: 22px;
            font-weight: 800;
            color: #5a3d35;
            letter-spacing: 0.5px;
            white-space: nowrap; /* 手机上不换行 */
        }
        .top-bar .brand span {
            color: #f59a7a;
        }
        .top-bar .right {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .top-bar .coin-display {
            display: flex;
            align-items: center;
            gap: 6px;
            background: rgba(255, 215, 0, 0.25);
            padding: 6px 14px 6px 10px;
            border-radius: 30px;
            font-size: 16px;
            font-weight: 700;
            color: #8a6a3a;
            border: 1.5px solid rgba(255, 200, 50, 0.4);
            backdrop-filter: blur(4px);
            cursor: pointer;
            transition: all 0.2s;
        }
        .top-bar .coin-display:active {
            transform: scale(0.94);
        }
        .top-bar .coin-display .coin-icon {
            font-size: 20px;
        }
        /* 顶栏圆形图标按钮：历史入口与语言入口共用同一套外观（语言入口见 .lang-btn） */
        .top-bar .history-btn,
        .top-bar .lang-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.7);
            border: none;
            font-size: 22px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            transition: all 0.2s;
            color: #5a4a42;
            text-decoration: none;
        }
        .top-bar .history-btn:active,
        .top-bar .lang-btn:active {
            transform: scale(0.90);
            background: rgba(255, 255, 255, 0.9);
        }

        .home-hero {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 10px 0 20px;
            text-align: center;
            position: relative;
        }
        .home-hero .magic-icon {
            font-size: 90px;
            line-height: 1;
            margin-bottom: 6px;
            animation: floatY 3.5s ease-in-out infinite;
            filter: drop-shadow(0 12px 30px rgba(255, 150, 100, 0.25));
        }
        @keyframes floatY {
            0%,
            100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-12px);
            }
        }

        .home-hero h1 {
            font-size: 36px;
            font-weight: 800;
            color: #4a2e26;
            margin: 4px 0 2px;
            letter-spacing: 2px;
        }
        .home-hero h1 .highlight {
            background: linear-gradient(135deg, #f9a87b, #f57a5a);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .home-greeting {
            font-size: 16px;
            font-weight: 700;
            color: #f5634a;
            margin: 0 0 4px;
            letter-spacing: 0.5px;
        }
        .home-hero .sub {
            font-size: 16px;
            color: #8a7068;
            font-weight: 500;
            margin-bottom: 10px;
            letter-spacing: 0.5px;
        }
        .home-hero .sub em {
            font-style: normal;
            color: #e8856a;
        }

        .float-deco {
            position: absolute;
            pointer-events: none;
            font-size: 28px;
            opacity: 0.5;
            animation: floatAround 8s ease-in-out infinite;
        }
        .float-deco:nth-child(1) {
            top: 8%;
            left: 6%;
            animation-delay: 0s;
            font-size: 34px;
        }
        .float-deco:nth-child(2) {
            top: 15%;
            right: 8%;
            animation-delay: 1.5s;
            font-size: 28px;
        }
        .float-deco:nth-child(3) {
            bottom: 25%;
            left: 4%;
            animation-delay: 3s;
            font-size: 32px;
        }
        .float-deco:nth-child(4) {
            bottom: 30%;
            right: 5%;
            animation-delay: 4.5s;
            font-size: 26px;
        }
        .float-deco:nth-child(5) {
            top: 45%;
            left: 50%;
            animation-delay: 2s;
            font-size: 20px;
            opacity: 0.3;
        }
        @keyframes floatAround {
            0%,
            100% {
                transform: translate(0, 0) rotate(0deg);
            }
            25% {
                transform: translate(8px, -12px) rotate(6deg);
            }
            75% {
                transform: translate(-6px, 10px) rotate(-4deg);
            }
        }

        .btn-start {
            margin-top: 12px;
            padding: 18px 52px;
            background: linear-gradient(135deg, #ff8a6a, #f5634a);
            border: none;
            border-radius: 60px;
            font-size: 28px;
            font-weight: 700;
            color: #fff;
            box-shadow: 0 12px 35px rgba(245, 99, 74, 0.4);
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            display: inline-flex;
            align-items: center;
            gap: 14px;
            letter-spacing: 1.5px;
            position: relative;
            overflow: hidden;
        }
        .btn-start::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 60%);
            border-radius: 60px;
            pointer-events: none;
        }
        .btn-start:active {
            transform: scale(0.94);
            box-shadow: 0 6px 20px rgba(245, 99, 74, 0.3);
        }
        .btn-start .sparkle {
            font-size: 32px;
            animation: sparklePulse 1.8s ease-in-out infinite;
        }
        @keyframes sparklePulse {
            0%,
            100% {
                transform: scale(1) rotate(0deg);
            }
            50% {
                transform: scale(1.15) rotate(12deg);
            }
        }

        .home-tip {
            margin-top: 18px;
            font-size: 14px;
            color: #b0958a;
            background: rgba(255, 255, 255, 0.5);
            padding: 8px 20px;
            border-radius: 30px;
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .page-title {
            font-size: 26px;
            font-weight: 700;
            color: #4a2e26;
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .page-title .emoji-big {
            font-size: 32px;
        }
        .page-sub {
            font-size: 15px;
            color: #9a8078;
            margin-bottom: 18px;
            font-weight: 500;
        }

        /* 主题网格 */
        .theme-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            align-content: start;
        }
        .theme-card {
            background: rgba(255, 255, 255, 0.8);
            border-radius: 24px;
            padding: 20px 12px 16px;
            text-align: center;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
            border: 2px solid rgba(255, 255, 255, 0.6);
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            backdrop-filter: blur(4px);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            min-height: 120px;
            justify-content: center;
        }
        .theme-card:active {
            transform: scale(0.94);
            border-color: #f5a080;
            box-shadow: 0 8px 25px rgba(245, 99, 74, 0.15);
        }
        .theme-card .icon {
            font-size: 48px;
            line-height: 1.1;
        }
        .theme-card .label {
            font-size: 17px;
            font-weight: 700;
            color: #4a2e26;
        }
        .theme-card .desc {
            font-size: 12px;
            color: #b0958a;
            font-weight: 500;
        }
        .theme-card:nth-child(1) {
            background: linear-gradient(145deg, #fff5ee, #ffede6);
        }
        .theme-card:nth-child(2) {
            background: linear-gradient(145deg, #eef6ff, #e0edff);
        }
        .theme-card:nth-child(3) {
            background: linear-gradient(145deg, #eefff5, #ddf5ea);
        }
        .theme-card:nth-child(4) {
            background: linear-gradient(145deg, #fdf0ff, #f8e0ff);
        }

        /* 语音按钮（精简） */
        .voice-section {
            margin-top: 18px;
            padding: 10px 12px 16px;
            background: rgba(255, 255, 255, 0.5);
            backdrop-filter: blur(8px);
            border-radius: 28px;
            border: 2px dashed rgba(245, 99, 74, 0.2);
            display: flex;
            justify-content: center;
            align-items: center;
            transition: all 0.3s;
        }
        .voice-section.listening {
            border-color: #f5634a;
            background: rgba(255, 245, 240, 0.7);
            box-shadow: 0 0 0 4px rgba(245, 99, 74, 0.08);
        }
        .voice-btn {
            background: linear-gradient(135deg, #f9a87b, #f57a5a);
            border: none;
            border-radius: 60px;
            padding: 14px 34px;
            font-size: 22px;
            font-weight: 700;
            color: #fff;
            box-shadow: 0 6px 20px rgba(245, 99, 74, 0.25);
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 12px;
            width: 100%;
            justify-content: center;
        }
        .voice-btn:active {
            transform: scale(0.94);
        }
        .voice-btn .mic-icon {
            font-size: 30px;
        }

        /* 角色选择 */
        .char-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 14px;
            flex: 1;
            align-content: start;
        }
        .char-card {
            background: rgba(255, 255, 255, 0.75);
            border-radius: 24px;
            padding: 18px 8px 14px;
            text-align: center;
            border: 2.5px solid rgba(255, 255, 255, 0.5);
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            backdrop-filter: blur(4px);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            min-height: 100px;
            justify-content: center;
        }
        .char-card:active {
            transform: scale(0.93);
            border-color: #f5a080;
            background: rgba(255, 255, 255, 0.9);
        }
        .char-card .icon {
            font-size: 44px;
            line-height: 1.1;
        }
        .char-card .label {
            font-size: 15px;
            font-weight: 700;
            color: #4a2e26;
        }
        .char-card .sub-label {
            font-size: 11px;
            color: #b0958a;
        }
        /* 实际渲染使用的类名 */
        .char-card .emoji {
            font-size: 44px;
            line-height: 1.1;
        }
        .char-card .name {
            font-size: 15px;
            font-weight: 700;
            color: #4a2e26;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .char-card .sub {
            font-size: 11px;
            color: #b0958a;
        }

        /* AI 生成主角提示条 */
        .char-ai-tip {
            display: flex;
            align-items: center;
            gap: 6px;
            margin: 0 2px 12px;
            padding: 8px 12px;
            font-size: 12px;
            color: #a06a52;
            background: rgba(255, 255, 255, 0.7);
            border: 1.5px dashed rgba(245, 99, 74, 0.35);
            border-radius: 14px;
            line-height: 1.4;
        }
        .ai-spin {
            display: inline-block;
            animation: aiSpin 1.4s linear infinite;
        }
        @keyframes aiSpin {
            0% { transform: rotate(0deg) scale(1); }
            50% { transform: rotate(180deg) scale(1.15); }
            100% { transform: rotate(360deg) scale(1); }
        }

        /* 主角加载骨架屏 */
        .char-card.is-loading {
            cursor: default;
            pointer-events: none;
        }
        .char-card.is-loading .emoji {
            opacity: 0.35;
            animation: aiSpin 1.6s linear infinite;
        }
        .sk-line {
            display: block;
            width: 62%;
            height: 12px;
            border-radius: 6px;
            background: linear-gradient(90deg, #f1e6e1 25%, #faf3ef 37%, #f1e6e1 63%);
            background-size: 400% 100%;
            animation: skShimmer 1.3s ease infinite;
        }
        .sk-line.sk-short {
            width: 38%;
            height: 9px;
            margin-top: 2px;
        }
        @keyframes skShimmer {
            0% { background-position: 100% 50%; }
            100% { background-position: 0 50%; }
        }

        /* 换一批主角 */
        .char-more-wrap {
            display: flex;
            justify-content: center;
            padding: 10px 0 2px;
        }
        .btn-more-chars {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 9px 22px;
            font-size: 14px;
            font-weight: 700;
            color: #a06a52;
            background: rgba(255, 255, 255, 0.8);
            border: 2px solid rgba(245, 99, 74, 0.3);
            border-radius: 30px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-more-chars:active {
            transform: scale(0.93);
            border-color: #f5634a;
        }
        .btn-more-chars:disabled {
            opacity: 0.7;
            cursor: default;
            transform: none;
        }

        /* 生成中 */
        .gen-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 20px 0;
        }
        .gen-spinner {
            position: relative;
            width: 140px;
            height: 140px;
            margin-bottom: 28px;
        }
        .gen-spinner .ring {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 6px solid transparent;
            animation: spinRing 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
        }
        .gen-spinner .ring:nth-child(1) {
            border-top-color: #f5634a;
            animation-duration: 1.2s;
        }
        .gen-spinner .ring:nth-child(2) {
            border-right-color: #f9a87b;
            animation-duration: 1.8s;
            animation-delay: 0.2s;
            width: 80%;
            height: 80%;
            top: 10%;
            left: 10%;
        }
        .gen-spinner .ring:nth-child(3) {
            border-bottom-color: #ffd93d;
            animation-duration: 2.4s;
            animation-delay: 0.4s;
            width: 60%;
            height: 60%;
            top: 20%;
            left: 20%;
        }
        .gen-spinner .center-icon {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
            animation: pulseCenter 1.2s ease-in-out infinite;
        }
        @keyframes spinRing {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }
        @keyframes pulseCenter {
            0%,
            100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.08);
            }
        }

        .gen-title {
            font-size: 28px;
            font-weight: 700;
            color: #4a2e26;
            margin-bottom: 6px;
        }
        .gen-sub {
            font-size: 16px;
            color: #9a8078;
            font-weight: 500;
        }
        .gen-progress {
            margin-top: 24px;
            width: 200px;
            height: 8px;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 10px;
            overflow: hidden;
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
        }
        .gen-progress .bar {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #f9a87b, #f5634a, #f9a87b);
            background-size: 200% 100%;
            border-radius: 10px;
            animation: progressMove 2s ease-in-out infinite;
            transition: width 0.3s;
        }
        @keyframes progressMove {
            0% {
                background-position: 0% 0%;
            }
            100% {
                background-position: 200% 0%;
            }
        }

        .gen-tips {
            margin-top: 30px;
            font-size: 15px;
            color: #b0958a;
            background: rgba(255, 255, 255, 0.5);
            padding: 12px 24px;
            border-radius: 30px;
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .gen-tips .dots {
            display: inline-flex;
            gap: 4px;
        }
        .gen-tips .dots span {
            width: 6px;
            height: 6px;
            background: #b0958a;
            border-radius: 50%;
            animation: dotBounce 1.4s ease-in-out infinite;
        }
        .gen-tips .dots span:nth-child(2) {
            animation-delay: 0.2s;
        }
        .gen-tips .dots span:nth-child(3) {
            animation-delay: 0.4s;
        }
        @keyframes dotBounce {
            0%,
            80%,
            100% {
                transform: scale(0.6);
                opacity: 0.4;
            }
            40% {
                transform: scale(1.2);
                opacity: 1;
            }
        }

        /* 结果 */
        .result-video {
            width: 100%;
            aspect-ratio: 4/3;
            background: linear-gradient(145deg, #1a1a2e, #2d2d44);
            border-radius: 24px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
            position: relative;
            overflow: hidden;
            margin-bottom: 16px;
            border: 2px solid rgba(255, 255, 255, 0.2);
        }
        /* 降级详情页：进入即自动播放分镜，无需播放按钮/标签 */

        .result-title {
            font-size: 20px;
            font-weight: 700;
            color: #4a2e26;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        /* 标题行：故事名 + 右侧下载图标（不放大按钮，图标即可，点击打包全部季） */
        .result-subrow {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 14px;
        }
        .result-sub {
            font-size: 14px;
            color: #9a8078;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        /* 标题行右侧下载图标：暖色胶囊按钮 + 内联 SVG（不放大按钮，图标即可） */
        .result-dl {
            flex: 0 0 auto;
            width: 38px;
            height: 38px;
            padding: 0;
            border-radius: 12px;
            /* 暖色渐变呼应站点主色，白描边让它在任何背景上都清清楚楚 */
            background: linear-gradient(145deg, #ff8a6b 0%, #f5634a 55%, #e8543c 100%);
            border: 2px solid rgba(255, 255, 255, 0.9);
            color: #fff;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            /* 双层阴影：贴地感 + 主色光晕 */
            box-shadow: 0 2px 6px rgba(229, 84, 60, 0.28), 0 6px 14px rgba(229, 84, 60, 0.18);
            transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
            -webkit-tap-highlight-color: transparent;
            position: relative;
            overflow: hidden;
        }
        /* 图标本体：让 currentColor 生效，尺寸与视觉重量对齐 */
        .result-dl-icon {
            width: 21px;
            height: 21px;
            display: block;
        }
        .result-dl:active {
            transform: translateY(1px) scale(0.94);
            box-shadow: 0 1px 3px rgba(229, 84, 60, 0.3);
        }
        .result-dl:disabled {
            opacity: 0.55;
            cursor: default;
            box-shadow: none;
        }
        /* 打包中：箭头上下「吞吐」小动画，比整圈旋转更贴合"下载"语义 */
        .result-dl.busy .dl-arrow,
        .result-dl.busy .dl-head {
            animation: resultDlBob 0.9s ease-in-out infinite;
        }
        .result-dl.busy .dl-tray {
            animation: resultDlTray 0.9s ease-in-out infinite;
        }
        @keyframes resultDlBob {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(2px); }
        }
        @keyframes resultDlTray {
            0%, 100% { opacity: 1; transform: translateY(0); }
            50% { opacity: 0.6; transform: translateY(1px); }
        }

        .result-actions {
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
            /* 操作区常驻页面底部（.result-actions 是 #pageResult 的最后一个 flex 子项，
               且 #pageResult 不再整体滚动、只有 .scene-list 内部滚动 → 无空位） */
            flex: 0 0 auto;
            z-index: 20;
            /* 抵消 .page 的左右内边距，让背景条铺满宽度、更贴底 */
            margin-left: -20px;
            margin-right: -20px;
            width: calc(100% + 40px);
            padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
            background: linear-gradient(180deg, rgba(255, 244, 230, 0.75), rgba(255, 244, 230, 0.98) 42%, #fff4e6);
            border-top: 1px solid rgba(214, 186, 168, 0.35);
            box-shadow: 0 -6px 18px rgba(150, 120, 100, 0.08);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }
        /* 详情页：页面本身不滚动，改为「内容区内部滚动 + 操作区常驻底部」，
           保证「生成动画片 / 再来一个」按钮始终贴住底部，任何内容长度都无空位 */
        #pageResult {
            overflow: hidden;
            padding-bottom: 0; /* 底部留白交给常驻操作区，避免出现空位 */
        }
        #pageResult .result-body {
            flex: 1 1 auto;
            min-height: 0; /* flex 子项内部滚动的前提 */
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 4px;
        }
        .result-actions .result-cost {
            flex-basis: 100%;
            text-align: center;
            font-size: 13px;
            color: #b0958a;
            margin-top: 2px;
        }
        .result-actions .btn-animate {
            padding: 14px 32px;
            font-size: 20px;
            border-radius: 60px;
            min-width: 170px;
            background: linear-gradient(135deg, #7c6cff, #5a8bff);
            border: none;
            box-shadow: 0 8px 28px rgba(90, 139, 255, 0.35);
            color: #fff;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            letter-spacing: 1px;
        }
        .result-actions .btn-animate:active {
            transform: scale(0.94);
            box-shadow: 0 4px 16px rgba(90, 139, 255, 0.25);
        }
        .result-actions .btn-animate:disabled {
            opacity: 0.75;
            cursor: default;
            animation: btnAnimatePulse 1.6s ease-in-out infinite;
        }
        @keyframes btnAnimatePulse {
            0%, 100% { box-shadow: 0 8px 28px rgba(90, 139, 255, 0.35); }
            50% { box-shadow: 0 8px 34px rgba(90, 139, 255, 0.6); }
        }
        .result-actions .btn-animate .icon {
            font-size: 24px;
            line-height: 1;
        }
        /* 抽同款盲盒按钮（他人已解锁作品详情页）：暖金色系，带惊喜感 */
        .result-actions .btn-remake {
            padding: 14px 32px;
            font-size: 20px;
            border-radius: 60px;
            min-width: 170px;
            background: linear-gradient(135deg, #ff9f43, #ff6b6b);
            border: none;
            box-shadow: 0 8px 28px rgba(255, 159, 67, 0.4);
            color: #fff;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            letter-spacing: 1px;
        }
        .result-actions .btn-remake:active {
            transform: scale(0.94);
            box-shadow: 0 4px 16px rgba(255, 159, 67, 0.3);
        }
        .result-actions .btn-remake:disabled {
            opacity: 0.75;
            cursor: default;
            animation: btnRemakePulse 1.6s ease-in-out infinite;
        }
        @keyframes btnRemakePulse {
            0%, 100% { box-shadow: 0 8px 28px rgba(255, 159, 67, 0.4); }
            50% { box-shadow: 0 8px 34px rgba(255, 159, 67, 0.65); }
        }
        .result-actions .btn-remake .icon {
            font-size: 24px;
            line-height: 1;
        }
        /* 续写下一季（作者本人的已完结作品）：青绿色系，与「生成动画片」区分 */
        .result-actions .btn-season {
            padding: 14px 32px;
            font-size: 20px;
            border-radius: 60px;
            min-width: 170px;
            background: linear-gradient(135deg, #17b978, #0fa);
            background: linear-gradient(135deg, #17b978, #0ea5a5);
            border: none;
            box-shadow: 0 8px 28px rgba(23, 185, 120, 0.35);
            color: #fff;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            letter-spacing: 1px;
        }
        .result-actions .btn-season:active {
            transform: scale(0.94);
            box-shadow: 0 4px 16px rgba(23, 185, 120, 0.25);
        }
        .result-actions .btn-season:disabled {
            opacity: 0.75;
            cursor: default;
            animation: btnSeasonPulse 1.6s ease-in-out infinite;
        }
        @keyframes btnSeasonPulse {
            0%, 100% { box-shadow: 0 8px 28px rgba(23, 185, 120, 0.35); }
            50% { box-shadow: 0 8px 34px rgba(23, 185, 120, 0.6); }
        }
        .result-actions .btn-season .icon { font-size: 24px; line-height: 1; }

        /* 一键下载全部季视频（仅多季且已有视频时出现） */
        .result-actions .btn-download {
            padding: 14px 26px;
            font-size: 17px;
            border-radius: 60px;
            background: #fff;
            border: 2px solid #d9c7b8;
            color: #6b4a3e;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.2s;
        }
        .result-actions .btn-download:active { transform: scale(0.94); }
        .result-actions .btn-download:disabled { opacity: 0.6; cursor: default; }
        .result-actions .btn-download .icon { font-size: 20px; line-height: 1; }

        /* 按季切换 Tab：横向可滑动的季号胶囊 */
        .season-tabs {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding: 10px 2px 12px;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .season-tabs::-webkit-scrollbar { display: none; }
        .season-tabs .season-tab {
            flex: 0 0 auto;
            padding: 7px 16px;
            border-radius: 40px;
            border: 2px solid #e3d4c8;
            background: #fff;
            color: #8a6a5c;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .season-tabs .season-tab.active {
            background: linear-gradient(135deg, #17b978, #0ea5a5);
            border-color: transparent;
            color: #fff;
            box-shadow: 0 4px 14px rgba(23, 185, 120, 0.35);
        }
        .season-tabs .season-tab.busy::after {
            content: '⏳';
            margin-left: 5px;
            font-size: 12px;
        }
        .season-tabs .season-tab.busy {
            border-color: #b8e6d4;
            color: #0e9c86;
            background: #f1fbf8;
        }

        /* 详情页「创作中」提示（续集/动画片生成中显示） */
        .season-creating {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin: 4px 0 10px;
            padding: 10px 14px;
            border-radius: 14px;
            background: linear-gradient(135deg, #f1fbf8, #fff7ec);
            border: 1px solid #e3d4c8;
            color: #0e9c86;
            font-size: 14px;
            font-weight: 700;
        }
        .season-creating .ai-spin { animation: spin 1s linear infinite; display: inline-block; }
        @keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

        /* 系列角色档案入口（本人作品详情页，紧邻集切换） */
        .profile-entry {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            margin: 10px 2px 0;
            padding: 7px 15px;
            border-radius: 40px;
            border: 2px dashed #d9b98a;
            background: linear-gradient(135deg, #fff9ef, #fdf3ff);
            color: #a3673a;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
        }
        .profile-entry:active { transform: scale(0.96); }

        /* 系列角色档案编辑弹窗 */
        .sp-tip {
            margin-bottom: 12px;
            padding: 9px 12px;
            border-radius: 12px;
            background: #f1fbf8;
            border: 1px solid #d7efe6;
            color: #0e9c86;
            font-size: 13px;
            line-height: 1.5;
        }
        .sp-field { margin-bottom: 16px; }
        .sp-label {
            margin-bottom: 7px;
            font-size: 14px;
            font-weight: 700;
            color: #6b5140;
        }
        .sp-input,
        .sp-textarea {
            width: 100%;
            box-sizing: border-box;
            padding: 10px 12px;
            border: 2px solid #e3d4c8;
            border-radius: 12px;
            background: #fff;
            color: #4a3a2f;
            font-size: 14px;
            font-family: inherit;
            outline: none;
        }
        .sp-input:focus,
        .sp-textarea:focus { border-color: #17b978; }
        .sp-textarea { resize: vertical; line-height: 1.6; }
        .sp-char {
            margin-bottom: 10px;
            padding: 12px;
            border: 2px solid #ede0d4;
            border-radius: 14px;
            background: #fffdfa;
        }
        .sp-char.lead { border-color: #c9ead9; background: #f8fffc; }
        .sp-char-head {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 9px;
            font-size: 13px;
            font-weight: 700;
            color: #8a6a5c;
        }
        .sp-char-head .sp-tag {
            padding: 2px 8px;
            border-radius: 20px;
            background: #17b978;
            color: #fff;
            font-size: 11px;
        }
        .sp-char-head .sp-del {
            margin-left: auto;
            padding: 3px 10px;
            border: none;
            border-radius: 20px;
            background: #ffe9e9;
            color: #d9534f;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
        }
        .sp-row { display: flex; gap: 8px; margin-bottom: 8px; }
        .sp-row .sp-input { flex: 1; }
        .sp-row .sp-emoji { flex: 0 0 62px; text-align: center; }
        .sp-hint { font-size: 12px; color: #a89283; margin-top: -3px; }
        /* 角色卡主体：左形象图 + 右文字字段 */
        .sp-char-body { display: flex; gap: 10px; align-items: flex-start; }
        .sp-char-fields { flex: 1; min-width: 0; }
        .sp-art {
            position: relative;
            flex: 0 0 84px;
            width: 84px;
            height: 112px;
            border-radius: 12px;
            overflow: hidden;
            background: #f6f1ea;
            border: 1px solid #eadfd2;
        }
        .sp-art-img { width: 100%; height: 100%; object-fit: cover; display: block; }
        .sp-art-ops {
            position: absolute;
            left: 0; right: 0; bottom: 0;
            display: flex;
            gap: 4px;
            padding: 4px;
            background: rgba(0, 0, 0, 0.45);
        }
        .sp-art-btn {
            flex: 1;
            padding: 3px 0;
            border: 0;
            border-radius: 7px;
            background: rgba(255, 255, 255, 0.9);
            color: #6b4a3e;
            font-size: 11px;
            font-weight: 700;
            text-align: center;
            cursor: pointer;
        }
        .sp-art-btn.danger { color: #c0392b; }
        .sp-art-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            border-style: dashed;
            border-color: #cfb79a;
            cursor: pointer;
        }
        .sp-art-ph { font-size: 22px; }
        .sp-art-ph-tip { font-size: 10px; line-height: 1.3; color: #a89283; text-align: center; }
        .sp-art-src {
            display: inline-block;
            margin-bottom: 6px;
            padding: 1px 7px;
            border-radius: 8px;
            background: #f0eae2;
            color: #a89283;
            font-size: 11px;
        }
        .sp-add {
            width: 100%;
            padding: 10px;
            border: 2px dashed #cfb79a;
            border-radius: 12px;
            background: #fff;
            color: #a3673a;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
        }

        /* 盲盒分镜二创编辑弹窗 */
        .rm-toolbar {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            text-align: left;
            margin: 10px 2px 6px;
        }
        .rm-toolbar .rm-toolbar-title {
            font-size: 14px;
            font-weight: 700;
            color: #6b4a3e;
        }
        .rm-toolbar .rm-toolbar-tip {
            font-size: 11px;
            color: #b09488;
        }
        .rm-scene-list {
            max-height: 42vh;
            overflow-y: auto;
            padding: 4px 2px;
            text-align: left;
        }
        .rm-scene {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 8px 6px;
            border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
            transition: opacity 0.2s ease, transform 0.2s ease;
        }
        .rm-scene:last-child { border-bottom: none; }
        .rm-scene.removing {
            opacity: 0;
            transform: translateX(24px) scale(0.96);
        }
        .rm-scene .rm-emoji { font-size: 20px; line-height: 1.3; flex: none; margin-top: 4px; }
        .rm-scene .rm-main { flex: 1; min-width: 0; }
        .rm-scene .rm-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 5px;
        }
        .rm-scene .rm-index {
            font-size: 11px;
            font-weight: 700;
            color: #9a8078;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 10px;
            padding: 3px 8px;
            white-space: nowrap;
        }
        .rm-scene .rm-del {
            flex: none;
            border: none;
            background: transparent;
            color: #cf9b8a;
            font-size: 11px;
            font-weight: 600;
            padding: 3px 8px;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .rm-scene .rm-del:active {
            background: rgba(255, 107, 107, 0.12);
            color: #e25555;
            transform: scale(0.92);
        }
        .rm-scene .rm-text {
            display: block;
            width: 100%;
            box-sizing: border-box;
            border: 1.5px solid rgba(0, 0, 0, 0.08);
            border-radius: 12px;
            padding: 8px 10px;
            font-size: 13px;
            line-height: 1.5;
            color: #4a2e26;
            background: rgba(255, 255, 255, 0.9);
            resize: none;
            font-family: inherit;
        }
        .rm-scene .rm-text:focus {
            outline: none;
            border-color: #ff9f43;
            box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.15);
        }
        /* 参考文件上传区 */
        .rm-ref-area {
            margin-top: 12px;
            padding: 10px 12px;
            background: rgba(255, 159, 67, 0.07);
            border: 1px dashed rgba(255, 159, 67, 0.45);
            border-radius: 14px;
            text-align: left;
        }
        .rm-ref-area .rm-ref-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            margin-bottom: 8px;
        }
        .rm-ref-area .rm-ref-title {
            font-size: 13px;
            font-weight: 700;
            color: #b06a2a;
        }
        .rm-ref-area .rm-ref-tip {
            font-size: 11px;
            color: #c09a76;
        }
        .rm-ref-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .rm-ref-grid:not(:empty) { margin-bottom: 8px; }
        .rm-ref {
            position: relative;
            width: 64px;
            height: 64px;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            animation: rmRefIn 0.25s ease;
        }
        @keyframes rmRefIn {
            from { opacity: 0; transform: scale(0.7); }
            to { opacity: 1; transform: scale(1); }
        }
        .rm-ref .rm-ref-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .rm-ref .rm-ref-badge {
            position: absolute;
            left: 0;
            bottom: 0;
            right: 0;
            font-size: 9px;
            font-weight: 700;
            color: #fff;
            background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
            padding: 8px 4px 2px;
            text-align: center;
        }
        .rm-ref .rm-ref-mask {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }
        .rm-ref .rm-ref-del {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 20px;
            height: 20px;
            border: none;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.55);
            color: #fff;
            font-size: 10px;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }
        .rm-ref-add {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            width: 100%;
            padding: 10px;
            border: 1.5px dashed rgba(255, 159, 67, 0.55);
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.6);
            color: #b06a2a;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.15s ease;
            font-family: inherit;
        }
        .rm-ref-add:active {
            background: rgba(255, 159, 67, 0.14);
            transform: scale(0.98);
        }
        /* 弹窗内的盲盒提交按钮 */
        .modal-sheet .btn-remake-submit {
            display: block;
            width: 100%;
            padding: 14px;
            font-size: 18px;
            font-weight: 700;
            color: #fff;
            background: linear-gradient(135deg, #ff9f43, #ff6b6b);
            border: none;
            border-radius: 50px;
            box-shadow: 0 8px 24px rgba(255, 159, 67, 0.4);
            cursor: pointer;
            margin-top: 14px;
            letter-spacing: 1px;
        }
        .modal-sheet .btn-remake-submit:disabled {
            opacity: 0.7;
            cursor: default;
        }
        .modal-sheet .btn-remake-submit + .close-btn {
            margin-top: 10px;
            background: transparent;
            color: #9a8078;
            box-shadow: none;
        }
        .result-actions .btn-again {
            padding: 16px 56px;
            font-size: 22px;
            border-radius: 60px;
            flex-direction: row;
            gap: 14px;
            min-width: 200px;
            background: linear-gradient(135deg, #ff8a6a, #f5634a);
            border: none;
            box-shadow: 0 8px 28px rgba(245, 99, 74, 0.35);
            color: #fff;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            letter-spacing: 1px;
        }
        .result-actions .btn-again:active {
            transform: scale(0.94);
            box-shadow: 0 4px 16px rgba(245, 99, 74, 0.25);
        }
        .result-actions .btn-again .icon {
            font-size: 28px;
            line-height: 1;
        }
        /* 朗读故事按钮（次级绿色系，与生成/再来一个区分） */
        .result-actions .btn-narrate {
            padding: 14px 30px;
            font-size: 19px;
            border-radius: 60px;
            min-width: 150px;
            background: linear-gradient(135deg, #43c9a0, #2fa8d8);
            border: none;
            box-shadow: 0 8px 28px rgba(47, 168, 216, 0.32);
            color: #fff;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            letter-spacing: 1px;
        }
        .result-actions .btn-narrate:active {
            transform: scale(0.94);
            box-shadow: 0 4px 16px rgba(47, 168, 216, 0.25);
        }
        .result-actions .btn-narrate .icon {
            font-size: 22px;
            line-height: 1;
        }

        /* 历史记录页 */
        .history-list {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding-bottom: 10px;
        }
        .history-item {
            background: rgba(255, 255, 255, 0.75);
            border-radius: 20px;
            padding: 14px 18px;
            border: 1.5px solid rgba(255, 255, 255, 0.4);
            backdrop-filter: blur(4px);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .history-item .icon {
            font-size: 32px;
            flex-shrink: 0;
        }
        .history-item .info {
            flex: 1;
            min-width: 0;
        }
        .history-item .info .title {
            font-size: 17px;
            font-weight: 700;
            color: #4a2e26;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .history-item .info .meta {
            font-size: 13px;
            color: #9a8078;
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }
        .history-item .info .meta span {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .history-empty {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #b0958a;
            font-size: 18px;
            gap: 12px;
        }
        .history-empty .big {
            font-size: 64px;
        }

        /* 注册档案弹窗（.auth-sheet 为登录/注册账号弹窗，共用同套表单样式） */
        .register-sheet .reg-field, .auth-sheet .reg-field {
            text-align: left;
            margin: 14px 20px 0;
        }
        .register-sheet .reg-field label, .auth-sheet .reg-field label {
            display: block;
            font-size: 14px;
            font-weight: 600;
            color: #4a2e26;
            margin-bottom: 7px;
        }
        .register-sheet .reg-field .reg-hint, .auth-sheet .reg-field .reg-hint {
            font-size: 12px;
            font-weight: 400;
            color: #b0958a;
        }
        .register-sheet .reg-field input, .auth-sheet .reg-field input {
            width: 100%;
            box-sizing: border-box;
            padding: 12px 14px;
            border-radius: 16px;
            border: 1.5px solid #f0dcd2;
            background: #fffaf7;
            font-size: 16px;
            color: #4a2e26;
            outline: none;
            transition: border-color 0.2s;
            font-family: inherit;
        }
        .register-sheet .reg-field input:focus, .auth-sheet .reg-field input:focus {
            border-color: #f5634a;
            background: #fff;
        }
        /* 全年龄段年龄输入 */
        .register-sheet .reg-age-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .register-sheet .reg-step {
            flex: 0 0 auto;
            width: 44px;
            height: 46px;
            border-radius: 16px;
            border: 1.5px solid #f0dcd2;
            background: #fffaf7;
            color: #f5634a;
            font-size: 24px;
            font-weight: 700;
            line-height: 1;
            cursor: pointer;
            transition: all 0.18s;
        }
        .register-sheet .reg-step:active {
            transform: scale(0.94);
            background: #fff1eb;
        }
        .register-sheet .reg-age-input {
            flex: 1 1 auto;
            text-align: center;
            font-size: 22px !important;
            font-weight: 700;
            letter-spacing: 1px;
        }
        .register-sheet .reg-unit {
            flex: 0 0 auto;
            font-size: 15px;
            color: #8a6a60;
            font-weight: 600;
        }
        .register-sheet .reg-age-tabs {
            display: flex;
            gap: 8px;
            margin-top: 10px;
            flex-wrap: wrap;
        }
        .register-sheet .reg-tab {
            flex: 1 1 auto;
            padding: 8px 4px;
            border-radius: 14px;
            border: 1.5px solid #f0dcd2;
            background: #fffaf7;
            color: #8a6a60;
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.18s;
            white-space: nowrap;
        }
        .register-sheet .reg-tab.active {
            border-color: #f5634a;
            background: #fff1eb;
            color: #f5634a;
        }
        .register-sheet .reg-more {
            margin-top: 10px;
            text-align: center;
        }
        .register-sheet .reg-toggle {
            display: inline-block;
            font-size: 13px;
            color: #b0958a;
            cursor: pointer;
            padding: 4px 2px;
            border-bottom: 1px dashed #e2cfc6;
        }
        .register-sheet .reg-birth-wrap {
            margin-top: 10px;
            padding: 12px;
            border-radius: 16px;
            background: #fff6f2;
            border: 1px dashed #f0dcd2;
        }
        .register-sheet .reg-birth-year {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 10px;
        }
        .register-sheet .reg-birth-year .reg-hint {
            flex: 0 0 auto;
        }
        .register-sheet .reg-year-input {
            flex: 1 1 auto;
            padding: 10px 12px !important;
            font-size: 15px !important;
        }

        /* 登录 / 注册弹窗（账号体系） */
        .auth-sheet .auth-tabs {
            display: flex;
            gap: 8px;
            margin: 14px 20px 4px;
            background: #fff2ec;
            border-radius: 16px;
            padding: 4px;
        }
        .auth-sheet .auth-tab {
            flex: 1;
            padding: 10px 0;
            border: none;
            border-radius: 13px;
            background: transparent;
            color: #8a6a60;
            font-size: 15px;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }
        .auth-sheet .auth-tab.active {
            background: #fff;
            color: #f5634a;
            box-shadow: 0 2px 8px rgba(245, 99, 74, 0.18);
        }

        /* 我的页账号区 */
        .me-account {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 14px 16px 0;
            padding: 13px 14px;
            border-radius: 18px;
            background: #fff7f3;
            border: 1.5px dashed #f5d5c8;
            cursor: pointer;
            transition: all 0.2s;
        }
        .me-account:active {
            transform: scale(0.98);
            background: #fff1eb;
        }
        .me-account .ma-icon {
            font-size: 24px;
        }
        .me-account .ma-text {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }
        .me-account .ma-title {
            font-size: 15px;
            font-weight: 700;
            color: #4a2e26;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .me-account .ma-sub {
            font-size: 12px;
            color: #b0958a;
        }

        .register-sheet .reg-error, .auth-sheet .reg-error {
            color: #e5484d;
            font-size: 13px;
            margin: 10px 20px 0;
        }
        .register-sheet .btn-register, .auth-sheet .btn-register {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: calc(100% - 40px);
            margin: 18px auto 10px;
            padding: 15px 0;
            border: none;
            border-radius: 50px;
            background: linear-gradient(135deg, #ff8a6a, #f5634a);
            color: #fff;
            font-size: 19px;
            font-weight: 700;
            letter-spacing: 1px;
            cursor: pointer;
            box-shadow: 0 8px 24px rgba(245, 99, 74, 0.35);
            transition: all 0.25s;
        }
        .register-sheet .btn-register:active, .auth-sheet .btn-register:active {
            transform: scale(0.97);
        }
        .register-sheet .btn-register:disabled, .auth-sheet .btn-register:disabled {
            opacity: 0.75;
        }
        .register-sheet .btn-register .icon, .auth-sheet .btn-register .icon {
            font-size: 22px;
        }

        /* 定制音色弹窗（声音克隆） */
        .voice-sheet .voice-sample-label {
            text-align: left;
            margin: 14px 20px 6px;
            font-size: 13px;
            font-weight: 600;
            color: #8a6f64;
        }
        .voice-sheet .voice-sample-text {
            margin: 0 20px;
            padding: 12px 14px;
            background: #fff7f3;
            border: 1.5px dashed #f6c8ba;
            border-radius: 14px;
            font-size: 15px;
            line-height: 1.7;
            color: #4a2e26;
            text-align: justify;
        }
        .voice-sheet .voice-rec-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin: 16px 20px 0;
        }
        .voice-sheet .voice-rec-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 22px;
            border: none;
            border-radius: 50px;
            background: linear-gradient(135deg, #7c5cff, #5a8dff);
            color: #fff;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 6px 18px rgba(90, 141, 255, 0.3);
            transition: all 0.25s;
            font-family: inherit;
        }
        .voice-sheet .voice-rec-btn:active {
            transform: scale(0.96);
        }
        .voice-sheet .voice-rec-time {
            font-size: 20px;
            font-weight: 800;
            color: #f5634a;
            font-variant-numeric: tabular-nums;
            min-width: 58px;
            text-align: left;
        }
        .voice-sheet .voice-rec-hint {
            margin: 10px 20px 0;
            font-size: 13px;
            color: #b0958a;
            text-align: center;
        }
        .voice-sheet .voice-rec-actions {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin: 12px 20px 0;
        }
        .voice-sheet .voice-mini-btn {
            padding: 10px 18px;
            border: none;
            border-radius: 50px;
            background: #fff1ea;
            color: #f5634a;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            font-family: inherit;
        }
        .voice-sheet .voice-mini-btn:active {
            transform: scale(0.96);
        }
        .voice-sheet .voice-mini-btn.ghost {
            background: #f4f1ef;
            color: #8a6f64;
        }
        .voice-sheet .voice-mini-btn.wide {
            display: block;
            width: calc(100% - 40px);
            margin: 14px auto 0;
            padding: 13px 0;
            font-size: 15px;
        }
        .voice-sheet .btn-clone {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: calc(100% - 40px);
            margin: 16px auto 4px;
            padding: 15px 0;
            border: none;
            border-radius: 50px;
            background: linear-gradient(135deg, #ff8a6a, #f5634a);
            color: #fff;
            font-size: 18px;
            font-weight: 700;
            letter-spacing: 1px;
            cursor: pointer;
            box-shadow: 0 8px 24px rgba(245, 99, 74, 0.35);
            transition: all 0.25s;
            font-family: inherit;
        }
        .voice-sheet .btn-clone:active {
            transform: scale(0.97);
        }
        .voice-sheet .btn-clone:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            box-shadow: none;
        }
        .voice-sheet .btn-clone.ghost {
            background: #fff;
            color: #f5634a;
            border: 1.5px solid #f6c8ba;
            box-shadow: none;
            font-size: 15px;
        }
        .voice-sheet .voice-card {
            display: flex;
            align-items: center;
            gap: 14px;
            margin: 14px 20px 0;
            padding: 16px;
            background: linear-gradient(135deg, #fff3ec, #ffe9f2);
            border: 1.5px solid #ffd9c9;
            border-radius: 18px;
            text-align: left;
        }
        .voice-sheet .voice-card-emoji {
            font-size: 34px;
        }
        .voice-sheet .voice-card-name {
            font-size: 17px;
            font-weight: 800;
            color: #4a2e26;
        }
        .voice-sheet .voice-card-sub {
            font-size: 13px;
            color: #b0958a;
            margin-top: 3px;
        }

        /* 充值相关 */
        .recharge-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 4px 0;
        }
        .recharge-balance {
            background: linear-gradient(135deg, #fff5e6, #ffede0);
            border-radius: 24px;
            padding: 18px 22px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            border: 1.5px solid rgba(255, 200, 150, 0.3);
        }
        .recharge-balance .left {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .recharge-balance .left .big-coin {
            font-size: 38px;
        }
        .recharge-balance .left .info .label {
            font-size: 14px;
            color: #8a7068;
            font-weight: 500;
        }
        .recharge-balance .left .info .count {
            font-size: 28px;
            font-weight: 800;
            color: #4a2e26;
        }
        .recharge-balance .badge {
            background: #f5634a;
            color: #fff;
            padding: 4px 16px;
            border-radius: 30px;
            font-size: 13px;
            font-weight: 700;
        }

        .recharge-plans {
            display: flex;
            flex-direction: column;
            gap: 12px;
            flex: 1;
        }
        .plan-item {
            background: rgba(255, 255, 255, 0.7);
            border-radius: 20px;
            padding: 14px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border: 2px solid rgba(255, 255, 255, 0.4);
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
            backdrop-filter: blur(4px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
        }
        .plan-item:active {
            transform: scale(0.96);
        }
        .plan-item .plan-info {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .plan-item .plan-info .emoji {
            font-size: 32px;
        }
        .plan-item .plan-info .detail .name {
            font-size: 17px;
            font-weight: 700;
            color: #4a2e26;
        }
        .plan-item .plan-info .detail .desc {
            font-size: 13px;
            color: #9a8078;
        }
        .plan-item .plan-price {
            font-size: 20px;
            font-weight: 800;
            color: #f5634a;
        }
        .plan-item .plan-price .unit {
            font-size: 13px;
            font-weight: 500;
            color: #b0958a;
        }
        .plan-item.popular {
            border-color: #f9a87b;
            background: linear-gradient(135deg, rgba(255, 245, 235, 0.9), rgba(255, 235, 220, 0.9));
            box-shadow: 0 4px 16px rgba(245, 99, 74, 0.08);
        }

        .recharge-footer {
            margin-top: 16px;
            text-align: center;
            font-size: 13px;
            color: #b0958a;
            padding: 4px;
        }

        /* ===== 「我的」页会员身份卡 ===== */
        .me-member {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 12px 0 4px;
            padding: 12px 14px;
            border-radius: 14px;
            background: linear-gradient(135deg, #fdf3ff, #f0e8ff 55%, #ffeef6);
            border: 1.5px solid #d9c2ff;
            cursor: pointer;
            transition: transform 0.2s;
        }
        .me-member:active { transform: scale(0.98); }
        .me-member .mm-badge {
            flex: 0 0 auto;
            padding: 3px 11px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
            color: #7a5c2e;
            background: #f0e2c8;
        }
        .me-member .mm-badge.pro {
            color: #fff;
            background: linear-gradient(135deg, #7c6cff, #b46cff);
        }
        .me-member .mm-desc {
            flex: 1 1 auto;
            min-width: 0;
            font-size: 12.5px;
            color: #6b5a52;
            line-height: 1.4;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        .me-member .mm-go {
            flex: 0 0 auto;
            font-size: 13px;
            font-weight: 700;
            color: #7c6cff;
        }

        /* ===== 会员专区（专业版，后台可整体关闭） ===== */
        .member-block {
            margin-top: 18px;
            padding: 16px;
            border-radius: 16px;
            background: linear-gradient(145deg, #fdf3ff, #f0e8ff 60%, #ffeef6);
            border: 1.5px solid #d9c2ff;
            box-shadow: 0 6px 20px rgba(124, 108, 255, 0.12);
        }
        .member-block .offline-title {
            font-size: 15px;
            font-weight: 700;
            color: #4a2e26;
            margin-bottom: 10px;
        }
        .member-card-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
        }
        .member-badge {
            display: inline-flex;
            align-items: center;
            padding: 3px 12px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 700;
            color: #7a5c2e;
            background: #f0e2c8;
        }
        .member-badge.pro {
            color: #fff;
            background: linear-gradient(135deg, #7c6cff, #b46cff);
            box-shadow: 0 3px 10px rgba(124, 108, 255, 0.4);
        }
        .member-expire {
            font-size: 12px;
            color: #9a8078;
        }
        .member-expire.warn { color: #e0703c; font-weight: 600; }
        .member-perks {
            display: flex;
            flex-direction: column;
            gap: 5px;
            margin-bottom: 12px;
        }
        .member-perk {
            display: flex;
            align-items: center;
            gap: 7px;
            font-size: 13px;
            color: #6b5a52;
            line-height: 1.4;
        }
        .member-perk .pi { font-size: 14px; }
        .member-price-row {
            display: flex;
            align-items: baseline;
            gap: 6px;
            margin-bottom: 10px;
        }
        .member-price {
            font-size: 24px;
            font-weight: 800;
            color: #f5634a;
        }
        .member-days { font-size: 13px; color: #9a8078; }
        .member-buy {
            width: 100%;
            padding: 13px;
            border: none;
            border-radius: 14px;
            font-size: 16px;
            font-weight: 700;
            color: #fff;
            cursor: pointer;
            background: linear-gradient(135deg, #7c6cff, #b46cff);
            box-shadow: 0 6px 18px rgba(124, 108, 255, 0.35);
            transition: all 0.2s;
        }
        .member-buy:active { transform: scale(0.97); }
        .member-buy:disabled { opacity: 0.6; cursor: default; }
        .member-tips {
            margin-top: 10px;
            font-size: 12px;
            line-height: 1.5;
            color: #9a8078;
            white-space: pre-wrap;
        }

        /* ===== 线下充值：提交金额（后台审核到账） ===== */
        .recharge-offline {
            margin-top: 18px;
            padding: 16px;
            border-radius: 16px;
            background: linear-gradient(145deg, #fffaf4, #fff2e6);
            border: 1.5px dashed #ffcfa8;
        }

        .recharge-offline .offline-title {
            font-size: 15px;
            font-weight: 700;
            color: #4a2e26;
            margin-bottom: 6px;
        }

        .recharge-offline .offline-tip {
            font-size: 12.5px;
            color: #a8846f;
            margin-bottom: 12px;
            line-height: 1.5;
        }

        /* ===== 充值套餐卡片（三档快捷选择） ===== */
        .plan-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }

        .plan-card {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: 12px 4px 10px;
            border-radius: 14px;
            background: #fff;
            border: 1.5px solid #ffe0c2;
            cursor: pointer;
            transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
            -webkit-tap-highlight-color: transparent;
        }

        .plan-card:active {
            transform: scale(.96);
        }

        .plan-card.selected {
            border-color: #f5634a;
            box-shadow: 0 4px 14px rgba(245, 99, 74, .18);
            background: linear-gradient(160deg, #fff7f2, #ffece4);
        }

        .plan-card.popular {
            border-color: #ffbd59;
            background: linear-gradient(160deg, #fffcf3, #fff4e0);
        }

        .plan-card .plan-tag {
            position: absolute;
            top: -8px;
            right: 6px;
            font-size: 10px;
            font-weight: 700;
            color: #fff;
            background: linear-gradient(135deg, #ff9a3d, #f5634a);
            padding: 2px 7px;
            border-radius: 8px;
            box-shadow: 0 2px 6px rgba(245, 99, 74, .3);
        }

        .plan-card .plan-emoji {
            font-size: 20px;
            line-height: 1.2;
        }

        .plan-card .plan-credits {
            font-size: 13px;
            font-weight: 700;
            color: #4a2e26;
        }

        .plan-card .plan-price {
            font-size: 15px;
            font-weight: 800;
            color: #f5634a;
        }

        .plan-card .plan-desc {
            font-size: 10.5px;
            color: #a8846f;
            line-height: 1.3;
        }

        .recharge-offline .offline-row {
            display: flex;
            align-items: center;
            gap: 8px;
            background: #fff;
            border: 1.5px solid #ffe0c2;
            border-radius: 12px;
            padding: 0 14px;
        }

        .recharge-offline .offline-cny {
            font-size: 20px;
            font-weight: 800;
            color: #f5634a;
        }

        .recharge-offline .offline-input {
            flex: 1;
            border: 0;
            outline: 0;
            background: transparent;
            padding: 13px 0;
            font-size: 17px;
            font-weight: 600;
            color: #4a2e26;
            min-width: 0;
        }

        .recharge-offline .offline-input::placeholder {
            font-weight: 400;
            font-size: 14px;
            color: #c7b3a6;
        }

        /* 去掉数字输入的上下箭头（视觉更干净） */
        .recharge-offline .offline-input::-webkit-outer-spin-button,
        .recharge-offline .offline-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .recharge-offline .offline-est {
            margin: 10px 2px 0;
            font-size: 12.5px;
            color: #b0958a;
        }

        .recharge-offline .offline-est.ok {
            color: #f5634a;
            font-weight: 600;
        }

        .recharge-offline .offline-btn {
            width: 100%;
            margin-top: 12px;
            padding: 13px 0;
            border: 0;
            border-radius: 12px;
            background: linear-gradient(135deg, #ffb26b, #f5634a);
            color: #fff;
            font-size: 15.5px;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 6px 14px rgba(245, 99, 74, 0.28);
        }

        .recharge-offline .offline-btn:active {
            transform: scale(0.98);
        }

        .recharge-offline .offline-btn:disabled {
            opacity: 0.6;
            box-shadow: none;
            cursor: default;
        }

        .recharge-offline .offline-note {
            margin-top: 10px;
            font-size: 12px;
            color: #b0958a;
            text-align: center;
            line-height: 1.5;
        }

        /* ===== 在线支付渠道（充值弹窗内） ===== */
        .recharge-offline .pay-channels {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 10px;
        }

        .recharge-offline .pay-channel {
            flex: 1 1 calc(50% - 5px);
            min-width: 130px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 10px;
            border: 2px solid #f2e4dc;
            border-radius: 12px;
            background: #fff;
            cursor: pointer;
            text-align: left;
            transition: border-color 0.15s, background 0.15s;
        }

        .recharge-offline .pay-channel.selected {
            border-color: #f5634a;
            background: #fff6f2;
        }

        .recharge-offline .pay-channel .pc-emoji {
            font-size: 20px;
            line-height: 1;
        }

        .recharge-offline .pay-channel .pc-main {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }

        .recharge-offline .pay-channel .pc-label {
            font-size: 13.5px;
            font-weight: 700;
            color: #4a2e26;
            white-space: nowrap;
        }

        .recharge-offline .pay-channel .pc-desc {
            font-size: 11px;
            color: #b0958a;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .recharge-offline .offline-btn-ghost {
            background: #fff;
            color: #f5634a;
            border: 2px solid #ffd9cd;
            box-shadow: none;
        }

        /* ===== 星愿明细（充值弹窗内 · #78 按页加载） ===== */
        .credit-logs {
            margin-top: 14px;
            text-align: left;
        }

        .credit-logs-title {
            font-size: 14px;
            font-weight: 700;
            color: #4a2e26;
            margin: 0 2px 8px;
        }

        .credit-logs-list {
            max-height: 220px;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .credit-log-item {
            display: flex;
            align-items: center;
            gap: 8px;
            background: #fff7ee;
            border: 1px solid #f5e3cd;
            border-radius: 12px;
            padding: 8px 10px;
        }

        .credit-log-item .cl-icon {
            font-size: 18px;
            flex: 0 0 auto;
        }

        .credit-log-item .cl-main {
            flex: 1;
            min-width: 0;
        }

        .credit-log-item .cl-remark {
            font-size: 13px;
            color: #4a2e26;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .credit-log-item .cl-time {
            font-size: 11px;
            color: #b0958a;
            margin-top: 2px;
        }

        .credit-log-item .cl-right {
            text-align: right;
            flex: 0 0 auto;
        }

        .credit-log-item .cl-amount {
            font-size: 14px;
            font-weight: 800;
        }

        .credit-log-item .cl-amount.plus {
            color: #2fa463;
        }

        .credit-log-item .cl-amount.minus {
            color: #f5634a;
        }

        .credit-log-item .cl-balance {
            font-size: 10px;
            color: #b0958a;
            margin-top: 2px;
        }

        .credit-logs-empty {
            text-align: center;
            color: #b0958a;
            font-size: 13px;
            padding: 14px 0 4px;
        }

        .credit-logs-loading {
            text-align: center;
            color: #b0958a;
            font-size: 13px;
            padding: 12px 0;
        }

        .credit-logs-more {
            width: 100%;
            margin-top: 8px;
            padding: 8px 0;
            border: 1.5px dashed #e8cfae;
            background: #fffaf2;
            color: #b07a4a;
            font-size: 13px;
            font-weight: 600;
            border-radius: 12px;
        }

        .credit-logs-more:active {
            background: #fff2e0;
        }

        .credit-logs-more:disabled {
            opacity: 0.6;
        }

        .flex-1 {
            flex: 1;
        }
        .mt-auto {
            margin-top: auto;
        }
        .gap-8 {
            gap: 8px;
        }

        @media (max-width: 420px) {
            .phone {
                border-radius: 32px;
                height: 100vh;
                height: 100dvh;
                max-height: 100vh;
                max-height: 100dvh;
                width: 100%;
                border-radius: 0;
                box-shadow: none;
            }
            .app {
                border-radius: 0;
                padding-top: 28px;
            }
            .notch {
                display: none;
            }
            body {
                padding: 0;
                background: #fff5f0;
            }
            .theme-grid {
                gap: 10px;
            }
            .char-grid {
                gap: 10px;
            }
            .result-actions .btn-again {
                padding: 14px 40px;
                font-size: 20px;
                min-width: 160px;
            }
            .voice-btn {
                font-size: 18px;
                padding: 12px 24px;
            }
        }

        @media (max-width: 380px) {
            .home-hero .magic-icon {
                font-size: 68px;
            }
            .home-hero h1 {
                font-size: 28px;
            }
            .btn-start {
                font-size: 22px;
                padding: 14px 36px;
            }
            .theme-card .icon {
                font-size: 36px;
            }
            .char-card .icon {
                font-size: 34px;
            }
            .page-title {
                font-size: 22px;
            }
            .result-actions .btn-again {
                padding: 12px 32px;
                font-size: 18px;
                min-width: 140px;
            }
        }

        .toast {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(80px);
            background: rgba(30, 20, 18, 0.85);
            backdrop-filter: blur(12px);
            color: #fff;
            padding: 12px 24px;
            border-radius: 30px;
            font-size: 15px;
            font-weight: 600;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            z-index: 200;
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
            pointer-events: none;
            white-space: nowrap;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }
        .toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        .toast .emoji {
            margin-right: 8px;
        }

        .modal-overlay {
            /* 需求：弹窗必须始终盖在最顶层、且不随页面滚动而位移。
               - position:fixed（而非 absolute）：以视口为定位基准，
                 详情页很长时也不会被页面滚动带走（历史缺陷：absolute 会跟着滚动）。
               - z-index 提升到 900：高于页面内一切内容层（最高内容层 200），
                 低于「全屏锁定遮罩」(9999) 与 toast(9500)，保证防沉迷遮罩仍能盖住弹窗。 */
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.42);
            backdrop-filter: blur(6px);
            z-index: 900;
            display: none;
            align-items: flex-end;
            justify-content: center;
            border-radius: 44px;
            overflow: hidden;
            animation: modalFade 0.3s ease-out;
        }
        .modal-overlay.open {
            display: flex;
        }
        @keyframes modalFade {
            0% {
                opacity: 0;
            }
            100% {
                opacity: 1;
            }
        }

        .modal-sheet {
            background: #ffffff;
            width: 100%;
            border-radius: 32px 32px 0 0;
            padding: 20px 24px calc(24px + env(safe-area-inset-bottom, 0px));
            /* 需求：底部弹窗最高占九成视口，内容多时可滚动，避免按钮被挤出可视区。
               两种布局：
               1) 使用 .modal-body 的弹窗（如盲盒二创）→ flex 列布局，
                  内容区独立滚动、底部 .modal-actions 固定钉底；
               2) 旧弹窗（无 .modal-body）→ 整片 sheet 自身滚动（overflow-y:auto），
                  保持原有行为不回归。 */
            max-height: 90%;
            overflow-y: auto;
            animation: sheetUp 0.4s cubic-bezier(0.23, 1, 0.32, 1);
            box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.12);
        }
        /* 带固定底栏的弹窗：容器不滚动，交给内层 .modal-body 滚动 */
        .modal-sheet:has(> .modal-body) {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        /* 固定底部操作区：提交/取消等主按钮钉底，长内容滚动时始终可见 */
        .modal-sheet > .modal-actions {
            flex: 0 0 auto;
            padding-top: 10px;
            background: #fff;
        }
        /* 可滚动内容区：占满剩余高度并独立滚动 */
        .modal-sheet > .modal-body {
            flex: 1 1 auto;
            min-height: 0; /* flex 子项允许收缩，否则内容撑破容器不滚动 */
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        @keyframes sheetUp {
            0% {
                transform: translateY(100%);
            }
            100% {
                transform: translateY(0);
            }
        }
        .modal-sheet .handle {
            width: 40px;
            height: 4px;
            background: #ddd;
            border-radius: 10px;
            margin: 0 auto 16px;
        }
        .modal-sheet .modal-title {
            font-size: 22px;
            font-weight: 700;
            color: #4a2e26;
            text-align: center;
            margin-bottom: 4px;
        }
        .modal-sheet .modal-sub {
            text-align: center;
            color: #9a8078;
            font-size: 15px;
            margin-bottom: 18px;
        }
        /* 大模型语音风格选择卡片 */
        .vs-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            padding: 0 4px;
        }
        .vs-item {
            border: 2px solid rgba(0, 0, 0, 0.06);
            border-radius: 16px;
            padding: 14px 10px;
            text-align: center;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.75);
            transition: all 0.2s ease;
        }
        .vs-item:active { transform: scale(0.96); }
        .vs-item.on {
            border-color: #7c6cff;
            background: linear-gradient(160deg, rgba(124, 108, 255, 0.12), rgba(90, 139, 255, 0.08));
            box-shadow: 0 4px 16px rgba(124, 108, 255, 0.2);
        }
        .vs-item .vs-emoji { font-size: 30px; line-height: 1.2; }
        .vs-item .vs-name { font-size: 15px; font-weight: 700; color: #4a2e26; margin-top: 4px; }
        .vs-item.on .vs-name { color: #5a4bd8; }
        .vs-item .vs-desc { font-size: 11px; color: #9a8078; margin-top: 3px; line-height: 1.4; }
        /* 弹窗内分组标题（如「声音性别」） */
        .vs-group-title {
            font-size: 13px;
            font-weight: 700;
            color: #9a8078;
            text-align: left;
            margin: 14px 6px 8px;
        }
        .modal-sheet .close-btn {
            display: block;
            margin: 18px auto 0;
            background: #f0ebe6;
            border: none;
            border-radius: 30px;
            padding: 12px 40px;
            font-size: 16px;
            font-weight: 600;
            color: #4a2e26;
            cursor: pointer;
            transition: all 0.2s;
        }
        .modal-sheet .close-btn:active {
            transform: scale(0.94);
        }
        .modal-sheet::-webkit-scrollbar {
            width: 4px;
        }
        .modal-sheet::-webkit-scrollbar-thumb {
            background: #ddd;
            border-radius: 10px;
        }

        .page:not(.page-home) .top-bar .brand {
            display: block;
        }

        .confetti-container {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 50;
            overflow: hidden;
            border-radius: 44px;
        }
        .confetti {
            position: absolute;
            width: 8px;
            height: 8px;
            border-radius: 2px;
            animation: confettiFall linear forwards;
            opacity: 0.8;
        }
        @keyframes confettiFall {
            0% {
                transform: translateY(-20px) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: translateY(700px) rotate(720deg);
                opacity: 0;
            }
        }

        .char-card.selected,
        .theme-card.selected {
            border-color: #f5634a;
            box-shadow: 0 0 0 3px rgba(245, 99, 74, 0.2), 0 8px 25px rgba(245, 99, 74, 0.12);
            background: rgba(255, 255, 255, 0.95);
            transform: scale(1.02);
        }

        .no-credit-overlay {
            position: absolute;
            inset: 0;
            background: rgba(255, 255, 255, 0.5);
            backdrop-filter: blur(2px);
            z-index: 20;
            display: none;
            align-items: center;
            justify-content: center;
            border-radius: 44px;
            flex-direction: column;
            padding: 40px;
            text-align: center;
        }
        .no-credit-overlay.open {
            display: flex;
        }
        .no-credit-overlay .big {
            font-size: 56px;
            margin-bottom: 8px;
        }
        .no-credit-overlay .title {
            font-size: 24px;
            font-weight: 700;
            color: #4a2e26;
        }
        .no-credit-overlay .desc {
            font-size: 16px;
            color: #8a7068;
            margin: 6px 0 18px;
        }
        .no-credit-overlay .btn-go-recharge {
            background: linear-gradient(135deg, #ff8a6a, #f5634a);
            border: none;
            border-radius: 60px;
            padding: 14px 44px;
            font-size: 20px;
            font-weight: 700;
            color: #fff;
            box-shadow: 0 8px 28px rgba(245, 99, 74, 0.3);
            cursor: pointer;
            transition: all 0.2s;
        }
        .no-credit-overlay .btn-go-recharge:active {
            transform: scale(0.94);
        }

/* ============================================================
 *  新增组件（原型之外，为真实数据/分镜播放/加载态补充）
 *  原型原有样式保持 1:1 未改动，以下内容全部为追加
 * ============================================================ */

/* 首屏加载 */
.boot-loading {
    position: absolute;
    inset: 0;
    z-index: 200;
    background: linear-gradient(170deg, #fff9f5, #fdeee7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}
.boot-loading.hide { display: none; }
.boot-spinner {
    font-size: 52px;
    animation: bootSpin 1.4s ease-in-out infinite;
}
@keyframes bootSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
}
.boot-text {
    font-size: 15px;
    color: #a08a80;
    letter-spacing: 0.5px;
}

/* 结果页：封面与分镜舞台 */
.result-video { position: relative; overflow: hidden; flex-shrink: 0; }
.storyboard {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.storyboard .cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.scene-stage {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    background: linear-gradient(160deg, #fff6ec, #ffe6d8);
    text-align: center;
}
.scene-emoji {
    font-size: 72px;
    animation: scenePop 0.5s ease;
}
@keyframes scenePop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.scene-text {
    font-size: 18px;
    line-height: 1.6;
    font-weight: 600;
    color: #4a2e26;
}
.scene-index {
    font-size: 12px;
    color: #b0958a;
}
/* 重播按钮：分镜播完后显示在分镜区中央，点击重新朗读播放（与广场暂停按钮同风格） */
.replay-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px;
    -webkit-tap-highlight-color: transparent;
    /* 显示时弹性进场（display:none → flex 会重新触发 animation） */
    animation: pbIn 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.replay-btn .pb-icon {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.32);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.replay-btn .pb-tri {
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent #fff;
    margin-left: 7px; /* 三角形视觉重心居中 */
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}
.replay-btn .pb-tip {
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}
.replay-btn:active .pb-icon {
    transform: scale(0.92);
}
@keyframes pbIn {
    from { transform: translate(-50%, -50%) scale(0.72); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 生成的动画片：独立流式块，显示在分镜区块下方 */
/*
 * 尺寸自适应（需求）：不再写死 16/9。竖屏视频（9:16）塞进 16:9 框会被压扁留黑边，
 * 统一改为由视频真实尺寸驱动 —— JS 在 loadedmetadata 时按 videoWidth/videoHeight
 * 计算并写入 width/height/aspect-ratio（pages.js 的 fitVideoBox）。
 *
 * 重要：这里刻意**不写 width:100%**，因为 JS 会按视频方向决定用宽度还是高度驱动
 * （横屏撑满宽度、竖屏按高度收窄居中）。CSS 只保留加载前的 16/9 兜底与外观。
 */
.result-film {
    display: block;
    aspect-ratio: 16/9; /* JS 实测尺寸后覆盖；此为加载前兜底 */
    margin: 12px auto 0;
    border-radius: 24px;
    background: linear-gradient(145deg, #1a1a2e, #2d2d44);
    object-fit: contain; /* 任意比例视频不裁剪不拉伸 */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* 剧情分段续传：多段动画片按生成时间顺序自上往下全部展示 */
.seg-film-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}
.seg-film-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.seg-film-title {
    font-size: 12px;
    font-weight: 700;
    color: #8a7268;
    letter-spacing: 0.5px;
    padding-left: 4px;
}
.seg-film {
    display: block;
    aspect-ratio: 16/9; /* JS 实测尺寸后覆盖；此为加载前兜底 */
    margin: 0 auto;
    border-radius: 20px;
    background: linear-gradient(145deg, #1a1a2e, #2d2d44);
    object-fit: contain;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
}

/* 分镜进度条 */
.scene-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    margin: 10px 20px 0;
    overflow: hidden;
}
.scene-progress .bar {
    height: 100%;
    background: linear-gradient(90deg, #f5634a, #f9a87b);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* 分镜列表 */
.scene-list {
    margin: 12px 20px 0;
    /* 全部展开：不再限高内滚，页面整体滚动查看完整分镜 */
    background: rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    padding: 10px 14px;
}
.scene-list-title {
    font-size: 13px;
    font-weight: 700;
    color: #9a8078;
    margin-bottom: 8px;
}
.scene-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}
.scene-item:last-child { border-bottom: none; }
.scene-item .s-emoji { font-size: 20px; flex-shrink: 0; }
.scene-item .s-text {
    font-size: 14px;
    line-height: 1.5;
    color: #5c443c;
}

/* 生成失败态 */
.gen-error {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.gen-error .err-text {
    font-size: 13px;
    color: #b08378;
    text-align: center;
    padding: 0 20px;
    line-height: 1.5;
}
.btn-retry {
    background: linear-gradient(145deg, #f5634a, #f9a87b);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(245, 99, 74, 0.28);
    cursor: pointer;
}
.btn-retry:active { transform: scale(0.96); }

/* 历史项：删除按钮与状态标记 */
.history-item .del-btn {
    background: none;
    border: none;
    font-size: 18px;
    opacity: 0.35;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.history-item .del-btn:active { opacity: 0.8; }
.history-item .info { cursor: pointer; }
.badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.badge.ok { background: #e6f7ee; color: #2e9e63; }
.badge.fail { background: #fdeceb; color: #d9534f; }
.badge.running { background: #fff4e0; color: #d98c2b; }

/* 自定义主题卡片 */
.theme-card.custom-theme {
    background: linear-gradient(145deg, #fff7e8, #ffeccd);
    border-color: #f9d9a0;
}

/* 语音提示 */
.voice-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #b0958a;
    text-align: center;
    min-height: 18px;
}

/* ============================================================
 * 语音引导开关（首页顶栏，原头像位置）
 * ============================================================ */
.voice-toggle {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe3c2, #ffd0e0);
    box-shadow: 0 2px 10px rgba(245, 99, 74, 0.25);
    font-size: 21px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}
.voice-toggle:active {
    transform: scale(0.88);
}
.voice-toggle.off {
    opacity: 0.55;
    box-shadow: none;
    background: #f0e6e0;
}

/* 「点一下屏幕开启语音」气泡已移除：开关开启时进入页面即自动触发语音指引（voice.js） */

/* ============================================================
 * 底部 Tab 导航（创作 / 广场 / 我的）
 * ============================================================ */
.tabbar {
    display: flex;
    height: 58px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom);
    flex-shrink: 0;
}
.tabbar .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: none;
    cursor: pointer;
    color: #b9a89f;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease, transform 0.15s ease;
}
.tabbar .tab:active { transform: scale(0.92); }
.tabbar .tab-icon { font-size: 21px; line-height: 1; filter: grayscale(1) opacity(0.55); transition: filter 0.2s ease; }
.tabbar .tab-label { font-size: 10.5px; font-weight: 600; letter-spacing: 1px; }
.tabbar .tab.active { color: #f5634a; }
.tabbar .tab.active .tab-icon { filter: none; transform: translateY(-1px) scale(1.12); }
.tabbar .tab.active .tab-label { background: linear-gradient(90deg, #f5634a, #ff9a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============================================================
 * 广场：抖音式全屏竖滑视频流
 * ============================================================ */
.page-square { padding: 0; display: none; }
.page-square.active { display: flex; flex-direction: column; }
.square-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 30;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 14px 18px 10px;
    background: linear-gradient(180deg, rgba(0,0,0,0.45), transparent);
    pointer-events: none;
}
.square-topbar .st-logo { font-size: 18px; }
.square-topbar .st-title { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: 2px; }
.square-topbar .st-sub { font-size: 11px; color: rgba(255,255,255,0.75); }
.square-feed {
    flex: 1;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    background: #000;
}
.square-feed::-webkit-scrollbar { display: none; }
.sq-item {
    position: relative;
    height: 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background: #000;
}
.sq-item video {
    width: 100%;
    height: 100%;
    /* 需求：视频左右必须铺满，不留空隙。
       采用 cover（缩放因子取 max(容器宽/视频宽, 容器高/视频高)）：
         - 横屏视频 vs 竖屏容器 → 等比放大到铺满宽度，左右无黑边，上下超出部分裁掉
         - 竖屏视频 vs 更瘦长容器 → 同样铺满，不出现任何空隙
       ⚠️ 历史上曾用 contain（完整画面不裁剪），但会在横屏视频左右留出大块黑边，
          手机浏览器上观感很差。已按需求改回 cover；如需恢复「完整画面」再改回 contain。 */
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1; /* 显式层级：防止视频合成层覆盖信息层 */
    /* 懒加载：未就绪时透明，露出封面背景图，首帧到位后淡入（无黑屏等待感） */
    opacity: 0;
    transition: opacity 0.28s ease;
}
.sq-item.video-ready video {
    opacity: 1;
}
.sq-item .sq-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sq-info {
    position: absolute;
    /* 需求修复：遮罩必须左右铺满。原 right:16px 让右侧留出一条 16px 的空隙，
       渐变底未贴到屏幕右边缘。内容保持 16px 内边距（padding 已含），故无贴边感。 */
    left: 0; right: 0; bottom: 0;
    padding: 60px 16px 22px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.65));
    color: #fff;
    pointer-events: none;
    z-index: 4;
}
.sq-info .sq-full-story { pointer-events: auto; }
.sq-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
/* 标题行：标题左 + 完整故事按钮右 */
.sq-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.sq-title-row .sq-title { margin-bottom: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 完整故事按钮（解锁扣点） */
.sq-full-story {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff9a3d, #f5634a);
    border: none;
    border-radius: 18px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(245, 99, 74, 0.45);
    -webkit-tap-highlight-color: transparent;
}
.sq-full-story:active { transform: scale(0.94); }
/* 收藏列表取消收藏按钮 */
.fav-del {
    flex-shrink: 0;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    opacity: 0.75;
    -webkit-tap-highlight-color: transparent;
}

/* ================= 防沉迷 ================= */
/* 设置弹窗扩展 */
.ac-field-label { font-size: 13px; font-weight: 700; color: #8a6a5c; margin: 6px 0 6px; }
.ac-pwd-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    margin: 6px 0;
    font-size: 15px;
    border: 2px solid rgba(245, 99, 74, 0.25);
    border-radius: 12px;
    background: #fffaf6;
    outline: none;
}
.ac-pwd-input:focus { border-color: rgba(245, 99, 74, 0.6); }
.ac-minutes { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-min {
    flex: 1;
    min-width: 68px;
    padding: 9px 6px;
    font-size: 14px;
    font-weight: 700;
    color: #a06a52;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(245, 99, 74, 0.25);
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ac-min.on { color: #fff; background: linear-gradient(135deg, #f5634a, #ff9a3d); border-color: transparent; }
.ac-tip { margin-top: 10px; font-size: 12px; line-height: 1.6; color: #b0958a; }
.ac-mgmt { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.ac-mgmt-btns { display: flex; gap: 10px; }
.ac-btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f5634a, #ff9a3d);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ac-btn.ghost { color: #a06a52; background: rgba(255, 255, 255, 0.85); border: 2px solid rgba(245, 99, 74, 0.3); }
.ac-btn.danger { background: linear-gradient(135deg, #e05a5a, #ff8a5c); }

/* 全屏锁定遮罩 */
.ac-lock-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(165deg, rgba(38, 30, 60, 0.96), rgba(20, 16, 40, 0.98));
    backdrop-filter: blur(14px);
}
.ac-lock-card {
    width: 100%;
    max-width: 340px;
    padding: 30px 26px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    color: #fff;
}
.ac-lock-icon { font-size: 52px; margin-bottom: 8px; }
.ac-lock-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.ac-lock-sub { font-size: 14px; line-height: 1.7; opacity: 0.85; margin-bottom: 16px; }
.ac-lock-sub b { color: #ffd08a; font-size: 18px; }
.ac-lock-pwd {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    outline: none;
}
.ac-lock-pwd::placeholder { color: rgba(255, 255, 255, 0.45); letter-spacing: 0; }
.ac-lock-err { margin-top: 8px; font-size: 13px; color: #ff9a9a; }
.ac-lock-btn {
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #f5634a, #ff9a3d);
    border: none;
    border-radius: 14px;
    cursor: pointer;
}
.ac-lock-btn:active { transform: scale(0.97); }
.sq-meta { font-size: 12px; color: rgba(255,255,255,0.85); display: flex; gap: 10px; align-items: center; }
.sq-meta .sq-badge { background: rgba(255,255,255,0.2); border-radius: 999px; padding: 2px 9px; backdrop-filter: blur(4px); }
/* 完整成片标识（需求）：绿色高亮，与主题/时间徽章区分 */
.sq-meta .sq-badge-full { background: rgba(52,199,89,0.85); color: #fff; font-weight: 700; }
/* 半成品标识（需求）：只生成了前几段 → 橙色提示「第 N/M 段」，且不显示完整故事入口 */
.sq-meta .sq-badge-part { background: rgba(255,159,10,0.9); color: #fff; font-weight: 700; }
.sq-acts {
    position: absolute;
    right: 10px; top: 62px; /* 收藏按钮：右上角（渐变标题栏下方） */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    z-index: 5;
}
.sq-act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border: none; background: none; cursor: pointer;
    color: #fff; font-size: 11px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    -webkit-tap-highlight-color: transparent;
}
.sq-act .ico { font-size: 30px; line-height: 1; transition: transform 0.15s ease; }
/* 未收藏：白色空心爱心（♡ 字符随 color 染白） */
.sq-act .ico.hollow {
    color: #fff;
    font-size: 38px;
    font-weight: 300;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.sq-act:active .ico { transform: scale(1.25); }
.sq-act.liked .ico { animation: sqHeart 0.45s ease; }
/* 右下角 CTA 按钮（需求④）：后台可配名称与跳转链接，仅运营视频渲染 */
.sq-cta {
    position: absolute;
    right: 12px;
    bottom: 108px; /* 底部信息栏之上、右侧图标列之下，避免互相压盖 */
    z-index: 6;
    max-width: 46vw;
    padding: 8px 15px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff9f0a, #ff6482);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 18px rgba(255, 100, 130, 0.4);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.sq-cta:active { transform: scale(0.95); }
/* 收藏页里运营视频条目的「精选」标识 */
.sq-fav-op {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff9f0a, #ff6482);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}
@keyframes sqHeart {
    0% { transform: scale(1); }
    40% { transform: scale(1.45); }
    100% { transform: scale(1); }
}
/* 暂停时的播放按钮：圆形毛玻璃 + CSS 三角（抖音式），出现时弹性放大 */
.sq-play-hint {
    position: absolute;
    top: 50%; left: 50%;
    width: 78px; height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) scale(0.72);
    background: rgba(0, 0, 0, 0.32);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sq-item.paused .sq-play-hint {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.sq-play-tri {
    display: block;
    width: 0; height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent #fff;
    margin-left: 7px; /* 三角视觉居中修正 */
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}
/* 浏览器拦截有声自动播放时的「点按开启声音」提示（画面中部偏上，避开中心播放键与顶部标题） */
.sq-unmute-hint {
    position: absolute;
    top: 34%; left: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 22px;
    pointer-events: none;
    z-index: 3;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}
.square-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #000;
    z-index: 20;
}
.square-empty .se-icon { font-size: 52px; }
.square-empty .se-text { font-size: 17px; font-weight: 700; color: #fff; }
.square-empty .se-sub { font-size: 13px; color: rgba(255,255,255,0.6); }
.square-empty .se-btn {
    margin-top: 10px;
    border: none;
    background: linear-gradient(90deg, #f5634a, #ff9a3d);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 26px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(245, 99, 74, 0.4);
    cursor: pointer;
}

/* ============================================================
 * 我的：个人中心
 * ============================================================ */
.me-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px 14px;
}
.me-avatar {
    width: 62px; height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe3c2, #ffd0e0);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 14px rgba(245, 152, 74, 0.25);
    flex-shrink: 0;
}
.me-info { flex: 1; min-width: 0; }
.me-name-row { display: flex; align-items: center; gap: 8px; }
.me-name { font-size: 18px; font-weight: 800; color: #4a2e26; }
/* 档案修改入口：昵称旁的小铅笔按钮 */
.me-edit-btn {
    border: none;
    background: rgba(245, 99, 74, 0.1);
    border-radius: 50%;
    width: 28px; height: 28px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.1s ease;
}
.me-edit-btn:active { background: rgba(245, 99, 74, 0.2); transform: scale(0.92); }
.me-sub { font-size: 12px; color: #b0958a; margin-top: 3px; }
/* 档案编辑弹窗：绑定手机号（脱敏只读） */
.pf-phone-field .pf-phone {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    color: #6b544b;
    letter-spacing: 0.5px;
}
.me-credits {
    display: flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, #fff3d6, #ffe6b3);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 15px; font-weight: 800; color: #d4882a;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(212, 136, 42, 0.18);
}
.me-stats {
    display: flex;
    margin: 0 18px;
    background: rgba(255,255,255,0.8);
    border-radius: 20px;
    padding: 14px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.me-stats .ms-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    cursor: pointer;
}
.me-stats .ms-num { font-size: 19px; font-weight: 800; color: #4a2e26; }
.me-stats .ms-label { font-size: 11px; color: #b0958a; }
.me-menu {
    margin: 0 18px;
    background: rgba(255,255,255,0.8);
    border-radius: 20px;
    overflow: hidden;
}
/* 分组标题：菜单按「内容 / 声音 / 点数 / 通用」分组展示 */
.me-group-title {
    margin: 16px 24px 6px;
    font-size: 12px;
    font-weight: 700;
    color: #b0958a;
    letter-spacing: 0.5px;
}
.me-group-title:first-of-type { margin-top: 14px; }
/* 退出登录：底部独立红色文字按钮（仅已登录显示） */
.me-logout {
    display: block;
    width: calc(100% - 36px);
    margin: 18px 18px 0;
    padding: 13px 0;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.85);
    font-size: 14.5px;
    font-weight: 700;
    color: #e5484d;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}
.me-logout:active { background: rgba(229, 72, 77, 0.08); }
/* 修复：.page 是 flex 列容器，菜单项增多后 me-menu 会被压缩截断（且无法滚动）。
   子元素一律禁止收缩 → 内容超高时由 .page 的 overflow-y:auto 整页滚动 */
#pageMe > * { flex-shrink: 0; }
.me-menu .mm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}
.me-menu .mm-item:last-child { border-bottom: none; }
.me-menu .mm-item:active { background: rgba(245, 99, 74, 0.06); }
.me-menu .mm-icon { font-size: 20px; }
.me-menu .mm-text { flex: 1; font-size: 14.5px; font-weight: 600; color: #4a2e26; }
.me-menu .mm-arrow { font-size: 20px; color: #d8c7bd; font-weight: 300; }
/* 菜单右侧文字标签（当前语音风格等） */
.me-menu .mm-tag {
    font-size: 12px; font-weight: 700;
    color: #8a6f65;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    padding: 3px 12px;
}
.me-menu .mm-switch {
    font-size: 12px; font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #f5634a, #ff9a3d);
    border-radius: 999px;
    padding: 3px 12px;
}
.me-menu .mm-switch.off { background: #d8c7bd; }
.me-foot {
    text-align: center;
    font-size: 11px;
    color: #cbb8ae;
    padding: 22px 0 16px;
}

/* 通用信息弹窗（家长须知等） */
.ui-alert-mask {
    position: absolute;
    inset: 0;
    z-index: 200;
    background: rgba(30, 20, 16, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    animation: fadeSlide 0.25s ease;
}
.ui-alert {
    background: #fff;
    border-radius: 24px;
    padding: 22px 20px 18px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
}
.ui-alert .ua-title { font-size: 17px; font-weight: 800; color: #4a2e26; margin-bottom: 10px; }
.ui-alert .ua-body {
    font-size: 13px;
    line-height: 1.8;
    color: #7a6055;
    /* 需求：提示文案居中显示（与居中的标题保持视觉一致）。
       注意：含表单的弹窗（如「防沉迷设置」的密码输入/时长按钮组）会自带
       行内 text-align:left 覆盖，不受此规则影响。 */
    text-align: center;
    margin-bottom: 16px;
}
/* 按钮行（需求）：两键左右分开、间隙拉开，避免误触；间距随屏宽略放大 */
.ui-alert .ua-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 4px;
}
.ui-alert .ua-btn {
    flex: 1 1 0;
    max-width: 130px;
    border: none;
    /* 确认键：深色实心（主色渐变），视觉权重最高 */
    background: linear-gradient(90deg, #f5634a, #ff9a3d);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 11px 14px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(245, 99, 74, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ui-alert .ua-btn:active { transform: scale(0.96); }
/* 取消键：浅色（浅底浅描边深字），与确认键形成明确主次对比 */
.ui-alert .ua-btn.ghost {
    background: #fff;
    color: #a06a52;
    border: 2px solid rgba(245, 99, 74, 0.28);
    box-shadow: none;
}

/* ============================================================
 *  邀请有奖
 * ============================================================ */

.invite-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, #fff3e0, #ffe0ec);
    border: 1.5px dashed #ffb74d;
    border-radius: 14px;
    padding: 9px 12px;
    font-size: 13px;
    color: #e65100;
    line-height: 1.5;
    margin-bottom: 12px;
}

.invite-sheet {
    max-height: 86vh;
    overflow-y: auto;
}

.invite-code-box {
    background: linear-gradient(135deg, #f3e8ff, #e0f2fe);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
    margin: 12px 0 14px;
}

.invite-code-box .ic-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.invite-code-box .ic-code {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 5px;
    color: #6c3bd6;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.invite-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.invite-qr #inviteQr {
    width: 148px;
    height: 148px;
    padding: 8px;
    background: #fff;
    border: 2px solid #ece6ff;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(108, 59, 214, 0.12);
    overflow: hidden;
}

.invite-qr #inviteQr img,
.invite-qr #inviteQr canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
}

.invite-qr .iqr-tip {
    font-size: 12px;
    color: #8b8fa3;
}

.invite-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.invite-stats .is-item {
    flex: 1;
    background: #faf9ff;
    border-radius: 12px;
    padding: 10px 4px;
    text-align: center;
}

.invite-stats .is-num {
    font-size: 20px;
    font-weight: 800;
    color: #6c3bd6;
}

.invite-stats .is-label {
    font-size: 11px;
    color: #8b8fa3;
    margin-top: 2px;
}

.invite-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-invite {
    flex: 1;
    border: 1.5px solid #e3d9ff;
    background: #fff;
    color: #6c3bd6;
    font-size: 13.5px;
    font-weight: 700;
    font-family: inherit;
    padding: 11px 6px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}

.btn-invite:active {
    transform: scale(0.97);
}

.btn-invite.primary {
    background: linear-gradient(90deg, #8b5cf6, #6c3bd6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 5px 14px rgba(108, 59, 214, 0.3);
}

.invite-list-title {
    font-size: 13px;
    font-weight: 700;
    color: #4a4a5a;
    margin-bottom: 8px;
}

.invite-list {
    max-height: 168px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.invite-list .il-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 2px;
    border-bottom: 1px dashed #f0eef7;
    font-size: 13px;
}

.invite-list .il-item:last-child {
    border-bottom: none;
}

.invite-list .il-emoji {
    font-size: 20px;
}

.invite-list .il-main {
    flex: 1;
    min-width: 0;
}

.invite-list .il-name {
    font-weight: 600;
    color: #33334a;
}

.invite-list .il-time {
    font-size: 11.5px;
    color: #9a9aae;
    margin-top: 1px;
}

.invite-list .il-reward {
    font-size: 12.5px;
    font-weight: 700;
    color: #16a34a;
    white-space: nowrap;
}

.invite-list .il-empty {
    text-align: center;
    color: #9a9aae;
    font-size: 13px;
    padding: 18px 0;
}

/* 落地页：好友邀请横幅 */
.invite-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, #ffe9a8, #ffd0e0);
    border-radius: 14px;
    padding: 10px 12px;
    margin: 8px 12px 0;
    box-shadow: 0 4px 12px rgba(255, 160, 60, 0.18);
    animation: invitePop 0.35s ease-out;
}

.invite-banner .ib-emoji {
    font-size: 24px;
}

.invite-banner .ib-text {
    flex: 1;
    font-size: 13px;
    color: #8a4b00;
    line-height: 1.45;
}

.invite-banner .ib-close {
    border: none;
    background: rgba(255, 255, 255, 0.7);
    color: #8a4b00;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

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

/* PWA 添加到主屏幕引导浮层（仅移动端 H5 且未安装时显示） */
.pwa-tip {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 84px; /* 避开底部导航栏 */
    z-index: 50;
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 34px rgba(245, 99, 74, 0.28);
    border: 1px solid rgba(245, 99, 74, 0.18);
    animation: pwaTipIn 0.4s ease both;
}
.pwa-tip.show { display: flex; }
@keyframes pwaTipIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.pwa-tip-icon {
    font-size: 26px;
    line-height: 1.2;
    flex-shrink: 0;
}
.pwa-tip-body { flex: 1; min-width: 0; }
.pwa-tip-text {
    font-size: 13.5px;
    line-height: 1.5;
    color: #4a2e26;
    font-weight: 600;
}
.pwa-tip-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}
.pwa-tip-actions button {
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.pwa-tip-later {
    background: #f0ece8;
    color: #8a7066;
}
.pwa-tip-dismiss {
    background: linear-gradient(135deg, #ff7a59, #f5552f);
    color: #fff;
}
