/* ============================================================
   豆蛙无限 - 全站样式
   风格: 科技简约 (对标影视飓风布局, 豆蛙品牌青绿)
   双主题: 黑绿(默认/夜间) + 白绿(日间), body[data-theme]
   ============================================================ */
/* 品牌字体（Web Font，font-display:swap 首帧不阻塞；两套并存便于切换） */
/* 醉寒江行草（行草风） */
@font-face {
  font-family: 'YEFONTZuiHanJiangXingCao';
  src: url('/fonts/zui.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* 三极锦宋简体 粗（锦宋风） */
@font-face {
  font-family: 'SJjinsongcu';
  src: url('/fonts/jinsong.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* 豆蛙像素（Minecraft 方块风；8x8 等宽，自绘字模） */
@font-face {
  font-family: 'DouwaPixel';
  src: url('/fonts/douwa-pixel.woff2') format('woff2'),
       url('/fonts/douwa-pixel.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root, html[data-theme="dark"] {
  --bg: #121212;
  --bg-elev: #1a1a1d;
  --bg-hover: #1f1f23;
  --border: #2a2a2f;
  --border-soft: #222226;
  --text: #f2f2f4;
  --text-2: #a3a3a8;
  /* 次级/静音文字：原 #6d6d72 在最亮的深色底(--bg-hover #1f1f23)上只有 3.19:1，
     达不到 WCAG AA 正文 4.5:1。改为 #8a8a90 → 各深色底全面 >= 4.7:1，
     同时仍明显弱于 --text-2(#a3a3a8)，保持"静音"的视觉层级。 */
  --text-3: #8a8a90;
  --brand: #00e6a0;
  --brand-dim: rgba(0, 230, 160, 0.12);
  --brand-border: rgba(0, 230, 160, 0.35);
  --danger: #ff4b40;
  --warn: #ffb020;
  --nav-bg: rgba(18, 18, 18, 0.78);
  --code-bg: #0c0c0e;
  --logo-filter: invert(1);
  /* 主题补齐：原先硬编码在规则里的颜色，改为语义变量（跟随主题） */
  --brand-hover: #00ffb3;                      /* 品牌色 hover 态 */
  --on-brand: #08110d;                         /* 品牌色底上的前景色（深色字） */
  --info: #6ea8ff;                             /* 信息蓝（badge-blue 文字） */
  --info-dim: rgba(70, 140, 255, 0.12);
  --info-border: rgba(70, 140, 255, 0.35);
  --danger-border: rgba(255, 75, 64, 0.4);     /* danger 描边 */
  --danger-dim: rgba(255, 75, 64, 0.1);        /* danger 淡底 */
  --role-owner: #2de0ff;                       /* 角色标签：站长 */
  --role-vip: #ffd84d;                         /* 角色标签：VIP */
  --role-svip: #5ad2e6;                        /* 角色标签：SVIP（[dsh 2026-10-05] 青蓝，区别于 VIP 金/管理员绿） */
  --role-auth: #7ab8ff;                        /* 角色标签：授权用户 */
  --role-admin: #58e08a;                       /* 角色标签：管理员 */
  --role-owner-border: rgba(45, 224, 255, 0.45);
  --role-vip-border: rgba(255, 216, 77, 0.45);
  --role-svip-border: rgba(90, 210, 230, 0.45);
  --role-auth-border: rgba(122, 184, 255, 0.45);
  --role-admin-border: rgba(88, 224, 138, 0.45);
  --role-user-bg: rgba(255, 255, 255, 0.06);   /* 角色标签：普通用户底色 */
  --rank-1: #ffd700;                           /* 排行榜第 1 名 */
  --rank-2: #c0c0c0;                           /* 排行榜第 2 名 */
  --rank-3: #cd7f32;                           /* 排行榜第 3 名 */
  --tile-2048-board: #2b2b2f;                  /* 2048 棋盘底色 */
  --tile-2048-lo: #eee4da;--tile-2048-lo-fg: #776e65;   /* 2048 小数字块 */
  --tile-2048-mid: #edc22e;--tile-2048-mid-fg: #463a20; /* 2048 中段数字块 */
  --tile-2048-hi: #e8552a;--tile-2048-hi-fg: #fdf7f2;   /* 2048 高段数字块 */
  --tile-2048-max: #3c3a32;--tile-2048-max-fg: #f9f6f2; /* 2048 空格/2048 块 */
  /* 固定白底块的悬停态（原为硬编码 #f3faf6，深色下会刺眼） */
  --tint-hover: rgba(255, 255, 255, 0.05);
  --radius: 10px;
  --radius-lg: 16px;
  --nav-h: 60px;
  --maxw: 1200px;
  --font: 'SJjinsongcu', "SimSun", "NSimSun", "Songti SC", "STSong", "华文宋体", "Noto Serif CJK SC", "PingFang SC", "Microsoft YaHei", "SimHei", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, Menlo, "Courier New", "PingFang SC", "Microsoft YaHei", "SimHei", "Noto Sans CJK SC", monospace;
}
/* 像素方块风（MC 风格）全局开关：数字/英文走像素字体，中文回退原字体 */
html[data-theme="dark"].font-pixel,
html[data-theme="light"].font-pixel {
  --font: 'DouwaPixel', 'SJjinsongcu', "SimSun", "Songti SC", "Noto Serif CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-theme="light"] {
  --bg: #f4f6f7;
  --bg-elev: #ffffff;
  --bg-hover: #eef1f2;
  --border: #dfe3e5;
  --border-soft: #e7eaec;
  --text: #1f2326;
  --text-2: #4a5156;   /* 原 #5c6468 与 text-3 太近(比值1.11)且偏浅；改 #4a5156 拉开层次(比值1.56) */
  /* 次级/静音文字：原 #98a0a5 在浅底上仅 2.34–2.66:1，达不到 WCAG AA。
     改为 #666e74 → 浅色全部底色(含最暗的 --bg-hover #eef1f2) 均 >= 4.5:1。
     与 --text-2 保持 1.56 倍对比度差，层级可感知。 */
  --text-3: #666e74;
  --brand: #00734f;
  --brand-dim: rgba(0, 115, 79, 0.1);
  --brand-border: rgba(0, 115, 79, 0.35);
  --danger: #c63527;   /* 原 #e03e30 压浅底仅 3.77–4.28:1，改 #c63527 → 4.70–5.33:1 */
  --warn: #826200;     /* 原 #8a6a00 压 .badge-gold 的暖金底仅 4.38:1，改 #826200 → 4.91:1 */
  --nav-bg: rgba(255, 255, 255, 0.82);
  --code-bg: #f1f3f4;
  --logo-filter: none;
  /* 浅色主题下的对应值：保证在白/浅灰底上仍可读 */
  --brand-hover: #005c40;
  --on-brand: #ffffff;
  --info: #2c68c4;     /* 原 #2f6fd0 压 --bg-hover 仅 4.30:1，改 #2c68c4 → 4.76:1 */
  --info-dim: rgba(44, 104, 196, 0.1);
  --info-border: rgba(44, 104, 196, 0.35);
  --danger-border: rgba(198, 53, 39, 0.45);
  --danger-dim: rgba(198, 53, 39, 0.1);
  --role-owner: #0a6b7e;
  --role-vip: #7a5e00;
  --role-svip: #0a6b7e;                        /* [dsh 2026-10-05] 浅色主题下压深，保证对比度 */
  --role-auth: #2760b0;
  --role-admin: #187a42;
  --role-owner-border: rgba(10, 107, 126, 0.45);
  --role-vip-border: rgba(122, 94, 0, 0.45);
  --role-svip-border: rgba(10, 107, 126, 0.45);
  --role-auth-border: rgba(39, 96, 176, 0.45);
  --role-admin-border: rgba(24, 122, 66, 0.45);
  --role-user-bg: rgba(0, 0, 0, 0.05);
  --rank-1: #a87900;
  --rank-2: #8a8a8a;
  --rank-3: #b5711f;
  --tile-2048-board: #dcd6cd;
  --tile-2048-lo: #e6d9bf;--tile-2048-lo-fg: #5c5245;
  --tile-2048-mid: #e3b32a;--tile-2048-mid-fg: #4c3b12;
  --tile-2048-hi: #d94a26;--tile-2048-hi-fg: #fff8f4;
  --tile-2048-max: #8f8577;--tile-2048-max-fg: #fffaf2;
  /* 固定白底块的悬停态（原为硬编码 #f3faf6，深色下会刺眼） */
  --tint-hover: rgba(0, 115, 79, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; }
main { flex: 1; }

/* ============ 顶部导航 (滚动毛玻璃) ============ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.site-nav.scrolled {
  border-bottom-color: var(--border-soft);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; gap: 32px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.5px; }
.nav-logo img { height: 30px; width: auto; filter: var(--logo-filter); }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  padding: 8px 14px; border-radius: 8px;
  color: var(--text-2); font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
/* 语言切换（中/EN） */
.nav-lang { display: inline-flex; align-items: center; gap: 2px; font-size: 0.82rem; margin-right: 6px; white-space: nowrap; }
.nav-lang a { color: var(--text-3); text-decoration: none; padding: 3px 7px; border-radius: 6px; font-weight: 600; }
.nav-lang a:hover { color: var(--brand); }
.nav-lang a.on { color: var(--brand); background: var(--brand-dim); }
.lang-sep { color: var(--text-3); opacity: 0.5; }
.nav-links a.active { color: var(--brand); }
/* VIP 徽章 */
.badge-vip {
  background: linear-gradient(135deg, rgba(255, 200, 60, 0.18), rgba(255, 150, 40, 0.14));
  color: var(--warn); border: 1px solid rgba(255, 180, 60, 0.45);
}
/* 圆形头像 */
.avatar-img {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--brand-border); flex-shrink: 0;
}
.avatar-xs {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  vertical-align: middle; margin-right: 6px; flex-shrink: 0;
}
.avatar-xs-text {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; margin-right: 6px;
  background: var(--brand-dim); color: var(--brand);
  font-size: 0.72rem; font-weight: 700; vertical-align: middle; flex-shrink: 0;
}
.who-avatar { display: inline-flex; align-items: center; }
.who-avatar .avatar-xs, .who-avatar .avatar-xs-text { margin-right: 4px; }
.comment-item .who { display: flex; align-items: center; gap: 2px; }
/* 个人中心头像 */
.avatar-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.avatar-lg {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--brand-border); box-shadow: 0 4px 18px rgba(0,0,0,.25); flex-shrink: 0;
}
.avatar-lg-text {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-dim); color: var(--brand);
  font-size: 2.4rem; font-weight: 800;
}
.avatar-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
/* ============ 积分 / 通知 / 答题 ============ */
.nav-icon-link { display: inline-flex; align-items: center; gap: 3px; font-size: .95rem; color: var(--text-2); text-decoration: none; position: relative; }
.nav-icon-link:hover { color: var(--brand); }
.nav-icon-link #nav-pts { font-size: .78rem; font-weight: 700; }
.bell-badge {
  position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 700; border-radius: 10px; padding: 1px 5px; min-width: 16px; text-align: center;
}
.week-row { display: flex; gap: 6px; }
.week-cell { flex: 1; text-align: center; border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px 0; background: var(--bg); }
.week-cell.week-ok { border-color: var(--brand-border); background: var(--brand-dim); }
.week-day { font-size: .7rem; color: var(--text-3); }
.week-dot { font-size: .9rem; color: var(--brand); }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--border-soft); }
.rank-row:last-child { border-bottom: none; }
.rank-me { background: var(--brand-dim); border-radius: 8px; }
.rank-no { width: 26px; text-align: center; font-weight: 700; color: var(--text-3); }
.rank-no.rank-top { color: var(--warn); }
.rank-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-streak { font-size: .8rem; }
.rank-pts { font-size: .9rem; }
.notif-unread { background: var(--brand-dim); border-radius: 10px; }
.quiz-q { margin-bottom: 16px; }
.quiz-q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.quiz-q-text { font-weight: 600; margin-bottom: 10px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-soft); border-radius: 10px; padding: 9px 14px; margin-bottom: 8px; cursor: pointer; background: var(--bg); transition: border-color .15s; }
.quiz-opt:hover { border-color: var(--brand-border); }
.quiz-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-dim); }
.quiz-opt-right { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-dim); border: 1px solid var(--brand-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--brand); font-size: 0.9rem;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text);
  cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { border-color: var(--brand-border); background: var(--bg-hover); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-dim); }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; border-radius: 6px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
  opacity: 0.32;
  filter: saturate(0.85) contrast(1.05);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,18,18,0.82) 0%, rgba(18,18,18,0.55) 45%, var(--bg) 100%);
}
html[data-theme="light"] .hero-bg { opacity: 0.5; }
html[data-theme="light"] .hero-bg::after {
  background: linear-gradient(180deg, rgba(244,246,247,0.82) 0%, rgba(244,246,247,0.4) 45%, var(--bg) 100%);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800; letter-spacing: -0.5px;
  line-height: 1.2; margin-bottom: 18px;
}
.hero h1 .accent { color: var(--brand); }
.hero .slogan { font-size: 1.1rem; color: var(--text-2); max-width: 640px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ============ 分区 ============ */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.section-head h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.3px; }
.section-head .more { color: var(--text-3); font-size: 0.85rem; }
.section-head .more:hover { color: var(--brand); }

