:root {
    --bg: #0d0d0f;
    --bg-elevated: #151518;
    --fg: #f4f4f5;
    --muted: #8b8b90;
    --red: #e50914;
    --red-soft: rgba(229, 9, 20, 0.15);
    --line: #2a2a2f;
    --accent: linear-gradient(135deg, #ff8a43 0%, #e50914 55%, #b30710 100%);
    --glass: rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 55% at 50% -15%, rgba(229, 9, 20, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 40% at 100% 0%, rgba(120, 60, 200, 0.08), transparent 45%);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.page-user .app-wrap {
    background: linear-gradient(180deg, #12121a 0%, var(--bg) 42%);
}

body { display: flex; justify-content: center; }

.app-wrap {
    width: 100%;
    max-width: 428px;
    min-height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

/* 顶栏 */
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(13, 13, 15, 0.86);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.topbar-slogan {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: clamp(9px, 2.75vw, 11px);
    font-weight: 700;
    color: #34d399;
    text-shadow: 0 0 12px rgba(52, 211, 153, 0.22);
    white-space: nowrap;
    letter-spacing: 0.01em;
    line-height: 1.3;
}
.logo {
    flex-shrink: 0;
    color: var(--fg);
    font-weight: 800;
    letter-spacing: 1px;
    text-decoration: none;
    font-size: 18px;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.logo-dot {
    font-size: 11px;
    font-weight: 700;
    color: var(--red);
    border: 1px solid rgba(229, 9, 20, 0.45);
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0;
}

/* 分类菜单：柔和红底白字；每排均分铺满整行（最多 5 个） */
.cat-nav {
    padding: 10px 10px 12px;
    border-bottom: 1px solid rgba(180, 80, 90, 0.35);
    background: linear-gradient(180deg, #241416 0%, #181516 100%);
}
.cat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    align-items: stretch;
    margin-bottom: 8px;
    width: 100%;
}
.cat-row:last-child {
    margin-bottom: 0;
}
.cat-item {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: #fffefd;
    text-decoration: none;
    border: 1px solid rgba(120, 40, 50, 0.45);
    border-radius: 10px;
    background: linear-gradient(180deg, #c93540 0%, #9e2931 52%, #7a252c 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    overflow: visible;
    transition: filter 0.15s, box-shadow 0.15s, transform 0.12s;
}
.cat-item:active {
    transform: scale(0.98);
    filter: brightness(1.05);
}
.cat-item.active {
    color: #fffefd;
    border-color: rgba(255, 200, 200, 0.45);
    background: linear-gradient(180deg, #d84852 0%, #bf323d 42%, #8f2931 100%);
    box-shadow: 0 0 0 1px rgba(255, 190, 180, 0.25), 0 3px 12px rgba(190, 50, 60, 0.35);
}

/* 播放页标题与推荐区块 */
.play-title {
    margin: 14px 0 16px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fg);
}
.play-rec {
    margin-top: 8px;
}
.play-rec .section-title {
    margin-top: 4px;
}

.main {
    padding: 12px 12px 86px;
}
.main.page-user {
    padding-top: 8px;
}

/* 幻灯 */
.slider {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.slider-inner {
    display: flex;
    transition: transform 0.35s ease;
}
.slide {
    min-width: 100%;
    position: relative;
}
.slide img {
    width: 100%;
    height: 152px;
    object-fit: cover;
    display: block;
    background: #111;
}
.slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 8px;
    background: var(--bg-elevated);
}
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #444;
    transition: background 0.2s;
}
.dot.on { background: var(--red); }

/* 分区标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
    margin: 14px 0 12px;
}
.section-title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--accent);
}

/* 卡片网格 */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-elevated);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
}
.card:active {
    transform: scale(0.985);
}
.card img {
    width: 100%;
    height: 118px;
    object-fit: cover;
    background: #0d0d0f;
}
.card .t {
    padding: 9px 10px 10px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-shell {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}
.player-shell video,
.player-shell .dplayer { width: 100% !important; }

/* 通用按钮（个人中心等） */
.btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    text-decoration: none;
    transition: filter 0.15s;
}
.btn.primary {
    background: var(--accent);
    color: #fff;
}
.btn.primary:active { filter: brightness(1.06); }
.btn.ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
}

.input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.35);
    color: var(--fg);
    font-size: 15px;
}
.err { color: #ff7a7a; font-size: 12px; margin-top: 6px; min-height: 16px; }

/* 开通会员 · 底部弹窗 */
.modal[hidden] { display: none !important; }
.vip-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.vip-modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.vip-sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 428px;
    max-height: 88vh;
    overflow: auto;
    background: linear-gradient(180deg, #1f1f26 0%, #141418 42%, #111113 100%);
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: none;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
    animation: vip-up 0.28s ease-out;
}
@keyframes vip-up {
    from { transform: translateY(100%); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}
.vip-sheet-head {
    padding: 22px 20px 12px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.vip-sheet-head h2 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
}
.vip-sheet-sub {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}
.vip-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.vip-sheet-body {
    padding: 16px 16px calc(22px + env(safe-area-inset-bottom));
}
.vip-label {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.06em;
    margin: 0 0 10px;
    text-transform: uppercase;
}
.vip-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.vip-plan {
    position: relative;
    display: block;
    cursor: pointer;
    border: 2px solid var(--line);
    border-radius: 14px;
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.vip-plan input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.vip-plan:has(input:checked) {
    border-color: rgba(229, 9, 20, 0.75);
    background: var(--red-soft);
    box-shadow: 0 0 0 1px rgba(229, 9, 20, 0.25);
}
.vip-plan-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--red);
    background: rgba(229, 9, 20, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.vip-plan-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.vip-plan-price {
    display: block;
    font-size: 22px;
    font-weight: 800;
    background: var(--accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}
.vip-plan-sub {
    display: block;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.35;
}
.vip-field { margin-bottom: 14px; }
.vip-select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.35);
    color: var(--fg);
    font-size: 14px;
}
.vip-hint, .vip-empty {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 12px;
}
.vip-order-panel {
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.25);
}
.vip-order-line {
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--muted);
    word-break: break-all;
}
.vip-order-line strong { color: var(--fg); font-size: 16px; }
.vip-err {
    min-height: 20px;
    font-size: 13px;
    color: #ff7a7a;
    margin: 0 0 10px;
}
.vip-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
}
.vip-btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 24px rgba(229, 9, 20, 0.35);
}
.vip-btn-demo {
    background: linear-gradient(135deg, #3d3d48, #2a2a32);
    color: #e8e8ec;
    border: 1px solid var(--line);
}
.vip-btn-ghost {
    background: transparent;
    color: var(--muted);
    font-weight: 500;
}

/* 个人中心 */
.user-hero {
    border-radius: 16px;
    padding: 20px 18px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.22) 0%, rgba(90, 40, 140, 0.12) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    gap: 14px;
    align-items: center;
}
.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.user-hero-meta { flex: 1; min-width: 0; }
.user-name {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-chip {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(0, 0, 0, 0.35);
    padding: 4px 10px;
    border-radius: 999px;
    margin-right: 6px;
}
.user-chip.muted {
    font-weight: 500;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
}

.u-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    background: var(--bg-elevated);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.u-card h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.u-card h3::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--red);
}

