﻿:root {
    /* 核心色板 - 采用更有层次的暗色系，而非纯黑 */
    --bg-base: #0f1115;
    --bg-gradient: radial-gradient(circle at top right, #1e2330 0%, #0f1115 100%);
    
    /* 玻璃拟态表面 */
    --surface: rgba(30, 35, 45, 0.7);
    --surface-solid: #1e232d;
    --surface-hover: rgba(45, 50, 60, 0.8);
    --surface-border: rgba(255, 255, 255, 0.08);
    
    /* 文字颜色 - 提高对比度与柔和度 */
    --text-main: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* 品牌色 - 更加典雅的流金 */
    --primary: #e0b06b;
    --primary-hover: #f0c07b;
    --primary-dim: rgba(224, 176, 107, 0.15);
    --primary-glow: rgba(224, 176, 107, 0.4);
    
    /* 辅助色 */
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    
    /* 质感 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(224, 176, 107, 0.15);
    
    --font-main: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-serif: "Playfair Display", "Songti SC", "SimSun", "Georgia", serif; /* 用于大标题增加神秘感 */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-main);
    background: var(--bg-base);
    background-image: var(--bg-gradient);
    background-attachment: scroll;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    min-height: 100vh;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 隐藏滚动条但保持滚动功能 */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary);
}

/* --- Layout --- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar 玻璃化 */
.sidebar {
    width: 240px;
    background: var(--surface-solid);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px 20px;
    z-index: 50;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* 导航栏分组样式 */
.nav-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 侧边栏底部固定区域 */
.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 导航项徽章 */
.nav-badge {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--surface-solid);
    color: var(--text-muted);
}

.nav-badge.soon {
    background: rgba(224, 176, 107, 0.15);
    color: var(--primary);
}