/* ============ 卡片 ============ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}
.card:hover { transform: translateY(-3px); border-color: var(--brand-border); }
.card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.card .desc { color: var(--text-2); font-size: 0.9rem; margin-bottom: 14px; }
.card .meta { color: var(--text-3); font-size: 0.78rem; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-dim); border: 1px solid var(--brand-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
}
.card-media { border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin: -24px -24px 18px; overflow: hidden; }
.card-media img { width: 100%; height: 170px; object-fit: cover; transition: transform 0.3s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-link { display: block; height: 100%; }

/* ============ 列表行 ============ */
.row-list { border-top: 1px solid var(--border-soft); }
.row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 4px; border-bottom: 1px solid var(--border-soft);
  transition: background 0.12s;
}
.row:hover { background: var(--bg-hover); border-radius: 10px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--text-3); font-size: 0.8rem; margin-top: 4px; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600;
}
.badge-brand { background: var(--brand-dim); color: var(--brand); border: 1px solid var(--brand-border); }
.badge-gray { background: var(--bg-hover); color: var(--text-3); border: 1px solid var(--border); }
.badge-red { background: rgba(255,75,64,0.12); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-gold { background: rgba(255,176,32,0.12); color: var(--warn); border: 1px solid rgba(255,176,32,0.4); }
.badge-blue { background: var(--info-dim); color: var(--info); border: 1px solid var(--info-border); }

/* ============ 表单 ============ */
.form-panel {
  max-width: 460px; margin: 0 auto;
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 36px;
}
.form-panel.wide { max-width: 720px; }
.form-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; text-align: center; }
.form-sub { color: var(--text-3); font-size: 0.88rem; margin-bottom: 26px; text-align: center; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.form-group input[type="text"], .form-group input[type="password"], .form-group input[type="email"],
.form-group input[type="number"], .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 0.95rem;
  font-family: inherit; outline: none; transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--brand); }