.u-muted { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0 0 8px; }
.u-strong { font-size: 22px; font-weight: 800; letter-spacing: 1px; color: var(--red); margin: 4px 0; font-variant-numeric: tabular-nums; }
.u-code-inline {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 12px;
    color: var(--fg);
}

/* 底部四栏 Tab */
.tabbar {
    --tab-muted: #8b8b8f;
    --tab-on-text: #ff6b84;
    --tab-glow: rgba(255, 90, 120, 0.45);
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 428px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    border-top: 1px solid #1f1f1f;
    background: #121214;
    z-index: 100;
    padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
}
.tabbar .tab {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 0 4px;
    text-decoration: none;
    color: var(--tab-muted);
    font-size: 11px;
    line-height: 1.15;
    -webkit-tap-highlight-color: transparent;
}
.tabbar .tab .txt {
    letter-spacing: 0;
}
.tabbar .tab:not(.on) .txt { color: var(--tab-muted); }
.tabbar .tab.on .txt {
    color: var(--tab-on-text);
    font-weight: 600;
}
.tabbar .ico {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.tabbar .ico svg {
    width: 30px;
    height: 30px;
    display: block;
}
.tabbar .tab:not(.on) .ico { background: transparent; }
.tabbar .tab:not(.on) svg .i-ring,
.tabbar .tab:not(.on) svg .i-frame,
.tabbar .tab:not(.on) svg .i-loop,
.tabbar .tab:not(.on) svg .i-loop2,
.tabbar .tab:not(.on) svg .i-hot,
.tabbar .tab:not(.on) svg .i-hot-s,
.tabbar .tab:not(.on) svg .i-me,
.tabbar .tab:not(.on) svg .i-me-cap {
    stroke: #7c7c82;
    stroke-width: 1.75;
    fill: none;
}
.tabbar .tab:not(.on) svg .i-play {
    fill: #7c7c82;
}
.tabbar .tab.on .ico {
    background: linear-gradient(145deg, #ffb347 0%, #ff6b6b 45%, #ff2d78 100%);
    box-shadow: 0 2px 10px var(--tab-glow);
    transform: scale(1.04);
}
.tabbar .tab.on svg .i-ring,
.tabbar .tab.on svg .i-frame,
.tabbar .tab.on svg .i-loop,
.tabbar .tab.on svg .i-loop2,
.tabbar .tab.on svg .i-hot,
.tabbar .tab.on svg .i-hot-s,
.tabbar .tab.on svg .i-me,
.tabbar .tab.on svg .i-me-cap {
    stroke: #ffffff;
    stroke-width: 1.75;
    fill: none;
}
.tabbar .tab.on svg .i-play {
    fill: #ffffff;
}
