/* ============================================================
   X-Dream CMS - 全局样式表
   ============================================================ */

/* ============================================================
   Emoji 禁用规则（强制，详见 docs/页面模块创建规范.md）
   ------------------------------------------------------------
   用空白字体接管 emoji 区段 U+1F000-1FAFF（📖🏠🎬🔥 等），
   使该区段字符在页面任何位置渲染为不可见；
   ✓ ✗ ❌ ✅ ★ ✉ ⚙ 等普通符号不在覆盖区段内，不受影响。
   同时用同名 @font-face 覆盖系统 emoji 字体的回退链，
   即使元素单独指定了其他 font-family 也会被拦截。
   ============================================================ */
@font-face {
    font-family: 'XD Emoji Block';
    src: url('../fonts/emoji-blank.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
    unicode-range: U+1F000-1FAFF;
}
@font-face {
    font-family: 'Apple Color Emoji';
    src: url('../fonts/emoji-blank.woff2') format('woff2');
    font-display: block;
    unicode-range: U+1F000-1FAFF;
}
@font-face {
    font-family: 'Segoe UI Emoji';
    src: url('../fonts/emoji-blank.woff2') format('woff2');
    font-display: block;
    unicode-range: U+1F000-1FAFF;
}
@font-face {
    font-family: 'Noto Color Emoji';
    src: url('../fonts/emoji-blank.woff2') format('woff2');
    font-display: block;
    unicode-range: U+1F000-1FAFF;
}

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #6c5ce7;
    --primary-dark: #5b4bd6;
    --primary-light: #a29bfe;
    --success: #00b894;
    --danger: #e74c3c;
    --warning: #fdcb6e;
    --dark: #1a1a2e;
    --gray-bg: #f5f6fa;
    --gray-border: #e0e0e0;
    --text: #333;
    --text-light: #888;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    /* 页面宽度规范：PC 宽屏内容居中最大宽度（窄于该值时自动收缩为 100%，小屏无需额外断点） */
    --page-max: 1280px;
    --page-max-wide: 1400px; /* 视频/剧集等大网格页 */
}
html { font-size: 16px; }
body {
    /* 'XD Emoji Block' 必须保持在字体栈首位：通过 unicode-range 仅拦截 emoji 区段，其余字符自动透传 */
    font-family: 'XD Emoji Block', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--gray-bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
/* 页面主内容容器：PC 宽屏居中（超过 --page-max 不再拉伸，两侧留白）；窄于该值时收缩为 100%，小屏自适应不变 */
.container {
    width: 100%;
    max-width: var(--page-max);
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}
.container-wide { max-width: var(--page-max-wide); } /* 视频/剧集等大网格页 */
/* 网格需要贴边时使用；用双类名提高优先级，避免移动端 .container 的 padding 覆盖（保持与原内联 padding:0 一致） */
.container.container-flush { padding: 0; }

/* ============================================================
   Header
   【冻结区】顶部导航条样式。内容区样式请一律写入 content.css，
   修改本区块会影响全站所有页面的导航条。
   ============================================================ */
.header {
    background: var(--dark);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.header-inner {
    display: flex;
    align-items: center;
    height: 60px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.logo-icon { font-size: 24px; }
.logo:hover { color: var(--primary-light); }

/* 导航 */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 24px;
}
.nav-link {
    color: rgba(255,255,255,0.7);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* 移动端下拉导航 */
.main-nav-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--dark);
    z-index: 99;
    padding: 12px 0;
    flex-direction: column;
    max-height: 80vh;
    overflow-y: auto;
}
.main-nav-dropdown.show { display: flex; }
.nav-link-dropdown {
    color: rgba(255,255,255,0.85);
    padding: 10px 20px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-link-dropdown:hover { color: #fff; background: rgba(255,255,255,0.05); }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 98;
}
.nav-overlay.show { display: block; }

/* 头部右侧 */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.btn-link {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    padding: 6px 10px;
}
.btn-link:hover { color: #fff; }
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    isolation: isolate;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* 靓号七彩顺时针流光描边 —— 通用规则：任意头像容器加 vip-active 类即显示
   实现：conic-gradient 多彩背景 + content-box mask 裁出向内 3px 描边环，
   z-index 9999 强制置于头像图片之上（父级 isolation 隔离层叠上下文），
   border-radius 继承容器圆角，天然适配圆形/方形/圆角方形头像。
   注意：必须用 mask-image + mask-clip 长属性，不能用 mask 简写——
   -webkit-mask 简写不支持 content-box 关键字，会导致两层 mask 相同，
   exclude 后整体透明，描边完全消失。 */
.vip-active {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
}
.vip-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        #ff4444,
        #ff8800,
        #ffdd00,
        #44ff44,
        #00ddff,
        #4488ff,
        #aa44ff,
        #ff44aa,
        #ff4444
    );
    padding: 3px;
    -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
    -webkit-mask-clip: content-box, border-box;
    -webkit-mask-composite: xor;
    mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
    mask-clip: content-box, border-box;
    mask-composite: exclude;
    z-index: 9999;
    pointer-events: none;
    animation: vipRainbowSpin 3s linear infinite;
}
@keyframes vipRainbowSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 动态广场 / 动态详情 共享头像样式 */
.moment-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gray-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0; overflow: hidden;
}
.moment-avatar img {
    width: 100%; height: 100%;
    border-radius: 50%; object-fit: cover;
}