.form-group textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-error {
  background: rgba(255, 75, 64, 0.1); border: 1px solid rgba(255, 75, 64, 0.35);
  color: var(--danger); padding: 10px 14px; border-radius: 8px;
  font-size: 0.88rem; margin-bottom: 16px;
}
.form-tip { text-align: center; color: var(--text-3); font-size: 0.85rem; margin-top: 18px; }
.form-tip a { color: var(--brand); }

/* 全局表单控件基线：散落在各处、不带 class 的 input 在深色主题下默认是白底黑字（不跟随主题） */
.container input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]),
.container select, .container textarea,
form select, form textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 8px 12px; font-family: inherit; font-size: 0.9rem;
}
.container input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):focus,
.container select:focus, .container textarea:focus,
form select:focus, form textarea:focus { border-color: var(--brand); outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

/* ============ 页面头 ============ */
.page-head { padding: calc(var(--nav-h) + 40px) 0 8px; }
.page-head h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.4px; }
.page-head .sub { color: var(--text-2); font-size: 0.92rem; margin-top: 6px; }
.content-section { padding: 28px 0 64px; }

/* ============ 详情页 ============ */
.article { max-width: 860px; margin: 0 auto; }
.article h1.title { font-size: 2rem; font-weight: 800; line-height: 1.3; margin-bottom: 14px; }
.article .meta-row { display: flex; gap: 18px; color: var(--text-3); font-size: 0.85rem; padding-bottom: 20px; border-bottom: 1px solid var(--border-soft); margin-bottom: 26px; flex-wrap: wrap; align-items: center;}
.article .content { font-size: 1.02rem; line-height: 1.9; }
.article .content p { margin: 14px 0; }
.article .content h2 { font-size: 1.35rem; margin: 30px 0 12px; }
.article .content h3 { font-size: 1.15rem; margin: 24px 0 10px; }
.article .content h4 { font-size: 1.05rem; margin: 20px 0 8px; }
.article .content h5 { font-size: 1rem; margin: 16px 0 6px; color: var(--text-2); }
.article .content h6 { font-size: 0.92rem; margin: 14px 0 6px; color: var(--text-2); }
.article .content hr { border: none; border-top: 1px solid var(--border-soft); margin: 26px 0; }
.article .content .md-li { margin: 4px 0; }
.article .content .md-li::before { content: '· '; color: var(--brand); }
.article .content .md-img { color: var(--text-3); font-size: 0.9rem; margin: 10px 0; }
.article .content .md-q { border-left: 3px solid var(--brand); background: var(--brand-dim); padding: 8px 14px; border-radius: 0 8px 8px 0; margin: 12px 0; color: var(--text-2); }
.article .content pre {
  background: var(--code-bg); border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 16px; overflow-x: auto; margin: 16px 0; font-size: 0.9rem;
  font-family: var(--font-mono); line-height: 1.6;
}
.article .content code { background: var(--code-bg); padding: 2px 6px; border-radius: 5px; font-size: 0.9em; font-family: var(--font-mono); }
/* 代码块折叠容器（论坛帖子/评论） */
.article .content .cb { margin: 16px 0; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; background: var(--code-bg); }
.article .content .cb-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 5px 8px 5px 14px; background: var(--bg-elev);
  border-bottom: 1px solid var(--border-soft); font-size: 0.78rem; color: var(--text-3);
}
.article .content .cb-tag { font-family: var(--font-mono); letter-spacing: 0.2px; }
.article .content .cb-toggle {
  border: 1px solid var(--border); background: var(--bg); color: var(--text-2);
  border-radius: 6px; padding: 1px 12px; font-size: 0.75rem; cursor: pointer;
  font-family: inherit; line-height: 1.8;
}
.article .content .cb-toggle:hover { color: var(--brand); border-color: var(--brand-border); }
.article .content .cb pre { margin: 0; border: none; border-radius: 0; border-top: 1px solid var(--border-soft); }
.article .content .cb.collapsed pre { display: none; }
.article .content blockquote {
  border-left: 3px solid var(--brand); background: var(--brand-dim);
  padding: 10px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; color: var(--text-2);
}
.article .content img { border-radius: 12px; margin: 14px 0; }
.article .content a { color: var(--brand); }
.article .content ul, .article .content ol { padding-left: 24px; margin: 12px 0; }
.article .content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.article .content td, .article .content th { border: 1px solid var(--border-soft); padding: 8px 12px; }

/* 评论区 */
.comments { margin-top: 34px; }
.comments h3 { font-size: 1.1rem; margin-bottom: 16px; }
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.comment-item .who { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-3); margin-bottom: 6px; }
.comment-item .who b { color: var(--text); font-size: 0.9rem; }

/* ============ 表格 ============ */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  text-align: left; padding: 10px 12px; color: var(--text-3);
  font-weight: 500; font-size: 0.8rem; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg-hover); }

