/* ==========================================================================
   css/style.css —— 樱舞次元 / SAKURA DANCE
   二次元换肤：深色底 + 樱粉/紫/青渐变 + 玻璃拟态
   说明：仅重写视觉样式；所有 JS 依赖的 id / class 钩子全部保留，不做删改。
   全部背景与装饰均为纯 CSS（渐变 / 阴影），不引用任何外部图片、字体、CDN。
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
    --bg-color: #141021;          /* 深色基底 */
    --bg-deep: #0c0916;           /* 更深的底色 */
    --pink: #ff7ab6;              /* 樱粉 */
    --purple: #a855f7;            /* 紫 */
    --cyan: #5eead4;              /* 青 */
    --primary-color: #ff7ab6;     /* 兼容旧样式变量引用 */
    --secondary-color: #a855f7;
    --text-color: #f7f2ff;
    --muted: #b9a9d6;             /* 次要文字 */
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-strong: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.14);
    --purple-border: rgba(168, 85, 247, 0.45);
    --grad-brand: linear-gradient(120deg, #ff7ab6 0%, #c47cff 48%, #5eead4 100%);
    --grad-btn: linear-gradient(135deg, #ff7ab6 0%, #a855f7 100%);
    --grad-btn-hover: linear-gradient(135deg, #ff92c4 0%, #b96bff 100%);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-soft: 0 20px 45px rgba(6, 3, 14, 0.55);
    --glow-pink: 0 0 26px rgba(255, 122, 182, 0.42);
    --glow-purple: 0 0 26px rgba(168, 85, 247, 0.4);
    --nav-height: 58px;
    --font-base: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
}

html {
    -webkit-text-size-adjust: 100%;
    /* 底色放在 html 上，body 保持透明，保证 body::before/::after 的光晕与星点可见 */
    background-color: var(--bg-color);
}

body {
    min-height: 100dvh;
    background-color: transparent;
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* 光晕层：固定在视口，缓慢漂移 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(60vmax 60vmax at 6% -10%, rgba(255, 122, 182, 0.30), transparent 62%),
        radial-gradient(55vmax 55vmax at 98% 2%, rgba(168, 85, 247, 0.28), transparent 62%),
        radial-gradient(62vmax 62vmax at 52% 116%, rgba(94, 234, 212, 0.18), transparent 66%);
    animation: auroraFloat 18s ease-in-out infinite alternate;
}

/* 星点层：纯 CSS 径向渐变平铺 */
body::after {
    content: "";
    position: fixed;
    inset: -10%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.55;
    background-image:
        radial-gradient(1.6px 1.6px at 22% 28%, rgba(255, 255, 255, 0.9), transparent 100%),
        radial-gradient(1.4px 1.4px at 74% 14%, rgba(255, 214, 235, 0.85), transparent 100%),
        radial-gradient(1.8px 1.8px at 44% 72%, rgba(255, 255, 255, 0.7), transparent 100%),
        radial-gradient(1.2px 1.2px at 88% 62%, rgba(170, 236, 255, 0.8), transparent 100%),
        radial-gradient(1.3px 1.3px at 12% 86%, rgba(255, 255, 255, 0.6), transparent 100%),
        radial-gradient(1.1px 1.1px at 62% 40%, rgba(255, 200, 230, 0.7), transparent 100%);
    background-repeat: repeat;
    background-size: 320px 320px, 260px 260px, 400px 400px, 300px 300px, 360px 360px, 240px 240px;
    animation: starTwinkle 7s ease-in-out infinite alternate;
}

@keyframes auroraFloat {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    to { transform: translate3d(1.5%, 1.5%, 0) scale(1.05); }
}

@keyframes starTwinkle {
    from { opacity: 0.32; }
    to { opacity: 0.72; }
}

/* ---------- 滚动条（细描边樱花色） ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 122, 182, 0.55), rgba(168, 85, 247, 0.55));
    border-radius: 99px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::selection {
    background: rgba(255, 122, 182, 0.35);
    color: #fff;
}

/* ---------- 装饰层：飘落樱花瓣（纯 DOM + CSS，不响应点击） ---------- */
.sakura-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.sakura-layer i {
    position: absolute;
    top: -10vh;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #ffe0ee 0%, #ff7ab6 100%);
    border-radius: 62% 6% 62% 6%;
    opacity: 0.6;
    filter: drop-shadow(0 0 8px rgba(255, 122, 182, 0.55));
    animation: petalFall 16s linear infinite;
}

.sakura-layer i:nth-child(1) {
    left: 6%;
    animation-delay: -2s;
    animation-duration: 17s;
}

.sakura-layer i:nth-child(2) {
    left: 19%;
    width: 10px;
    height: 10px;
    animation-delay: -8s;
    animation-duration: 21s;
}

.sakura-layer i:nth-child(3) {
    left: 33%;
    width: 12px;
    height: 12px;
    animation-delay: -4s;
    animation-duration: 15s;
    opacity: 0.45;
}

.sakura-layer i:nth-child(4) {
    left: 47%;
    width: 9px;
    height: 9px;
    animation-delay: -12s;
    animation-duration: 23s;
}

.sakura-layer i:nth-child(5) {
    left: 63%;
    width: 15px;
    height: 15px;
    animation-delay: -6s;
    animation-duration: 19s;
    opacity: 0.5;
}

.sakura-layer i:nth-child(6) {
    left: 76%;
    width: 11px;
    height: 11px;
    animation-delay: -14s;
    animation-duration: 25s;
}

.sakura-layer i:nth-child(7) {
    left: 87%;
    width: 13px;
    height: 13px;
    animation-delay: -9s;
    animation-duration: 18s;
    opacity: 0.42;
}

.sakura-layer i:nth-child(8) {
    left: 54%;
    width: 8px;
    height: 8px;
    animation-delay: -17s;
    animation-duration: 22s;
}

@keyframes petalFall {
    0% {
        transform: translate3d(0, -12vh, 0) rotate(0deg);
        opacity: 0;
    }
    12% {
        opacity: 0.6;
    }
    50% {
        transform: translate3d(-36px, 52vh, 0) rotate(200deg);
    }
    88% {
        opacity: 0.55;
    }
    100% {
        transform: translate3d(28px, 112vh, 0) rotate(430deg);
        opacity: 0;
    }
}

/* ---------- 顶部导航（毛玻璃吸顶） ---------- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 clamp(12px, 3vw, 28px);
    background: rgba(20, 16, 33, 0.62);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 30px rgba(6, 3, 14, 0.45);
    z-index: 9999;
}

/* 导航底部霓虹细线 */
.main-nav::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 122, 182, 0.7), rgba(168, 85, 247, 0.7), rgba(94, 234, 212, 0.7), transparent);
    opacity: 0.75;
    pointer-events: none;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex: none;
}