.nav-badge.new {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

/* 禁用的导航项 */
.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 管理后台入口特殊样式 */
.nav-item.admin-portal {
    background: linear-gradient(135deg, rgba(224, 176, 107, 0.1) 0%, rgba(224, 176, 107, 0.05) 100%);
    border: 1px solid rgba(224, 176, 107, 0.2);
    justify-content: space-between;
}

.nav-item.admin-portal:hover {
    background: linear-gradient(135deg, rgba(224, 176, 107, 0.2) 0%, rgba(224, 176, 107, 0.1) 100%);
    border-color: rgba(224, 176, 107, 0.4);
}

.nav-item.admin-portal .nav-arrow {
    font-size: 12px;
    opacity: 0.6;
    transition: transform 0.2s, opacity 0.2s;
}

.nav-item.admin-portal:hover .nav-arrow {
    transform: translateX(4px);
    opacity: 1;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 28px;
    color: var(--text-main);
    letter-spacing: 0.5px;
    font-family: var(--font-serif);
}

.brand i {
    font-size: 20px;
    color: var(--primary);
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

/* 剧盒品牌样式 */
.juhe-brand {
    gap: 10px;
}

.brand-logo-mini {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 12px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
    border-color: rgba(224, 176, 107, 0.1);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    /* 增加一个全局的微妙光效背景 */
    background: radial-gradient(circle at 50% 0%, rgba(30, 35, 50, 0.5) 0%, transparent 70%);
}

/* Topbar - 现代玻璃拟态设计 */
.topbar {
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 40;
    position: sticky;
    top: 0;
    /* 默认状态：完全透明，融入背景 */
    background: rgba(15, 17, 21, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border: 1px solid transparent;
    box-shadow: 0 0 0 rgba(0,0,0,0);
    /* 优化动画曲线，使其更丝滑 */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 8px 16px 0;
    border-radius: var(--radius-lg);
    will-change: background, padding, backdrop-filter;
}

/* 滚动后的玻璃效果 */
.topbar.scrolled {
    background: rgba(15, 17, 21, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    padding: 12px 24px;
    margin: 8px 16px;
}

/* 用户信息区域的悬浮效果 */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-right form {
    margin: 0;
    display: flex;
    align-items: center;
}

/* 语言切换 - 更精致的胶囊设计 */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 3px;
}

.lang-switch .btn.ghost {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    letter-spacing: 0.5px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.lang-switch .btn.ghost:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.lang-switch .btn.ghost.active {
    opacity: 1;
    background: var(--primary-dim);
    color: var(--primary);
}

/* 用户徽章 - 精致胶囊设计 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
    font-weight: 500;
    font-size: 13px;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.badge:hover {
    background: rgba(40, 45, 58, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.badge i {
    color: var(--primary);
    font-size: 12px;
}

/* User Info Bar with Stats - 更紧凑的布局 */
.user-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 迷你统计胶囊 - 更精致的设计 */
.stat-mini {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(30, 35, 48, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.stat-mini:hover {
    background: rgba(40, 45, 58, 0.7);
    color: var(--text-main);
}

.stat-mini i {
    color: var(--primary);
    font-size: 11px;
    opacity: 0.8;
}

/* 钱包胶囊 - 特殊强调 */
.wallet-pill {
    gap: 5px;
    background: rgba(224, 176, 107, 0.08);
    border-color: rgba(224, 176, 107, 0.15);
}

.wallet-pill:hover {
    background: rgba(224, 176, 107, 0.12);
    border-color: rgba(224, 176, 107, 0.25);
}

.wallet-pill .wallet-label {
    color: var(--text-muted);
    font-size: 11px;
}

.wallet-pill #wallet-balance-value {
    color: var(--primary);
    font-weight: 600;
}

.wallet-pill.negative {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.wallet-pill.negative,
.wallet-pill.negative #wallet-balance-value {
    color: var(--accent-red);
}

.wallet-pill.negative i {
    color: var(--accent-red);
}

/* 负余额提示 - 更柔和的警告 */
.wallet-negative-tip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
    color: var(--accent-red);
    font-size: 11px;
    animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Page Container */
.page {
    padding: 12px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

h1 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 16px;
}

h1 i {
    color: var(--primary);
    opacity: 0.8;
}

/* --- Cards & Grid --- */

.grid {
    display: grid;
    gap: 24px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
    transition: border-color 0.15s ease, background-color 0.15s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: rgba(224, 176, 107, 0.35);
    background: var(--surface-hover);
}

/* 卡片微光效果 - 简化以提升性能 */
.card::after {
    display: none;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--text-main);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 24px 0;
    font-size: 15px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(30, 35, 45, 0.6), rgba(20, 25, 30, 0.8));
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    z-index: 10;
    position: relative;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-dim);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 0 15px rgba(224, 176, 107, 0.1);
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    color: var(--text-main);
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-serif);
}

.stat-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* --- Buttons --- */

.btn {
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn.small {
    padding: 8px 16px;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.btn.primary {
    background: var(--primary);
    color: #0f1115;
    box-shadow: 0 4px 12px rgba(224, 176, 107, 0.3);
}

.btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(224, 176, 107, 0.5);
    transform: translateY(-1px);
}

.btn.secondary {
    background: var(--surface-hover);
    color: var(--text-main);
    border: 1px solid var(--surface-border);
}

.btn.secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--text-muted);
}

.btn.ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn.ghost:hover {
    color: var(--text-main);
    background: var(--surface-border);
}

.btn.ghost.active {
    background: var(--surface-solid);
    color: var(--text-main);
    border-color: var(--surface-border);
}

/* --- Hero Section (Mysterious Style) --- */

.hero {
    position: relative;
    /* 更复杂的背景，营造神秘氛围 */
    background: 
        radial-gradient(circle at 20% 150%, rgba(224, 176, 107, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% -50%, rgba(60, 70, 90, 0.4) 0%, transparent 50%),
        #151820;
    border-radius: 24px;
    padding: 80px 60px;
    overflow: hidden;
    border: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 480px;
    box-shadow: var(--shadow-lg);
}

/* 动态迷雾效果 (简化版) */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    letter-spacing: -1px;
}

.hero h1 i {
    color: var(--primary);
    -webkit-text-fill-color: initial;
    margin-right: 16px;
    filter: drop-shadow(0 0 15px var(--primary-glow));
}