/* ============ 面板容器 ============ */
.panel {
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 24px;
  margin-bottom: 20px;
}
.panel h3 { font-size: 1.02rem; margin-bottom: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat {
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 18px; text-align: center;
}
.stat .num { font-size: 1.7rem; font-weight: 800; color: var(--brand); }
.stat .lbl { color: var(--text-3); font-size: 0.8rem; margin-top: 4px; }

/* ============ 页脚 ============ */
.site-footer { border-top: 1px solid var(--border-soft); padding: 40px 0 48px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.footer-brand { font-weight: 800; font-size: 1.1rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.footer-brand img { height: 24px; filter: var(--logo-filter); }
.footer-desc { color: var(--text-3); font-size: 0.85rem; }
.footer-col h4 { font-size: 0.85rem; color: var(--text-2); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-3); font-size: 0.85rem; margin-bottom: 8px; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--border-soft); padding-top: 20px; display: flex; justify-content: space-between; color: var(--text-3); font-size: 0.78rem; flex-wrap: wrap; gap: 10px; }

/* ============ 其他 ============ */
.tag { display: inline-block; font-size: 0.78rem; color: var(--text-3); background: var(--bg); border: 1px solid var(--border-soft); border-radius: 6px; padding: 2px 8px; margin-right: 6px; }
.muted { color: var(--text-3); }
.empty-tip { text-align: center; color: var(--text-3); padding: 48px 0; font-size: 0.92rem; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.text-brand { color: var(--brand); }
.pill-input { display: flex; gap: 8px; }
.pill-input input { flex: 1; }

/* 403/404 */
.error-page { text-align: center; padding: 120px 24px; }
.error-page .code { font-size: 5rem; font-weight: 800; color: var(--brand); letter-spacing: -2px; }
.error-page .msg { color: var(--text-2); margin: 16px 0 28px; font-size: 1.05rem; }

/* ============ 小程序 · 算命系统 ============ */
.btn-lg { padding: 12px 26px; font-size: 1rem; }

/* ============ 文档作品 ============ */
.doc-media {
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-elev));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.doc-media img { width: 100%; height: 170px; object-fit: cover; object-position: top center; display: block; }
.doc-thumb-lg { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border-soft); flex-shrink: 0; }
.doc-icon { font-size: 2.6rem; line-height: 1; filter: grayscale(.15); }
.doc-ext {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 1px;
  padding: 2px 10px; border-radius: 4px; color: #fff;
}
.doc-ext-pdf { background: #e5484d; }
.doc-ext-doc, .doc-ext-docx { background: #2f6fed; }
.doc-ext-xls, .doc-ext-xlsx { background: #1f9d55; }
.doc-ext-ppt, .doc-ext-pptx { background: #e2711d; }
.doc-ext-tag { display: inline-block; margin-left: 8px; font-size: 0.68rem; padding: 2px 8px; border-radius: 4px; color: #fff; vertical-align: middle; }
.doc-panel { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-elev); }
.doc-panel-main { display: flex; align-items: center; gap: 16px; padding: 22px; flex-wrap: wrap; }
.doc-big-icon { font-size: 2.6rem; }
.doc-info { flex: 1; min-width: 180px; }
.doc-file-name { font-weight: 700; font-size: 1.05rem; word-break: break-all; }
.doc-preview { width: 100%; height: 70vh; border: none; border-top: 1px solid var(--border-soft); background: var(--bg-elev); }
.pillar-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.pillar { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 14px; text-align: center; min-width: 74px; }
.pillar-label { font-size: 0.75rem; color: var(--text-3); margin-bottom: 6px; }
.pillar-gan, .pillar-zhi { font-size: 1.45rem; font-weight: 700; line-height: 1.5; }
.pillar-wx { font-size: 0.68rem; color: var(--text-3); font-weight: 400; }
.wuxing-bar { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.wx-chip { background: var(--brand-dim); color: var(--brand); border: 1px solid var(--brand-border); border-radius: 20px; padding: 3px 14px; font-size: 0.85rem; font-weight: 600; }
.wx-empty { background: var(--bg-hover); color: var(--text-3); border-color: var(--border); }
.tarot-card, .lot-card { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 16px; padding: 28px 20px; }
.tarot-name { font-size: 2rem; font-weight: 800; }
.tarot-pos { display: inline-block; margin-top: 8px; padding: 2px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.pos-up { color: var(--brand); background: var(--brand-dim); }
.pos-dn { color: var(--danger); background: rgba(255, 75, 64, 0.12); }
.tarot-text, .lot-text { margin-top: 12px; font-size: 1.05rem; }
.lot-no { color: var(--text-3); font-size: 0.85rem; }
.lot-grade { font-size: 1.9rem; font-weight: 800; color: var(--warn); margin-top: 6px; }
/* 今天吃什么 */
.food-result { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 16px; padding: 24px 16px; }
.food-label { font-size: 0.8rem; color: var(--text-3); }
.food-main { font-size: 2.2rem; font-weight: 800; margin: 8px 0 4px; color: var(--brand); }
.food-alts { color: var(--text-2); font-size: 0.9rem; margin-bottom: 6px; }
.food-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 14px; }
.food-cat { font-weight: 700; color: var(--text-2); margin-bottom: 8px; font-size: 0.9rem; }
.food-items { display: flex; flex-wrap: wrap; gap: 6px; }
.food-chip { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 20px; padding: 3px 10px; font-size: 0.8rem; color: var(--text-2); }
/* 考研单词 */
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.word-card { display: flex; gap: 12px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; }
.word-no { color: var(--text-3); font-size: 0.75rem; font-weight: 700; margin-top: 3px; }
.word-en { font-size: 1.15rem; font-weight: 700; }
.word-pos { color: var(--brand); font-size: 0.78rem; margin-right: 8px; font-weight: 600; }
.word-zh { color: var(--text-2); margin-top: 3px; }
/* 政治考点 */
.topic-core { background: var(--brand-dim); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; padding: 12px 16px; margin-top: 12px; color: var(--text); }
/* 番茄钟 */
.pomo-modes { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.pomo-mode {
  border: 1px solid var(--border); background: var(--bg); color: var(--text-2);
  border-radius: 20px; padding: 6px 18px; font-size: 0.88rem; cursor: pointer; font-weight: 600;
  transition: all 0.15s;
}
.pomo-mode:hover { color: var(--brand); border-color: var(--brand-border); }
.pomo-mode.on { background: var(--brand-dim); color: var(--brand); border-color: var(--brand-border); }
.pomo-ring-wrap { position: relative; width: 300px; height: 300px; margin: 0 auto; }
.pomo-ring { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--border-soft); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.pomo-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
}
.pomo-time { font-size: 3.4rem; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.pomo-mode-label { color: var(--text-3); font-size: 0.95rem; }
.pomo-controls { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.pomo-stats { display: flex; gap: 10px; justify-content: center; margin-top: 18px; color: var(--text-2); font-size: 0.9rem; flex-wrap: wrap; align-items: center; }
.pomo-stats b { color: var(--brand); font-size: 1.05rem; }
.stat-sep { opacity: 0.4; }
.pomo-settings { display: flex; gap: 14px; justify-content: center; margin-top: 18px; flex-wrap: wrap; color: var(--text-2); font-size: 0.85rem; align-items: center; }
.pomo-settings input { width: 62px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 5px 8px; text-align: center; }
.pomo-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(8px);
  background: var(--bg-elev); border: 1px solid var(--brand-border); color: var(--brand);
  padding: 10px 22px; border-radius: 30px; font-size: 0.92rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 9999;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.pomo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 移动端 */
@media (max-width: 800px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .section { padding: 44px 0; }
}

/* 淡入过渡 */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ 双击图片全屏查看 ============ */
#dw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  cursor: zoom-out;
  animation: lbFade 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
}
#dw-lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.8);
  animation: lbZoom 0.18s ease;
}
.dw-lb-hint {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  pointer-events: none;
}
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbZoom { from { transform: scale(0.96); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }

/* ============ 影视飓风式全屏主页 ============ */
.hero-mega { position: relative; height: 92vh; min-height: 560px; overflow: hidden; margin-top: -1px; }
.hero-mega-slides, .hero-slide { position: absolute; inset: 0; }
.hero-slide { background-size: cover; background-position: center; opacity: 0; transition: opacity 1.6s ease; }
.hero-slide.active { opacity: 1; }
.hero-mega-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.55) 55%, rgba(18,18,18,.92) 100%); }
html[data-theme="light"] .hero-mega-mask { background: linear-gradient(180deg, rgba(0,0,0,.4) 0%, rgba(0,0,0,.55) 60%, rgba(244,246,247,.95) 100%); }
.hero-mega-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: #fff; padding-bottom: 9vh; }
.hero-kicker { letter-spacing: 4px; font-size: .95rem; opacity: .8; margin-bottom: 18px; }
/* ---- hero 按钮组：绝对定位沉底（脱离文档流，让字标能真正居中）---- */
.hero-actions {
  position: absolute; left: 50%; bottom: 78px;
  transform: translateX(-50%);
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
}

/* ---- hero 字标（方案2 衬线编辑型）---- */
.hero-wordmark { display: inline-flex; flex-direction: column; align-items: center; }
.hero-wordmark-sub {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 13px; font-weight: 800; letter-spacing: .42em; text-indent: .42em;
  color: var(--brand); opacity: .9; margin-bottom: 12px;
}
.hero-mega-title {
  font-family: "SJjinsongcu", "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  font-size: clamp(2.8rem, 7.5vw, 5.4rem);
  font-weight: 600; line-height: 1.12;
  letter-spacing: .18em; text-indent: .18em;
  text-shadow: 0 4px 34px rgba(0,0,0,.55);
}
.hero-wordmark-line {
  height: 3px; width: 100%; margin-top: 14px; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, rgba(0,230,160,.55) 60%, rgba(0,230,160,0) 100%);
}
@media (max-width: 640px) {
  .hero-actions { bottom: 66px; gap: 10px; }
  .hero-dots { bottom: 24px; }
  .hero-wordmark-sub { font-size: 10px; letter-spacing: .34em; }
  .hero-mega-title { font-size: clamp(2.2rem, 11vw, 3.2rem); letter-spacing: .14em; text-indent: .14em; }
}
.hero-mega-sub { margin-top: 18px; color: rgba(255,255,255,.75); font-size: 1.05rem; max-width: 640px; }
.hero-mega-content .btn-glass { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); color: #fff; backdrop-filter: blur(8px); }
.hero-mega-content .btn-glass:hover { background: rgba(255,255,255,.22); }
.hero-dots {
  position: absolute; left: 50%; bottom: 32px;
  transform: translateX(-50%);
  display: flex; gap: 8px;
}
.hero-dots .dot { width: 8px; height: 8px; padding: 0; border: 0; cursor: pointer; border-radius: 50%; background: rgba(255,255,255,.4); transition: all .3s; }
.hero-dots .dot.on { background: var(--brand); width: 26px; border-radius: 5px; }
.hero-scroll-hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.6); font-size: 1.4rem; animation: hero-bob 1.8s infinite; z-index: 2; }
@keyframes hero-bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ============ 公告横幅 / 导航搜索 ============ */
.ann-bar { background: linear-gradient(90deg, var(--brand-dim), rgba(0,230,160,.04)); border-bottom: 1px solid var(--brand-border); position: relative; z-index: 5; }
.ann-inner { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: .88rem; }
.ann-tag { font-size: 1rem; }
.ann-tag.ann-imp { color: var(--warn); }
.ann-link { flex: 1; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-link:hover { color: var(--brand); }
.ann-close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: .85rem; padding: 2px 6px; }
.ann-close:hover { color: var(--brand); }
.nav-search { display: flex; align-items: center; margin-right: 4px; }
.nav-search input { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; width: 170px; font-size: .82rem; color: var(--text); outline: none; transition: all .2s; }
.nav-search input:focus { border-color: var(--brand); width: 210px; }
.nav-search button { background: none; border: none; cursor: pointer; font-size: .9rem; margin-left: -30px; }
@media (max-width: 900px) { .nav-search { display: none; } }