/* 移动端搜索栏 */
.mobile-search-bar {
    background: var(--dark);
    padding: 0 0 12px;
}
.search-box-mobile {
    display: flex;
    gap: 8px;
}
.search-box-mobile input {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
}
.search-box-mobile input::placeholder { color: rgba(255,255,255,0.5); }
.search-box-mobile button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 0 8px;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    min-height: calc(100vh - 200px);
    padding-top: 24px;
    padding-bottom: 40px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    border: none;
    background: var(--gray-bg);
    color: var(--text);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: var(--dark); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-border);
}
.btn-muted {
    background: #e0e0e0;
    color: var(--text-light);
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ============================================================
   Cards & Forms
   ============================================================ */
.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.form-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}
.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group { flex: 1; }
.hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-warn { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.badge-0 { background: #e0e0e0; color: #666; }
.badge-1 { background: #e8f5e9; color: #2e7d32; }
.badge-2 { background: #fff3e0; color: #e65100; }
.badge-verified { background: #fff3e0; color: #e65100; font-weight: 600; font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.badge-subscribed { background: #e8f5e9; color: #2e7d32; font-weight: 600; font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.badge-pretty {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #48dbfb 100%);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    animation: prettyShine 2s ease-in-out infinite;
}
@keyframes prettyShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}
.pretty-number {
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff6b6b);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    animation: numberStream 3s linear infinite;
}
@keyframes numberStream {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}
.badge-unread {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}
.btn-icon { position: relative; }

/* ============================================================
   Mobile Toggle
   ============================================================ */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

/* ============================================================
   Footer
   【冻结区】底部页脚样式。内容区样式请一律写入 content.css，
   修改本区块会影响全站所有页面的页脚。
   ============================================================ */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
}
.footer p { margin-bottom: 4px; }
.footer .icp { font-size: 12px; opacity: 0.6; }
.footer-links { margin-bottom: 12px; }
.footer-links a { color: rgba(255,255,255,0.6); font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer-links .sep { color: rgba(255,255,255,0.3); margin: 0 8px; font-size: 12px; }

/* ============================================================
   Admin / Author Dashboard Common
   ============================================================ */
.dash-layout { display: flex; min-height: calc(100vh - 60px); }
.dash-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity .25s;
}
.dash-sidebar {
    width: 240px;
    background: var(--dark);
    color: #fff;
    padding: 0;
    flex-shrink: 0;
    overflow-y: auto;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
}
.dash-sidebar .dash-brand {
    padding: 20px 20px 16px;
    font-size: 17px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 0.5px;
}
.dash-nav { padding: 8px 0 24px; }
.dash-nav-top {
    display: block;
    padding: 11px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 600;
    border-left: 3px solid transparent;
    margin-bottom: 4px;
}
.dash-nav-top:hover, .dash-nav-top.active {
    color: #fff;
    background: rgba(255,255,255,0.06);
    border-left-color: var(--primary);
}
.dash-nav-group { margin-bottom: 2px; }
.dash-nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 20px;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}
.dash-nav-group-toggle:hover { color: rgba(255,255,255,0.9); }
.dash-nav-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform .2s;
}
.dash-nav-group.open .dash-nav-arrow { transform: rotate(180deg); }
.dash-nav-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.dash-nav-group.open .dash-nav-sub { max-height: 500px; }
.dash-nav-item {
    display: block;
    padding: 9px 20px 9px 36px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.dash-nav-item:hover, .dash-nav-item.active {
    color: #fff;
    background: rgba(255,255,255,0.05);
    border-left-color: var(--primary);
    text-decoration: none;
}
.dash-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
    min-width: 0;
    /* PC 宽屏：内容区同样居中限宽，避免侧边栏右侧内容无限拉伸 */
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}
/* Mobile sidebar toggle button (hidden on desktop) */
.dash-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}
.dash-mobile-toggle span {
    display: block;
    height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 1px;
}
.dash-page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-border);
}
.dash-page-header h1 { font-size: 24px; font-weight: 700; }
.dash-subtitle { color: var(--text-light); margin-top: 4px; font-size: 14px; }
.dash-section { margin-bottom: 30px; }
.dash-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
/* Feature cards (update / agent) */
.dash-feature-card {
    margin-bottom: 20px;
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid transparent;
}
.dash-feature-update {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
    border-color: #d0d4ff;
}
.dash-feature-agent {
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    border-color: #d0c4ff;
}
.dash-feature-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.dash-feature-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dash-feature-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 15px;
}
.dash-feature-desc {
    font-size: 13px;
    color: var(--text-light);
}
.dash-feature-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.dash-feature-result {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}