.hero p {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

/* --- Forms & Inputs --- */

/* 全局表单元素样式 - 适用于所有 input/select/textarea */
input,
select,
textarea {
    background: rgba(20, 22, 28, 0.8);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(20, 22, 28, 0.95);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Select 下拉箭头自定义 */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

select:hover {
    border-color: var(--text-muted);
}

/* Number input 隐藏默认箭头 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* .form 类下的特定样式 */
.form label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
}

.auth-card {
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 48px;
    max-width: 460px;
    width: 100%;
    margin: 60px auto;
    box-shadow: var(--shadow-md);
}

.auth-card.wide {
    max-width: 700px;
}

.form-foot {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-foot .link {
    color: var(--primary);
    font-weight: 600;
    transition: color 0.2s;
}

.form-foot .link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* --- Table Styles --- */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
}

th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--surface-border);
    font-weight: 600;
}

td {
    padding: 16px;
    color: var(--text-main);
    border-bottom: 1px solid var(--surface-border);
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.code-pill {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: "JetBrains Mono", monospace;
    letter-spacing: 1px;
    color: var(--primary);
    border: 1px solid rgba(224, 176, 107, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --- Dashboard Header --- */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.welcome-section h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.welcome-section .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    position: relative;
    width: 240px;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-bar input {
    width: 100%;
    padding-left: 36px;
    background: var(--surface);
    border-radius: 20px;
    height: 40px;
    font-size: 13px;
}

/* --- Filter Bar --- */

.filter-bar {
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 20px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.filter-group select {
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    min-width: 120px;
}

.clear-filters {
    padding: 8px;
    color: var(--text-muted);
}

.filter-actions {
    flex-shrink: 0;
}

/* --- Section Header --- */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 18px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* --- Room Grid & Cards --- */

.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.room-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(224, 176, 107, 0.3);
}

.room-cover {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.room-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
}

.room-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.room-status-badge.open { color: var(--accent-green); border-color: rgba(16, 185, 129, 0.3); }
.room-status-badge.full { color: var(--accent-red); border-color: rgba(239, 68, 68, 0.3); }

.room-host {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
    transition: transform 0.2s;
}

.room-host:hover {
    transform: scale(1.05);
}

.room-host img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.room-host span {
    font-size: 12px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    font-weight: 500;
}

.room-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.room-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.room-title:hover {
    color: var(--primary);
}

.room-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item i {
    color: var(--text-muted);
}

.room-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.room-action {
    margin-top: auto;
}

/* --- Script Cards (Enhanced) --- */

.script-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.script-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: block;
    aspect-ratio: 2/3;
}

.script-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.script-cover {
    width: 100%;
    height: 100%;
    background-color: #1a1d24;
    background-size: cover;
    background-position: center;
    position: relative;
}

.script-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(15, 17, 21, 0.95) 100%);
}

.script-info {
    padding: 16px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

.script-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.script-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
}

.script-card:hover .script-overlay {
    opacity: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-radius: 16px;
    border: 1px dashed var(--surface-border);
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--text-main);
}

.empty-state p {
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    font-size: 14px;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .app-shell { flex-direction: column; }
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: static;
        flex-direction: row; 
        align-items: center; 
        overflow-x: auto; 
        padding: 16px; 
        border-right: none;
        border-bottom: 1px solid var(--surface-border);
    }
    .brand { margin-bottom: 0; margin-right: 30px; }
    .nav { flex-direction: row; gap: 20px; }
    .nav-section { flex-direction: row; }
    .nav-title { display: none; }
    .page { padding: 24px; }
    .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
    .topbar { 
        padding: 12px 16px; 
        margin: 8px 12px 0;
    }
    .topbar.scrolled {
        padding: 10px 14px;
        margin: 6px 10px;
    }
    /* 移动端隐藏用户统计，只显示核心信息 */
    .user-stats {
        display: none;
    }
    .user-info-bar {
        gap: 8px;
    }
    .badge {
        padding: 5px 10px;
        font-size: 12px;
    }
    .lang-switch {
        padding: 2px;
    }
    .lang-switch .btn.ghost {
        padding: 5px 8px;
        font-size: 11px;
    }
    .topbar-right {
        gap: 8px;
    }
    .topbar-right .btn.ghost {
        padding: 6px 10px;
        font-size: 11px;
    }
    .hero { padding: 40px 24px; text-align: center; align-items: center; }
    .hero-content { text-align: center; }
    .hero-actions { justify-content: center; }
    .hero h1 { font-size: 36px; }
    .sidebar { flex-wrap: wrap; }
}

