/* ============================================================
   base.css — 通用组件（只吃变量，不含任何主题分支）
   freerivers.cn 移动端皮肤系统 · 版本 3.5
   作者：妙宣 · p4diy@126.com · https://itmoo.freerivers.cn
   ============================================================ */
/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: var(--bg-page);
    color: var(--t1);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background .3s ease, color .3s ease;
}
a { color: inherit; }
button { font-family: inherit; }

/* 莲花底纹（仅禅意版可见） */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="%238B4513" d="M50,20 C60,15 70,15 80,20 C85,30 85,40 80,50 C70,55 60,55 50,50 C40,55 30,55 20,50 C15,40 15,30 20,20 C30,15 40,15 50,20 Z"/></svg>');
    background-size: 200px;
    opacity: var(--pattern-opacity);
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   通用组件
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    min-height: var(--btn-h);
    padding: 10px 20px;
    border: none; border-radius: 999px;
    font-size: 1rem; font-weight: 700;
    cursor: pointer; text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-contrast); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(139,69,19,.35); }
.btn-secondary { background: var(--bg-elev); color: var(--t1); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--t2); border: 1px dashed var(--line); }

.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; color: var(--t2); font-size: .85rem; font-weight: 600; }
.field label .req { color: var(--err); font-weight: 700; margin-left: 2px; }
.field input {
    width: 100%;
    min-height: var(--tap);
    padding: 9px 12px;
    background: var(--bg-card-2);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    color: var(--t1);
    font-size: .82rem;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,69,19,.15); }
.field input::placeholder { color: var(--muted); }
.field .err-msg { display: none; color: var(--err); font-size: .82rem; margin-top: 4px; }
/* 密码框：缩短宽度 + 右侧"显示"按钮（适老：文字按钮，不用小图标） */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 64px; }
.pwd-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    min-height: 30px;
    padding: 2px 10px;
    background: var(--bg-elevated, rgba(139,69,19,.1));
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 3px);
    color: var(--t2);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.pwd-toggle:active { transform: translateY(-50%) scale(.95); }
.field .field-hint { color: var(--muted); font-size: .72rem; line-height: 1.45; margin-top: 4px; }
.field.invalid .field-hint { display: none; }
.field.invalid input { border-color: var(--err); }
.field.invalid .err-msg { display: block; }

/* 邮箱：账号输入框 + 后缀下拉 */
.email-split { display: flex; gap: 8px; }
.email-split input { flex: 1 1 auto; min-width: 0; }
.email-split select {
    flex: 0 0 auto;
    max-width: 46%;
    min-height: var(--tap);
    padding: 9px 30px 9px 12px;
    background-color: var(--bg-card-2);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M8 11L3 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    color: var(--t1);
    font-family: inherit;
    font-size: .82rem;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.email-split select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,69,19,.15); }
.field.invalid .email-split select { border-color: var(--err); }