.brand-mark {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(255, 122, 182, 0.8));
    animation: brandSway 4.5s ease-in-out infinite;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-name {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.08em;
    white-space: nowrap;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.brand-sub {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.26em;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

@keyframes brandSway {
    0%, 100% { transform: rotate(-6deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.08); }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: color 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-links a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 122, 182, 0.3), rgba(168, 85, 247, 0.3));
    border-color: rgba(255, 122, 182, 0.45);
    box-shadow: 0 0 18px rgba(255, 122, 182, 0.3), inset 0 0 12px rgba(255, 255, 255, 0.06);
}

/* ---------- 左上角在线统计 ---------- */
.top-bar {
    position: fixed;
    top: calc(var(--nav-height) + 8px);
    left: 8px;
    z-index: 9998;
    display: flex;
    gap: 6px;
    pointer-events: auto;
}

.stats-item {
    background: rgba(20, 16, 33, 0.6);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(6, 3, 14, 0.4);
    white-space: nowrap;
}

/* ---------- 首页布局 ---------- */
#app {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100dvh;
    padding: calc(var(--nav-height) + 18px) 12px 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stage {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.hero-head {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-title {
    font-size: clamp(18px, 4.6vw, 24px);
    font-weight: 800;
    letter-spacing: 0.14em;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-sub {
    font-size: 9px;
    letter-spacing: 0.34em;
    color: rgba(255, 255, 255, 0.42);
    text-transform: uppercase;
}

/* ---------- 播放器玻璃卡片 ---------- */
.video-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    z-index: 1;
}

.player-card {
    position: relative;
    padding: 10px;
    border-radius: var(--radius-xl);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft), 0 0 60px rgba(168, 85, 247, 0.16);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.player-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft), 0 0 70px rgba(255, 122, 182, 0.22);
}