/* --- Page Header with Actions --- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 8px;
}

.page-header h1 {
    margin: 0;
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-header h3 {
    margin: 0;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.text-muted {
    color: var(--text-muted);
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-chip i {
    color: var(--text-muted);
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* --- Tab Bar --- */

.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 0;
}

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.tab-item:hover {
    color: var(--text-main);
    background: var(--surface-hover);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-item i {
    font-size: 14px;
}

.tab-count {
    background: var(--surface-solid);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.tab-item.active .tab-count {
    background: var(--primary-dim);
    color: var(--primary);
}

/* --- Compact Table Card --- */

.table-card.compact {
    padding: 0;
}

.table-card.compact table {
    margin-top: 0;
}

.table-card.compact th,
.table-card.compact td {
    padding: 12px 16px;
}

/* --- Status Tags --- */

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface-solid);
    color: var(--text-muted);
}

.status-tag.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-tag.warning {
    background: rgba(224, 176, 107, 0.15);
    color: var(--primary);
}

.status-tag.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* --- Icon Button --- */

.btn.icon {
    padding: 6px 8px;
    min-width: auto;
}

/* --- Table Card Wrapper --- */

.table-card {
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

/* --- Empty Row --- */

.empty-row {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px !important;
}

/* --- Helper Classes --- */
.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.centered-title {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* --- Filter Tabs (房间筛选标签) --- */

.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--text-main);
    background: var(--surface-hover);
}

.filter-tab.active {
    color: var(--primary);
    background: var(--primary-dim);
}

.filter-tab i {
    font-size: 14px;
}

/* 主持人下拉菜单 */
.filter-tab-dropdown {
    position: relative;
}

.filter-tab .dropdown-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s;
}

.host-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.host-dropdown.show {
    display: block;
}

.host-dropdown .dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.15s;
    cursor: pointer;
}

.host-dropdown .dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--text-main);
}

.host-dropdown .dropdown-item.active {
    color: var(--primary);
    background: var(--primary-dim);
}

.host-dropdown .dropdown-item.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    font-style: italic;
}

/* ============================================
   房间详情页 - 麦位系统样式
   ============================================ */

.room-live-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 房间头部 */
.room-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.room-info h1 {
    margin-bottom: 12px;
}

.room-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.room-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* 麦位区域 */
.seats-section {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.seats-section .section-header {
    margin-bottom: 24px;
}

/* 麦位网格 - 自适应布局 */
.seats-grid {
    display: grid;
    gap: 16px;
    justify-content: center;
}

/* 根据麦位数量自适应列数 */
.seats-grid[data-seat-count="1"],
.seats-grid[data-seat-count="2"],
.seats-grid[data-seat-count="3"] {
    grid-template-columns: repeat(auto-fit, minmax(140px, 160px));
}

.seats-grid[data-seat-count="4"],
.seats-grid[data-seat-count="5"],
.seats-grid[data-seat-count="6"] {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    max-width: 720px;
    margin: 0 auto;
}

.seats-grid[data-seat-count="7"],
.seats-grid[data-seat-count="8"],
.seats-grid[data-seat-count="9"],
.seats-grid[data-seat-count="10"],
.seats-grid[data-seat-count="11"],
.seats-grid[data-seat-count="12"] {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    max-width: 900px;
    margin: 0 auto;
}

/* 麦位卡片 */
.seat-card {
    background: var(--surface-solid);
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
    min-height: 160px;
}

.seat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.seat-card.occupied {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.05);
}

.seat-card.reserved {
    border-color: var(--primary);
    background: rgba(224, 176, 107, 0.05);
}

