/* ============================================================
   毒区API · 古风水墨主题 v4.0「宣纸江山」浅色版
   设计语言：宣纸米底 + 墨字 + 古铜金线 / 朱砂 / 竹青 / 黛青
   质感：宣纸面板 + 金线勾勒 + 淡墨晕染 + 楷体文气
   注：深色仅保留在游戏舞台内部（各游戏页自带深色场景），
       全局页面一律浅色，保证正文字对比度。
   ============================================================ */
:root {
    --bg: #ece2cc;
    --bg2: #e4d8be;
    --panel: rgba(252, 248, 236, .92);
    --panel2: #f6efdc;
    --panel-solid: #fbf6e8;
    --line: rgba(139, 105, 20, .32);
    --gold: #a8842f;
    --gold2: #8b6914;
    --txt-h: #6b1410;       /* 标题·最深朱砂 */
    --txt: #8b1e16;          /* 正文·朱砂 */
    --txt-muted: #7a1812;    /* 次要文字·深朱砂（提升对比度） */
    --muted: #7a1812;        /* 别名兼容 */
    --red: #b3261e;
    --green: #007a4d;
    --blue: #2c5f7c;
    --purple: #6a4a8a;
    --grad-gold: linear-gradient(135deg, #f0e0b0 0%, #dfc27a 45%, #c9a227 100%);
    --grad-red: linear-gradient(135deg, #d96a5a 0%, #b3261e 50%, #8b1e16 100%);
    --grad-blue: linear-gradient(135deg, #9cc4d8 0%, #6f9cbf 50%, #4a6e8e 100%);
    --grad-green: linear-gradient(135deg, #8fc9a8 0%, #5aab7f 50%, #2f7a55 100%);
    --grad-purple: linear-gradient(135deg, #c9aedf 0%, #9a79b8 50%, #6f5488 100%);
    --grad-gold-text: linear-gradient(135deg, #8b6914 0%, #a8842f 50%, #8b6914 100%);
    --shadow-gold: 0 6px 24px rgba(168, 123, 42, .18), 0 0 0 1px rgba(139, 105, 20, .16);
    --shadow-red: 0 6px 24px rgba(142, 47, 38, .22);
    --clip: none;
}

/* ---------- 动画库 ---------- */
@keyframes scanline { 0% { transform: translateY(-10vh); } 100% { transform: translateY(110vh); } }
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 12px rgba(168, 123, 42, .18); }
    50%      { box-shadow: 0 0 26px rgba(168, 123, 42, .3), 0 0 40px rgba(168, 123, 42, .12); }
}
@keyframes neon-flicker {
    0%, 100% { opacity: 1; }
}
@keyframes float-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes rotate-slow { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes border-flow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes shine { 0% { left: -100%; } 60%, 100% { left: 100%; } }
@keyframes ink-breathe {
    0%, 100% { opacity: .85; }
    50% { opacity: 1; }
}

/* ---------- 速度令牌：统一调节动效节奏 ---------- */
:root {
    --dur-fast: .12s;      /* 微交互：下划线、图标 */
    --dur-hover: .18s;     /* 悬停反馈 */
    --dur-card: .22s;      /* 卡片/磁贴悬浮 */
    --dur-pulse: 2.6s;     /* 呼吸 */
    --dur-flow: 5s;        /* 金线流光 */
    --dur-flicker: 4.5s;   /* 保留兼容 */
    --dur-scan: 6s;        /* 保留兼容 */
    --ease-out: cubic-bezier(.25, .8, .35, 1);
}

/* ---------- 古风字体 ---------- */
:root {
    --font-gufeng: "KaiTi", "STKaiti", "楷体", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
}

/* ---------- 基础 ---------- */
body {
    position: relative;
    font-family: var(--font-gufeng);
    background:
        radial-gradient(ellipse 900px 460px at 88% -8%, rgba(201, 162, 39, .12), transparent 62%),
        radial-gradient(ellipse 700px 420px at -6% 108%, rgba(106, 84, 136, .09), transparent 62%),
        radial-gradient(ellipse 800px 520px at 50% 118%, rgba(179, 38, 30, .07), transparent 62%),
        linear-gradient(180deg, #f0e7d2 0%, #e9dec5 52%, #e2d5b8 100%);
    background-attachment: fixed;
    color: var(--txt);
    overflow-x: hidden;
}
/* 宣纸纹理 */
body::before {
    content: ""; position: fixed; inset: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(90, 60, 20, .028) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(90deg, rgba(90, 60, 20, .028) 0 1px, transparent 1px 4px);
    pointer-events: none; z-index: 0;
}
/* 底部淡墨晕带（浅色，替代深色压暗） */
body::after {
    content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 22vh;
    background: linear-gradient(180deg, transparent, rgba(120, 90, 40, .1));
    pointer-events: none; z-index: 0;
}

h1 { color: var(--txt-h); font-size: 26px; letter-spacing: 4px; font-weight: 700; }
h1 .accent, .accent {
    background: var(--grad-gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 2px 4px rgba(168, 123, 42, .25));
}
h2 { color: var(--txt-h); letter-spacing: 2px; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--gold2); }
.muted { color: var(--muted); }
code { color: #6e4a10; background: #f5edd8; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); }
pre {
    background: #f8f1dd; border: 1px solid var(--line); border-left: 3px solid var(--gold2);
    box-shadow: 0 6px 18px rgba(120, 90, 40, .12), inset 0 0 24px rgba(139, 105, 20, .05);
    color: #3a2c14;
}
pre .tag, .tag { color: var(--gold2); font-weight: 700; }

/* ---------- 卡片：宣纸 + 金线 ---------- */
.card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 8px 26px rgba(120, 90, 40, .14), inset 0 1px 0 rgba(255, 252, 244, .8);
    overflow: hidden;
    transition: border-color var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out);
}
.card::before {
    content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
    background: var(--grad-gold);
}
.card::after {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 105, 20, .5), transparent);
}
.card:hover {
    border-color: rgba(139, 105, 20, .5);
    box-shadow: 0 14px 36px rgba(120, 90, 40, .2), 0 0 24px rgba(168, 123, 42, .1);
}

/* ---------- 按钮：烫金 / 印章 ---------- */
button, .btn {
    position: relative; display: inline-block; text-align: center;
    font-family: var(--font-gufeng);
    background: var(--grad-gold); background-size: 200% 200%;
    color: #241708; font-weight: 700; letter-spacing: 2.5px;
    border: 1px solid #8b6914; border-radius: 8px; padding: 11px 26px; font-size: 14.5px;
    cursor: pointer; overflow: hidden;
    transition: filter var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
    box-shadow: 0 4px 14px rgba(168, 123, 42, .28), inset 0 1px 0 rgba(255, 250, 235, .6);
    animation: border-flow var(--dur-flow) ease infinite;
}
button::before, .btn::before {
    content: ""; position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 250, 235, .45), transparent);
    transition: left .3s var(--ease-out);
}
button:hover::before, .btn:hover::before { left: 130%; }
button:hover, .btn:hover {
    filter: brightness(1.05); transform: translateY(-2px);
    box-shadow: var(--shadow-gold), 0 8px 20px rgba(168, 123, 42, .25); color: #241708;
}
button:active, .btn:active { transform: translateY(0); }
button.danger, .btn.danger {
    background: var(--grad-red); color: #fdf3e0; border-color: #6e1f16;
    box-shadow: 0 4px 14px rgba(142, 47, 38, .35), inset 0 1px 0 rgba(255, 235, 220, .25);
}
button.danger:hover, .btn.danger:hover { box-shadow: var(--shadow-red), 0 8px 20px rgba(142, 47, 38, .3); color: #fff5ea; }
button.small, .btn.small { padding: 6px 15px; font-size: 12.5px; letter-spacing: 1.5px; }
.btn.ghost {
    background: rgba(201, 162, 39, .1); color: #a02018;
    border: 1.5px solid rgba(139, 105, 20, .55); box-shadow: none; animation: none;
}
.btn.ghost::before { display: none; }
.btn.ghost:hover {
    background: rgba(201, 162, 39, .2); border-color: var(--gold2); color: #6e4a10;
    box-shadow: 0 0 14px rgba(168, 123, 42, .15), inset 0 0 14px rgba(201, 162, 39, .08);
}

/* ---------- 表单 ---------- */
input, select, textarea {
    font-family: var(--font-gufeng);
    background: #fdfaf0; border: 1.5px solid rgba(139, 105, 20, .4); border-radius: 8px;
    color: #8b1e16; padding: 11px 15px; font-size: 14px; outline: none;
    box-shadow: inset 0 2px 6px rgba(139, 105, 20, .08);
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
input:hover, select:hover, textarea:hover { border-color: rgba(139, 105, 20, .65); }
input:focus, select:focus, textarea:focus {
    border-color: var(--gold2);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, .18), inset 0 2px 6px rgba(139, 105, 20, .08);
    background: #fffdf6;
}
input::placeholder, textarea::placeholder { color: #a8946c; }
label { color: var(--muted); font-weight: 700; letter-spacing: 1px; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 13px; border-bottom: 1px solid rgba(139, 105, 20, .18); }
th {
    background: rgba(201, 162, 39, .1); color: #a02018; font-weight: 700;
    font-size: 12px; letter-spacing: 2px;
    border-bottom: 2px solid rgba(201, 162, 39, .45);
}
tr:hover td { background: rgba(201, 162, 39, .08); }

/* ---------- 统计块 ---------- */
.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat {
    flex: 1; min-width: 160px; position: relative; overflow: hidden;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
    box-shadow: 0 6px 20px rgba(120, 90, 40, .12);
    transition: transform var(--dur-hover) var(--ease-out), border-color var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out);
}
.stat::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--grad-gold);
}
.stat:hover { transform: translateY(-3px); border-color: rgba(139, 105, 20, .45); box-shadow: 0 12px 30px rgba(120, 90, 40, .18), 0 0 18px rgba(168, 123, 42, .1); }
.stat .num {
    font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums;
    background: var(--grad-gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 1px 2px rgba(168, 123, 42, .2));
}
.stat .lbl { color: var(--muted); font-size: 12px; letter-spacing: 2px; margin-top: 6px; }