/* 渐变描边（用遮罩实现 1px 渐变边框） */
.player-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 122, 182, 0.8), rgba(168, 85, 247, 0.35), rgba(94, 234, 212, 0.7));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.85;
}

.player-frame {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #08060f;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#player {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #08060f;
}

.player-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 6px 2px;
    flex-wrap: wrap;
}

.meta-chip {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 122, 182, 0.28), rgba(168, 85, 247, 0.28));
    border: 1px solid rgba(255, 122, 182, 0.4);
    box-shadow: 0 0 16px rgba(255, 122, 182, 0.22);
}

.meta-hint {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.04em;
}

/* ---------- 右下角操作按钮 ---------- */
.right-actions {
    position: fixed;
    right: 10px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    pointer-events: auto;
}

.action-btn {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(6, 3, 14, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.22s ease, background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.action-btn:hover {
    transform: translateY(-3px) scale(1.06);
    background: linear-gradient(135deg, rgba(255, 122, 182, 0.45), rgba(168, 85, 247, 0.45));
    border-color: rgba(255, 122, 182, 0.6);
    box-shadow: var(--glow-pink), 0 10px 26px rgba(6, 3, 14, 0.5);
}

.action-btn:active {
    transform: scale(0.96);
}

/* “下一个”按钮：主渐变 */
#nextBtn {
    background: var(--grad-btn);
    border-color: rgba(255, 200, 225, 0.5);
    box-shadow: var(--glow-pink), 0 10px 24px rgba(255, 122, 182, 0.28);
}

#nextBtn:hover {
    background: var(--grad-btn-hover);
    box-shadow: 0 0 30px rgba(255, 122, 182, 0.7), 0 12px 26px rgba(6, 3, 14, 0.5);
}

.action-text {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* 自动播放开关 */
.auto-play-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 5px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(6, 3, 14, 0.4);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.auto-play-toggle:hover {
    border-color: rgba(255, 122, 182, 0.5);
    box-shadow: 0 0 18px rgba(255, 122, 182, 0.3);
}

.auto-play-toggle span.toggle-text {
    font-size: 8px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    transition: background 0.35s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    transition: transform 0.35s;
}

input:checked + .slider {
    background-image: var(--grad-btn);
}

input:checked + .slider:before {
    transform: translateX(14px);
}

/* ---------- 加载层 ---------- */
.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 26px 30px;
    min-width: 220px;
    max-width: 86%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-lg);
    background: rgba(20, 16, 33, 0.72);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow-soft), 0 0 40px rgba(168, 85, 247, 0.3);
    z-index: 30;
}

.loading-overlay p {
    margin-top: 18px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    animation: pulse 1.8s ease-in-out infinite;
}

/* 双层樱花渐变环形加载 */
.spinner {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(255, 122, 182, 0) 0deg, #ff7ab6 130deg, #a855f7 220deg, #5eead4 320deg, rgba(94, 234, 212, 0) 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
    animation: spin 1s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 122, 182, 0.55));
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.55; }
    50% { opacity: 1; }
    100% { opacity: 0.55; }
}

/* ---------- 点赞红心动画（位置/缩放逻辑与 JS 配合，不可改） ---------- */
.heart-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 80px;
    line-height: 1;
    color: #ff7ab6;
    z-index: 10000;
    pointer-events: none;
    opacity: 1;
    animation: heartFade 2s ease-out forwards;
    text-shadow: 0 0 22px rgba(255, 122, 182, 0.9), 0 0 40px rgba(168, 85, 247, 0.7);
}