.seat-card.is-me {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* 麦位序号 */
.seat-index {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.seat-card.occupied .seat-index {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #fff;
}

.seat-card.is-me .seat-index {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* 麦位头像 */
.seat-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    margin-top: 8px;
}

.seat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seat-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--surface);
    border: 2px dashed var(--surface-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
}

.seat-card.empty .avatar-placeholder {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.seat-card.empty:hover .avatar-placeholder {
    border-color: var(--primary);
    color: var(--primary);
}

/* 麦位状态图标 */
.seat-status-icon {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.seat-status-icon.muted {
    background: var(--accent-red);
    color: #fff;
}

.seat-status-icon.deafened {
    background: var(--text-muted);
    color: #fff;
}

/* 麦位名称 */
.seat-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seat-card.empty .seat-name {
    color: var(--text-muted);
}

/* 麦位按钮 */
.seat-card .btn {
    margin-top: auto;
    width: 100%;
    justify-content: center;
}

/* 聊天区域 */
.chat-section {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 24px;
    min-height: 200px;
}

.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: var(--text-muted);
}

.chat-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.chat-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* 底部操作栏 */
.room-bottom-bar {
    position: sticky;
    bottom: 0;
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.room-bottom-bar .btn {
    flex: 1;
    max-width: 160px;
    justify-content: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .room-header {
        flex-direction: column;
    }
    
    .room-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .seats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 100% !important;
    }
    
    .seat-card {
        min-height: 140px;
        padding: 12px;
    }
    
    .seat-avatar {
        width: 48px;
        height: 48px;
    }
    
    .room-bottom-bar {
        padding: 12px;
        gap: 8px;
    }
    
    .room-bottom-bar .btn {
        padding: 10px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .seats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .room-meta-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Guilds */
.guild-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.guild-room-list,
.carpool-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guild-card,
.guild-room,
.carpool-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface-solid);
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.guild-card {
    flex-direction: column;
}

.guild-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.guild-meta h4 {
    margin: 0;
    font-size: 16px;
}

.guild-meta p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.guild-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.guild-avatar.large {
    width: 72px;
    height: 72px;
}

.guild-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guild-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.guild-member-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guild-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--surface-border);
}

.guild-detail-header {
    display: flex;
    gap: 16px;
    align-items: center;
}

.guild-boost-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: #f9c74f;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Traffic */
.traffic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.traffic-card {
    padding: 18px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface-solid);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.traffic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.traffic-card-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-main);
}

.traffic-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.traffic-price-amount {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.traffic-price-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.traffic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.traffic-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.traffic-select {
    flex: 1;
    min-width: 160px;
}

.traffic-bag-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.traffic-bag-item {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px dashed var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface-solid);
}

.traffic-bag-status {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 72px;
    text-align: right;
}

/* ============================
   Performance Helpers
   ============================ */

.cv-auto {
    content-visibility: auto;
    contain-intrinsic-size: 600px 800px;
}

.room-list,
.my-room-list,
.grid,
.script-grid,
.room-grid,
.guild-list,
.guild-room-list,
.carpool-list,
.traffic-grid {
    content-visibility: auto;
    contain-intrinsic-size: 600px 800px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.perf-lite * {
    animation: none !important;
    transition: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.perf-lite body {
    background-attachment: scroll;
}

.perf-lite .sidebar,
.perf-lite .badge,
.perf-lite .card,
.perf-lite .stat-card,
.perf-lite .auth-card,
.perf-lite .filter-bar,
.perf-lite .table-card,
.perf-lite .room-card,
.perf-lite .room-card-v2,
.perf-lite .my-room-card,
.perf-lite .script-card,
.perf-lite .guild-card,
.perf-lite .guild-room,
.perf-lite .carpool-card,
.perf-lite .traffic-card,
.perf-lite .player-hero,
.perf-lite .empty-state,
.perf-lite .empty-state-v2,
.perf-lite .empty-state-compact {
    box-shadow: none !important;
}

.perf-lite .brand i,
.perf-lite .stat-icon,
.perf-lite .hero h1 i {
    filter: none !important;
}

.perf-lite .room-code-float,
.perf-lite .room-code-badge,
.perf-lite .badge-genre,
.perf-lite .room-status-overlay {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

@supports (content-visibility: auto) {
    .card {
        content-visibility: auto;
        contain-intrinsic-size: 320px 240px;
    }
}

.perf-lite-cards .card {
    background: var(--surface-solid) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    transition: none !important;
}

.perf-lite-cards .card::after {
    display: none;
}

.perf-lite-cards .card:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Carpool */
.carpool-card {
    align-items: center;
}

.carpool-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.carpool-actions {
    display: flex;
    gap: 8px;
}

.carpool-adopt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.carpool-adopt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border: 1px dashed var(--surface-border);
    border-radius: 8px;
}

/* ========================================
   语言切换器 - 优雅下拉设计
   ======================================== */

.lang-switcher {
    position: relative;
}

.lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lang-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.lang-trigger.active {
    background: rgba(224, 176, 107, 0.1);
    border-color: rgba(224, 176, 107, 0.25);
    color: var(--primary);
}

.lang-trigger i.fa-globe {
    font-size: 14px;
    opacity: 0.8;
}

.lang-trigger .lang-arrow {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.lang-trigger.active .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--surface-solid);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.lang-option:hover {
    background: var(--surface-hover);
    color: var(--text-main);
}

.lang-option.active {
    background: var(--primary-dim);
    color: var(--primary);
}

.lang-option .lang-flag {
    font-size: 16px;
}

.lang-option i.fa-check {
    margin-left: auto;
    font-size: 12px;
    color: var(--primary);
}

/* ========================================
   返回首页按钮 - 登录/注册页面
   ======================================== */

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
}

.back-home-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.back-home-btn i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.back-home-btn:hover i {
    transform: translateX(-3px);
}

/* 移动端响应式 */
@media (max-width: 640px) {
    .back-home-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .back-home-btn span {
        display: none;
    }
}

/* ========================================
   退出按钮 - 简洁设计
   ======================================== */

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
}