/* ---------- 徽章 / 提示 ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .5px; }
.badge.ok { background: rgba(0, 122, 77, .1); color: #006540; border: 1px solid rgba(0, 122, 77, .4); }
.badge.off { background: rgba(179, 38, 30, .1); color: #a02018; border: 1px solid rgba(179, 38, 30, .4); }
.flash { border-radius: 10px; font-weight: 600; }
.flash.success { background: rgba(0, 122, 77, .08); color: #006540; border: 1px solid rgba(0, 122, 77, .35); border-left: 4px solid var(--green); }
.flash.error { background: rgba(179, 38, 30, .08); color: #a02018; border: 1px solid rgba(179, 38, 30, .35); border-left: 4px solid var(--red); }
.key-text { color: #a02018; letter-spacing: 1px; }

/* ============================================================
   顶栏导航（base.html）
   ============================================================ */
.navbar {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px;
    background: linear-gradient(180deg, rgba(250, 245, 231, .97), rgba(243, 235, 216, .97));
    border-bottom: 1px solid var(--line); padding: 0 34px; height: 68px; z-index: 100;
    box-shadow: 0 2px 14px rgba(120, 90, 40, .1);
}
.navbar::after {
    content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 105, 20, .55), rgba(179, 38, 30, .3), transparent);
}
.navbar .logo { font-size: 21px; font-weight: 900; letter-spacing: 4px; }
.navbar .logo .skull {
    display: inline-flex; width: 36px; height: 36px; border-radius: 10px; background: var(--grad-gold); background-size: 200% 200%;
    align-items: center; justify-content: center; font-size: 18px; margin-right: 10px; vertical-align: -8px;
    border: 1px solid #8b6914;
    box-shadow: 0 0 14px rgba(168, 123, 42, .3); animation: ink-breathe var(--dur-pulse) ease-in-out infinite;
}
.navbar .logo a { color: #8b1e16; }
.navbar .nav-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.navbar .nav-right a {
    position: relative; color: #8b1e16; font-size: 13.5px; font-weight: 700; letter-spacing: 1.5px;
    padding: 9px 15px; border-radius: 8px; transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.navbar .nav-right a:hover { color: #6e4a10; background: rgba(201, 162, 39, .12); }
.navbar .nav-right a:not(.btn)::after {
    content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
    width: 0; height: 2px; background: var(--grad-gold-text); transition: width var(--dur-fast) var(--ease-out);
}
.navbar .nav-right a:not(.btn):hover::after { width: 58%; }

/* ============================================================
   侧边栏（console_base.html）
   ============================================================ */
.sidebar {
    background: linear-gradient(180deg, rgba(248, 242, 226, .98), rgba(240, 231, 210, .98));
    border-right: 1px solid var(--line); position: relative;
}
.sidebar::after {
    content: ""; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
    background: linear-gradient(180deg, transparent, rgba(139, 105, 20, .45), rgba(179, 38, 30, .2), transparent);
}
.side-logo .mark { background: var(--grad-gold); background-size: 200% 200%; border: 1px solid #8b6914; box-shadow: 0 0 14px rgba(168, 123, 42, .3); animation: ink-breathe var(--dur-pulse) ease-in-out infinite; }
.side-logo b { letter-spacing: 3px; font-weight: 900; }
.side-group .cap { color: #9a4a3c; font-weight: 700; letter-spacing: 3px; }
.side-group .cap::before { content: "◆"; color: var(--gold2); margin-right: 6px; opacity: .6; font-size: 9px; vertical-align: 2px; }
.side-group a { color: #8b1e16; font-weight: 600; border-radius: 8px; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.side-group a .ico { transition: filter var(--dur-fast) var(--ease-out); }
.side-group a:hover { background: rgba(201, 162, 39, .12); color: #6e4a10; transform: translateX(2px); }
.side-group a.on {
    background: linear-gradient(90deg, rgba(201, 162, 39, .2), rgba(201, 162, 39, .05), transparent);
    color: #6e4a10; border-left: 3px solid var(--gold2); border-radius: 0 8px 8px 0;
    box-shadow: inset 0 0 18px rgba(168, 123, 42, .06);
}
.side-group a.on .ico { filter: drop-shadow(0 0 5px rgba(168, 123, 42, .45)); }
.topbar { background: rgba(248, 242, 226, .94); border-bottom: 1px solid var(--line); position: relative; }
.topbar::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, rgba(139, 105, 20, .45), transparent); }
.page-title { letter-spacing: 2px; font-weight: 700; color: var(--txt-h); }
.icon-btn { background: rgba(252, 248, 236, .9); border: 1px solid var(--line); color: #8b6914; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.icon-btn:hover { background: rgba(201, 162, 39, .14); border-color: rgba(139, 105, 20, .5); box-shadow: 0 0 10px rgba(168, 123, 42, .18); }
.avatar { background: var(--grad-gold) !important; color: #241708 !important; font-weight: 900; border: 1px solid #8b6914; box-shadow: 0 0 10px rgba(168, 123, 42, .28); }

/* ============================================================
   首页 Hero
   ============================================================ */
.hero {
    position: relative; overflow: hidden; text-align: center; padding: 96px 20px 78px;
    background:
        radial-gradient(ellipse 820px 420px at 50% -10%, rgba(201, 162, 39, .16), transparent 70%),
        radial-gradient(ellipse 520px 320px at 16% 106%, rgba(179, 38, 30, .08), transparent 70%),
        radial-gradient(ellipse 520px 320px at 84% 106%, rgba(106, 84, 136, .08), transparent 70%),
        linear-gradient(180deg, rgba(250, 245, 231, .6), var(--bg));
    border-bottom: 1px solid var(--line);
}
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        radial-gradient(ellipse 55% 22% at 22% 68%, rgba(120, 90, 40, .1), transparent 70%),
        radial-gradient(ellipse 60% 24% at 76% 72%, rgba(90, 70, 40, .12), transparent 70%);
}
.hero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold2), var(--red), var(--purple), transparent);
}
.hero .kicker {
    position: relative; z-index: 2; display: inline-block; font-size: 12px; letter-spacing: 5px;
    color: #a02018; border: 1.5px solid rgba(139, 105, 20, .55); padding: 7px 20px; border-radius: 4px; margin-bottom: 26px;
    background: rgba(201, 162, 39, .1);
    box-shadow: inset 0 0 16px rgba(201, 162, 39, .08);
}
.hero h1 {
    position: relative; z-index: 2; font-size: 66px; font-weight: 900; letter-spacing: 8px;
    margin-bottom: 14px; text-shadow: 0 2px 0 rgba(255, 252, 244, .9), 0 4px 18px rgba(139, 105, 20, .18);
}
.hero h1 .g {
    background: var(--grad-gold-text); background-size: 200% 200%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 3px 8px rgba(168, 123, 42, .3)); animation: border-flow var(--dur-flow) ease infinite;
}
.hero p { position: relative; z-index: 2; color: #8b1e16; font-size: 16px; max-width: 700px; margin: 0 auto 34px; line-height: 1.85; }
.hero .cta { position: relative; z-index: 2; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero .cta .btn { padding: 14px 38px; font-size: 15.5px; border-radius: 10px; }
@media (max-width: 640px) { .hero { padding: 66px 16px 56px; } .hero h1 { font-size: 36px; letter-spacing: 4px; } }

/* 特性卡 */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature {
    position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    padding: 26px 22px; clip-path: var(--clip);
    transition: transform var(--dur-card) var(--ease-out), border-color var(--dur-card) var(--ease-out), box-shadow var(--dur-card) var(--ease-out);
    box-shadow: 0 6px 20px rgba(120, 90, 40, .12); overflow: hidden;
}
.feature::before {
    content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(201, 162, 39, .12) 10%, transparent 22%);
    opacity: 0; transition: opacity var(--dur-card) var(--ease-out); pointer-events: none;
}
.feature:hover { transform: translateY(-5px); border-color: rgba(139, 105, 20, .48); box-shadow: 0 16px 38px rgba(120, 90, 40, .18), 0 0 24px rgba(168, 123, 42, .12); }
.feature:hover::before { opacity: 1; animation: rotate-slow 8s linear infinite; }
.feature .fi { font-size: 32px; margin-bottom: 12px; display: block; transition: transform var(--dur-card) var(--ease-out); position: relative; }
.feature:hover .fi { transform: scale(1.1); animation: float-up var(--dur-pulse) ease-in-out infinite; }
.feature b { color: #8b1e16; font-size: 15.5px; letter-spacing: 2px; display: block; margin-bottom: 8px; font-weight: 700; position: relative; }
.feature span { color: var(--muted); font-size: 13px; line-height: 1.75; position: relative; }

/* 步骤条 */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.step-item {
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px;
    position: relative; overflow: hidden;
    transition: border-color var(--dur-hover) var(--ease-out), transform var(--dur-hover) var(--ease-out);
}
.step-item::before {
    content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 0;
    background: var(--grad-gold); transition: height var(--dur-card) var(--ease-out);
}
.step-item:hover { border-color: rgba(139, 105, 20, .45); transform: translateY(-2px); }
.step-item:hover::before { height: 100%; }
.step-item .no {
    font-size: 34px; font-weight: 900; background: var(--grad-gold-text); background-size: 200% 200%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    line-height: 1; margin-bottom: 10px; font-family: Georgia, "Times New Roman", serif;
}
.step-item b { display: block; color: #8b1e16; margin-bottom: 6px; font-weight: 700; letter-spacing: 1.5px; }
.step-item span { color: var(--muted); font-size: 12.5px; line-height: 1.7; }

/* ============================================================
   游戏大厅磁贴
   ============================================================ */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.tile {
    position: relative; display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
    color: #8b1e16; background: var(--panel);
    box-shadow: 0 8px 24px rgba(120, 90, 40, .14); transition: transform var(--dur-card) var(--ease-out), border-color var(--dur-card) var(--ease-out), box-shadow var(--dur-card) var(--ease-out);
}
.tile::before {
    content: ""; position: absolute; inset: 0; border-radius: 14px; padding: 2px; z-index: 3; pointer-events: none;
    background: linear-gradient(135deg, transparent 25%, rgba(139, 105, 20, .75) 50%, transparent 75%);
    background-size: 300% 300%; background-position: 0% 0%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity var(--dur-card) var(--ease-out), background-position .4s var(--ease-out);
}
.tile:hover {
    transform: translateY(-8px) scale(1.015); text-decoration: none; border-color: transparent;
    box-shadow: 0 20px 44px rgba(120, 90, 40, .22), 0 0 30px rgba(168, 123, 42, .15);
}
.tile:hover::before { opacity: 1; background-position: 100% 100%; }
.tile .cover {
    height: 145px; display: flex; align-items: center; justify-content: center; font-size: 64px; position: relative;
    background: repeating-linear-gradient(45deg, rgba(139, 105, 20, .05) 0 3px, transparent 3px 16px);
    transition: transform .3s var(--ease-out);
}
.tile:hover .cover { transform: scale(1.06); }
.tile .cover::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255, 250, 235, .55), transparent 70%); }
.tile .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(120, 90, 40, .12)); }
.tile .cover > * { position: relative; z-index: 1; filter: drop-shadow(0 4px 10px rgba(120, 90, 40, .3)); }
.tile .body { padding: 16px 18px 20px; background: linear-gradient(180deg, rgba(246, 239, 220, .6), var(--panel-solid)); }
.tile .body b { display: block; font-size: 17px; letter-spacing: 2.5px; margin-bottom: 6px; font-weight: 700; }
.tile .body p { color: var(--muted); font-size: 12.5px; line-height: 1.7; min-height: 42px; }
.tile .go {
    position: absolute; top: 12px; right: 12px; z-index: 4; font-size: 11px; font-weight: 700; letter-spacing: 2px;
    background: var(--grad-gold); color: #241708; padding: 5px 14px; border-radius: 6px; border: 1px solid #8b6914;
    box-shadow: 0 4px 10px rgba(168, 123, 42, .3); transition: transform var(--dur-hover) var(--ease-out);
}
.tile:hover .go { animation: ink-breathe var(--dur-pulse) ease-in-out infinite; transform: translateX(2px); }
.tile .ribbon {
    position: absolute; top: 12px; left: 12px; z-index: 4; font-size: 10.5px; font-weight: 700; letter-spacing: 2px;
    padding: 5px 12px; border-radius: 6px; color: #fdf3e0;
    box-shadow: 0 4px 10px rgba(120, 90, 40, .3); text-shadow: 0 1px 3px rgba(90, 30, 20, .4);
}