@keyframes heartFade {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ---------- 全局 Toast（二次元玻璃胶囊） ---------- */
.anime-toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: 92vw;
    pointer-events: none;
}

.anime-toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 122, 182, 0.35), rgba(168, 85, 247, 0.42));
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255, 158, 202, 0.55);
    box-shadow: 0 12px 30px rgba(6, 3, 14, 0.55), 0 0 26px rgba(255, 122, 182, 0.35);
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        toastFadeOut 0.3s ease-out 2.7s forwards;
}

.anime-toast::before {
    content: "🌸";
    font-size: 15px;
    line-height: 1;
}

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

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

/* ---------- 通用玻璃卡片 ---------- */
.glass-box {
    position: relative;
    border-radius: var(--radius-xl);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft), 0 0 50px rgba(168, 85, 247, 0.14);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

/* ==========================================================================
   大厅（lobby.php）
   ========================================================================== */
.page-lobby {
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.chat-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 760px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: calc(var(--nav-height) + 12px) 12px 14px;
}

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 6px 0;
    flex: none;
}

.chat-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.chat-sub {
    margin-top: 2px;
    font-size: 9px;
    letter-spacing: 0.28em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.chat-live {
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--cyan);
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(94, 234, 212, 0.35);
    background: rgba(94, 234, 212, 0.08);
    box-shadow: 0 0 16px rgba(94, 234, 212, 0.2);
    flex: none;
    animation: pulse 2.4s ease-in-out infinite;
}

.chat-box {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 14px;
    overflow-y: auto;
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft), inset 0 0 40px rgba(168, 85, 247, 0.06);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

/* 聊天气泡 */
.msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.msg-row.me {
    flex-direction: row-reverse; /* 自己发的消息靠右 */
}

.avatar {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: #241b38;
    border: 2px solid rgba(255, 122, 182, 0.65);
    box-shadow: 0 0 14px rgba(255, 122, 182, 0.35);
}

.msg-content {
    display: flex;
    flex-direction: column;
    max-width: 74%;
}

.msg-row.me .msg-content {
    align-items: flex-end;
}

.nickname {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
    padding: 0 2px;
}

/* 覆盖聊天脚本里内联的时间戳颜色（#666 在深色底上过暗） */
.nickname span {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.38) !important;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 16px 16px 16px 6px;
    font-size: 14px;
    line-height: 1.55;
    color: #f4edff;
    word-break: break-word;
    background: rgba(168, 85, 247, 0.18);
    border: 1px solid rgba(168, 85, 247, 0.32);
    box-shadow: 0 8px 20px rgba(6, 3, 14, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.msg-row.me .msg-bubble {
    border-radius: 16px 16px 6px 16px;
    background: linear-gradient(135deg, rgba(255, 122, 182, 0.3), rgba(94, 234, 212, 0.18));
    border-color: rgba(255, 122, 182, 0.45);
    box-shadow: 0 8px 22px rgba(255, 122, 182, 0.18);
}

/* 聊天输入区 */
.input-area {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.input-area input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 11px 16px;
    font-size: 14px;
    color: #fff;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.input-area input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.input-area input[type="text"]:focus {
    border-color: rgba(255, 122, 182, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 122, 182, 0.16), 0 0 20px rgba(255, 122, 182, 0.25);
}

.input-area button {
    flex: none;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255, 200, 225, 0.45);
    border-radius: 999px;
    background: var(--grad-btn);
    box-shadow: var(--glow-pink), 0 8px 20px rgba(6, 3, 14, 0.4);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.input-area button:hover {
    background: var(--grad-btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 122, 182, 0.65), 0 10px 24px rgba(6, 3, 14, 0.45);
}

.input-area button:active {
    transform: scale(0.97);
}

/* ==========================================================================
   个人中心（profile.php）
   ========================================================================== */
.page-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    padding: calc(var(--nav-height) + 22px) 14px 44px;
}

.page-profile .glass-box {
    padding: clamp(20px, 5vw, 30px);
}

.page-profile h2 {
    text-align: center;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 18px;
}

.avatar-wrap {
    position: relative;
    text-align: center;
    margin-bottom: 12px;
}