.btn-logout i {
    font-size: 14px;
}

/* 移动端响应式 */
@media (max-width: 640px) {
    .lang-trigger {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .lang-trigger span {
        display: none;
    }
    
    .lang-trigger .lang-arrow {
        display: none;
    }
    
    .lang-dropdown {
        right: -50%;
        min-width: 140px;
    }
    
    .btn-logout {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn-logout span {
        display: none;
    }
}

/* ========================================
   新版线索通知 - 扑克牌堆叠 (Fan Stack)
   ======================================== */

#clue-stack-container,
#clue-notification-container {
    position: fixed;
    top: 50%;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, -50%); /* 屏幕居中 */
    width: 280px;
    height: 380px;
    z-index: 80; /* 低于模态框 */
    pointer-events: none; /* 容器透传点击 */
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* 移动端适配位置 */
@media (max-width: 768px) {
    #clue-stack-container,
    #clue-notification-container {
        top: 50%;
        bottom: auto;
        width: 280px;
        height: 380px;
        transform: translate(-50%, -50%);
    }
}

#clue-stack-container.is-empty,
#clue-notification-container.is-empty {
    display: none;
}

.clue-stack-card {
    position: absolute;
    bottom: 0;
    width: 220px;
    height: 320px;
    /* 扑克牌质感：深色磨砂底 + 金色边框 */
    background: linear-gradient(165deg, #1a1c24 0%, #0f1116 100%);
    border: 1px solid #b88a4d;
    border-radius: 14px;
    box-shadow:
        0 20px 50px -10px rgba(0,0,0,0.8),
        0 0 0 1px rgba(184, 138, 77, 0.2) inset,
        inset 0 0 40px rgba(0,0,0,0.8);
    transform-origin: bottom center;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    pointer-events: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    opacity: 0;
    transform: translateY(100px) scale(0.8);
}

@media (max-width: 768px) {
    .clue-stack-card {
        width: 240px; /* 增加宽度以容纳更多内容 */
        height: 340px;
    }
    
    .clue-stack-title {
        font-size: 16px;
    }
    
    .clue-stack-desc {
        -webkit-line-clamp: 3; /* 允许显示更多行 */
    }
}

.clue-stack-card.show {
    opacity: 1;
}

/* 金属光扫过效果 */
.clue-stack-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 215, 0, 0.05) 45%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 215, 0, 0.05) 55%,
        transparent 100%
    );
    transform: rotate(30deg) translate(-100%, -100%);
    animation: card-shine 6s infinite linear;
    pointer-events: none;
    z-index: 10;
}

@keyframes card-shine {
    0% { transform: rotate(30deg) translate(-100%, -100%); }
    20% { transform: rotate(30deg) translate(100%, 100%); }
    100% { transform: rotate(30deg) translate(100%, 100%); }
}

/* 浮雕纹理 - 内部微光 */
.clue-stack-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