/* ============ 专栏 ============ */
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.col-card { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-elev); text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: transform .2s, border-color .2s; }
.col-card:hover { transform: translateY(-3px); border-color: var(--brand-border); }
.col-cover { height: 96px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; background: linear-gradient(135deg, var(--brand-dim), var(--bg)); }
.col-cover img { width: 100%; height: 100%; object-fit: cover; }
.col-body { padding: 12px 14px; }
.col-title { font-weight: 700; margin-bottom: 4px; }
.col-desc { color: var(--text-2); font-size: .82rem; height: 36px; overflow: hidden; }
.col-meta { color: var(--text-3); font-size: .76rem; margin-top: 8px; }
.chem-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chem-chip { border: 1px solid var(--border); background: var(--bg); color: var(--text-2); border-radius: 6px; padding: 4px 10px; font-family: var(--font-mono); font-size: .8rem; cursor: pointer; }
.chem-chip:hover { color: var(--brand); border-color: var(--brand-border); }

/* ============ 思维导图 ============ */
.mm-root { display: inline-block; background: linear-gradient(135deg, var(--brand), var(--brand-hover)); color: var(--on-brand); font-weight: 800; padding: 12px 22px; border-radius: 999px; font-size: 1.15rem; margin: 10px auto; }
.mm-canvas { text-align: center; overflow-x: auto; padding: 26px 10px; }
.mm-branches { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 26px; position: relative; }
.mm-branch { max-width: 300px; }
.mm-node1 { border: 1.5px solid var(--brand-border); background: var(--brand-dim); color: var(--brand); font-weight: 700; padding: 8px 16px; border-radius: 12px; margin-bottom: 8px; }
.mm-sub { border-left: 2px dashed var(--border); padding-left: 12px; text-align: left; }
.mm-node2 { background: var(--bg-elev); border: 1px solid var(--border-soft); padding: 5px 10px; border-radius: 8px; margin: 5px 0; font-size: .88rem; }
.mm-node3 { display: inline-block; background: var(--bg); border: 1px solid var(--border-soft); font-size: .76rem; color: var(--text-2); border-radius: 6px; padding: 2px 8px; margin: 3px; }

/* ============ 趋势图 / 统计 ============ */
.trend-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.trend-bar { width: 70%; background: var(--brand); border-radius: 4px 4px 0 0; opacity: .85; min-height: 2px; }
.trend-day { font-size: .62rem; color: var(--text-3); }

/* ============ 2048 棋盘 / 转盘（走主题变量，避免浅底白块） ============ */
.game-2048-board { position: relative; width: 100%; aspect-ratio: 1; background: var(--tile-2048-board); border: 1px solid var(--border-soft); border-radius: 12px; touch-action: none; user-select: none; }
.tw-2048-lo  { background: var(--tile-2048-lo);  color: var(--tile-2048-lo-fg); }
.tw-2048-mid { background: var(--tile-2048-mid); color: var(--tile-2048-mid-fg); }
.tw-2048-hi  { background: var(--tile-2048-hi);  color: var(--tile-2048-hi-fg); }
.tw-2048-max { background: var(--tile-2048-max); color: var(--tile-2048-max-fg); }
.rank-gold   { color: var(--rank-1); font-weight: 800; }
.rank-silver { color: var(--rank-2); font-weight: 800; }
.rank-bronze { color: var(--rank-3); font-weight: 800; }
.dwm-mini.danger, .dwm-left button.danger, .dwm-region .rdel { color: var(--danger); }