.avatar-wrap img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
    border: 3px solid transparent;
    background-image: linear-gradient(#1b1429, #1b1429), var(--grad-brand);
    background-origin: border-box;
    background-clip: content-box, border-box;
    box-shadow: 0 0 28px rgba(255, 122, 182, 0.45);
}

.role-badge {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    border-radius: 999px;
    background: var(--grad-btn);
    border: 2px solid rgba(20, 16, 33, 0.9);
    box-shadow: 0 0 16px rgba(255, 122, 182, 0.5);
    white-space: nowrap;
}

.avatar-file {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
    max-width: 100%;
}

.avatar-file::file-selector-button {
    margin-right: 10px;
    padding: 7px 14px;
    font-size: 12px;
    font-family: inherit;
    color: #fff;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s;
}

.avatar-file::file-selector-button:hover {
    background: rgba(255, 122, 182, 0.25);
    border-color: rgba(255, 122, 182, 0.5);
}

.reg-time {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
}

/* 数据面板：注意仅在 .stats-panel 内生效，避免影响首页左上角 .stats-item */
.stats-panel {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    padding: 14px 10px;
    margin-bottom: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stats-panel .stats-item {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.stats-panel .stats-item h4 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.stats-panel .stats-item p {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    color: #fff;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.form-group textarea {
    resize: vertical;
    min-height: 72px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(255, 122, 182, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 122, 182, 0.15), 0 0 20px rgba(255, 122, 182, 0.22);
}

.form-group input.is-readonly {
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.04);
    border-style: dashed;
    cursor: not-allowed;
}

.btn-wrap {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-wrap button,
.btn-logout {
    flex: 1;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-save {
    background: var(--grad-btn);
    border-color: rgba(255, 200, 225, 0.5);
    box-shadow: var(--glow-pink), 0 10px 24px rgba(6, 3, 14, 0.4);
}

.btn-save:hover {
    background: var(--grad-btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 122, 182, 0.6), 0 12px 26px rgba(6, 3, 14, 0.45);
}

.btn-back {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.35);
}

.btn-logout {
    width: 100%;
    margin-top: 12px;
    background: rgba(255, 122, 182, 0.14);
    border-color: rgba(255, 122, 182, 0.35);
    color: #ffb3d4;
}

.btn-logout:hover {
    background: rgba(255, 122, 182, 0.26);
    box-shadow: 0 0 22px rgba(255, 122, 182, 0.35);
}

.btn-wrap button:active,
.btn-logout:active {
    transform: scale(0.97);
}

/* ==========================================================================
   登录 / 注册（login.php）
   ========================================================================== */
.page-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 28px 16px;
}

.auth-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 18px;
    text-align: center;
}

.auth-brand .brand-mark {
    font-size: 30px;
    filter: drop-shadow(0 0 16px rgba(255, 122, 182, 0.8));
}

.auth-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.14em;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.auth-sub {
    font-size: 9px;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.45);
}

.auth-card {
    padding: clamp(22px, 6vw, 34px);
    text-align: center;
}

.auth-card h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 18px;
}

.auth-card input[type="text"],
.auth-card input[type="password"] {
    display: block;
    width: 100%;
    margin: 0 auto 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: #fff;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.auth-card input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.auth-card input:focus {
    border-color: rgba(255, 122, 182, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 122, 182, 0.15), 0 0 20px rgba(255, 122, 182, 0.22);
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 4px;
}

.captcha-row input[type="text"] {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.captcha-row img {
    width: 108px;
    height: 42px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 122, 182, 0.45);
    box-shadow: 0 0 14px rgba(255, 122, 182, 0.25);
    transition: box-shadow 0.25s, transform 0.25s;
    flex: none;
}

.captcha-row img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(255, 122, 182, 0.5);
}

.auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.auth-actions button {
    flex: 1;
    padding: 11px 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #fff;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-login {
    background: var(--grad-btn);
    border-color: rgba(255, 200, 225, 0.5);
    box-shadow: var(--glow-pink), 0 10px 24px rgba(6, 3, 14, 0.4);
}