/* 悬停效果 (仅当未展开时) */
#clue-stack-container.is-empty,
#clue-notification-container.is-empty {
    display: none;
}

.clue-stack-card:not(.active):hover {
    z-index: 100 !important;
    border-color: #e0b06b;
    box-shadow: 0 -10px 30px rgba(224, 176, 107, 0.15);
    /* 稍微上浮放大 */
    transform: translateY(-40px) scale(1.1) !important; 
}

/* 展开/聚焦状态 (Active) */
#clue-stack-container.is-empty,
#clue-notification-container.is-empty {
    display: none;
}

.clue-stack-card.active {
    position: fixed;
    top: 50%;
    left: 50%;
    bottom: auto;
    width: 320px;
    height: 480px;
    z-index: 999 !important;
    transform: translate(-50%, -50%) !important;
    box-shadow: 0 20px 100px rgba(0,0,0,0.9), 0 0 0 1000px rgba(0,0,0,0.7); /* 大阴影作为遮罩 */
    border-color: #e0b06b;
}

@media (max-width: 768px) {
    .clue-stack-card.active {
        width: 90vw;
        height: 70vh;
        max-height: 500px;
    }
}

/* 卡片图片区域 */
.clue-stack-img {
    width: 100%;
    height: 180px;
    background: radial-gradient(circle at 20% 20%, rgba(224, 176, 107, 0.18), transparent 55%), #0b0d12;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.clue-stack-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.0), rgba(0,0,0,0.45));
    pointer-events: none;
}

.clue-stack-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.clue-stack-placeholder {
    background: linear-gradient(135deg, rgba(224, 176, 107, 0.12), rgba(30, 33, 43, 0.6));
}

.clue-stack-placeholder-icon {
    font-size: 40px;
    color: #e0b06b;
    text-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

#clue-stack-container.is-empty,
#clue-notification-container.is-empty {
    display: none;
}

.clue-stack-card.active .clue-stack-img {
    height: 60%; /* 展开时图片变大 */
}

/* 卡片内容区域 */
.clue-stack-body {
    flex: 1;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    position: relative;
    z-index: 2;
}

.clue-stack-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.clue-stack-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e0b06b;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(224, 176, 107, 0.12);
    border: 1px solid rgba(224, 176, 107, 0.35);
}

.clue-stack-sender {
    font-size: 10px;
    color: #e5e7eb;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* 标题 */
.clue-stack-title {
    font-size: 17px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.clue-stack-desc {
    font-size: 12px;
    color: #d6d9f4;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#clue-stack-container.is-empty,
#clue-notification-container.is-empty {
    display: none;
}

.clue-stack-card.active .clue-stack-title {
    font-size: 20px;
    margin-bottom: 8px;
    color: #e0b06b;
}

/* 描述/类型 */
.clue-stack-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clue-stack-pill {
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(224, 176, 107, 0.18), rgba(255,255,255,0.06));
    color: #f8f2e6;
    border: 1px solid rgba(224, 176, 107, 0.35);
}

/* 关闭按钮 (仅 Active 时显示更明显，或者一直有小叉号) */
.clue-stack-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(10, 12, 16, 0.75);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    opacity: 0.75; /* 默认可见，hover或active更明显 */
    box-shadow: 0 6px 16px rgba(0,0,0,0.45);
}

#clue-stack-container.is-empty,
#clue-notification-container.is-empty {
    display: none;
}

.clue-stack-card:hover .clue-stack-close {
    opacity: 1;
}

.clue-stack-card.active .clue-stack-close {
    opacity: 1;
}

.clue-stack-close:hover {
    background: #ef4444;
}

@media (hover: none), (pointer: coarse) {
    .clue-stack-close {
        opacity: 1;
    }
}

/* Viewer Animation - Zoom Scale */
@keyframes viewerZoomIn {
    0% { opacity: 0; transform: scale(0.95); filter: blur(10px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

.clue-viewer-animate-enter {
    animation: viewerZoomIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Landing Page Layout Fix for PC */
.page.landing-page-container {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 0 !important;
}

/* High-end Brand Refinement */
.juhe-brand span {
    font-family: var(--font-serif);
    background: linear-gradient(135deg, var(--primary) 0%, #fff 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(224, 176, 107, 0.3);
}