/* ============================================================
   认证页（login / register）
   ============================================================ */
.auth-wrap { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; padding: 40px 16px; position: relative; }
.auth-wrap::before {
    content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 520px; height: 520px; background: radial-gradient(circle, rgba(201, 162, 39, .14), transparent 70%); pointer-events: none;
}
.auth-box {
    width: 100%; max-width: 440px; position: relative;
    background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; padding: 40px 36px;
    box-shadow: 0 26px 60px rgba(120, 90, 40, .22); overflow: hidden;
}
.auth-box::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--grad-gold); background-size: 200% 200%;
    animation: border-flow var(--dur-flow) ease infinite;
}
.auth-box::after {
    content: ""; position: absolute; inset: 0; border-radius: 16px; padding: 1.5px; pointer-events: none;
    background: linear-gradient(135deg, rgba(139, 105, 20, .45) 0%, transparent 32%, transparent 68%, rgba(179, 38, 30, .3) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
.auth-box .brand { text-align: center; margin-bottom: 26px; position: relative; z-index: 1; }
.auth-box .brand .mark {
    display: inline-flex; width: 60px; height: 60px; border-radius: 16px; background: var(--grad-gold); background-size: 200% 200%;
    align-items: center; justify-content: center; font-size: 30px; border: 1px solid #8b6914; box-shadow: var(--shadow-gold);
    animation: ink-breathe var(--dur-pulse) ease-in-out infinite;
}
.auth-box .brand b { display: block; font-size: 23px; letter-spacing: 5px; margin-top: 14px; color: #8b1e16; font-weight: 900; }
.auth-box .brand span { display: inline-block; color: var(--muted); font-size: 11.5px; letter-spacing: 3px; margin-top: 5px; }

/* ============================================================
   数据看板 / 内部页组件
   ============================================================ */
.dcard {
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; position: relative; overflow: hidden;
    box-shadow: 0 6px 20px rgba(120, 90, 40, .12);
}
.dcard::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--grad-gold); background-size: 200% 200%; animation: border-flow var(--dur-flow) ease infinite;
}
.dcard .hdh2 { color: var(--txt-h); letter-spacing: 2px; font-size: 12.5px; font-weight: 700; }
.dcard .kv .v, .dcard .kv .num {
    background: var(--grad-gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
    font-weight: 900; filter: drop-shadow(0 1px 2px rgba(168, 123, 42, .2));
}
.dcard .kv .t { letter-spacing: .5px; color: var(--muted); }
.bar-col .bar { background: var(--grad-gold) !important; background-size: 200% 200% !important; box-shadow: 0 0 8px rgba(168, 123, 42, .25) !important; border-radius: 4px; animation: border-flow var(--dur-flow) ease infinite; }
.model-row .fill { background: var(--grad-gold) !important; box-shadow: 0 0 8px rgba(168, 123, 42, .22); border-radius: 4px; }
.chart-tabs span.on { color: #a02018; border-color: rgba(139, 105, 20, .55); background: rgba(201, 162, 39, .12); }
.api-item .tt { letter-spacing: .5px; font-weight: 700; color: #8b1e16; }
.pill { border-color: rgba(139, 105, 20, .45); color: #a02018; background: rgba(201, 162, 39, .1); font-weight: 700; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.pill:hover { border-color: var(--gold2); box-shadow: 0 0 10px rgba(168, 123, 42, .15); }
details.faq summary { font-weight: 700; letter-spacing: 1px; cursor: pointer; }
details.faq summary::after { color: var(--gold2); }
.anno .dot { box-shadow: 0 0 8px currentColor; }

/* 键卡 / 提示块 */
.key-card {
    background: rgba(246, 239, 220, .85); border: 1px solid var(--line); border-radius: 10px; position: relative; overflow: hidden;
}
.key-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--grad-gold); }
.hint { background: rgba(246, 239, 220, .8); border: 1.5px dashed rgba(139, 105, 20, .45); border-radius: 10px; }

/* 管理后台标题装饰 */
.admin-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-banner .tagline {
    font-size: 11.5px; letter-spacing: 2.5px; color: #a02018; border: 1.5px solid rgba(179, 38, 30, .5);
    padding: 4px 12px; border-radius: 6px; font-weight: 700;
    background: rgba(179, 38, 30, .08);
}

/* ---------- 无障碍：尊重减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    body::after, .hero h1, .navbar .logo, .card::before, .stat::before,
    button, .btn, .side-logo .mark, .navbar .logo .skull, .auth-box::before, .auth-box .brand .mark,
    .dcard::before, .bar-col .bar, .tile:hover .go { animation: none !important; }
    body::after { display: none; }
    * { transition-duration: .01ms !important; }
}

/* ============================================================
   移动端适配（手机 / 小屏）
   ============================================================ */
/* 宽表格横向滚动容器（admin/loan 自带 .tbl-wrap，其余页面由 JS 自动包裹） */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 760px) {
    /* ---- 未登录页顶栏 ---- */
    .navbar { padding: 8px 14px; height: auto; flex-wrap: wrap; gap: 4px; }
    .navbar .logo { font-size: 16px; letter-spacing: 1.5px; }
    .navbar .logo .skull { width: 30px; height: 30px; font-size: 15px; margin-right: 7px; vertical-align: -6px; }
    .navbar .nav-right { gap: 2px; flex-wrap: wrap; }
    .navbar .nav-right a { padding: 8px 9px; font-size: 12px; letter-spacing: .5px; }
    .container { padding: 18px 13px 48px; }

    /* ---- 认证页（登录/注册） ---- */
    .auth-wrap { min-height: auto; padding: 26px 12px; }
    .auth-wrap::before { width: 300px; height: 300px; }
    .auth-box { padding: 24px 18px; border-radius: 12px; }
    .auth-box .brand { margin-bottom: 18px; }
    .auth-box .brand .mark { width: 50px; height: 50px; font-size: 25px; }
    .auth-box .brand b { font-size: 18px; letter-spacing: 3px; margin-top: 10px; }

    /* ---- 卡片 / 标题 ---- */
    .card { padding: 14px; border-radius: 10px; margin-bottom: 14px; }
    h1 { font-size: 19px !important; letter-spacing: 2px; margin-bottom: 12px; }
    h2 { font-size: 15px !important; margin-bottom: 10px; }

    /* ---- 宽表格：滚动容器内保持表格布局（>=5 列才强制宽度，小表自然摆放） ---- */
    .tbl-wrap table { min-width: 100%; }
    .tbl-wrap table.tbl-wide { min-width: 560px; }
    th, td { padding: 8px 9px; font-size: 12px; }

    /* ---- 统计卡：两列 ---- */
    .stats { gap: 10px; }
    .stat { flex: 1 1 calc(50% - 5px); min-width: calc(50% - 5px); padding: 13px 14px; }
    .stat .num { font-size: 19px; }
    .stat .lbl { font-size: 10px; letter-spacing: .5px; }

    /* ---- 表单：16px 字号防止 iOS 聚焦自动放大 ---- */
    input, select, textarea { font-size: 16px; padding: 10px 12px; }
    button, .btn { padding: 11px 18px; font-size: 13.5px; letter-spacing: 1.5px; }
    button.small, .btn.small { padding: 7px 12px; font-size: 12px; }

    /* ---- 游戏大厅磁贴：两列、隐藏描述 ---- */
    .game-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .tile .cover { height: 92px; font-size: 42px; }
    .tile .body { padding: 12px 12px 14px; }
    .tile .body b { font-size: 13px; letter-spacing: 1px; }
    .tile .body p { display: none; }
    .tile .go { font-size: 9px; padding: 4px 10px; letter-spacing: 1px; }

    /* ---- 首页 Hero ---- */
    .hero { padding: 52px 14px 44px; }
    .hero h1 { font-size: 30px !important; letter-spacing: 3px; }
    .hero p { font-size: 13.5px; margin-bottom: 24px; }
    .hero .cta { flex-direction: column; gap: 10px; width: 100%; max-width: 320px; margin: 0 auto; }
    .hero .cta .btn { width: 100%; padding: 13px 20px; }
    .feature-grid, .steps { grid-template-columns: 1fr; }
    .feature { padding: 20px 18px; clip-path: none; }

    /* ---- 管理后台：侧栏变上下结构 ---- */
    .admin-shell { grid-template-columns: 1fr !important; }
    .usearch input { width: 100%; }
    .ubatch-bar select, .lbatch-bar select { width: 100% !important; min-width: 0 !important; }

    /* ---- 贷款页钱包 ---- */
    .hero-num { font-size: 30px; }
    .hero-side { width: 100%; }
    .hchip { flex: 1 1 calc(50% - 6px); min-width: calc(50% - 6px); }

    /* ---- 贷款页：内联固定宽表单改全宽（父级已是 flex-wrap 行） ---- */
    .card input[style*="width:1"] { width: 100% !important; flex: 1 1 100%; }
    .card select[style*="min-width"] { width: 100% !important; min-width: 0 !important; flex: 1 1 100%; }

    /* ---- 令牌管理：操作按钮区换行铺满 ---- */
    .key-card { padding: 12px; }
    .key-card .ops { margin-left: 0; width: 100%; }
    .key-card .ops .btn, .key-card .ops button { flex: 1; }

    /* ---- 老虎机：转盘缩小（slot.html 不部署，样式放这里） ---- */
    #reels { gap: 10px !important; margin-bottom: 18px !important; }
    .reel { width: 64px !important; height: 84px !important; font-size: 28px !important; border-radius: 8px !important; }

    /* ---- 炸金花/德州牌桌：牌桌区允许横移，操作按钮纵向铺满 ---- */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .poker-actions, .actions { flex-wrap: wrap; }
    .poker-actions button, .poker-actions .btn, .actions button, .actions .btn { flex: 1 1 100%; }
}

@media (max-width: 380px) {
    .game-grid { grid-template-columns: 1fr; }
    .stat { flex-basis: 100%; min-width: 100%; }
    .hchip { flex-basis: 100%; min-width: 100%; }
}