.btn-login:hover {
    background: var(--grad-btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 122, 182, 0.65), 0 12px 26px rgba(6, 3, 14, 0.45);
}

.btn-register {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(168, 85, 247, 0.5);
}

.btn-register:hover {
    background: rgba(168, 85, 247, 0.36);
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(168, 85, 247, 0.5);
}

.auth-actions button:active {
    transform: scale(0.97);
}

.auth-card .tips {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
}

.auth-card .back-row {
    margin-top: 10px;
}

.auth-card .back-row a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.25s, text-shadow 0.25s;
}

.auth-card .back-row a:hover {
    color: var(--pink);
    text-shadow: 0 0 14px rgba(255, 122, 182, 0.6);
}

/* ---------- 无障碍：键盘焦点可见 ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(255, 122, 182, 0.7);
    outline-offset: 2px;
}

/* ==========================================================================
   响应式：移动端优先，600px 以下单列、无横向滚动
   ========================================================================== */
@media (max-width: 600px) {
    :root {
        --nav-height: 54px;
        --radius-xl: 22px;
    }

    .main-nav {
        padding: 0 10px;
        gap: 8px;
    }

    .brand-mark {
        font-size: 17px;
    }

    .brand-name {
        font-size: 16px;
        letter-spacing: 0.06em;
    }

    .brand-sub {
        font-size: 7px;
        letter-spacing: 0.2em;
    }

    .nav-links {
        gap: 2px;
    }

    .nav-links a {
        padding: 6px 9px;
        font-size: 12px;
    }

    #app {
        padding: calc(var(--nav-height) + 14px) 10px 96px;
        align-items: flex-start;
    }

    .stage {
        gap: 10px;
    }

    .hero-title {
        font-size: 18px;
    }

    .player-card {
        padding: 7px;
    }

    .player-frame {
        border-radius: 15px;
    }

    .player-meta {
        padding: 8px 4px 2px;
    }

    .right-actions {
        right: 8px;
        bottom: 14px;
        gap: 8px;
    }

    .action-btn {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 15px;
    }

    .auto-play-toggle {
        padding: 5px 4px;
        border-radius: 12px;
    }

    .loading-overlay {
        padding: 20px 22px;
        min-width: 190px;
    }

    .loading-overlay p {
        font-size: 12px;
    }

    .spinner {
        width: 46px;
        height: 46px;
    }

    .anime-toast {
        padding: 9px 16px;
        font-size: 13px;
        max-width: 92vw;
    }

    .chat-shell {
        padding: calc(var(--nav-height) + 10px) 10px 10px;
        gap: 8px;
    }

    .chat-box {
        padding: 12px 10px;
        border-radius: var(--radius-xl);
    }

    .msg-content {
        max-width: 78%;
    }

    .msg-bubble {
        font-size: 13px;
        padding: 9px 12px;
    }

    .input-area {
        padding: 6px;
        gap: 6px;
    }

    .input-area input[type="text"] {
        padding: 10px 13px;
        font-size: 13px;
    }

    .input-area button {
        padding: 10px 15px;
        font-size: 13px;
    }

    .profile-shell {
        padding: calc(var(--nav-height) + 16px) 10px 32px;
    }

    .page-profile .glass-box {
        padding: 18px 14px;
    }

    .avatar-wrap img {
        width: 84px;
        height: 84px;
    }

    .btn-wrap {
        flex-direction: column;
    }

    .auth-wrap {
        max-width: 100%;
    }

    .auth-name {
        font-size: 23px;
    }

    .captcha-row img {
        width: 96px;
        height: 40px;
    }
}

/* 矮屏（横屏手机等）：登录卡片改为顶部对齐，避免被裁切 */
@media (max-height: 520px) {
    .page-auth {
        align-items: flex-start;
    }
}

/* 桌面端把操作按钮贴近播放器卡片右侧，避免飘到屏幕边缘 */
@media (min-width: 601px) {
    .right-actions {
        right: max(10px, calc(50vw - 320px));
    }
}

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
    .sakura-layer i,
    body::before,
    body::after,
    .brand-mark {
        animation: none;
    }
}