/* ============================================================
   Stats & Data Tables
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.stat-icon.purple { background: #f3e5f5; }
.stat-icon.green { background: #e8f5e9; }
.stat-icon.blue { background: #e3f2fd; }
.stat-icon.orange { background: #fff3e0; }
.stat-info h3 { font-size: 24px; font-weight: 700; }
.stat-info p { font-size: 13px; color: var(--text-light); }

.data-table {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.data-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    background: var(--gray-bg);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    border-bottom: 1px solid var(--gray-border);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-bg);
}
.data-table tr:hover { background: #fafafa; }
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius);
    font-size: 14px;
}

/* ============================================================
   Auth Pages (Login, Register, Success) - Centered Card Layout
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8eaf0 100%);
}
.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 440px;
    padding: 36px 32px;
}
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}
.auth-header p {
    font-size: 14px;
    color: var(--text-light);
}
.auth-form .form-group {
    margin-bottom: 16px;
}
.auth-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.auth-form .form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s;
    background: #fafbfc;
}
.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
    background: #fff;
}
.auth-form .form-group input::placeholder {
    color: #bbb;
}
.auth-form .btn-block {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 4px;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}
.auth-footer p {
    font-size: 14px;
    color: var(--text-light);
    margin: 4px 0;
}
.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}
.auth-footer a:hover {
    color: var(--primary-dark);
}

/* ============================================================
   Success Page (Register Success) - Centered Card Layout
   ============================================================ */
.success-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8eaf0 100%);
}
.success-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 460px;
    padding: 36px 32px;
    text-align: center;
}

/* Auth Responsive */
@media (max-width: 768px) {
    .auth-page, .success-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }
    .auth-card, .success-card {
        padding: 28px 20px;
        border-radius: 12px;
    }
}

/* ============================================================
   Responsive (Mobile First)
   ============================================================ */

/* Tablet & Mobile (<=1024px): hide desktop nav, show mobile elements */
@media (max-width: 1024px) {
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .header-right .btn-link { display: none; }
    .dash-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px;
        height: 100vh;
        z-index: 999;
        transition: left .3s ease;
    }
    .dash-sidebar.open { left: 0; }
    .dash-overlay.show { display: block; opacity: 1; }
    .dash-mobile-toggle { display: flex; }
}

/* Mobile only (<=768px): fine-tune layout */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .search-box-mobile input { font-size: 14px; }
    .hero-content h1 { font-size: 24px; }
    .hero-banner { padding: 40px 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dash-grid-2col { grid-template-columns: 1fr; }
    .dash-content { padding: 16px; }
    .data-table { overflow-x: auto; }
    .data-table table { min-width: 600px; }
    .form-card .form-row { flex-direction: column; }
}

.license-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}
.license-unlicensed {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}
.license-licensed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ============================================================
   图片加速器 - 懒加载模糊渐显效果
   ============================================================ */
img.lazy-loading {
    filter: blur(8px);
    transition: filter 0.4s ease;
    background: #f0f0f0;
}
img.lazy-loaded {
    animation: imgFadeIn 0.5s ease forwards;
}
@keyframes imgFadeIn {
    from { opacity: 0.6; filter: blur(4px); }
    to   { opacity: 1; filter: blur(0); }
}
/* 防止懒加载图片布局抖动 */
img[data-src] {
    background: #f0f0f0;
}

/* ============================================================
   Token 销售额度徽标（全站视频付费蒙版通用外观）
   ------------------------------------------------------------
   数值一律由后端聚合 token_consumptions 得出（见
   includes/token-functions.php 的 getTargetSalesMap / getTargetSalesTotal），
   禁止前端写死或用 DOM 估算。
   本区块只负责"外观"，具体位置由各页面的蒙版各自定位
   （如 assets/css/video.css 的 .video-token-sales 负责沉浸式播放器的偏移）。
   ============================================================ */
.token-sales-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 20px);
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}
.token-sales-badge-label {
    color: rgba(255, 255, 255, 0.6);
}
.token-sales-badge-value {
    color: var(--warning, #fdcb6e);
    font-weight: 700;
}
/* 小尺寸容器（聊天视频蒙版等窄卡片）用紧凑版，避免遮挡蒙版文字 */
.token-sales-badge-sm {
    gap: 3px;
    padding: 2px 7px;
    font-size: 10px;
    max-width: calc(100% - 8px);
}