/* 大复选框 */
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: .78rem; line-height: 1.5; color: var(--t2); cursor: pointer; user-select: none; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
    flex: none;
    width: 24px; height: 24px; margin-top: 2px;
    border: 2px solid var(--line); border-radius: 6px;
    background: var(--bg-card-2);
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
    color: transparent; font-size: 14px;
}
.check-row input:checked + .check-box { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.check-row a { color: var(--primary); font-weight: 700; text-decoration: none; }

/* 轻提示 */
/* 全站统一提示（与 mplay、xxfyv2 同一套视觉）：
   绿底白字、从右侧飞入、单行（超长先缩字号到 10px，再省略号），停留 2.6s */
.toast {
    position: fixed; left: auto; right: 12px;
    top: calc(env(safe-area-inset-top) + 76px); bottom: auto;
    transform: translateX(120%);
    width: max-content; max-width: calc(100vw - 24px);
    padding: 10px 18px;
    background: #2E7D32; color: #fff;
    border: none;
    border-radius: 999px;
    box-shadow: var(--shadow);
    font-size: 14px; text-align: center;
    line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; pointer-events: none;
    transition: transform .26s ease, opacity .26s ease;
    z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(0); }

/* ============================================================
   跳转/风格选择页（index.html）
   ============================================================ */
.entry-container {
    min-height: 100vh; min-height: 100dvh;
    background: linear-gradient(135deg, var(--bg-page), var(--bg-page-2));
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    padding: 20px 16px;
}
.lotus-animation {
    position: absolute; inset: 0; opacity: .1;
    background-image:
        radial-gradient(circle at 20% 30%, var(--primary) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, var(--secondary) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: bdgFloat 20s infinite linear;
}
@keyframes bdgFloat {
    0% { transform: translate(0,0) rotate(0); }
    100% { transform: translate(-50px,-50px) rotate(360deg); }
}
.entry-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-2));
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    max-width: 520px; width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    position: relative; z-index: 10;
    animation: bdgCardIn .7s ease-out;
}
@keyframes bdgCardIn {
    from { opacity: 0; transform: translateY(26px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.lotus-icon { font-size: 52px; color: var(--primary); margin-bottom: 10px; animation: bdgPulse 4s infinite ease-in-out; }
@keyframes bdgPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.app-title { font-size: 1.7rem; font-weight: 800; margin-bottom: 4px; }
.app-subtitle { color: var(--t2); font-size: .95rem; margin-bottom: 10px; }
.version-badge {
    display: inline-block;
    background: var(--primary); color: var(--primary-contrast);
    padding: 3px 12px; border-radius: 999px;
    font-size: .78rem; font-weight: 700;
    margin-bottom: 22px;
}
.entry-section-label {
    text-align: left; color: var(--muted); font-size: .85rem;
    margin: 18px 0 10px;
}

/* 风格选择卡 */
.theme-options { display: flex; flex-direction: column; gap: 12px; }
.theme-btn {
    width: 100%;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card-2);
    border: 2px solid transparent;
    border-radius: var(--radius);
    color: var(--t1);
    cursor: pointer; text-align: left;
    transition: all .2s;
}
.theme-btn:hover { background: var(--bg-elev); transform: translateY(-2px); }
.theme-btn.active { border-color: var(--primary); background: var(--bg-elev); box-shadow: var(--shadow-soft); }
.theme-swatch {
    flex: none; width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
}
.swatch-skin-01 { background: linear-gradient(135deg, #8B4513, #D2691E); }
.swatch-skin-02 { background: linear-gradient(135deg, #FFFFFF, #F3ECDC); color: #8B4513; border: 1px solid #E4D9C3; }
.swatch-skin-03 { background: linear-gradient(135deg, #4F6BED, #06B6D4); }
.theme-info { flex: 1; min-width: 0; }
.theme-name { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.theme-desc { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.rec-tag {
    font-size: .68rem; font-weight: 700; color: var(--primary-contrast);
    background: var(--accent); border-radius: 999px; padding: 1px 8px;
}
html[data-theme=""] .rec-tag, .rec-tag { color: #fff; }

.remember-row { justify-content: center; margin: 18px 0 6px; }
.auto-redirect {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 10px; margin-top: 18px; padding: 12px;
    background: var(--bg-card-2); border-radius: var(--radius);
    font-size: .92rem; color: var(--t2);
}
.countdown { font-size: 1.15rem; font-weight: 800; color: var(--accent); min-width: 24px; }
.auto-redirect button {
    min-height: 34px; padding: 4px 14px; width: auto;
    border-radius: 999px; border: 1px solid var(--line);
    background: var(--bg-elev); color: var(--t2); cursor: pointer; font-size: .85rem;
}
.entry-footer {
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--divider);
    display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
}
.entry-footer a { color: var(--t2); text-decoration: none; font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; }
.entry-footer a:hover { color: var(--t1); }

/* ============================================================
   移动端长页（mobile.html）
   ============================================================ */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: var(--primary-contrast);
    padding: 12px 14px;
    padding-top: calc(12px + env(safe-area-inset-top));
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 3px 14px rgba(0,0,0,.18);
}
.brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.brand i { flex: none; font-size: 1.4rem; }
.brand > div { flex: 1; min-width: 0; font-weight: 800; font-size: 1.2rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small {
    display: block;
    font-size: .72rem; font-weight: 400; opacity: .88; line-height: 1.35;
    margin-top: 2px;
}
.icon-btn {
    flex: none;
    width: var(--tap); height: var(--tap);
    border-radius: 50%; border: none;
    background: rgba(255,255,255,.16);
    color: var(--primary-contrast);
    font-size: 1.05rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.28); }
.icon-btn:active { transform: scale(.92); }
/* 顶栏“添加到桌面”按钮：使用站点 LOGO */
.icon-btn img { width: 62%; height: 62%; object-fit: contain; border-radius: 6px; display: block; }
/* 站名左侧的收藏按钮：LOGO 即站标，图标显示更饱满 */
.brand .icon-btn { width: 42px; height: 42px; margin-right: -2px; }
.brand .icon-btn img { width: 86%; height: 86%; border-radius: 50%; }
/* 账号胶囊隐藏：未登录时页面顶部即登录卡，已登录时有欢迎条；
   设置入口保留在右侧调色板按钮。隐藏后保证站名与副标题任何状态下完整一行 */
.user-chip { display: none; }

/* 手机窄屏：图标按钮略收 */
@media (max-width: 480px) {
    .topbar { gap: 8px; padding: 10px 12px; }
    .icon-btn { width: 40px; height: 40px; font-size: .98rem; }
}

.page { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }

/* 登录卡片 */
.auth-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-2));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 20px 18px;
    margin-bottom: 18px;
}
.auth-head { text-align: center; margin-bottom: 14px; }
.auth-head .auth-logo { width: 64px; height: 64px; margin: 0 auto 8px; }
.auth-head .auth-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.auth-head h2 { font-size: 1.25rem; }
.auth-head p { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.auth-tabs { display: flex; background: var(--bg-elev); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.auth-tabs button {
    flex: 1; min-height: 40px; border: none; border-radius: 999px;
    background: transparent; color: var(--t2);
    font-size: .95rem; font-weight: 700; cursor: pointer;
}
.auth-tabs button.active { background: var(--primary); color: var(--primary-contrast); }
.auth-error {
    display: none;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(244,67,54,.10);
    border: 1px solid var(--err);
    border-radius: var(--radius);
    color: var(--err);
    font-size: .88rem;
    line-height: 1.5;
}
.guest-line { text-align: center; margin-top: 12px; }
.guest-line button {
    border: none; background: none; cursor: pointer;
    color: var(--t2); font-size: .74rem; text-decoration: underline;
    text-underline-offset: 3px; font-family: inherit;
    white-space: nowrap;
}
.guest-line button:hover { color: var(--primary); }

/* 已登录欢迎条 */
.welcome-bar {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-card); border: 1px solid var(--line);
    border-left: 4px solid var(--ok);
    border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 18px;
    box-shadow: var(--shadow-soft);
}
.welcome-bar { align-items: center; padding: 10px 14px; gap: 10px; }
.welcome-bar i { flex: none; color: var(--ok); font-size: 1.15rem; }
.welcome-bar .wb-text { flex: 1; min-width: 0; font-size: .9rem; }
.welcome-bar .wb-name {
    font-size: .95rem; font-weight: 700;
}
.welcome-bar .wb-line {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px;
    min-width: 0;
}
/* 姓名（管理员/编辑等）在上；会员等级 / 积分等级图标 / 积分数在下，放不下自动换行 */
.welcome-bar .wb-line + .wb-member { margin-top: 5px; }
/* 积分等级图标 + 积分数作为一组，换行时一起下移，不被拆开 */
.wb-pts { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.welcome-bar .wb-sub {
    font-size: .82rem; line-height: 1.45; min-width: 0;
}
.welcome-bar button {
    flex: none; border: 1px solid var(--line); background: var(--bg-elev);
    color: var(--t2); border-radius: 999px; padding: 8px 16px;
    min-height: 38px; min-width: 64px;
    font-size: .85rem; cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.welcome-bar button:active { transform: scale(.96); }
.welcome-bar button:disabled { opacity: .6; cursor: default; transform: none; }

/* 分类区块 */
.cat-section { margin-bottom: 10px; }
.cat-head {
    width: 100%;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
    padding: 13px 16px;
    background: linear-gradient(135deg, var(--bg-head), var(--bg-head-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--t1);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    font-family: inherit;
    text-align: left;
}
.cat-head:active { transform: scale(.99); }
.cat-icon {
    flex: none; width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: var(--primary-contrast); font-size: 1.15rem;
}
.cat-title { flex: 1; min-width: 0; font-size: 1.12rem; font-weight: 800; }
.cat-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 描述独立占第二行，与标题文字左对齐，完整换行不省略；数据中的 \n 按换行显示 */
.cat-desc {
    flex: 0 0 100%;
    padding-left: 56px; /* 图标 44 + gap 12 */
    font-size: .74rem; font-weight: 400; color: var(--muted);
    line-height: 1.5;
    white-space: pre-line;
}
/* 窄屏：图标略缩，描述缩进同步 */
@media (max-width: 480px) {
    .cat-head { padding: 12px 14px; gap: 8px 10px; }
    .cat-icon { width: 40px; height: 40px; }
    .cat-desc { padding-left: 50px; }
}
.cat-count {
    flex: none; font-size: .9rem; color: var(--t2);
    background: var(--bg-elev); border-radius: 999px; padding: 3px 10px;
}
.chevron { color: var(--muted); transition: transform .3s; font-size: .95rem; }
.cat-section.collapsed .chevron { transform: rotate(-90deg); }
.cat-body {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height .35s ease, margin .35s ease;
    margin-top: 10px;
}
.cat-section.collapsed .cat-body { max-height: 0; margin-top: 0; }

/* 课程菜单：课程类单列大卡；应用中心两列 */
.menu-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.menu-grid.two-col { grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-card {
    display: flex; flex-direction: column; gap: 8px;
    min-width: 0;            /* grid item：防止一行长文本撑破 1fr 轨道 */
    min-height: 80px;
    padding: 11px 14px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none; color: var(--t1);
    box-shadow: var(--shadow-soft);
    transition: transform .15s, box-shadow .2s, border-color .2s;
    position: relative;
}
.menu-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.menu-card:active { transform: scale(.98); }

/* 第一行：图标在左、名称在右，固定一行（超长省略号兜底，不逐卡缩字） */
.m-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.menu-card .m-icon {
    flex: none;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--bg-elev); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.02rem;
}
.menu-name {
    flex: 1; min-width: 0;
    font-size: 1.02rem; font-weight: 700; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu-meta { margin-top: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .75rem; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.st-done { color: var(--ok); }
.st-done .dot { background: var(--ok); }
.st-updating { color: var(--warn); }
.st-updating .dot { background: var(--warn); }
.tag-pill {
    background: var(--bg-elev); color: var(--t2);
    border-radius: 999px; padding: 1px 8px; font-size: .68rem;
}
.url-note { position: absolute; top: 10px; right: 10px; font-size: .65rem; color: var(--warn); }


/* 应用中心两列卡：标题缩小一档保证完整，图标同步收窄 */
.menu-grid.two-col .menu-name { font-size: .96rem; }
.menu-grid.two-col .m-icon { width: 32px; height: 32px; border-radius: 9px; font-size: .92rem; }
.menu-grid.two-col .m-main { gap: 7px; }
.menu-grid.two-col .menu-meta { font-size: .68rem; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.page-footer {
    margin-top: 26px;
    padding: 16px 0 calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--divider);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.page-footer .footer-version,
.page-footer a, .page-footer button {
    background: none; border: none; cursor: pointer;
    color: var(--t2); font-size: .75rem; text-decoration: none; font-family: inherit;
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.page-footer .footer-version { cursor: default; }
.page-footer .footer-version i { font-size: .75rem; }
.page-footer a:hover, .page-footer button:hover { color: var(--t1); }
/* 三项之间用竖线分隔：版本号|使用协议|桌面端 */
.page-footer .footer-version,
.page-footer a {
    border-right: 1px solid var(--divider);
}

/* ---------- 底部设置抽屉 ---------- */
/* PWA 提示条（页脚上方，不弹窗不打扰） */
.pwa-hint-banner,
.pwa-installed-banner {
    margin-top: 14px;
    padding: 11px 16px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    line-height: 1.4;
}
/* 未安装：蓝色提示条，可点击（等同按顶栏莲花图标） */
.pwa-hint-banner {
    background: rgba(37, 99, 235, .1);
    border: 1px solid rgba(37, 99, 235, .32);
    color: #1d4ed8;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.pwa-hint-banner:active { background: rgba(37, 99, 235, .18); }
.pwa-hint-banner i { color: #1d4ed8; }
/* 已安装：绿色提示条 */
.pwa-installed-banner {
    background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .35);
    color: #16a34a;
}
.pwa-installed-banner i { color: #16a34a; }
.sheet-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    opacity: 0; pointer-events: none; transition: opacity .25s;
    z-index: 500;
}
.sheet-mask.open { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--bg-card);
    border-radius: 22px 22px 0 0;
    padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
    max-height: 86vh; overflow-y: auto;
    transform: translateY(100%); transition: transform .28s ease;
    z-index: 501;
    box-shadow: var(--shadow);
}
.sheet.open { transform: translateY(0); }
.sheet-handle { width: 42px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet-title {
    font-size: 1.1rem; font-weight: 800; text-align: center; margin-bottom: 16px;
    display: flex; align-items: baseline; justify-content: center; gap: 8px;
}
.sheet-version { font-size: .7rem; font-weight: 600; color: var(--muted); letter-spacing: .5px; white-space: nowrap; }
.sheet-group { margin-bottom: 20px; }
.sheet-group > .sg-label { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.sheet-theme-list { display: flex; flex-direction: column; gap: 10px; }
.sheet-theme-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius);
    background: var(--bg-card-2); border: 2px solid transparent;
    cursor: pointer;
}
.sheet-theme-item.active { border-color: var(--primary); }
.stepper { display: flex; align-items: center; gap: 14px; justify-content: center; }
.stepper button {
    width: 48px; height: 44px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--bg-elev);
    color: var(--t1); font-size: 1.1rem; cursor: pointer; font-weight: 700;
}
.stepper .scale-val { min-width: 64px; text-align: center; font-weight: 700; }
.seg { display: flex; background: var(--bg-elev); border-radius: 999px; padding: 4px; }
.seg button {
    flex: 1; min-height: 38px; border: none; background: none;
    border-radius: 999px; color: var(--t2); cursor: pointer; font-size: .88rem; font-weight: 600;
}
.seg button.active { background: var(--primary); color: var(--primary-contrast); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px; }
.switch-row .s-label { font-size: .95rem; }
.switch-row .s-label small { display: block; color: var(--muted); font-size: .76rem; }
.switch { position: relative; display: inline-block; width: 56px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--bg-elev); border: 1px solid var(--line);
    border-radius: 999px; transition: .25s;
}
.slider::before {
    content: ''; position: absolute; width: 22px; height: 22px;
    left: 3px; bottom: 3px; background: var(--muted);
    border-radius: 50%; transition: .25s;
}
.switch input:checked + .slider { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(26px); background: #fff; }
.sheet-tip { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 6px; line-height: 1.5; }

/* 青春版开启手势：保留单指上下滚动，双指捏合交给 JS 缩放（禁用浏览器原生缩放避免冲突） */
html.gesture-on, html.gesture-on body { touch-action: pan-y; }

/* 桌面端访问跳转页时（理论上自动去幻灯片，这里仅兜底排版） */
@media (min-width: 900px) {
    .page { max-width: 760px; }
}

/* ===== 移动门户 v45：入口门 + 全能播放器置顶（流光）+ 桌面模块 ===== */

/* 未登录/未选游客：先只显示登录注册卡片 */
body.is-gated #categoryWrap { display: none; }

/* 全能播放器置顶卡片：金 / 深桃红 / 明黄 流光 */
.player-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 17px 18px;
    border-radius: 18px;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(115deg, #9c1f45 0%, #b8405f 26%, #c8a35a 58%, #e8c878 78%, #f5e2a8 100%);
    background-size: 220% 220%;
    animation: ph-flow 9s ease-in-out infinite;
    box-shadow: 0 16px 34px -18px rgba(140, 26, 63, .7), inset 0 1px 0 rgba(255,255,255,.28);
    border: 1px solid rgba(255,255,255,.22);
}
.player-hero::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 226, 160, .35);
    pointer-events: none;
}
.ph-shine {
    position: absolute; top: -60%; left: -40%;
    width: 55%; height: 220%;
    background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.55) 48%, transparent 100%);
    transform: rotate(16deg);
    animation: ph-shine 4.6s ease-in-out infinite;
    pointer-events: none; z-index: 1;
}
.ph-icon {
    position: relative; z-index: 2;
    flex: none;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.45);
    font-size: 20px;
    box-shadow: 0 0 0 4px rgba(255,255,255,.1);
    animation: ph-pulse 2.8s ease-in-out infinite;
}
.ph-text { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ph-text b { font-size: 1.06rem; letter-spacing: .04em; font-weight: 700; text-shadow: 0 2px 8px rgba(80,10,30,.35); }
.ph-text em { font-style: normal; font-size: .78rem; opacity: .92; letter-spacing: .02em; }
.ph-go {
    position: relative; z-index: 2; flex: none;
    width: 32px; height: 32px; display: grid; place-items: center;
    border-radius: 50%; background: rgba(255,255,255,.24);
    border: 1px solid rgba(255,255,255,.4); font-size: 12px;
}
@keyframes ph-flow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes ph-shine { 0% { left: -55%; opacity: 0; } 18% { opacity: 1; } 55% { left: 115%; opacity: 0; } 100% { left: 115%; opacity: 0; } }
@keyframes ph-pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(255,255,255,.1); } 50% { box-shadow: 0 0 0 9px rgba(255,255,255,.04); } }
@media (prefers-reduced-motion: reduce) {
    .player-hero, .ph-shine, .ph-icon { animation: none; }
}

/* 桌面模块：与其它分组保持一致（不再使用差异化样式） */

/* 欢迎条 · 会员等级 / 积分等级 / 积分（三项同一规格） */
.wb-member {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin: 0;
    min-width: 0;
}
.wb-tier,
.wb-level,
.wb-points {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    height: 24px;
    padding: 0 9px;
    background: var(--bg-card-2);
    border: 2px solid var(--line);
    border-radius: 999px;
    font-size: .72rem;
    line-height: 1;
    color: var(--t1);
    text-decoration: none;
    white-space: nowrap;
}
/* 会员等级：外圈按等级着色，文字跟随皮肤 */
.wb-tier { font-weight: 600; }
.wb-tier[data-tier="D"] { border-color: #7c6bd6; }
.wb-tier[data-tier="G"] { border-color: #c9971f; }
.wb-tier[data-tier="S"] { border-color: #8b98a5; }
.wb-tier[data-tier="B"] { border-color: #b07a4f; }
/* 积分等级：与积分中心同一套图标 */
.wb-level { font-size: .72rem; }
.wb-level svg { width: 13px; height: 13px; display: block; }
.wb-level .bdgp-lvset { display: inline-flex; align-items: center; gap: 2px; }
/* 积分：数字 + 文字，字号统一 */
.wb-points b { font-size: .72rem; font-weight: 700; line-height: 1; }
.wb-points span { font-size: .72rem; font-weight: 400; line-height: 1; }
@media (max-width: 360px) {
    .wb-member, .wb-pts { gap: 5px; }
    .wb-tier, .wb-level, .wb-points { height: 22px; padding: 0 7px; font-size: .7rem; }
    .wb-points b, .wb-points span { font-size: .7rem; }
}