/* ============ 双模编辑器 ============ */
.editor-mode-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.mode-btn { border: none; background: var(--bg); color: var(--text-2); padding: 6px 16px; cursor: pointer; font-size: .85rem; }
.mode-btn.on { background: var(--brand); color: var(--on-brand); font-weight: 700; }
.md-pane { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.md-pane textarea { width: 100%; min-height: 460px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: 14px; font-family: var(--font-mono); font-size: .88rem; line-height: 1.7; resize: vertical; outline: none; }
.md-pane textarea:focus { border-color: var(--brand); }
.md-preview { border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px 18px; background: var(--bg-elev); min-height: 460px; overflow-y: auto; }
.rich-pane .ql-toolbar { border-radius: 10px 10px 0 0; background: var(--bg-elev); border-color: var(--border-soft); }
.rich-pane .ql-container { min-height: 420px; border-radius: 0 0 10px 10px; background: var(--bg-elev); border-color: var(--border-soft); font-size: 1rem; }
.rich-pane .ql-editor { min-height: 400px; }
.ql-editor img { max-width: 100%; border-radius: 8px; }
@media (max-width: 900px) { .md-pane { grid-template-columns: 1fr; } }/* ============ 公告横幅与 fixed 导航的定位修正 ============ */
.ann-bar { padding-top: var(--nav-h); margin-top: -1px; position: relative; z-index: 6; }
.ann-bar .ann-inner { padding: 7px 0; }
/* 登录态导航元素多：中屏收拢次要项，防挤压错乱 */
@media (max-width: 1180px) {
  .nav-user .badge { display: none; }
  .nav-user .avatar-img, .nav-user .avatar { display: none; }
}
@media (max-width: 1080px) {
  .nav-links, .nav-search { display: none; }
  .nav-user .btn-ghost { padding: 6px 10px; }
}/* ============ 导航防挤压（字竖排修复 / 瘦身版） ============ */
.nav-inner { gap: 18px; flex-wrap: nowrap; }
.nav-logo, .nav-links, .nav-user, .nav-search { flex-shrink: 0; }
.nav-links { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { white-space: nowrap; }
.nav-user { flex-wrap: nowrap; gap: 8px; }
.nav-user > * { flex-shrink: 0; white-space: nowrap; }
.nav-user .avatar, .nav-user a.avatar { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-dim); border: 1px solid var(--brand-border); align-items: center; justify-content: center; font-weight: 700; color: var(--brand); font-size: .9rem; text-decoration: none; }
.nav-settings { font-size: 1.05rem; }
.nav-search { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-search input { width: 170px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-hover); color: var(--text); outline: none; transition: width .2s, border-color .2s; }
.nav-search input:focus { width: 210px; border-color: var(--brand-border); }
.nav-search button { border: none; background: transparent; cursor: pointer; font-size: .95rem; padding: 6px; border-radius: 8px; }
.nav-search button:hover { background: var(--bg-hover); }
@media (max-width: 1350px) {
  .nav-search { display: none; }
}
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .nav-logo { margin-right: auto; }
}/* hero 箭头 */
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.25); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.hero-arrow:hover { background: rgba(0,230,160,.25); border-color: var(--brand); }
.hero-prev { left: 18px; }
.hero-next { right: 18px; }
@media (max-width: 800px) { .hero-arrow { display: none; } }/* 作品附件 */
.att-grid { display: flex; flex-direction: column; gap: 8px; }
.att-file { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px 12px; background: var(--bg-elev); }
.att-file-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: var(--text); }
.att-ico { font-size: 1.4rem; }
.att-file-info { display: flex; flex-direction: column; min-width: 0; }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.att-meta { font-size: .72rem; color: var(--text-3); }
.att-img { display: inline-flex; flex-direction: column; width: 140px; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; background: var(--bg-elev); text-decoration: none; color: var(--text); }
.att-img img { width: 100%; height: 92px; object-fit: cover; }
.att-ph { height: 92px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.att-name { padding: 4px 8px; }
@media (min-width: 700px) { .att-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }.att-img-box { position: relative; display: inline-flex; }
.att-del { position: absolute; top: 4px; right: 4px; }
.att-del .btn { padding: 1px 8px; font-size: .7rem; }

/* ============ 移动端导航（汉堡菜单，≤1080px 时替代被隐藏的 nav-links） ============ */
.nav-burger {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
}
.nav-burger:hover { color: var(--brand); border-color: var(--brand-border); }
.mobile-nav {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  z-index: 99;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  padding: 10px 16px 16px;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav .nav-links { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav a {
  display: block;
  padding: 12px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 1rem;
  border-bottom: 1px solid var(--border-soft);
  text-decoration: none;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover, .mobile-nav a.active { color: var(--brand); background: var(--bg-hover); }
.mobile-nav .nav-search { display: flex; margin-top: 10px; padding: 0 4px; }
.mobile-nav .nav-search input { width: 100%; min-width: 0; }
@media (max-width: 1080px) {
  .nav-burger { display: inline-flex; }
  .nav-inner { gap: 12px; padding: 0 14px; }
}

/* ============ 全站主题开关（导航栏，桌面+移动端） ============ */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--bg-elev); color: var(--text);
  font-size: 1rem; line-height: 1; cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}
.theme-toggle:hover { border-color: var(--brand-border); background: var(--bg-hover); transform: rotate(-12deg); }
.mobile-theme-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding: 10px 10px 4px;
  border-top: 1px solid var(--border-soft);
}
.mobile-theme-label { color: var(--text-2); font-size: .95rem; }

/* ============ 角色标签（名字左侧，全站内容作者通用） ============ */
.role-tag {
  display: inline-block; font-size: .62rem; font-weight: 700;
  padding: 1px 7px; border-radius: 99px; margin-right: 6px;
  vertical-align: 1px; letter-spacing: .5px; white-space: nowrap;
  border: 1px solid; line-height: 1.5;
}
.role-owner  { color: var(--role-owner); background: rgba(45,224,255,.10); border-color: var(--role-owner-border); }   /* 站长 青 */
.role-vip    { color: var(--role-vip); background: rgba(255,216,77,.10); border-color: var(--role-vip-border); }   /* VIP 金 */
.role-auth   { color: var(--role-auth); background: rgba(122,184,255,.10); border-color: var(--role-auth-border); }  /* 授权用户 蓝 */
.role-admin  { color: var(--role-admin); background: rgba(88,224,138,.10); border-color: var(--role-admin-border); }    /* 管理员 绿 */
.role-user   { color: var(--text-2); background: var(--role-user-bg); border-color: var(--border); }    /* 普通用户 白/灰 */

/* ============ 作品互动 / 评论点赞 ============ */
.w-react, .c-like { transition: all .15s; }
.w-react.btn-primary { border-color: var(--brand-border); }
.w-react.btn-danger { border-color: rgba(255,75,64,.5); }
.c-like.active { background: var(--brand-dim); color: var(--brand); border-color: var(--brand-border); }
.c-like.active:hover { color: var(--brand); }
.w-fav { transition: all .15s; }
.w-fav.btn-primary { background: var(--brand-dim); color: var(--brand); border-color: var(--brand-border); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============ 白色工作台：小程序 / 站长管理 / TS3 点歌台 / 作品集 ============
   ⚠️ 关键：整套变量重定义必须用 html[data-theme="light"] 做祖先门控。
   原因：html[data-theme="dark"] 与 body.light-workspace 优先级同为 (0,1,1)，
   而本块在文件末尾 → 后者胜出 → 用户在深色主题下访问这 4 个页面时，
   html 明明挂着 data-theme="dark"（--bg:#121212），body 却被强制覆写成
   --bg:#f7f8f8，页面永远白底。这就是"不同页面自动变回另一种主题"的根因。

   门控后行为：
     · 浅色主题 → 本块生效，工作台保持原有浅色品牌风格（视觉零变化）
     · 深色主题 → 本块不生效，工作台跟随全局深色变量
   ============================================================ */
body.light-workspace { background: var(--bg); color: var(--text); }
html[data-theme="light"] body.light-workspace {
  --bg: #f7f8f8; --bg-elev: #fff; --bg-hover: #f1f4f2;
  --border: #dfe5e1; --border-soft: #e8ece9;
  --text: #1d2421; --text-2: #424e47; --text-3: #5c6a62;
  /* 品牌色联动：同一个 --brand 既当按钮底色(配白字 --on-brand)、又当文字色
     (.workspace-eyebrow / .apps-intro a / .badge-brand 文字 / a.active / .stat-link span)。
     原 #00a977 三处全不达标：白字压它 3.03:1、作文字压浅底 2.73:1、badge 2.48:1。
     改 #00714e 后三处同时达标：白字 6.05:1、作文字 5.46:1、badge 4.75:1。
     该值与全局浅色 --brand(#00734f) 视觉几乎无差，品牌观感不变。 */
  --brand: #00714e; --brand-dim: rgba(0,113,78,.10); --brand-border: rgba(0,113,78,.34);
  --nav-bg: rgba(255,255,255,.92); --code-bg: #f1f4f2; --logo-filter: none;
  /* 浅色工作台是固定浅底，danger/warn/info/on-brand 必须是浅色底版本 */
  --danger: #c62828; --danger-dim: rgba(198,40,40,.10); --danger-border: rgba(198,40,40,.35);
  --warn: #8a6a00;
  --info: #2c68c4; --info-dim: rgba(44,104,196,.10); --info-border: rgba(44,104,196,.35);
  /* hover 与全局浅色主题保持同一语义（更深一档），既保留"按下变深"的反馈，
     又保证白字压它 >= 4.5（#00694a 配白字 6.73:1）。原 #008c63 压白字只有 4.26:1。 */
  --on-brand: #ffffff; --brand-hover: #00694a;
  --role-owner: #0a6b7e; --role-vip: #7a5e00; --role-svip: #0a6b7e; --role-auth: #2760b0; --role-admin: #187a42;
  --role-user-bg: rgba(0,0,0,.05);
  --rank-1: #a87900; --rank-2: #8a8a8a; --rank-3: #b5711f;
  --tint-hover: #f3faf6;
}
html[data-theme="light"] body.light-workspace .site-nav { background: var(--nav-bg); border-bottom-color: var(--border-soft); box-shadow: 0 1px 0 rgba(20,35,27,.04); }
html[data-theme="light"] body.light-workspace .site-footer { background: #fff; border-top-color: var(--border-soft); }
body.light-workspace .nav-logo img { width: 31px; height: 31px; border-radius: 8px; filter: var(--logo-filter); }
body.light-workspace .page-head.workspace-head { padding-top: calc(var(--nav-h) + 50px); padding-bottom: 24px; border-bottom: 1px solid var(--border-soft); }
.workspace-eyebrow { margin: 0 0 7px; color: var(--brand); font-size: .7rem; font-weight: 800; letter-spacing: .14em; }
body.light-workspace .workspace-head h1 { font-size: clamp(2.15rem, 4vw, 3.25rem); letter-spacing: -.055em; line-height: 1.08; }
body.light-workspace .workspace-content { padding-top: 24px; }
body.light-workspace .btn-primary { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
body.light-workspace .btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
body.light-workspace .card, body.light-workspace .panel, body.light-workspace .stat { box-shadow: 0 2px 8px rgba(23,40,29,.025); }

/* 小程序 */
.apps-intro { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; margin-bottom: 18px; border: 1px solid var(--brand-border); border-radius: 10px; background: var(--brand-dim); color: var(--text-2); font-size: .88rem; }
.apps-intro a { color: var(--brand); font-weight: 700; white-space: nowrap; }
.apps-grid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; }
body.light-workspace .apps-grid .card { min-height: 174px; padding: 18px; border-radius: 12px; background: var(--bg-elev); }
body.light-workspace .apps-grid .card:hover { transform: translateY(-2px); border-color: var(--brand-border); box-shadow: 0 13px 26px rgba(21,65,43,.08); }
body.light-workspace .apps-grid .card-icon { width: 38px; height: 38px; margin-bottom: 13px; border: 0; border-radius: 9px; background: var(--brand-dim); color: var(--brand); font-size: 1.2rem !important; }
body.light-workspace .apps-grid .card h3 { margin-bottom: 6px; font-size: 1rem; }
body.light-workspace .apps-grid .card .desc { min-height: 42px; margin-bottom: 8px; font-size: .83rem; line-height: 1.6; }

/* 站长管理台 */
.owner-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 7px; margin-bottom: 18px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--bg-elev); }
.owner-nav .btn { border-color: transparent; background: transparent; }
.owner-nav .btn-primary { box-shadow: none; }
body.light-workspace-owner .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
body.light-workspace-owner .stat { padding: 17px; border-radius: 12px; text-align: left; }
body.light-workspace-owner .stat .num { font-size: 1.85rem; color: var(--text); }
body.light-workspace-owner .stat .lbl { margin-top: 3px; }
.owner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
body.light-workspace-owner .panel { border-radius: 12px; padding: 19px; }
body.light-workspace-owner .stat-link { display: block; color: inherit; cursor: pointer; transition: transform .16s, border-color .16s, box-shadow .16s; }
html[data-theme="light"] body.light-workspace-owner .stat-link:hover { transform: translateY(-2px); border-color: #b7ddca; box-shadow: 0 10px 22px rgba(20,67,43,.08); }
body.light-workspace-owner .stat-link .lbl { display: flex; justify-content: space-between; align-items: center; }
body.light-workspace-owner .stat-link .lbl span { color: var(--brand); font-size: 1rem; opacity: 0; transform: translateX(-4px); transition: opacity .16s, transform .16s; }
body.light-workspace-owner .stat-link:hover .lbl span { opacity: 1; transform: none; }
.owner-view { min-height: 180px; transition: opacity .16s; }
.owner-view.owner-view-loading { opacity: .45; pointer-events: none; }

/* TS3 与点歌台 */
.ts3-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
html[data-theme="light"] body.light-workspace-ts3 .ts3-status-panel { border-color: #d5eade; background: linear-gradient(135deg,#effaf5,#fff 72%); }
body.light-workspace-ts3 .stat-grid { gap: 10px; }
body.light-workspace-ts3 .stat { padding: 15px; border-radius: 10px; text-align: left; }
body.light-workspace-ts3 .stat .num { color: var(--text); font-size: 1.7rem; }
body.light-workspace-ts3 .panel { border-radius: 12px; }
body.light-workspace-ts3 .music-workspace { margin-top: 14px; border-color: var(--border); background: var(--bg-elev); }
body.light-workspace-ts3 .pill-input { border-color: var(--border); background: var(--bg-elev); color: var(--text); }
body.light-workspace-ts3 #search-results > div:hover, body.light-workspace-ts3 #queue-list > div:hover { background: var(--tint-hover) !important; }
@media (max-width: 900px) {
  body.light-workspace .page-head.workspace-head { padding-top: calc(var(--nav-h) + 32px); }
  .apps-intro { align-items: flex-start; flex-direction: column; }
  body.light-workspace-owner .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .owner-grid, .ts3-grid { grid-template-columns: 1fr; }
  .owner-nav { flex-wrap: nowrap; overflow-x: auto; }
  .owner-nav .btn { white-space: nowrap; }
}

/* 作品集：白色素材库式陈列，保留豆蛙内容与权限流程。
   同 light-workspace：依赖浅底的视觉规则一律加 html[data-theme="light"] 门控，
   纯版式规则保持无条件生效（避免深色下版式走样）。 */
body.light-workspace-works .works-head { padding-top: calc(var(--nav-h) + 58px); padding-bottom: 22px; }
body.light-workspace-works .works-head h1 { font-size: clamp(2.4rem, 5.4vw, 4.25rem); letter-spacing: -.07em; }
body.light-workspace-works .works-head .sub { max-width: 650px; font-size: .95rem; }
.works-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
body.light-workspace-works .works-content { padding-top: 20px; }
body.light-workspace-works .works-filter { margin-bottom: 24px; padding: 0 0 15px; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: transparent; }
body.light-workspace-works .works-filter .btn { padding: 6px 0; margin-right: 18px; border: 0; border-radius: 0; background: transparent; color: var(--text-3); }
body.light-workspace-works .works-filter .btn:hover { color: var(--text); }
body.light-workspace-works .works-filter .btn-primary { color: var(--brand); box-shadow: none; }
.material-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
body.light-workspace-works .material-card { padding: 13px; border-radius: 10px; background: var(--bg-elev); box-shadow: none; }
html[data-theme="light"] body.light-workspace-works .material-card:hover { transform: translateY(-2px); border-color: #b8dfcc; box-shadow: 0 14px 28px rgba(18,61,40,.08); }
body.light-workspace-works .material-card .card-media { margin: -13px -13px 14px; border-radius: 9px 9px 0 0; background: var(--bg-hover); }
body.light-workspace-works .material-card .card-media img { height: 208px; transition: transform .28s ease; }
body.light-workspace-works .material-card:hover .card-media img { transform: scale(1.025); }
body.light-workspace-works .material-card h3 { margin: 0 0 6px; font-size: 1rem; line-height: 1.45; letter-spacing: -.015em; }
body.light-workspace-works .material-card .desc { display: -webkit-box; overflow: hidden; min-height: 39px; margin-bottom: 11px; color: var(--text-2); font-size: .81rem; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
body.light-workspace-works .material-card .meta { padding-top: 9px; border-top: 1px solid var(--border-soft); }
body.light-workspace-works .material-card .badge-gray { background: var(--bg-hover); color: var(--text-2); border-color: var(--border); }
body.light-workspace-works .material-card .card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top-color: var(--border-soft); }
@media (max-width: 720px) {
  body.light-workspace-works .works-head { padding-top: calc(var(--nav-h) + 34px); }
  body.light-workspace-works .works-head h1 { font-size: 2.45rem; }
  .works-actions { justify-content: flex-start; }
  body.light-workspace-works .works-filter { overflow-x: auto; flex-wrap: nowrap; }
  body.light-workspace-works .works-filter .btn { white-space: nowrap; margin-right: 15px; }
  .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.light-workspace-works .material-card { padding: 9px; }
  body.light-workspace-works .material-card .card-media { margin: -9px -9px 10px; }
  body.light-workspace-works .material-card .card-media img { height: 148px; }
  body.light-workspace-works .material-card h3 { font-size: .9rem; }
  body.light-workspace-works .material-card .desc { display: none; }
}

/* ============================================================
   丝滑页面切换 —— 跨文档 View Transition（渐进增强，零依赖）

   原理：站点是 SSR + 普通 <a href> 整页导航，浏览器原生跨文档 VT 最贴合。
        @view-transition { navigation: auto } 让浏览器自动接管整页导航：
        旧页冻结成快照淡出、新页淡入，两层交叠 → 不会出现白屏。

   渐进增强（三层，互不叠加）：
     1) 支持跨文档 VT  → @view-transition 生效，禁用「入场动画」
        （靠 @supports (view-transition-name:none) 门控，避免双重动画）
     2) 不支持跨文档 VT → 走下面的 dw-page-in 入场动画（Safari/Firefox 也平滑）
     3) prefers-reduced-motion: reduce → 全局兜底(见上方 885 行)把时长压到 .01ms

   性能约束：只动 opacity / transform（合成层），绝不碰 width/height/top/left/margin
   ============================================================ */
:root {
  --vt-dur: 180ms;                 /* 整页切换时长，落在 150–300ms 要求内 */
  --vt-dur-fast: 160ms;            /* 局部内容切换 */
  --vt-ease: cubic-bezier(.2, .7, .2, 1);   /* 自然减速，无弹跳 */
}

/* ---- 页面类型标识：由 layout.ejs 的 data-view 落到 body 上 ---- */

/* 1) 支持跨文档 View Transition 的浏览器：交给浏览器接管整页导航 */
@view-transition { navigation: auto; }

/* 内容区命名：详情类页面多一个轻微上浮方向感
   ⚠️ data-view 的实际取值是「视图路径」（斜杠分隔），例如 apps/map、forum/forum、
   apps/tools —— 不是连字符。早期版本误写成 apps-map，导致所有选择器静默不匹配。 */
body[data-view="forum/forum_post"] main,
body[data-view="works/works_item"] main,
body[data-view="studio/article"] main,
body[data-view="detail"] main {
  view-transition-name: page-content;
}

/* 快照动画：旧页淡出略微上移，新页从下方 8px 淡入 */
::view-transition-old(root) {
  animation: dw-vt-out var(--vt-dur) var(--vt-ease) both;
}
::view-transition-new(root) {
  animation: dw-vt-in var(--vt-dur) var(--vt-ease) both;
}
::view-transition-old(page-content) {
  animation: dw-vt-out var(--vt-dur) var(--vt-ease) both;
}
::view-transition-new(page-content) {
  animation: dw-vt-in-lg var(--vt-dur) var(--vt-ease) both;
}
@keyframes dw-vt-out {
  to { opacity: 0; transform: translateY(-4px); }
}
@keyframes dw-vt-in {
  from { opacity: 0; transform: translateY(6px); }
}
@keyframes dw-vt-in-lg {
  from { opacity: 0; transform: translateY(12px); }
}

/* 2) 不支持跨文档 VT 的浏览器：用 body 入场动画保证"不硬切"
      用 @supports 取反门控 —— 支持 VT 的浏览器不会拿到这个动画，避免双重叠加 */
@supports not (view-transition-name: none) {
  body.dw-page-enter {
    animation: dw-page-in var(--vt-dur) var(--vt-ease) both;
  }
}
@keyframes dw-page-in {
  from { opacity: 0; transform: translateY(6px); }
}

/* ⚠️ 无障碍硬要求：prefers-reduced-motion 下必须真的"不动"
   上面的全局兜底（transition-duration:.01ms）管不到 ::view-transition-*，
   因为快照动画由 UA 样式表提供（默认 250ms 交叉淡化）。
   实测：只靠全局兜底时，reduce 模式仍会完整播放默认动画。

   ⚠️ 坑：这里只能列「确实存在的伪元素」。曾经写成
     ::view-transition-group(page-content), ::view-transition-image-pair(page-content)
   等——当页面没有 page-content 名字时这些是无效选择器，**无效选择器会让整条规则被丢弃**，
   于是整个覆盖静默失效（动画照跑）。所以只保留 root 与真实存在的 page-content 两族，
   且分两条规则写，任一条失效不影响另一条。 */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-group(root) {
    animation: none !important;
  }
  ::view-transition-old(page-content),
  ::view-transition-new(page-content),
  ::view-transition-group(page-content) {
    animation: none !important;
  }
}

/* ⚠️ 地图工具页：三层隔离，确保绝不被干扰
   ① 不参与跨文档 VT（否则整页快照合成可能让 canvas 尺寸抖动）
   ② 页面根元素不加任何动画 / 合成提示（不给 canvas 地图创造合成层）
   ③ JS 侧（page-transition.js）把同文档切换降级为同步执行
   注意 data-view 实际值是 "apps/map"（斜杠），用 ^= 前缀匹配更稳。 */
body[data-view^="apps/map"] { view-transition-name: none; }
body[data-view^="apps/map"] main,
body[data-view^="apps/map"] #map {
  animation: none !important;
  transition: none !important;
  will-change: auto !important;
}
/* 地图页兜底：即使浏览器支持 VT，也不给它挂 page-content 名 */
body[data-view^="apps/map"] main { view-transition-name: none !important; }

/* 3) 主题切换时避免与过渡动画互相干扰（page-transition.js 会瞬时加上再移除） */
html.dw-no-anim,
html.dw-no-anim *,
html.dw-no-anim *::before,
html.dw-no-anim *::after {
  transition: none !important;
  animation: none !important;
}

/* 4) 点击反馈：卡片/列表项按下瞬间的物理感（纯 CSS，不动布局） */
.card-link:active, .material-card:active, .row-title:active, .stat-link:active {
  transform: scale(.985);
}
.card-link, .material-card, .row-title, .stat-link {
  transition: transform var(--vt-dur-fast) var(--vt-ease),
              border-color .2s ease, box-shadow .2s ease;
}
/* 注：灯箱开合已有 lbFade/lbZoom（见 635/645 行），此处不重复定义 */


/* ===== 小程序批次一：刷题 / 积分商城 补充类（20260921） ===== */
.alert { margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); color: var(--text); }
.alert-error { border-color: var(--danger-border); color: var(--danger); }
.alert-success { border-color: var(--brand-border); color: var(--brand); }
.badge-common { background: var(--bg-hover); color: var(--text-2); border: 1px solid var(--border); }
.badge-rare { background: var(--info-dim); color: var(--info); border: 1px solid var(--info-border); }
.badge-epic { background: var(--brand-dim); color: var(--brand); border: 1px solid var(--brand-border); }
.badge-legend { background: var(--bg-hover); color: var(--text); border: 1px solid var(--brand); }
.content-section form label { display: block; margin-bottom: 12px; }
.content-section select, .content-section textarea { width: 100%; min-height: 44px; }
.content-section progress { width: 100%; }
@media (max-width: 520px) {
  .content-section .card-grid { grid-template-columns: 1fr; }
  .content-section .btn, .content-section select { min-height: 44px; }
}

/* ===== 修正：hidden 属性被作者 CSS 的 display 覆盖（20260921apps2） =====
   浏览器只在 UA 样式表里给 [hidden] 加 display:none，任何作者规则都能盖掉它
   （含页面内联 <style> 的 .toolimg-editor{display:grid} / .toolqr-form{display:flex}）。
   实测后果：二维码工坊六个输入表单同时显示、图片工具箱“单图编辑”面板没选图就展开、
   关闭按钮点了没反应。这是 [hidden] 的标准修法（normalize.css 同款），全站一次性修正。
   站点此前没有任何 [hidden] 规则，但有 28 处元素用了该属性，所以顺带修掉潜在同类问题。 */
[hidden] { display: none !important; }
