﻿/* ============================================================
   ROM 下载中心 · 样式表
   设计风格：深色科技 + 蓝色霓虹渐变；提供浅色主题
   ============================================================ */

/* ---------- 全局变量 · 主题令牌 ---------- */
/* 每个主题给全一套令牌，组件只认令牌、不写死颜色（文件末「主题层」统一接管颜色出口）。
   --primary / --accent 也用作文字高亮色：浅色主题必须取对白底够对比度的深色值。
   --on-primary 是主按钮 / 徽标上的文字色，按钮渐变偏亮的主题（黑金）要用深色。
   新增主题：在这里补一组令牌，再到 index.html 首屏脚本与 app.js 的 THEMES 登记。 */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1c;
  --bg-2: #0f1627;
  --bg-3: #161f35;
  --bg-card: rgba(22, 31, 53, 0.78);
  --bg-card-hover: rgba(30, 42, 70, 0.92);
  --line: rgba(148, 173, 214, 0.13);
  --line-strong: rgba(148, 173, 214, 0.26);
  --text: #e8eef7;
  --text-muted: #9fb0c8;
  --text-dim: #6c7e99;
  --primary: #2f7bff;
  --accent: #38d6f5;
  --primary-rgb: 47, 123, 255;
  --accent-rgb: 56, 214, 245;
  --primary-glow: rgba(47, 123, 255, 0.36);
  --accent-glow: rgba(56, 214, 245, 0.24);
  --on-primary: #fff;
  --link: #6cb6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --hue-blue: #7cb4ff;
  --hue-violet: #c4a1ff;
  --hue-orange: #fdae6b;
  --hue-green: #4ade80;
  --grad-primary: linear-gradient(135deg, #2f6bff 0%, #1d9bf0 100%);
  --grad-soft: linear-gradient(135deg, rgba(47, 123, 255, 0.18), rgba(56, 214, 245, 0.08));
  --grad-title: linear-gradient(180deg, #ffffff 30%, #9fd4ff 120%);
  --grad-head: linear-gradient(135deg, rgba(47, 123, 255, 0.2), rgba(56, 214, 245, 0.05)), var(--bg-2);
  --title-sweep: rgba(255, 255, 255, 0.62);
  --sheen: rgba(255, 255, 255, 0.05);
  --topbar-bg: rgba(12, 18, 32, 0.9);
  --field-bg: rgba(255, 255, 255, 0.04);
  --mask: rgba(3, 7, 18, 0.74);
  --ambient-a: rgba(47, 123, 255, 0.14);
  --ambient-b: rgba(56, 214, 245, 0.1);
  --shadow-1: 0 8px 24px rgba(2, 6, 16, 0.36);
  --shadow-2: 0 18px 50px rgba(2, 6, 16, 0.5);
  --shadow-topbar: 0 8px 24px rgba(2, 6, 16, 0.22);
  --shadow-card: 0 8px 22px rgba(2, 6, 16, 0.3);
  --shadow-card-hover: 0 14px 34px rgba(2, 6, 16, 0.42), 0 0 0 1px var(--accent-glow);
  --shadow-pop: 0 24px 64px rgba(2, 6, 16, 0.58);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
}

/* 薰衣草（默认） */
:root[data-theme="lavender"] {
  color-scheme: dark;
  --bg: #120d1f;
  --bg-2: #1a1430;
  --bg-3: #231b3d;
  --bg-card: rgba(35, 27, 61, 0.76);
  --bg-card-hover: rgba(48, 37, 82, 0.92);
  --line: rgba(196, 181, 253, 0.13);
  --line-strong: rgba(196, 181, 253, 0.26);
  --text: #f6f2ff;
  --text-muted: #c3b5e6;
  --text-dim: #9384bd;
  --primary: #8b5cf6;
  --accent: #c4a1ff;
  --primary-rgb: 139, 92, 246;
  --accent-rgb: 196, 161, 255;
  --primary-glow: rgba(139, 92, 246, 0.36);
  --accent-glow: rgba(196, 161, 255, 0.24);
  --on-primary: #fff;
  --link: #c4a1ff;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --hue-blue: #93b8ff;
  --hue-violet: #d6b4ff;
  --hue-orange: #fdb07a;
  --hue-green: #5ee6a8;
  --grad-primary: linear-gradient(135deg, #7c4dff 0%, #a36bff 55%, #c084fc 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(192, 132, 252, 0.08));
  --grad-title: linear-gradient(180deg, #ffffff 30%, #d7c2ff 120%);
  --grad-head: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(192, 132, 252, 0.06)), var(--bg-2);
  --title-sweep: rgba(255, 255, 255, 0.62);
  --sheen: rgba(255, 255, 255, 0.055);
  --topbar-bg: rgba(22, 16, 38, 0.9);
  --field-bg: rgba(255, 255, 255, 0.045);
  --mask: rgba(8, 5, 18, 0.74);
  --ambient-a: rgba(139, 92, 246, 0.2);
  --ambient-b: rgba(192, 132, 252, 0.12);
  --shadow-1: 0 8px 24px rgba(8, 4, 20, 0.38);
  --shadow-2: 0 18px 50px rgba(8, 4, 20, 0.52);
  --shadow-topbar: 0 8px 24px rgba(8, 4, 20, 0.24);
  --shadow-card: 0 8px 22px rgba(8, 4, 20, 0.32);
  --shadow-card-hover: 0 14px 34px rgba(8, 4, 20, 0.44), 0 0 0 1px var(--accent-glow);
  --shadow-pop: 0 24px 64px rgba(6, 3, 16, 0.6);
}

/* 玫瑰：酒红底 + 玫瑰粉，阴影回归中性深色（原先整片粉色外发光） */
:root[data-theme="rose"] {
  color-scheme: dark;
  --bg: #160910;
  --bg-2: #1f0e18;
  --bg-3: #2a1521;
  --bg-card: rgba(42, 21, 33, 0.78);
  --bg-card-hover: rgba(58, 28, 46, 0.92);
  --line: rgba(255, 182, 198, 0.13);
  --line-strong: rgba(255, 182, 198, 0.26);
  --text: #fff3f5;
  --text-muted: #dfb9c3;
  --text-dim: #a67d89;
  --primary: #f43f6e;
  --accent: #ff94ae;
  --primary-rgb: 244, 63, 110;
  --accent-rgb: 255, 148, 174;
  --primary-glow: rgba(244, 63, 110, 0.34);
  --accent-glow: rgba(255, 148, 174, 0.22);
  --on-primary: #fff;
  --link: #ff94ae;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #ff6b7d;
  --hue-blue: #9cbcff;
  --hue-violet: #e2a8ff;
  --hue-orange: #ffb37d;
  --hue-green: #5ee6a8;
  --grad-primary: linear-gradient(135deg, #e11d5c 0%, #f43f6e 55%, #fb6f8f 100%);
  --grad-soft: linear-gradient(135deg, rgba(244, 63, 110, 0.18), rgba(255, 148, 174, 0.07));
  --grad-title: linear-gradient(180deg, #ffffff 30%, #ffc3d2 120%);
  --grad-head: linear-gradient(135deg, rgba(244, 63, 110, 0.22), rgba(255, 148, 174, 0.05)), var(--bg-2);
  --title-sweep: rgba(255, 255, 255, 0.62);
  --sheen: rgba(255, 255, 255, 0.05);
  --topbar-bg: rgba(26, 11, 20, 0.9);
  --field-bg: rgba(255, 255, 255, 0.045);
  --mask: rgba(12, 3, 8, 0.74);
  --ambient-a: rgba(244, 63, 110, 0.16);
  --ambient-b: rgba(255, 148, 174, 0.1);
  --shadow-1: 0 8px 24px rgba(12, 2, 7, 0.4);
  --shadow-2: 0 18px 50px rgba(12, 2, 7, 0.54);
  --shadow-topbar: 0 8px 24px rgba(12, 2, 7, 0.26);
  --shadow-card: 0 8px 22px rgba(12, 2, 7, 0.34);
  --shadow-card-hover: 0 14px 34px rgba(12, 2, 7, 0.46), 0 0 0 1px var(--accent-glow);
  --shadow-pop: 0 24px 64px rgba(10, 2, 6, 0.62);
}

/* 翡翠：墨绿底 + 翠绿 / 青玉 */
:root[data-theme="emerald"] {
  color-scheme: dark;
  --bg: #07130f;
  --bg-2: #0b1c16;
  --bg-3: #10261e;
  --bg-card: rgba(16, 38, 30, 0.78);
  --bg-card-hover: rgba(22, 52, 41, 0.92);
  --line: rgba(134, 239, 172, 0.12);
  --line-strong: rgba(134, 239, 172, 0.24);
  --text: #ecfdf5;
  --text-muted: #a3c9b8;
  --text-dim: #6d9483;
  --primary: #10b981;
  --accent: #5eead4;
  --primary-rgb: 16, 185, 129;
  --accent-rgb: 94, 234, 212;
  --primary-glow: rgba(16, 185, 129, 0.32);
  --accent-glow: rgba(94, 234, 212, 0.2);
  --on-primary: #fff;
  --link: #5eead4;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --hue-blue: #7dd3fc;
  --hue-violet: #c4b5fd;
  --hue-orange: #fdba74;
  --hue-green: #86efac;
  --grad-primary: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  --grad-soft: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(94, 234, 212, 0.07));
  --grad-title: linear-gradient(180deg, #ffffff 30%, #a7f3d0 120%);
  --grad-head: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(94, 234, 212, 0.05)), var(--bg-2);
  --title-sweep: rgba(255, 255, 255, 0.62);
  --sheen: rgba(255, 255, 255, 0.045);
  --topbar-bg: rgba(9, 24, 19, 0.9);
  --field-bg: rgba(255, 255, 255, 0.04);
  --mask: rgba(2, 10, 7, 0.74);
  --ambient-a: rgba(16, 185, 129, 0.14);
  --ambient-b: rgba(94, 234, 212, 0.09);
  --shadow-1: 0 8px 24px rgba(1, 8, 5, 0.4);
  --shadow-2: 0 18px 50px rgba(1, 8, 5, 0.54);
  --shadow-topbar: 0 8px 24px rgba(1, 8, 5, 0.24);
  --shadow-card: 0 8px 22px rgba(1, 8, 5, 0.32);
  --shadow-card-hover: 0 14px 34px rgba(1, 8, 5, 0.44), 0 0 0 1px var(--accent-glow);
  --shadow-pop: 0 24px 64px rgba(1, 6, 4, 0.6);
}

/* 黑金：石墨黑 + 香槟金；金色按钮上用深色字 */
:root[data-theme="gold"] {
  color-scheme: dark;
  --bg: #0b0b0d;
  --bg-2: #121215;
  --bg-3: #1a1a1f;
  --bg-card: rgba(26, 26, 31, 0.8);
  --bg-card-hover: rgba(36, 35, 42, 0.94);
  --line: rgba(255, 230, 190, 0.1);
  --line-strong: rgba(255, 230, 190, 0.2);
  --text: #f6f3ec;
  --text-muted: #bab3a5;
  --text-dim: #80796c;
  --primary: #d4a24c;
  --accent: #f0c46a;
  --primary-rgb: 212, 162, 76;
  --accent-rgb: 240, 196, 106;
  --primary-glow: rgba(212, 162, 76, 0.28);
  --accent-glow: rgba(240, 196, 106, 0.2);
  --on-primary: #1f1606;
  --link: #f0c46a;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --hue-blue: #93c5fd;
  --hue-violet: #d8b4fe;
  --hue-orange: #fdba74;
  --hue-green: #86efac;
  --grad-primary: linear-gradient(135deg, #c8913a 0%, #e2b05a 55%, #f3d083 100%);
  --grad-soft: linear-gradient(135deg, rgba(212, 162, 76, 0.16), rgba(240, 196, 106, 0.06));
  --grad-title: linear-gradient(180deg, #fffaf0 30%, #eccb85 120%);
  --grad-head: linear-gradient(135deg, rgba(212, 162, 76, 0.16), rgba(240, 196, 106, 0.04)), var(--bg-2);
  --title-sweep: rgba(255, 244, 214, 0.66);
  --sheen: rgba(255, 255, 255, 0.04);
  --topbar-bg: rgba(14, 14, 17, 0.92);
  --field-bg: rgba(255, 255, 255, 0.04);
  --mask: rgba(0, 0, 0, 0.72);
  --ambient-a: rgba(212, 162, 76, 0.1);
  --ambient-b: rgba(240, 196, 106, 0.06);
  --shadow-1: 0 8px 24px rgba(0, 0, 0, 0.42);
  --shadow-2: 0 18px 50px rgba(0, 0, 0, 0.56);
  --shadow-topbar: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 8px 22px rgba(0, 0, 0, 0.36);
  --shadow-card-hover: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-glow);
  --shadow-pop: 0 24px 64px rgba(0, 0, 0, 0.64);
}

/* 浅色：冷白瓷底 + 宝蓝 / 靛蓝。高亮色取深值保证白底可读；阴影用淡蓝灰分层，不再压一圈黑影 */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-2: #eef2f8;
  --bg-3: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #7a879b;
  --primary: #2563eb;
  --accent: #4f46e5;
  --primary-rgb: 37, 99, 235;
  --accent-rgb: 79, 70, 229;
  --primary-glow: rgba(37, 99, 235, 0.22);
  --accent-glow: rgba(79, 70, 229, 0.16);
  --on-primary: #fff;
  --link: #2563eb;
  --success: #059669;
  --warning: #b45309;
  --danger: #dc2626;
  --hue-blue: #2563eb;
  --hue-violet: #7c3aed;
  --hue-orange: #c2410c;
  --hue-green: #047857;
  --grad-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --grad-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(79, 70, 229, 0.05));
  --grad-title: linear-gradient(120deg, #0f172a 25%, #1e3a8a 65%, #4338ca 100%);
  --grad-head: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(79, 70, 229, 0.035)), #f7f9fd;
  --title-sweep: rgba(99, 102, 241, 0.55);
  --sheen: rgba(255, 255, 255, 0);
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --field-bg: #ffffff;
  --mask: rgba(15, 23, 42, 0.36);
  --ambient-a: rgba(79, 70, 229, 0.06);
  --ambient-b: rgba(14, 165, 233, 0.08);
  --shadow-1: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-topbar: 0 1px 0 rgba(15, 23, 42, 0.04), 0 6px 18px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow-card-hover: 0 2px 6px rgba(15, 23, 42, 0.05), 0 14px 30px rgba(37, 99, 235, 0.12);
  --shadow-pop: 0 24px 60px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* 燕麦：暖米白底 + 陶土橙 / 焦糖棕，长时间看不刺眼 */
:root[data-theme="oat"] {
  color-scheme: light;
  --bg: #f6f1e9;
  --bg-2: #efe7da;
  --bg-3: #fffcf7;
  --bg-card: rgba(255, 252, 247, 0.94);
  --bg-card-hover: #fffdf9;
  --line: rgba(74, 52, 30, 0.1);
  --line-strong: rgba(74, 52, 30, 0.18);
  --text: #2b2118;
  --text-muted: #6b5a49;
  --text-dim: #978673;
  --primary: #c0562e;
  --accent: #a4561f;
  --primary-rgb: 192, 86, 46;
  --accent-rgb: 164, 86, 31;
  --primary-glow: rgba(192, 86, 46, 0.22);
  --accent-glow: rgba(164, 86, 31, 0.16);
  --on-primary: #fff;
  --link: #b4532a;
  --success: #3f7d3a;
  --warning: #a16207;
  --danger: #c0392b;
  --hue-blue: #2f5fa7;
  --hue-violet: #7b4fa0;
  --hue-orange: #b4532a;
  --hue-green: #3f7d3a;
  --grad-primary: linear-gradient(135deg, #b84e28 0%, #cf6d3a 100%);
  --grad-soft: linear-gradient(135deg, rgba(192, 86, 46, 0.09), rgba(164, 86, 31, 0.05));
  --grad-title: linear-gradient(120deg, #2b2118 25%, #6e3a1c 65%, #b4532a 100%);
  --grad-head: linear-gradient(135deg, rgba(192, 86, 46, 0.08), rgba(164, 86, 31, 0.03)), #fbf6ee;
  --title-sweep: rgba(214, 120, 70, 0.5);
  --sheen: rgba(255, 255, 255, 0);
  --topbar-bg: rgba(255, 252, 247, 0.88);
  --field-bg: #fffdf9;
  --mask: rgba(43, 33, 24, 0.34);
  --ambient-a: rgba(192, 86, 46, 0.07);
  --ambient-b: rgba(217, 164, 65, 0.08);
  --shadow-1: 0 4px 14px rgba(74, 52, 30, 0.07);
  --shadow-2: 0 16px 40px rgba(74, 52, 30, 0.13);
  --shadow-topbar: 0 1px 0 rgba(74, 52, 30, 0.05), 0 6px 18px rgba(74, 52, 30, 0.04);
  --shadow-card: 0 1px 2px rgba(74, 52, 30, 0.05), 0 4px 14px rgba(74, 52, 30, 0.06);
  --shadow-card-hover: 0 2px 6px rgba(74, 52, 30, 0.06), 0 14px 30px rgba(192, 86, 46, 0.12);
  --shadow-pop: 0 24px 60px rgba(74, 52, 30, 0.18), 0 2px 8px rgba(74, 52, 30, 0.06);
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 900px at 74% -8%, rgba(0, 212, 255, 0.08), transparent 62%),
    radial-gradient(980px 680px at -8% 34%, rgba(168, 85, 247, 0.11), transparent 64%),
    linear-gradient(180deg, var(--bg), var(--bg));
  background-attachment: scroll;
  position: relative;
  isolation: isolate;
  /* 界面文字默认不可选中、不显示文本(I 形)光标，贴近原生 App 观感 */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
  -webkit-touch-callout: none;
}
/* 白名单：输入框与需要复制的信息仍可选中/可复制 */
input, textarea, select,
[contenteditable="true"], [contenteditable=""],
code, kbd, pre, samp,
.selectable {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  cursor: auto;
  -webkit-touch-callout: default;
}
body::before,
body::after {
  content: '';
  position: absolute;
  left: -18vw;
  right: -18vw;
  top: -12vh;
  height: max(220vh, 100%);
  pointer-events: none;
  z-index: -1;
}
:root[data-theme="lavender"] body {
  background:
    radial-gradient(1200px 820px at 72% -10%, rgba(56, 189, 248, 0.11), transparent 64%),
    radial-gradient(980px 700px at 0% 18%, rgba(168, 85, 247, 0.14), transparent 66%),
    #171326;
}
body::before {
  background:
    radial-gradient(circle at 18% 28%, rgba(168, 85, 247, 0.22), transparent 18vmax),
    radial-gradient(circle at 72% 18%, rgba(56, 189, 248, 0.18), transparent 20vmax),
    radial-gradient(circle at 52% 74%, rgba(244, 114, 182, 0.14), transparent 18vmax);
  background-size: 140% 140%, 150% 150%, 130% 130%;
  background-position: 12% 18%, 82% 8%, 48% 86%;
  filter: blur(34px) saturate(140%);
  animation: liquidOrbDrift 27s cubic-bezier(.45,0,.2,1) infinite;
}
body::after {
  background:
    conic-gradient(from 120deg at 30% 40%, transparent, rgba(196, 181, 253, 0.12), transparent 34%),
    conic-gradient(from 280deg at 72% 54%, transparent, rgba(34, 211, 238, 0.1), transparent 38%);
  mix-blend-mode: screen;
  opacity: 0.85;
  filter: blur(48px);
  animation: liquidFlow 32s linear infinite;
}
@keyframes liquidOrbDrift {
  0% { background-position: 12% 18%, 82% 8%, 48% 86%; transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1); }
  23% { background-position: 24% 42%, 64% 18%, 70% 72%; transform: translate3d(3%, 1%, 0) rotate(11deg) scale(1.05); }
  47% { background-position: 8% 66%, 88% 46%, 38% 58%; transform: translate3d(1%, 4%, 0) rotate(-9deg) scale(0.98); }
  71% { background-position: 36% 24%, 58% 72%, 82% 36%; transform: translate3d(-3%, 2%, 0) rotate(16deg) scale(1.08); }
  100% { background-position: 16% 82%, 76% 22%, 44% 18%; transform: translate3d(2%, -2%, 0) rotate(-13deg) scale(1.01); }
}
@keyframes liquidFlow {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1.04); }
}
:root[data-theme="light"] body {
  background-image:
    radial-gradient(1200px 800px at 80% -10%, rgba(0, 212, 255, 0.12), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(30, 111, 255, 0.08), transparent 60%);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul { list-style: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }

/* ---------- 通用按钮 ---------- */
.btn[hidden] { display: none !important; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.16s cubic-bezier(.2,.7,.2,1.2), box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  /* 点击亮环 */
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(255,255,255,0.5), transparent 60%);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.btn:active::after { opacity: 0.45; transform: scale(2.2); transition: 0s; }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1.5px); box-shadow: 0 12px 30px var(--primary-glow); }
.btn-ghost {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-card-hover); border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-block { width: 100%; padding: 11px 16px; }

/* ---------- 胶囊按钮 ---------- */
button,
.btn,
.btn-sm,
.search-btn,
.search-clear,
.view-btn,
.modal-close,
.auth-close,
.captcha-x,
.captcha-knob,
.contact-copy,
.cs-trigger,
.v-btn,
.link-actions .btn,
.btn-load,
.btn-reset {
  border-radius: 999px;
}

/* ---------- 绝对最后覆盖：手机端强制可用 ---------- */
@media (max-width: 720px) {
  html, body { width: 100%; overflow-x: hidden; }
  .topbar-inner { min-height: 58px; padding: 8px 10px; gap: 8px; }
  .topbar-spacer { display: none; }
  .brand { min-width: 0; flex: 0 1 auto; }
  .brand-text { font-size: 15px; white-space: nowrap; }
  .topbar-actions {
    margin-left: auto;
    min-width: 0;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions .btn { flex: 0 0 auto; min-height: 34px; padding: 7px 10px; font-size: 12px; }
  #btnTheme { width: 36px; min-width: 36px; padding: 0; }
  #btnLogin { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { padding: 30px 14px 22px; }
  .hero-title { font-size: clamp(26px, 8vw, 34px); }
  .searchbar { width: 100%; max-width: none; padding: 5px 5px 5px 12px; }
  #searchInput { min-width: 0; padding: 11px 8px; font-size: 14px; }
  .search-btn { padding: 9px 14px; flex: 0 0 auto; }
  .layout { display: block; width: 100%; padding: 14px 12px 44px; }
  .sidebar { margin-bottom: 12px; }
  .sidebar-card { padding: 10px; border-radius: 22px; }
  .brand-list {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .brand-list::-webkit-scrollbar { display: none; }
  .brand-item,
  .brand-list .brand-item-all {
    flex: 0 0 auto;
    grid-column: auto !important;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .brand-arrow { display: none; }
  .filterbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 22px;
    overflow: visible;
  }
  .filter-group { min-width: 0; width: 100%; }
  .btn-reset { grid-column: 1 / -1; width: 100%; margin: 0; }
  .cs-menu { max-height: min(48vh, 320px); overflow-y: auto; z-index: 80; }
  .rom-grid,
  .rom-grid.list-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .rom-card,
  .list-view .rom-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 24px;
  }
  .rom-card-head,
  .list-view .rom-card-head { flex-direction: row; align-items: flex-start; min-width: 0; }
  .rom-info,
  .list-view .rom-info { min-width: 0; }
  .rom-device-name { font-size: 15.5px; word-break: break-word; }
  .rom-rom-name { -webkit-line-clamp: 2; line-clamp: 2; }
  .rom-meta,
  .list-view .rom-meta { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .rom-card-foot,
  .list-view .rom-card-foot { width: 100%; margin-top: 12px; }
  .modal { align-items: stretch; justify-content: stretch; padding: 8px; }
  .modal-box { width: 100%; max-width: none; max-height: calc(100dvh - 16px); border-radius: 24px; }
  .detail-head { padding: 18px 14px 14px; }
  .detail-title { font-size: 20px; padding-right: 36px; word-break: break-word; }
  .detail-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .detail-meta-cell { min-width: 0; border-radius: 20px; padding: 9px 8px; }
  .detail-body { padding: 14px; }
  .v-list-head { display: grid; grid-template-columns: 1fr; }
  .v-search { width: 100%; min-width: 0; }
  .v-list { max-height: none; overflow: visible; padding-right: 0; }
  .v-item { border-radius: 24px; padding: 12px; }
  .v-head { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .v-name, .v-name strong { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
  .v-link { grid-template-columns: 1fr auto !important; align-items: center; border-radius: 22px; padding: 10px; }
  .v-tag { grid-column: 1 / 2; justify-self: start; }
  .v-url { grid-column: 1 / -1; order: 3; font-size: 12px; }
  .v-actions { grid-column: 2 / 3; grid-row: 1; }
  .v-btn { width: 34px; height: 32px; }
  .auth-modal, .captcha-modal { padding: 10px; }
  .auth-box, .captcha-box, .accounts-box, .security-box, .mini-dialog-box {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    border-radius: 24px;
  }
  .toast { max-width: min(84vw, 320px); }
}

@media (max-width: 380px) {
  .filterbar { grid-template-columns: 1fr; }
  .brand-text em { display: none; }
  #btnLogin { max-width: 48vw; }
  .detail-meta-grid { grid-template-columns: 1fr !important; }
}

/* ---------- 绝对最终覆盖：移动端防爆闪 ---------- */
@media (max-width: 720px), (pointer: coarse) {
  html {
    background: var(--bg);
  }
  body {
    background-attachment: scroll !important;
    transform: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  body::before,
  body::after {
    position: absolute !important;
    top: 0 !important;
    left: -20vw !important;
    right: -20vw !important;
    height: max(140vh, 980px) !important;
    transform: translateZ(0) !important;
    animation: none !important;
    will-change: auto !important;
    contain: paint;
  }
  body::before {
    opacity: 0.54 !important;
    filter: blur(18px) saturate(122%) !important;
    background-size: 118% 118%, 122% 122%, 112% 112% !important;
    background-position: 14% 18%, 82% 10%, 54% 74% !important;
  }
  body::after {
    opacity: 0.24 !important;
    filter: blur(18px) saturate(116%) !important;
    mix-blend-mode: screen;
  }
  .hero-glow {
    animation: none !important;
    opacity: 0.55 !important;
    transform: translateZ(0) !important;
    filter: blur(18px) !important;
  }
  .rom-card,
  .v-item,
  .v-link,
  .modal-box,
  .auth-box,
  .accounts-box,
  .security-box,
  .mini-dialog-box,
  .topbar,
  .sidebar-card,
  .filterbar {
    will-change: auto !important;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  .rom-card::after,
  .modal-box::before,
  .auth-box::before {
    animation: none !important;
    opacity: 0.45;
  }
  .modal-box,
  .auth-box,
  .accounts-box,
  .security-box,
  .mini-dialog-box {
    animation-duration: 0.18s !important;
    filter: none !important;
  }
  .modal-mask,
  .auth-mask,
  .captcha-mask {
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* ---------- final runtime performance override ---------- */
body::before,
body::after {
  animation: none !important;
  transform: none !important;
  will-change: auto !important;
}

body::before {
  height: 115vh !important;
  opacity: 0.18 !important;
  filter: none !important;
  background-size: 100% 100% !important;
}

body::after {
  display: none !important;
}

.hero-glow,
.auth-box::before,
.modal-box::before,
.rom-card::after {
  animation: none !important;
  filter: none !important;
}

.rom-card::after {
  display: none !important;
}

.topbar,
.filterbar,
.sidebar-card,
.rom-card,
.modal-box,
.auth-box,
.slider-box,
.accounts-box,
.security-box,
.mini-dialog-box,
.cs-menu,
.toast,
.account-menu button {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  will-change: auto !important;
}

.auth-mask,
.slider-mask,
.modal-mask,
.captcha-mask,
.mini-dialog-mask {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sidebar-card,
.filterbar,
.rom-card {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
}

.rom-card {
  animation: none !important;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease !important;
}

.rom-card:hover {
  transform: translateY(-2px) !important;
}

.auth-box,
.modal-box,
.sidebar-card,
.filterbar,
.hero-badge,
.hero-title,
.hero-sub,
.searchbar,
.hero-stats {
  animation: none !important;
}

/* ---------- eof opaque panels after blur removal ---------- */
.topbar {
  background: var(--bg-2) !important;
}

.sidebar-card,
.filterbar,
.rom-card,
.view-toggle,
.cs-menu {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    var(--bg-3) !important;
}

.modal-mask,
.auth-mask,
.slider-mask,
.captcha-mask,
.mini-dialog-mask {
  background: rgba(3, 7, 18, 0.82) !important;
}

.modal-box,
.auth-box,
.slider-box,
.accounts-box,
.security-box,
.mini-dialog-box,
.toast {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    var(--bg-3) !important;
  opacity: 1 !important;
}

.detail-head {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(0, 212, 255, 0.06)),
    var(--bg-2) !important;
}

.detail-body,
.v-list {
  background: var(--bg-3) !important;
}

.detail-meta-cell,
.v-item,
.v-link,
.detail-pwd-bar {
  background: var(--bg-2) !important;
}

.v-item.is-latest {
  background:
    linear-gradient(135deg, rgba(30, 111, 255, 0.11), rgba(0, 212, 255, 0.07)),
    var(--bg-2) !important;
}

.v-link:hover,
.v-item:hover,
.rom-card:hover {
  background: var(--bg-card-hover) !important;
}

/* [屎山清理] 已删除两段被取代的「详情弹窗动画」死代码：
   detailPop / detailPopFinal / modalMaskFade(Final) 入场动画与 .modal-box 规则——
   详情弹窗动效现由文件末尾 #detailModal 单一权威实现接管；
   .rom-card.is-loading 的权威副本见后文 .rom-card.is-loading 区块。 */

/* ---------- runtime performance override ---------- */
body::before,
body::after {
  animation: none !important;
  transform: none !important;
  will-change: auto !important;
}

body::before {
  height: 115vh !important;
  opacity: 0.18 !important;
  filter: none !important;
  background-size: 100% 100% !important;
}

body::after {
  display: none !important;
}

.hero-glow,
.auth-box::before,
.modal-box::before,
.rom-card::after {
  animation: none !important;
  filter: none !important;
}

.rom-card::after {
  display: none !important;
}

.topbar,
.filterbar,
.sidebar-card,
.rom-card,
.modal-box,
.auth-box,
.slider-box,
.accounts-box,
.security-box,
.mini-dialog-box,
.cs-menu,
.toast,
.account-menu button {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  will-change: auto !important;
}

.auth-mask,
.slider-mask,
.modal-mask,
.captcha-mask,
.mini-dialog-mask {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sidebar-card,
.filterbar,
.rom-card {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
}

.rom-card {
  animation: none !important;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease !important;
}

.rom-card:hover {
  transform: translateY(-2px) !important;
}

.auth-box,
.modal-box,
.sidebar-card,
.filterbar,
.hero-badge,
.hero-title,
.hero-sub,
.searchbar,
.hero-stats {
  animation: none !important;
}

/* ---------- 绝对最终覆盖：移动端管理员入口 ---------- */
.mobile-admin-dock {
  display: none;
}
@media (max-width: 720px) {
  .topbar-actions #btnSecurity,
  .topbar-actions #btnAccounts {
    display: none !important;
  }
  .mobile-admin-dock {
    position: sticky;
    top: 58px;
    z-index: 96;
    width: calc(100% - 20px);
    margin: 8px auto 0;
    padding: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-card) 82%, transparent);
    box-shadow: 0 10px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
  }
  .mobile-admin-dock[hidden] {
    display: none !important;
  }
  .mobile-admin-dock .btn {
    min-height: 36px;
    padding: 8px 10px;
    justify-content: center;
    border-radius: 999px;
    font-size: 13px;
  }
}

/* ---------- 绝对最终覆盖：移动端管理员入口 ---------- */
.mobile-admin-dock {
  display: none;
}
@media (max-width: 720px) {
  .topbar-actions #btnSecurity,
  .topbar-actions #btnAccounts {
    display: none !important;
  }
  .mobile-admin-dock {
    position: sticky;
    top: 58px;
    z-index: 96;
    width: calc(100% - 20px);
    margin: 8px auto 0;
    padding: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-card) 82%, transparent);
    box-shadow: 0 10px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
  }
  .mobile-admin-dock[hidden] {
    display: none !important;
  }
  .mobile-admin-dock .btn {
    min-height: 36px;
    padding: 8px 10px;
    justify-content: center;
    border-radius: 999px;
    font-size: 13px;
  }
}

/* ---------- 绝对最后覆盖：移动端防爆闪 ---------- */
@media (max-width: 720px), (pointer: coarse) {
  html {
    background: var(--bg);
  }
  body {
    background-attachment: scroll !important;
    transform: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  body::before,
  body::after {
    position: absolute !important;
    top: 0 !important;
    left: -20vw !important;
    right: -20vw !important;
    height: max(140vh, 980px) !important;
    transform: translateZ(0) !important;
    animation: none !important;
    will-change: auto !important;
    contain: paint;
  }
  body::before {
    opacity: 0.54 !important;
    filter: blur(18px) saturate(122%) !important;
    background-size: 118% 118%, 122% 122%, 112% 112% !important;
    background-position: 14% 18%, 82% 10%, 54% 74% !important;
  }
  body::after {
    opacity: 0.24 !important;
    filter: blur(18px) saturate(116%) !important;
    mix-blend-mode: screen;
  }
  .hero-glow {
    animation: none !important;
    opacity: 0.55 !important;
    transform: translateZ(0) !important;
    filter: blur(18px) !important;
  }
  .rom-card,
  .v-item,
  .v-link,
  .modal-box,
  .auth-box,
  .accounts-box,
  .security-box,
  .mini-dialog-box,
  .topbar,
  .sidebar-card,
  .filterbar {
    will-change: auto !important;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  .rom-card::after,
  .modal-box::before,
  .auth-box::before {
    animation: none !important;
    opacity: 0.45;
  }
  .modal-box,
  .auth-box,
  .accounts-box,
  .security-box,
  .mini-dialog-box {
    animation-duration: 0.18s !important;
    filter: none !important;
  }
  .modal-mask,
  .auth-mask,
  .captcha-mask {
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* ---------- 最后覆盖：手机端强制可用 ---------- */
@media (max-width: 720px) {
  html, body { width: 100%; overflow-x: hidden; }
  .topbar-inner { min-height: 58px; padding: 8px 10px; gap: 8px; }
  .topbar-spacer { display: none; }
  .brand { min-width: 0; flex: 0 1 auto; }
  .brand-text { font-size: 15px; white-space: nowrap; }
  .topbar-actions {
    margin-left: auto;
    min-width: 0;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions .btn { flex: 0 0 auto; min-height: 34px; padding: 7px 10px; font-size: 12px; }
  #btnTheme { width: 36px; min-width: 36px; padding: 0; }
  #btnLogin { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { padding: 30px 14px 22px; }
  .hero-title { font-size: clamp(26px, 8vw, 34px); }
  .searchbar { width: 100%; max-width: none; padding: 5px 5px 5px 12px; }
  #searchInput { min-width: 0; padding: 11px 8px; font-size: 14px; }
  .search-btn { padding: 9px 14px; flex: 0 0 auto; }
  .layout { display: block; width: 100%; padding: 14px 12px 44px; }
  .sidebar { margin-bottom: 12px; }
  .sidebar-card { padding: 10px; border-radius: 22px; }
  .brand-list {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .brand-list::-webkit-scrollbar { display: none; }
  .brand-item,
  .brand-list .brand-item-all {
    flex: 0 0 auto;
    grid-column: auto !important;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .brand-arrow { display: none; }
  .filterbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 22px;
    overflow: visible;
  }
  .filter-group { min-width: 0; width: 100%; }
  .btn-reset { grid-column: 1 / -1; width: 100%; margin: 0; }
  .cs-menu { max-height: min(48vh, 320px); overflow-y: auto; z-index: 80; }
  .rom-grid,
  .rom-grid.list-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .rom-card,
  .list-view .rom-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 24px;
  }
  .rom-card-head,
  .list-view .rom-card-head { flex-direction: row; align-items: flex-start; min-width: 0; }
  .rom-info,
  .list-view .rom-info { min-width: 0; }
  .rom-device-name { font-size: 15.5px; word-break: break-word; }
  .rom-rom-name { -webkit-line-clamp: 2; line-clamp: 2; }
  .rom-meta,
  .list-view .rom-meta { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .rom-card-foot,
  .list-view .rom-card-foot { width: 100%; margin-top: 12px; }
  .modal { align-items: stretch; justify-content: stretch; padding: 8px; }
  .modal-box { width: 100%; max-width: none; max-height: calc(100dvh - 16px); border-radius: 24px; }
  .detail-head { padding: 18px 14px 14px; }
  .detail-title { font-size: 20px; padding-right: 36px; word-break: break-word; }
  .detail-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .detail-meta-cell { min-width: 0; border-radius: 20px; padding: 9px 8px; }
  .detail-body { padding: 14px; }
  .v-list-head { display: grid; grid-template-columns: 1fr; }
  .v-search { width: 100%; min-width: 0; }
  .v-list { max-height: none; overflow: visible; padding-right: 0; }
  .v-item { border-radius: 24px; padding: 12px; }
  .v-head { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .v-name, .v-name strong { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
  .v-link { grid-template-columns: 1fr auto !important; align-items: center; border-radius: 22px; padding: 10px; }
  .v-tag { grid-column: 1 / 2; justify-self: start; }
  .v-url { grid-column: 1 / -1; order: 3; font-size: 12px; }
  .v-actions { grid-column: 2 / 3; grid-row: 1; }
  .v-btn { width: 34px; height: 32px; }
  .auth-modal, .captcha-modal { padding: 10px; }
  .auth-box, .captcha-box, .accounts-box, .security-box, .mini-dialog-box {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    border-radius: 24px;
  }
  .toast { max-width: min(84vw, 320px); }
}

@media (max-width: 380px) {
  .filterbar { grid-template-columns: 1fr; }
  .brand-text em { display: none; }
  #btnLogin { max-width: 48vw; }
  .detail-meta-grid { grid-template-columns: 1fr !important; }
}

/* ---------- 最终覆盖：减少首页背景分层 ---------- */
:root[data-theme="lavender"] body,
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1180px 760px at 76% -8%, rgba(34, 211, 238, 0.09), transparent 66%),
    radial-gradient(1080px 720px at 8% 20%, rgba(168, 85, 247, 0.12), transparent 68%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
}
.hero {
  background: transparent;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -1px 0 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, transparent 72%, var(--bg) 100%);
  opacity: 0.28;
}
.searchbar {
  border-radius: 999px;
}
.search-btn,
.search-clear {
  border-radius: 999px;
}
.hero::before {
  z-index: 0;
}
@media (max-width: 640px) {
  .batch-tools {
    grid-template-columns: 1fr;
  }
  .batch-tools .btn {
    width: 100%;
  }
}

/* ---------- 最终覆盖：性能优先，保留质感但降低掉帧 ---------- */
body::before {
  filter: blur(18px) saturate(118%);
  animation-duration: 60s;
  opacity: 0.72;
}
body::after {
  filter: blur(24px);
  animation-duration: 72s;
  opacity: 0.42;
}
.hero-glow {
  opacity: 0.6;
  animation: none !important;
}
.topbar,
.auth-box,
.modal-box,
.sidebar-card,
.filterbar,
.rom-card {
  backdrop-filter: saturate(145%) blur(10px);
  -webkit-backdrop-filter: saturate(145%) blur(10px);
}
.modal-mask,
.auth-mask,
.captcha-mask {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.rom-card,
.v-item,
.v-link,
.modal-box,
.auth-box {
  will-change: auto;
}
.rom-card {
  animation-duration: 0.24s;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.06);
}
.rom-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.26);
}
.rom-card::after,
.modal-box::before,
.auth-box::before {
  animation: none !important;
}
.modal-box {
  box-shadow: 0 18px 48px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.08);
}
.v-item,
.v-link {
  transition: border-color 0.16s ease, background 0.16s ease;
}
.v-item:hover,
.v-link:hover {
  transform: none;
}
.toast {
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
}

/* ---------- 最终覆盖：120Hz 高刷新率质感动效 ---------- */
body::before {
  filter: blur(22px) saturate(132%);
  opacity: 0.82;
  animation: liquidOrbDrift 18s cubic-bezier(.37,0,.16,1) infinite alternate;
}
body::after {
  filter: blur(28px);
  opacity: 0.62;
  animation: liquidFlow 22s linear infinite;
}
.hero-glow {
  opacity: 0.82;
  animation: heroGlowPulse 5.6s ease-in-out infinite alternate !important;
}
@keyframes heroGlowPulse {
  from { transform: translate3d(-1%, -0.5%, 0) scale(1); opacity: 0.68; }
  to { transform: translate3d(1.2%, 0.8%, 0) scale(1.035); opacity: 0.9; }
}
.topbar,
.auth-box,
.modal-box,
.sidebar-card,
.filterbar,
.rom-card {
  backdrop-filter: saturate(165%) blur(14px);
  -webkit-backdrop-filter: saturate(165%) blur(14px);
}
.modal-mask,
.auth-mask,
.captcha-mask {
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.rom-card,
.v-item,
.v-link,
.modal-box,
.auth-box,
.btn,
.search-btn,
.view-btn {
  will-change: transform, opacity;
}
.rom-card {
  animation-duration: 0.18s;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.08);
  transition:
    transform 0.16s cubic-bezier(.2,.8,.2,1),
    border-color 0.14s ease,
    background 0.14s ease,
    box-shadow 0.16s ease;
}
.rom-card:hover {
  transform: translate3d(0, -4px, 0) scale(1.004);
  box-shadow: 0 14px 34px rgba(0,0,0,0.34), 0 0 0 1px var(--accent-glow);
}
.rom-card::after,
.modal-box::before,
.auth-box::before {
  animation: liquidSheen 4.8s ease-in-out infinite alternate !important;
}
.modal-box,
.auth-box {
  animation: liquidDialogInFast 0.2s cubic-bezier(.16,1,.3,1) both;
  box-shadow: 0 20px 56px rgba(0,0,0,0.44), inset 0 1px 0 rgba(255,255,255,0.11);
}
@keyframes liquidDialogInFast {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.v-item,
.v-link {
  transition:
    transform 0.14s cubic-bezier(.2,.8,.2,1),
    border-color 0.14s ease,
    background 0.14s ease,
    box-shadow 0.14s ease;
}
.v-item:hover,
.v-link:hover {
  transform: translate3d(0, -2px, 0);
}
.btn,
.search-btn,
.view-btn,
.v-btn {
  transition:
    transform 0.12s cubic-bezier(.2,.8,.2,1),
    box-shadow 0.14s ease,
    background 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease;
}
.btn:hover,
.search-btn:hover {
  transform: translate3d(0, -2px, 0);
}
.toast {
  backdrop-filter: saturate(170%) blur(16px);
  -webkit-backdrop-filter: saturate(170%) blur(16px);
}
.toast.show,
.toast.toast-center.show {
  animation-duration: 0.32s;
}

/* ---------- 最终覆盖：移动端可用性修复 ---------- */
@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }
  body::before,
  body::after {
    left: -32vw;
    right: -32vw;
    height: 160vh;
  }
  .topbar {
    position: sticky;
    height: auto;
  }
  .topbar-inner {
    min-height: 58px;
    padding: 8px 10px;
    gap: 8px;
  }
  .brand {
    min-width: 0;
    flex: 0 1 auto;
  }
  .brand-text {
    font-size: 15px;
    white-space: nowrap;
  }
  .topbar-spacer {
    display: none;
  }
  .topbar-actions {
    margin-left: auto;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-actions::-webkit-scrollbar {
    display: none;
  }
  .topbar-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
    flex: 0 0 auto;
  }
  #btnTheme {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }
  #btnLogin {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hero {
    padding: 30px 14px 22px;
  }
  .hero-title {
    font-size: clamp(26px, 8vw, 34px);
    line-height: 1.18;
    margin-bottom: 16px;
  }
  .searchbar {
    max-width: none;
    width: 100%;
    padding: 5px 5px 5px 12px;
  }
  #searchInput {
    min-width: 0;
    padding: 11px 8px;
    font-size: 14px;
  }
  .search-btn {
    padding: 9px 14px;
    flex: 0 0 auto;
  }
  .hero-stats {
    gap: 12px;
    flex-wrap: nowrap;
  }
  .hero-stats .stat strong {
    font-size: 22px;
  }
  .layout {
    display: block;
    width: 100%;
    padding: 14px 12px 44px;
  }
  .sidebar {
    margin-bottom: 12px;
  }
  .sidebar-card {
    padding: 10px;
    border-radius: 22px;
  }
  .brand-list {
    display: flex !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .brand-list::-webkit-scrollbar {
    display: none;
  }
  .brand-item {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .brand-item-sub {
    margin-left: 0;
  }
  .brand-arrow {
    display: none;
  }
  .filterbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 22px;
    overflow: visible;
  }
  .filter-group {
    min-width: 0;
    width: 100%;
  }
  .btn-reset {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
  }
  .cs-menu {
    max-height: min(48vh, 320px);
    overflow-y: auto;
    z-index: 80;
  }
  .results-header {
    gap: 10px;
    align-items: center;
  }
  .view-toggle {
    flex-shrink: 0;
  }
  .rom-grid,
  .rom-grid.list-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .rom-card,
  .list-view .rom-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 24px;
  }
  .rom-card-head,
  .list-view .rom-card-head {
    flex-direction: row;
    align-items: flex-start;
    min-width: 0;
  }
  .rom-info,
  .list-view .rom-info {
    min-width: 0;
  }
  .rom-device-name {
    font-size: 15.5px;
    word-break: break-word;
  }
  .rom-rom-name {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .rom-meta,
  .list-view .rom-meta {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    column-gap: 8px;
  }
  .rom-card-foot,
  .list-view .rom-card-foot {
    width: 100%;
    margin-top: 12px;
  }
  .rom-card-foot .btn {
    min-width: 0;
  }
  .modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 8px;
  }
  .modal-box {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 16px);
    border-radius: 24px;
  }
  .modal-close {
    top: 10px;
    right: 10px;
    z-index: 5;
  }
  .detail-head {
    padding: 18px 14px 14px;
  }
  .detail-title {
    font-size: 20px;
    padding-right: 36px;
    word-break: break-word;
  }
  .detail-rom {
    word-break: break-word;
  }
  .detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  .detail-meta-cell {
    min-width: 0;
    border-radius: 20px;
    padding: 9px 8px;
  }
  .detail-body {
    padding: 14px;
  }
  .v-list-head {
    display: grid;
    grid-template-columns: 1fr;
  }
  .v-search {
    width: 100%;
    min-width: 0;
  }
  .v-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .v-item {
    border-radius: 24px;
    padding: 12px;
  }
  .v-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .v-name {
    min-width: 0;
  }
  .v-name strong {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .v-link {
    grid-template-columns: 1fr auto;
    align-items: center;
    border-radius: 22px;
    padding: 10px;
  }
  .v-tag {
    grid-column: 1 / 2;
    justify-self: start;
  }
  .v-url {
    grid-column: 1 / -1;
    order: 3;
    font-size: 12px;
  }
  .v-actions {
    grid-column: 2 / 3;
    grid-row: 1;
  }
  .v-btn {
    width: 34px;
    height: 32px;
  }
  .auth-modal,
  .captcha-modal {
    padding: 10px;
  }
  .auth-box,
  .captcha-box,
  .accounts-box,
  .security-box,
  .mini-dialog-box {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    border-radius: 24px;
  }
  .accounts-list li {
    flex-direction: column;
    align-items: stretch;
  }
  .accounts-ops {
    justify-content: stretch;
  }
  .accounts-ops .btn-sm {
    flex: 1 1 72px;
  }
  .toast {
    max-width: min(88vw, 360px);
  }
}

@media (max-width: 380px) {
  .filterbar {
    grid-template-columns: 1fr;
  }
  .brand-text em {
    display: none;
  }
  #btnLogin {
    max-width: 48vw;
  }
  .hero-stats {
    transform: scale(0.92);
  }
  .detail-meta-grid {
    grid-template-columns: 1fr !important;
  }
}
.v-link {
  border-radius: 999px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.72), rgba(15, 23, 42, 0.48));
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.78); }
:root[data-theme="lavender"] .topbar { background: rgba(33, 26, 53, 0.78); border-bottom-color: rgba(196, 181, 253, 0.2); }
:root[data-theme="lavender"] body {
  background-image:
    radial-gradient(1200px 800px at 80% -10%, rgba(139, 92, 246, 0.2), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(192, 132, 252, 0.13), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(244, 114, 182, 0.08), transparent 70%);
}
:root[data-theme="rose"] .topbar { background: rgba(34, 16, 27, 0.78); border-bottom-color: rgba(253, 164, 175, 0.22); }
:root[data-theme="rose"] body {
  background-image:
    radial-gradient(1200px 800px at 80% -10%, rgba(244, 63, 94, 0.25), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(251, 113, 133, 0.18), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(236, 72, 153, 0.12), transparent 70%);
}
.topbar-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  height: 64px;
  padding: 0 clamp(18px, 2.8vw, 56px);
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo {
  display: block;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
}
.brand-text {
  font-size: 18px; font-weight: 700; letter-spacing: 0.3px;
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text em { font-style: normal; font-weight: 600; opacity: 0.85; margin-left: 2px; }
.brand.brand-sm .brand-text { font-size: 16px; }

.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; gap: 10px; flex-shrink: 0; }
#btnSecurity,
#btnAccounts,
.mobile-admin-dock {
  display: none !important;
}
.topbar-actions .is-login {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.45);
}
.account-menu {
  position: fixed;
  z-index: 10001;
  width: var(--account-menu-width, 136px);
  max-width: calc(100vw - 20px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: grid;
  gap: 8px;
  transform-origin: center top;
  animation: accountMenuIn 0.24s cubic-bezier(.2,.8,.3,1);
}
.account-menu button {
  width: 100%;
  height: var(--account-menu-height, 36px);
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    var(--bg-card);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--text);
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.account-menu button:hover {
  color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
@media (max-width: 720px) {
  .account-menu { gap: 6px; }
  .account-menu button { min-height: 34px; }
}
@keyframes accountMenuIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.92); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.auth-modal,
.slider-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
}
.auth-mask,
.slider-mask {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(10px);
}
.auth-box,
.slider-box {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 26px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--bg-card);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: saturate(185%) blur(26px);
  -webkit-backdrop-filter: saturate(185%) blur(26px);
  overflow: hidden;
}
.auth-box::before,
.slider-box::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(360px 160px at 18% 0%, rgba(255,255,255,0.16), transparent 68%),
    radial-gradient(280px 180px at 100% 22%, var(--accent-glow), transparent 72%);
  opacity: 0.9;
}
.auth-box h3,
.slider-box h3 {
  position: relative;
  font-size: 22px;
  margin-bottom: 8px;
}
.auth-box p,
.slider-box p {
  position: relative;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.auth-link {
  color: #60a5fa;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.auth-link:hover {
  color: #38bdf8;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}
.auth-box label {
  position: relative;
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 13px;
}
.auth-box input {
  position: relative;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(15, 23, 42, 0.22);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, transform 0.22s cubic-bezier(.2,.7,.2,1.05);
}
.auth-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: translateY(-1px);
}
.auth-box input:-webkit-autofill,
.auth-box input:-webkit-autofill:hover,
.auth-box input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  border-color: var(--accent);
  box-shadow:
    0 0 0 1000px rgba(30, 24, 48, 0.96) inset,
    0 0 0 3px var(--accent-glow);
  transition: background-color 9999s ease-out 0s, color 9999s ease-out 0s;
}
#loginPass,
#loginPass:-webkit-autofill {
  background-color: rgba(15, 23, 42, 0.22) !important;
}
.auth-remember {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
}
.auth-remember input {
  width: 16px;
  height: 16px;
}
.auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--text-muted);
  font-size: 24px;
}
.auth-feedback {
  margin: 4px 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: feedbackIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 500;
}
/* feedback 条图标 = emoji（和 toast 同款旋转甩出） */
.auth-feedback::before {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
  display: inline-block;
  animation: toastIconSpin 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-feedback.is-info {
  border-color: rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.06);
  color: var(--accent);
}
.auth-feedback.is-info::before { content: 'ℹ️'; }
.auth-feedback.is-success {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
  font-weight: 600;
}
.auth-feedback.is-success::before { content: '✅'; }
.auth-feedback.is-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
}
.auth-feedback.is-error::before { content: '❌'; }
.btn.is-success {
  background: linear-gradient(135deg, #34d399 0%, var(--success) 100%) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35) !important;
}
@keyframes feedbackIn {
  0%   { opacity: 0; transform: translateY(-8px) scale(0.92); }
  55%  { opacity: 1; transform: translateY(2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
/* ---------- 安全验证（滑块）弹窗 ---------- */
.captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.captcha-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.captcha-box {
  position: relative;
  width: min(380px, calc(100vw - 24px));
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  font-family: inherit;
  animation: boxIn 0.2s ease;
}
.captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.captcha-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}
.captcha-x {
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.captcha-x:hover { color: var(--text); background: var(--bg-card); }
.captcha-body {
  padding: 16px;
}
.captcha-track {
  position: relative;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  user-select: none;
  overflow: hidden;
  touch-action: none;
}
.captcha-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(30, 111, 255, 0.18), rgba(0, 212, 255, 0.24));
  transition: width 0.15s ease, background 0.2s ease;
}
.captcha-fill.is-success { background: rgba(16, 185, 129, 0.22); }
.captcha-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
  transition: color 0.15s;
  letter-spacing: 0.2px;
}
.captcha-tip.is-success {
  color: var(--success);
  font-weight: 700;
}
.captcha-knob {
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--grad-primary);
  color: #fff;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 4px 14px var(--primary-glow);
  touch-action: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.captcha-knob:active { cursor: grabbing; transform: scale(0.97); }
.captcha-knob.is-success {
  background: linear-gradient(135deg, #34d399 0%, var(--success) 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
}
.captcha-knob.is-error {
  background: linear-gradient(135deg, #ff8585 0%, var(--danger) 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
  animation: captcha-shake 0.4s;
}
@keyframes captcha-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
/* 滑块图标：与 toast 图标同一套。圆环完成度 = 拖动进度（app.js setPos 写 stroke-dashoffset），
   到头校验时圆环呼吸；通过描出勾并轻弹，失败描出叉（滑块本身抖动）；减弱动效时直接显示终态 */
.knob-icon {
  width: 26px;
  height: 26px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.knob-icon .kn-track { opacity: .3; }
.knob-icon .ti-ring {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .15s ease;
}
.knob-icon .ti-bg { fill: rgba(255, 255, 255, .2); stroke: none; opacity: 0; }
.knob-icon .kn-arrow { transform-box: fill-box; transform-origin: center; transition: opacity .15s ease, transform .15s ease; }
.knob-icon .kn-ok,
.knob-icon .kn-no { display: none; }
.captcha-knob.is-success .kn-ok,
.captcha-knob.is-error .kn-no { display: inline; }
.captcha-knob.is-success .kn-arrow,
.captcha-knob.is-error .kn-arrow { opacity: 0; transform: scale(.4); }
.captcha-knob.is-success .ti-bg,
.captcha-knob.is-error .ti-bg { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .captcha-knob.is-verifying .ti-ring { animation: knBreath 1s ease-in-out infinite; }
  .captcha-knob.is-success .ti-bg,
  .captcha-knob.is-error .ti-bg { transform-box: fill-box; transform-origin: center; animation: tiBgIn .3s var(--mo-ease) both; }
  .captcha-knob.is-success .ti-mark,
  .captcha-knob.is-error .ti-mark { stroke-dasharray: 1; animation: tiDraw .26s cubic-bezier(.33, 1, .68, 1) .06s both; }
  .captcha-knob.is-error .ti-mark-2 { animation-delay: .16s; }
  .captcha-knob.is-success .knob-icon { animation: tiPop .36s var(--mo-emph) .3s both; }
}
@keyframes knBreath { 50% { opacity: .62; } }
@media (max-width: 480px) {
  .captcha-modal { padding: 12px; }
  .captcha-box { width: 100%; }
  .captcha-header { padding: 12px 14px; }
  .captcha-body { padding: 14px; }
  .captcha-track { height: 48px; }
  .captcha-knob { width: 64px; height: 48px; }
  .captcha-tip { font-size: 13px; }
}

/* ---------- 账号管理 ---------- */
.accounts-box {
  width: min(640px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 72px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(196, 181, 253, 0.58) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}
.accounts-box::-webkit-scrollbar { width: 10px; }
.accounts-box::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
}
.accounts-box::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), rgba(196, 181, 253, 0.42));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.accounts-box h4 {
  margin: 16px 0 10px;
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}
.accounts-groups {
  display: grid;
  gap: 10px;
  margin: 14px 0 8px;
}
.accounts-search {
  margin-bottom: 4px !important;
}
.accounts-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  overflow: hidden;
}
.accounts-section[open] {
  overflow: hidden;
}
.accounts-section summary {
  cursor: pointer;
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  list-style: none;
}
.accounts-section summary::-webkit-details-marker { display: none; }
.accounts-section summary::after {
  content: '展开';
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.accounts-section[open] summary::after { content: '收起'; }
.accounts-section summary em {
  margin-left: auto;
  font-style: normal;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-3);
}
.accounts-section.is-filter-empty::before {
  content: '没有匹配账号';
  display: block;
  padding: 0 14px 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.accounts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
  background: transparent;
}
.accounts-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.accounts-list li:last-child {
  border-bottom: none;
}
.accounts-name {
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.accounts-ops {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.accounts-tag {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
  font-weight: 500;
}
.accounts-tag-locked {
  color: var(--danger);
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.accounts-tag-warn {
  color: var(--warning);
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}
.accounts-tag-online {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.48);
  background: rgba(16, 185, 129, 0.1);
}
.accounts-name strong {
  min-width: 96px;
}
.accounts-empty {
  text-align: center;
  padding: 18px !important;
  color: var(--text-muted);
  justify-content: center !important;
}
.accounts-add {
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(30, 111, 255, 0.04);
}
.accounts-add label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.accounts-add input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-input, var(--bg));
  color: var(--text);
  outline: none;
}
.accounts-add input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.batch-tools {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 0 14px 12px;
}
.batch-tools label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.batch-tools input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-input, var(--bg));
  color: var(--text);
  outline: none;
}
.batch-result {
  margin: 0 14px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.04);
}
.batch-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.batch-result textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--text);
  outline: none;
}
.accounts-tip {
  margin: 8px 0 0 !important;
  font-size: 12px;
  color: var(--text-muted);
}

/* 安全态势的样式已收拢到文件末「安全态势 · 唯一权威样式」 */
.auth-box .btn { position: relative; }
.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}
.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 64px 28px 30px;
  overflow: hidden;
}
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(700px 380px at 30% 60%, rgba(30, 111, 255, 0.22), transparent 60%),
    radial-gradient(700px 380px at 70% 30%, rgba(0, 212, 255, 0.22), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 880px; margin: 0 auto;
  text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 22px;
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
  animation: pulse 1.6s infinite;
}
.hero-badge strong { color: var(--accent); font-weight: 700; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-title {
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.18;
  margin-bottom: 14px;
  color: var(--text);
  text-shadow: 0 0 18px var(--accent-glow);
}
/* 桌面端保留渐变效果 */
@media (min-width: 720px) {
  .hero-title {
    background: var(--grad-title);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
}
.hero-sub {
  color: var(--text-muted);
  font-size: 15.5px;
  max-width: 600px;
  margin: 0 auto 32px;
}

/* 搜索栏 */
.searchbar {
  position: relative;
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.searchbar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-1);
}
.search-icon { color: var(--text-muted); flex-shrink: 0; }
#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 12px;
  font-size: 15px;
}
#searchInput::placeholder { color: var(--text-dim); }
/* 修复 hidden 属性失效：原来 .search-clear 写 display:flex 覆盖了 UA 的 [hidden]{display:none} */
.search-clear[hidden] { display: none !important; }
.search-clear {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: var(--bg-3);
  margin-right: 8px;
  transition: all 0.15s ease;
}
.search-clear:hover { color: var(--text); background: var(--line-strong); }
.search-btn {
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.search-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--primary-glow); }

/* 统计 */
.hero-stats {
  display: flex; justify-content: center; align-items: center;
  gap: 24px;
  margin: 30px 0 22px;
  color: var(--text-muted);
}
.stat strong {
  display: block;
  font-size: 26px; font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}
.stat em { font-style: normal; font-size: 13px; }
.stat-sep { width: 1px; height: 26px; background: var(--line-strong); }

/* 遗留的 chip 样式（如果之后需要可复用） */
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px var(--accent-glow);
}

/* ---------- 主布局 ---------- */
.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px 28px 60px;
  display: grid;
  grid-template-columns: 256px 1fr;
  gap: 28px;
}

/* ---------- 侧边栏 ---------- */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.brand-list { display: flex; flex-direction: column; gap: 2px; }
.brand-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease, padding 0.18s ease;
  position: relative;
}
.brand-item::before {
  content: '';
  position: absolute;
  left: 6px; top: 50%; transform: translateY(-50%) scale(0);
  width: 4px; height: 18px;
  border-radius: 3px;
  background: var(--grad-primary);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform 0.25s cubic-bezier(.18,.89,.32,1.28);
}
.brand-item:hover {
  color: var(--text);
  background: var(--bg-3);
  transform: translateX(2px);
}
.brand-item.active {
  color: var(--accent);
  background: var(--grad-soft);
  font-weight: 600;
}
.brand-item.active::before { transform: translateY(-50%) scale(1); }
.brand-item .brand-name { flex: 1; }
.brand-item .brand-count {
  font-size: 11.5px;
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-dim);
  transition: all 0.18s ease;
  font-variant-numeric: tabular-nums;
}
.brand-count { display: none !important; }
.brand-item.active .brand-count { background: rgba(0, 212, 255, 0.15); color: var(--accent); }

/* 折叠箭头（出现在 all/brand 项左侧） */
.brand-arrow {
  width: 14px; height: 14px;
  flex-shrink: 0;
  position: relative;
  opacity: 0.55;
  transition: transform 0.32s cubic-bezier(.34,1.56,.64,1), opacity 0.18s ease;
}
.brand-arrow::before {
  content: '';
  position: absolute;
  left: 3px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-65%) rotate(-45deg);
}
.brand-item.open .brand-arrow {
  transform: rotate(90deg);
  opacity: 0.95;
}
.brand-item:hover .brand-arrow { opacity: 0.9; }

/* 一级品牌：稍突出，加左侧装饰线 */
.brand-item-brand {
  margin-top: 6px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  padding-left: 12px;
}
.brand-item-brand:first-of-type { margin-top: 4px; }
.brand-item-brand.open {
  background: rgba(0, 212, 255, 0.04);
}

/* 二级系列：缩进，并加层级视觉提示 */
.brand-item-sub {
  padding-left: 38px;
  font-size: 13px;
  margin-left: 6px;
  position: relative;
}
.brand-item-sub::after {
  content: '';
  position: absolute;
  left: 26px; top: 50%;
  width: 6px; height: 1px;
  background: var(--line-strong);
  transform: translateY(-50%);
}
.brand-item-sub:hover { transform: translateX(2px); }
.brand-item-all { font-weight: 600; color: var(--text); }

/* ---------- 筛选条 ---------- */
.filterbar {
  position: relative;
  z-index: 20; /* 让下拉菜单能盖在下方 ROM 卡片上层（backdrop-filter 创建了堆叠上下文） */
  display: flex; align-items: end; gap: 12px;
  flex-wrap: wrap;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.filter-group label {
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* 原生 select（表单内） 与筛选区原生 select 兼用样式 */
.filter-group select {
  padding: 8px 32px 8px 12px;
  border-radius: 9px;
  background: var(--bg-3) url("data:image/svg+xml;charset=UTF-8,%3csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m6 9 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 10px center;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.filter-group select:hover { border-color: var(--accent); }
.filter-group select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-reset { margin-left: auto; }

/* ---------- 自定义下拉（QQ 弹弹弹簧动效） ---------- */
.cs-select {
  position: relative;
  width: 100%;
}
.cs-select.open { z-index: 5; } /* 打开态在 filterbar 内部高于相邻 filter-group */
.cs-select select {
  position: absolute;
  width: 0; height: 0;
  opacity: 0; pointer-events: none;
  border: none; padding: 0; background: none;
}
.cs-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.cs-trigger:hover { border-color: var(--accent); }
.cs-select.open .cs-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: translateY(-1px);
}
.cs-arrow {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.32s cubic-bezier(.34, 1.56, .64, 1);
}
.cs-select.open .cs-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}
.cs-menu {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  z-index: 30;
  margin: 0;
  padding: 5px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  /* 关闭态 */
  transform: translateY(-8px) scale(0.92);
  transform-origin: top center;
  opacity: 0;
  pointer-events: none;
  /* QQ 弹弹：out-back 弹簧曲线 */
  transition:
    transform 0.36s cubic-bezier(.34, 1.56, .64, 1),
    opacity 0.18s ease;
}
:root[data-theme="light"] .cs-menu {
  box-shadow: 0 14px 40px rgba(60, 90, 160, 0.18), 0 2px 8px rgba(60, 90, 160, 0.08);
}
.cs-select.open .cs-menu {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.cs-option {
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  /* 选项逐个 stagger 入场 */
  opacity: 0;
  transform: translateY(-4px);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    opacity 0.2s ease,
    transform 0.32s cubic-bezier(.34, 1.56, .64, 1);
}
.cs-select.open .cs-option {
  opacity: 1;
  transform: translateY(0);
}
.cs-select.open .cs-option:nth-child(1) { transition-delay: 0s, 0s, 0.04s, 0.04s; }
.cs-select.open .cs-option:nth-child(2) { transition-delay: 0s, 0s, 0.08s, 0.08s; }
.cs-select.open .cs-option:nth-child(3) { transition-delay: 0s, 0s, 0.12s, 0.12s; }
.cs-select.open .cs-option:nth-child(4) { transition-delay: 0s, 0s, 0.16s, 0.16s; }
.cs-select.open .cs-option:nth-child(5) { transition-delay: 0s, 0s, 0.2s, 0.2s; }
.cs-select.open .cs-option:nth-child(6) { transition-delay: 0s, 0s, 0.24s, 0.24s; }
.cs-option:hover {
  background: var(--bg-3);
  color: var(--text);
}
.cs-option.active {
  background: linear-gradient(135deg, rgba(30, 111, 255, 0.15), rgba(0, 212, 255, 0.10));
  color: var(--accent);
  font-weight: 600;
}

/* ---------- 结果头部 ---------- */
.results-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}
.results-count {
  font-size: 13.5px;
  color: var(--text-muted);
}
.results-count strong { color: var(--text); font-weight: 700; }
.view-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
}
.view-btn {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: flex; align-items: center; justify-content: center;
}
.view-btn:hover { color: var(--text); }
.view-btn.active { color: #fff; background: var(--grad-primary); }

/* ---------- ROM 列表（网格） ---------- */
.rom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(296px, 1fr));
  gap: 16px;
}
.rom-grid.list-view {
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ---------- ROM 卡片 ---------- */
/* 懒加载触发的"安静"重渲染：取消所有卡片的入场动画，避免每次品牌加载完都抖动 */
.rom-grid.no-stagger .rom-card {
  animation: none !important;
}
.rom-card {
  position: relative;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform 0.22s cubic-bezier(.2,.7,.2,1.05), border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  display: flex; flex-direction: column;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  /* 逐项入场动画（stagger 由 JS 设置 animation-delay） */
  animation: cardIn 0.42s cubic-bezier(.22,.72,.3,1) backwards;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.rom-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s cubic-bezier(.2,.7,.2,1.05);
}
.rom-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px 180px at var(--mx, 50%) var(--my, 0%), rgba(0,212,255,0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.rom-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42), 0 0 0 1px var(--accent-glow);
}
.rom-card:hover::before { transform: scaleX(1); }
.rom-card:hover::after { opacity: 1; }
.rom-card:active { transform: translateY(-2px) scale(0.995); }

.rom-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.rom-brand-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  color: var(--accent);
}
.rom-version-count {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  transition: all 0.2s ease;
}
.rom-card:hover .rom-version-count {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
}
.rom-type-tag {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
}
.rom-type-tag.tag-official { color: #60a5fa; border-color: rgba(96, 165, 250, 0.4); background: rgba(96, 165, 250, 0.08); }
.rom-type-tag.tag-custom { color: #c084fc; border-color: rgba(192, 132, 252, 0.4); background: rgba(192, 132, 252, 0.08); }
.rom-type-tag.tag-recovery { color: #fb923c; border-color: rgba(251, 146, 60, 0.4); background: rgba(251, 146, 60, 0.08); }
.rom-type-tag.tag-kernel { color: #34d399; border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }

.rom-device-name {
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.3;
}
.rom-rom-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rom-rom-name strong { color: var(--accent); }

.rom-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-bottom: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--text-muted);
}
.rom-meta-row { display: flex; align-items: center; gap: 6px; }
.rom-meta-row svg { color: var(--text-dim); flex-shrink: 0; }
.rom-meta-row em { font-style: normal; color: var(--text); }

.rom-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 14px;
  min-height: 22px;
}
.rom-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--line);
  text-align: center;
}

.rom-card-foot {
  display: flex; gap: 8px;
  margin-top: auto;
}
.rom-card-foot .btn { flex: 1; padding: 8px 12px; font-size: 12.5px; }
.rom-card-foot .btn-detail { flex: 1.4; }

/* 列表视图 */
.list-view .rom-card {
  flex-direction: row;
  align-items: center;
  padding: 14px 18px;
  gap: 16px;
}
.list-view .rom-card-head { flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; min-width: 110px; flex-shrink: 0; }
.list-view .rom-info { flex: 1; min-width: 0; }
.list-view .rom-device-name { margin-bottom: 2px; font-size: 15px; }
.list-view .rom-rom-name { margin-bottom: 6px; font-size: 12.5px; }
.list-view .rom-meta { margin: 0; padding: 0; border: none; grid-template-columns: repeat(4, auto); justify-content: start; column-gap: 18px; }
.list-view .rom-tags { display: none; }
.list-view .rom-card-foot { margin: 0; flex-shrink: 0; }
.list-view .rom-card-foot .btn { padding: 8px 14px; }

/* ---------- 空状态 / 加载更多 ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { color: var(--text-dim); margin-bottom: 14px; }
.empty-state h3 { font-size: 17px; color: var(--text); margin-bottom: 6px; }
.empty-state p { margin-bottom: 18px; font-size: 13.5px; }

/* 首屏加载状态：圆环旋转 */
.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: spinnerSpin 0.9s linear infinite;
  box-shadow: 0 0 24px var(--accent-glow);
}
@keyframes spinnerSpin {
  to { transform: rotate(360deg); }
}

.load-more {
  display: flex; justify-content: center;
  padding: 28px 0 0;
}
.load-more[hidden] { display: none !important; }
.btn-load { padding: 10px 28px; }

/* ---------- 详情弹窗 ---------- */
.modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modalIn 0.18s ease;
}
.modal[hidden] { display: none; }
/* [屎山清理] modalIn 重复定义已删除（统一由末尾「优雅动效系统」定义）。 */
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(2, 6, 16, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-box {
  position: relative;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: saturate(185%) blur(26px);
  -webkit-backdrop-filter: saturate(185%) blur(26px);
  animation: boxIn 0.22s ease;
}
.modal-box::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 180px at 18% 0%, rgba(255,255,255,0.12), transparent 68%),
    radial-gradient(320px 220px at 100% 16%, var(--accent-glow), transparent 72%);
  opacity: 0.8;
}
.modal-lg { max-width: 760px; }
.modal-sm { max-width: 460px; padding: 28px; }
/* [屎山清理] boxIn 重复定义已删除（统一由末尾「优雅动效系统」定义）。 */
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: all 0.15s ease;
}
.modal-close:hover { background: var(--danger); color: #fff; }

.modal-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
  padding-right: 40px;
}
.modal-sub {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 18px;
}

/* 详情卡片头部 */
.detail-head {
  padding: 30px 30px 22px;
  background: var(--grad-soft);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.detail-tags { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  line-height: 1.25;
}
.detail-rom {
  font-size: 15px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}
.detail-meta-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.detail-meta-cell {
  min-width: 138px;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09);
}
.detail-meta-cell em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: block;
  margin-bottom: 3px;
}
.detail-meta-cell strong {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
  line-height: 1.2;
}

/* 详情正文 */
.detail-body { padding: 24px 30px 30px; }
.detail-section { margin-bottom: 24px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.detail-section-title::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--grad-primary);
  border-radius: 2px;
}
.detail-desc {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 13.5px;
}
.detail-list {
  display: flex; flex-direction: column; gap: 6px;
}
.detail-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}
.detail-list li::before {
  content: '';
  position: absolute;
  left: 6px; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* 下载链接列表 */
.link-list { display: flex; flex-direction: column; gap: 10px; }
.link-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: all 0.16s ease;
}
.link-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateX(2px);
}
.link-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.link-icon.icon-official { background: rgba(30, 111, 255, 0.16); color: #60a5fa; }
.link-icon.icon-mirror { background: rgba(0, 212, 255, 0.16); color: var(--accent); }
.link-icon.icon-netdisk { background: rgba(245, 158, 11, 0.16); color: var(--warning); }
.link-icon.icon-github { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
.link-icon.icon-forum { background: rgba(192, 132, 252, 0.16); color: #c084fc; }
.link-info { flex: 1; min-width: 0; }
.link-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.link-info span {
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-actions { display: flex; gap: 6px; flex-shrink: 0; }
.link-actions .btn { padding: 7px 12px; font-size: 12px; }

/* ---------- 版本列表（详情弹窗内）---------- */
.detail-link {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px dashed var(--accent);
  padding-bottom: 1px;
  transition: opacity 0.18s ease;
}
.detail-link:hover { opacity: 0.85; }

.v-list-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.v-list-head .detail-section-title { margin-bottom: 0; }
.v-search {
  position: relative;
  display: flex; align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 4px 10px;
  min-width: 220px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.v-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.v-search svg { color: var(--text-dim); flex-shrink: 0; }
.v-search input {
  background: transparent; border: none; outline: none;
  padding: 6px 8px;
  font-size: 12.5px;
  flex: 1;
  width: 100%;
}

.v-list {
  display: flex; flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
}
.v-list::-webkit-scrollbar { width: 6px; }

.v-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 14px 18px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  animation: vItemIn 0.32s cubic-bezier(.2,.7,.2,1.05) backwards;
}
@keyframes vItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.v-item:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.v-item.is-latest {
  border-color: rgba(0, 212, 255, 0.45);
  background: linear-gradient(135deg, rgba(30,111,255,0.08), rgba(0,212,255,0.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 1px rgba(0,212,255,0.08);
}

.v-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.v-name { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.v-name strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}
.v-latest-badge {
  display: inline-flex; align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: var(--grad-primary);
  color: #fff;
  flex-shrink: 0;
}
.v-refresh-badge {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.36);
  flex-shrink: 0;
  cursor: help;
}

/* 联想解压密码条 */
.detail-pwd-bar {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-3);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--text);
}
.detail-pwd-bar svg { color: var(--accent); flex-shrink: 0; }
.detail-pwd-bar em {
  font-style: normal;
  color: var(--text-dim);
  font-size: 12.5px;
  flex-shrink: 0;
}
.detail-pwd-bar code {
  padding: 3px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.5px;
  user-select: all;
}
.detail-pwd-bar .v-btn { width: 26px; height: 26px; }
.v-meta {
  display: flex; align-items: center; gap: 4px;
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.v-meta-sep { opacity: 0.5; }

.v-links { display: flex; flex-direction: column; gap: 6px; }
.v-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.v-link:hover { border-color: var(--accent); background: var(--bg-2); }
.v-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  text-align: center;
}
.v-tag-fb { color: #60a5fa; border-color: rgba(96, 165, 250, 0.4); background: rgba(96, 165, 250, 0.08); }
.v-tag-rc { color: #fb923c; border-color: rgba(251, 146, 60, 0.4); background: rgba(251, 146, 60, 0.08); }
.v-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
/* 中文提示文案（"请点击右侧按钮复制链接或下载"）：用系统中文字体 + 允许换行，
   避免被等宽字体 + ellipsis 截断成"请点击右侧按..." */
.v-url.is-hint {
  font-family: inherit;
  font-style: normal;
  font-size: 12.5px;
  color: var(--accent);
  white-space: normal;
  text-overflow: clip;
  line-height: 1.45;
}
.v-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.v-btn {
  width: 30px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.v-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.v-btn:active { transform: translateY(0) scale(0.94); }
.v-btn-dl:hover { color: #fff; background: var(--grad-primary); border-color: transparent; box-shadow: 0 4px 12px var(--primary-glow); }

@media (max-width: 720px) {
  .v-link { grid-template-columns: auto 1fr auto; }
  .v-list-head { flex-direction: column; align-items: stretch; }
}

/* ---------- Hero 入场动效 ---------- */
.hero-badge { animation: heroIn 0.5s cubic-bezier(.22,.72,.3,1) 0.05s both; }
.hero-title { animation: heroIn 0.5s cubic-bezier(.22,.72,.3,1) 0.12s both; }
.hero-sub   { animation: heroIn 0.5s cubic-bezier(.22,.72,.3,1) 0.18s both; }
.searchbar  { animation: heroIn 0.5s cubic-bezier(.22,.72,.3,1) 0.24s both; }
.hero-stats { animation: heroIn 0.5s cubic-bezier(.22,.72,.3,1) 0.32s both; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.hero-glow {
  animation: glowDrift 16s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -1%, 0) scale(1.04); }
  100% { transform: translate3d(-2%, 1%, 0) scale(0.98); }
}

/* ---------- Toast 默认：屏幕中央 Q 弹，图标在上、文字在下 ---------- */
.toast {
  position: fixed;
  top: 50%;
  bottom: auto;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  transform-origin: 50% 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    var(--bg-card);
  border: 1.5px solid var(--line-strong);
  color: var(--text);
  padding: 18px 24px 15px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow-2), 0 0 32px var(--primary-glow);
  backdrop-filter: saturate(185%) blur(24px);
  -webkit-backdrop-filter: saturate(185%) blur(24px);
  opacity: 0;
  pointer-events: none;
  z-index: 20000;  /* 高于所有 modal (9999) 和 slider (10000)，确保不被蒙版遮住 */
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-width: 148px;
  max-width: min(86vw, 340px);
  text-align: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}
.toast.show {
  opacity: 1;
  animation: toastPopCenter 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes toastPop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(30px) scale(0.6); }
  45%  { opacity: 1; transform: translateX(-50%) translateY(-4px) scale(1.08); }
  70%  { transform: translateX(-50%) translateY(2px) scale(0.97); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

/* 兼容旧调用：toast-center 保持同一套居中表现 */
.toast.toast-center {
  border-radius: 20px;
  box-shadow: var(--shadow-2), 0 0 48px var(--primary-glow);
}
.toast.toast-center.show {
  animation: toastPopCenter 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes toastPopCenter {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-8deg); }
  45%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(2deg); }
  70%  { transform: translate(-50%, -50%) scale(0.97) rotate(-1deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}
@keyframes toastIconSpin {
  0%   { transform: scale(0.2) rotate(-180deg); }
  60%  { transform: scale(1.3) rotate(20deg); }
  100% { transform: scale(1) rotate(0deg); }
}
/* 图标：app.js toastIcon() 生成的自绘 SVG。底色圆淡入 → 圆环从 12 点顺时针画出 → 勾 / 叉 / i 依次描出，
   成功收尾轻弹一下、失败轻摇一下；减弱动效时直接显示终态 */
.toast-icon {
  --ti: var(--accent);
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  overflow: visible;
  fill: none;
  stroke: var(--ti);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toast-success .toast-icon { --ti: var(--success); }
.toast-error .toast-icon { --ti: var(--danger); }
.toast-icon .ti-bg { fill: color-mix(in srgb, var(--ti) 16%, transparent); stroke: none; }
.toast-icon .ti-dot { fill: var(--ti); stroke: none; }
.toast-text { min-width: 0; max-width: 100%; }
.toast.toast-success { border-color: var(--success); }
.toast.toast-error { border-color: var(--danger); }
@media (prefers-reduced-motion: no-preference) {
  .toast.show .ti-bg,
  .toast.show .ti-dot { transform-box: fill-box; transform-origin: center; }
  .toast.show .ti-bg { animation: tiBgIn .32s var(--mo-ease) both; }
  .toast.show .ti-ring,
  .toast.show .ti-mark { stroke-dasharray: 1; }
  .toast.show .ti-ring { animation: tiDraw .42s cubic-bezier(.65, 0, .35, 1) .04s both; }
  .toast.show .ti-mark { animation: tiDraw .28s cubic-bezier(.33, 1, .68, 1) .34s both; }
  .toast.show .ti-mark-2 { animation-delay: .46s; }
  .toast.show .ti-dot { animation: tiDot .3s var(--mo-emph) .3s both; }
  .toast-success.show .toast-icon { animation: tiPop .36s var(--mo-emph) .6s both; }
  .toast-error.show .toast-icon { animation: tiShake .4s ease .74s both; }
}
@keyframes tiDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tiBgIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
@keyframes tiDot { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
@keyframes tiPop { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.2); } }
@keyframes tiShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(1px); }
}

/* ---------- 页脚 ---------- */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 28px 28px;
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1.4fr;
  gap: 40px;
}
/* 联系方式行 */
.footer-contact {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}
.footer-contact .contact-label {
  color: var(--text-dim);
  font-size: 12px;
  flex-shrink: 0;
  min-width: 30px;
}
.footer-contact .contact-value {
  padding: 3px 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: 'Consolas', 'Monaco', monospace;
  color: var(--accent);
  letter-spacing: 0.4px;
  user-select: all;
}
.footer-contact .contact-copy {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.footer-contact .contact-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-3);
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--accent); }
.footer-desc, .footer-tip {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.7;
  margin-top: 10px;
}
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 28px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap;
}

/* ---------- 轻微过渡：表单、3个侧栏入场、主题切换 ---------- */
.sidebar-card { animation: heroIn 0.5s cubic-bezier(.22,.72,.3,1) 0.2s both; }
.filterbar { animation: heroIn 0.46s cubic-bezier(.22,.72,.3,1) 0.1s both; }

/* 主题切换过渡：让颜色切换不会硜然
   注：启用 View Transitions API 后，这个过渡被涟漪扩散接管，只作为降级 */
body, .topbar, .sidebar-card, .rom-card, .modal-box, .filterbar, select, input, textarea, .toast {
  transition: background 0.28s ease, color 0.28s ease, border-color 0.28s ease;
}

/* ---------- 丝滑动效增强 ---------- */
.btn,
.search-btn,
.view-btn,
.brand-item,
.cs-trigger,
.cs-option,
.rom-card,
.v-item,
.v-link,
.modal-box,
.auth-box,
.sidebar-card,
.filterbar {
  will-change: transform, opacity;
}
.btn,
.search-btn,
.view-btn,
.v-btn,
.contact-copy {
  transition:
    transform 0.24s cubic-bezier(.2,.8,.2,1),
    box-shadow 0.24s ease,
    background 0.24s ease,
    border-color 0.24s ease,
    color 0.24s ease;
}
.btn:hover,
.search-btn:hover {
  transform: translateY(-2px);
}
.brand-item {
  transition:
    transform 0.26s cubic-bezier(.2,.8,.2,1),
    background 0.24s ease,
    color 0.24s ease,
    padding 0.24s ease;
}
.brand-item:hover {
  transform: translateX(4px);
}
.cs-menu {
  transform-origin: 50% 0;
}
.rom-card {
  transition:
    transform 0.34s cubic-bezier(.2,.8,.2,1),
    border-color 0.26s ease,
    background 0.26s ease,
    box-shadow 0.34s ease;
}
.rom-card:hover {
  transform: translateY(-6px) scale(1.006);
}
.v-item,
.v-link {
  transition:
    transform 0.24s cubic-bezier(.2,.8,.2,1),
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}
.v-item:hover,
.v-link:hover {
  transform: translateY(-1px);
}
.auth-box,
.modal-box {
  animation: liquidDialogIn 0.34s cubic-bezier(.16, 1, .3, 1) both;
}
.auth-box::before,
.modal-box::before,
.rom-card::after {
  animation: liquidSheen 8s ease-in-out infinite alternate;
}
@keyframes liquidDialogIn {
  from { opacity: 0; transform: translateY(18px) scale(0.965); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes liquidSheen {
  from { background-position: 0% 0%; }
  to { background-position: 100% 80%; }
}

/* ---------- 主题切换：涟漪扩散 (View Transitions API) ---------- */
@supports (view-transition-name: root) {
  /* 禁用浏览器默认的 fade 交叉过渡，让 JS 驱动的 clip-path 扩散完全接管 */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }
  /* 新主题层盖在旧主题上面 */
  ::view-transition-old(root) { z-index: 1; }
  ::view-transition-new(root) { z-index: 2; }
}
/* 主题按钮点击瞬间的迷你波纹反馈（与涟漪扩散呼应） */
#btnTheme { position: relative; overflow: visible; }
#btnTheme:active svg {
  transform: scale(0.88) rotate(-18deg);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#btnTheme svg {
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 尊重用户减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.05ms !important;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px 1fr; gap: 22px; }
}
@media (max-width: 880px) {
  .topbar-inner { padding: 0 18px; gap: 14px; }
  .layout { grid-template-columns: 1fr; padding: 22px 18px 50px; gap: 18px; }
  .sidebar { order: 0; }
  .sidebar-card { padding: 14px; }
  .brand-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
  /* "全部品牌" 在窄屏占满整行并居中显示 */
  .brand-list .brand-item-all { grid-column: 1 / -1; justify-content: center; text-align: center; }
  .brand-list .brand-item-all .brand-name { flex: 0 0 auto; }
  /* 顶栏按钮在窄屏下避免被点击穿透/遮挡，强制可点 */
  .topbar { z-index: 100; }
  .topbar-actions { position: relative; z-index: 101; }
  .topbar-actions .btn { -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; }
  .hero { padding: 44px 18px 36px; }
  .hero-title { font-size: 28px; }
  .filterbar { padding: 12px; }
  .filter-group { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .btn-reset { width: 100%; margin-left: 0; margin-top: 4px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; padding: 36px 18px 22px; }
  .detail-head { padding: 22px 20px 18px; }
  .detail-body { padding: 18px 20px 24px; }
  .modal { padding: 12px; }
  .modal-sm { padding: 22px; }
  .list-view .rom-card { flex-direction: column; align-items: stretch; }
  .list-view .rom-card-head { flex-direction: row; min-width: 0; }
  .list-view .rom-meta { grid-template-columns: 1fr 1fr; }
  .list-view .rom-card-foot { width: 100%; }
}
@media (max-width: 480px) {
  .hero-stats { gap: 14px; }
  .stat strong { font-size: 21px; }
  .footer-inner { grid-template-columns: 1fr; }
  .rom-grid { grid-template-columns: 1fr; }
  .rom-meta { grid-template-columns: 1fr 1fr; }
  /* 顶栏紧凑：避免 admin 已登录 + 账号管理两个按钮挤出屏幕 */
  .topbar-inner { padding: 0 12px; gap: 8px; flex-wrap: nowrap; }
  .topbar-actions { gap: 6px; flex-wrap: nowrap; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 12.5px; min-height: 32px; }
  /* 主题按钮单独保护，保证永远可见可点 */
  #btnTheme { min-width: 36px; min-height: 36px; padding: 6px; flex-shrink: 0; }
  .brand-logo { width: 28px; height: 28px; }
  /* admin 已登录按钮可截断（超长用户名也不撑爆） */
  #btnLogin { max-width: 35vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 弹窗在窄屏占满宽 */
  .auth-box { padding: 22px 18px; width: 100%; }
  .accounts-box { width: 100%; max-height: calc(100vh - 20px); }
  .accounts-list li { padding: 10px 12px; gap: 8px; }
  .accounts-name { font-size: 13px; }
  .accounts-list li { align-items: flex-start; flex-direction: column; }
  .accounts-ops { width: 100%; justify-content: flex-start; }
  .accounts-ops .btn-sm { flex: 1 1 auto; min-width: 66px; }
  /* 详情弹窗单元格在窄屏 2 列 */
  .detail-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .detail-meta-cell { min-width: 0; padding: 9px 10px; }
  /* ROM 列表卡片紧凑 */
  .rom-card { padding: 14px; }
  .v-link { padding: 10px 12px; gap: 8px; }
  .v-url { font-size: 12px; }
  .toast {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: max-content;
    max-width: min(84vw, 320px);
    padding: 16px 20px 13px;
    font-size: 14px;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
  }
  /* 手机端取消版本列表的内部滚动条，整个 modal 一起滚动 */
  .v-list { max-height: none; overflow-y: visible; padding-right: 0; }
}
/* 超窄屏（≤360px，老安卓机/iPhone SE）：进一步省空间 */
@media (max-width: 360px) {
  .brand-text { display: none; }                     /* 只剩 logo */
  .topbar-actions .btn { padding: 6px 8px; font-size: 12px; }
  #btnLogin { max-width: 42vw; }
}
/* 触屏设备：去掉 :hover 遗留高亮状态 */
@media (hover: none) {
  .btn-ghost:hover { background: var(--bg-card); border-color: var(--line-strong); color: var(--text); transform: none; }
  .v-btn:hover { transform: none; }
}

/* ===== 首屏欢迎引导（brand===null 时显示）===== */
/* 用户刚进网站、还没点过左侧任何品牌 → 右侧不列任何 ROM，避免后台懒加载引起的视觉跳动 */
.welcome-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 80px 20px 60px;
  text-align: center;
  animation: skeletonFade 0.5s cubic-bezier(.2,.7,.2,1.05);
}
.welcome-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  box-shadow: 0 0 32px var(--accent-glow);
  animation: welcomeArrowSway 2.4s ease-in-out infinite;
}
@keyframes welcomeArrowSway {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-6px); }
}
.welcome-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.5px;
}
.welcome-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  max-width: 460px;
  line-height: 1.65;
}

/* ===== 首屏加载骨架 ===== */
/* 用于 ALL_ROMS 还在后台懒加载时，结果区显示一个友好的加载提示，
   而不是"未找到匹配的 ROM"空状态 */
.loading-skeleton {
  animation: skeletonFade 0.4s ease-out;
}
@keyframes skeletonFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.spinner-ring {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinnerRotate 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}
@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

/* ---------- 胶囊化圆角 ---------- */
.accounts-section,
.accounts-add,
.filterbar,
.sidebar-card,
.rom-card,
.v-link {
  border-radius: 28px;
}
.ban-screen {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.ban-box {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  border-radius: 32px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(251, 113, 133, 0.14), rgba(255,255,255,0.035)),
    var(--bg-card);
  box-shadow: var(--shadow-2);
}
.ban-box h2 { margin-bottom: 10px; color: #fb7185; }
.ban-box p { color: var(--text-muted); margin-bottom: 14px; }
.ban-box strong {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text);
}
.mini-dialog-box {
  width: min(420px, calc(100vw - 40px));
  border-radius: 30px;
  animation: miniDialogIn 0.28s cubic-bezier(.16, 1, .3, 1) both;
}
.mini-dialog-box label {
  margin-bottom: 12px;
}
.mini-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  margin-top: 8px;
}
@keyframes miniDialogIn {
  from { opacity: 0; transform: translateY(16px) scale(0.94); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .accounts-section,
  .accounts-list li,
  .account-menu,
  .mini-dialog-box {
    transition:
      transform 0.24s cubic-bezier(.2,.8,.2,1),
      opacity 0.24s ease,
      border-color 0.24s ease,
      background 0.24s ease,
      box-shadow 0.24s ease;
  }
  .accounts-list li:hover {
    transform: translateY(-1px);
  }
  .accounts-section[open] {
    animation: sectionUnfold 0.28s cubic-bezier(.2,.8,.2,1) both;
  }
  @keyframes sectionUnfold {
    from { opacity: 0.82; transform: translateY(-4px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* ---------- 最终覆盖：站内按钮统一胶囊 ---------- */
button,
.btn,
.btn-sm,
.search-btn,
.search-clear,
.view-btn,
.modal-close,
.auth-close,
.captcha-x,
.captcha-knob,
.contact-copy,
.cs-trigger,
.v-btn,
.link-actions .btn,
.btn-load,
.btn-reset {
  border-radius: 999px;
}

/* ---------- 绝对最后覆盖：手机端强制可用 ---------- */
@media (max-width: 720px) {
  html, body { width: 100%; overflow-x: hidden; }
  .topbar-inner { min-height: 58px; padding: 8px 10px; gap: 8px; }
  .topbar-spacer { display: none; }
  .brand { min-width: 0; flex: 0 1 auto; }
  .brand-text { font-size: 15px; white-space: nowrap; }
  .topbar-actions {
    margin-left: auto;
    min-width: 0;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions .btn { flex: 0 0 auto; min-height: 34px; padding: 7px 10px; font-size: 12px; }
  #btnTheme { width: 36px; min-width: 36px; padding: 0; }
  #btnLogin { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { padding: 30px 14px 22px; }
  .hero-title { font-size: clamp(26px, 8vw, 34px); }
  .searchbar { width: 100%; max-width: none; padding: 5px 5px 5px 12px; }
  #searchInput { min-width: 0; padding: 11px 8px; font-size: 14px; }
  .search-btn { padding: 9px 14px; flex: 0 0 auto; }
  .layout { display: block; width: 100%; padding: 14px 12px 44px; }
  .sidebar { margin-bottom: 12px; }
  .sidebar-card { padding: 10px; border-radius: 22px; }
  .brand-list {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .brand-list::-webkit-scrollbar { display: none; }
  .brand-item,
  .brand-list .brand-item-all {
    flex: 0 0 auto;
    grid-column: auto !important;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .brand-arrow { display: none; }
  .filterbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 22px;
    overflow: visible;
  }
  .filter-group { min-width: 0; width: 100%; }
  .btn-reset { grid-column: 1 / -1; width: 100%; margin: 0; }
  .cs-menu { max-height: min(48vh, 320px); overflow-y: auto; z-index: 80; }
  .rom-grid,
  .rom-grid.list-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .rom-card,
  .list-view .rom-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 24px;
  }
  .rom-card-head,
  .list-view .rom-card-head { flex-direction: row; align-items: flex-start; min-width: 0; }
  .rom-info,
  .list-view .rom-info { min-width: 0; }
  .rom-device-name { font-size: 15.5px; word-break: break-word; }
  .rom-rom-name { -webkit-line-clamp: 2; line-clamp: 2; }
  .rom-meta,
  .list-view .rom-meta { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .rom-card-foot,
  .list-view .rom-card-foot { width: 100%; margin-top: 12px; }
  .modal { align-items: stretch; justify-content: stretch; padding: 8px; }
  .modal-box { width: 100%; max-width: none; max-height: calc(100dvh - 16px); border-radius: 24px; }
  .detail-head { padding: 18px 14px 14px; }
  .detail-title { font-size: 20px; padding-right: 36px; word-break: break-word; }
  .detail-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .detail-meta-cell { min-width: 0; border-radius: 20px; padding: 9px 8px; }
  .detail-body { padding: 14px; }
  .v-list-head { display: grid; grid-template-columns: 1fr; }
  .v-search { width: 100%; min-width: 0; }
  .v-list { max-height: none; overflow: visible; padding-right: 0; }
  .v-item { border-radius: 24px; padding: 12px; }
  .v-head { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .v-name, .v-name strong { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
  .v-link { grid-template-columns: 1fr auto !important; align-items: center; border-radius: 22px; padding: 10px; }
  .v-tag { grid-column: 1 / 2; justify-self: start; }
  .v-url { grid-column: 1 / -1; order: 3; font-size: 12px; }
  .v-actions { grid-column: 2 / 3; grid-row: 1; }
  .v-btn { width: 34px; height: 32px; }
  .auth-modal, .captcha-modal { padding: 10px; }
  .auth-box, .captcha-box, .accounts-box, .security-box, .mini-dialog-box {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    border-radius: 24px;
  }
  .toast { max-width: min(84vw, 320px); }
}

@media (max-width: 380px) {
  .filterbar { grid-template-columns: 1fr; }
  .brand-text em { display: none; }
  #btnLogin { max-width: 48vw; }
  .detail-meta-grid { grid-template-columns: 1fr !important; }
}

/* ---------- 绝对最终覆盖：移动端防爆闪 ---------- */
@media (max-width: 720px), (pointer: coarse) {
  html {
    background: var(--bg);
  }
  body {
    background-attachment: scroll !important;
    transform: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  body::before,
  body::after {
    position: absolute !important;
    top: 0 !important;
    left: -20vw !important;
    right: -20vw !important;
    height: max(140vh, 980px) !important;
    transform: translateZ(0) !important;
    animation: none !important;
    will-change: auto !important;
    contain: paint;
  }
  body::before {
    opacity: 0.54 !important;
    filter: blur(18px) saturate(122%) !important;
    background-size: 118% 118%, 122% 122%, 112% 112% !important;
    background-position: 14% 18%, 82% 10%, 54% 74% !important;
  }
  body::after {
    opacity: 0.24 !important;
    filter: blur(18px) saturate(116%) !important;
    mix-blend-mode: screen;
  }
  .hero-glow {
    animation: none !important;
    opacity: 0.55 !important;
    transform: translateZ(0) !important;
    filter: blur(18px) !important;
  }
  .rom-card,
  .v-item,
  .v-link,
  .modal-box,
  .auth-box,
  .accounts-box,
  .security-box,
  .mini-dialog-box,
  .topbar,
  .sidebar-card,
  .filterbar {
    will-change: auto !important;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  .rom-card::after,
  .modal-box::before,
  .auth-box::before {
    animation: none !important;
    opacity: 0.45;
  }
  .modal-box,
  .auth-box,
  .accounts-box,
  .security-box,
  .mini-dialog-box {
    animation-duration: 0.18s !important;
    filter: none !important;
  }
  .modal-mask,
  .auth-mask,
  .captcha-mask {
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* ---------- 账号搜索：筛掉的行必须隐藏（账号行自带 display:flex 会盖过 [hidden]） ---------- */
.accounts-list li[hidden],
.accounts-list [data-account-row][hidden] {
  display: none !important;
}

/* ---------- eof runtime performance override ---------- */
body::before,
body::after {
  animation: none !important;
  transform: none !important;
  will-change: auto !important;
}

body::before {
  height: 115vh !important;
  opacity: 0.18 !important;
  filter: none !important;
  background-size: 100% 100% !important;
}

body::after {
  display: none !important;
}

.hero-glow,
.auth-box::before,
.modal-box::before,
.rom-card::after {
  animation: none !important;
  filter: none !important;
}

.rom-card::after {
  display: none !important;
}

.topbar,
.filterbar,
.sidebar-card,
.rom-card,
.modal-box,
.auth-box,
.slider-box,
.accounts-box,
.security-box,
.mini-dialog-box,
.cs-menu,
.toast,
.account-menu button {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  will-change: auto !important;
}

.auth-mask,
.slider-mask,
.modal-mask,
.captcha-mask,
.mini-dialog-mask {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sidebar-card,
.filterbar,
.rom-card {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
}

.rom-card {
  animation: none !important;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease !important;
}

.rom-card:hover {
  transform: translateY(-2px) !important;
}

.auth-box,
.modal-box,
.sidebar-card,
.filterbar,
.hero-badge,
.hero-title,
.hero-sub,
.searchbar,
.hero-stats {
  animation: none !important;
}

/* ---------- eof opaque panels after blur removal ---------- */
.topbar {
  background: var(--bg-2) !important;
}

.sidebar-card,
.filterbar,
.rom-card,
.view-toggle,
.cs-menu {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    var(--bg-3) !important;
}

.modal-mask,
.auth-mask,
.slider-mask,
.captcha-mask,
.mini-dialog-mask {
  background: rgba(3, 7, 18, 0.82) !important;
}

.modal-box,
.auth-box,
.slider-box,
.accounts-box,
.security-box,
.mini-dialog-box,
.toast {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    var(--bg-3) !important;
  opacity: 1 !important;
}

.detail-head {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(0, 212, 255, 0.06)),
    var(--bg-2) !important;
}

.detail-body,
.v-list {
  background: var(--bg-3) !important;
}

.detail-meta-cell,
.v-item,
.v-link,
.detail-pwd-bar {
  background: var(--bg-2) !important;
}

.v-item.is-latest {
  background:
    linear-gradient(135deg, rgba(30, 111, 255, 0.11), rgba(0, 212, 255, 0.07)),
    var(--bg-2) !important;
}

.v-link:hover,
.v-item:hover,
.rom-card:hover {
  background: var(--bg-card-hover) !important;
}

/* Toast visibility fix: normal toasts remain, empty hidden shells never draw. */
#toast,
#toast[hidden],
#toast:empty,
#toast:not(.show) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden;
}

#toast.show:not(:empty) {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible;
}

/* Intent-first loading and motion polish. */
.results-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  white-space: nowrap;
}

.results-loading::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  animation: brandLoadPulse 0.95s ease-in-out infinite;
}

.loading-panel {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
    var(--bg-card);
  color: var(--text);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.loading-panel-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.loading-panel-sub {
  max-width: min(440px, 92%);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.brand-item.is-loading {
  color: var(--accent);
}

.brand-item.is-loading .brand-count {
  border-color: rgba(0, 212, 255, 0.26);
  color: var(--accent);
}

.brand-loading-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  animation: brandLoadPulse 0.95s ease-in-out infinite;
}

@keyframes brandLoadPulse {
  0%, 100% { opacity: 0.42; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1.18); }
}

.rom-card-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  border-radius: inherit;
  background: rgba(7, 12, 26, 0.72);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

[data-theme="light"] .rom-card-loading {
  background: rgba(255, 255, 255, 0.78);
}

.rom-card.is-loading {
  pointer-events: none;
  opacity: 0.92 !important;
  transform: translateY(-1px) scale(0.998);
}

.rom-card.is-loading::before {
  transform: scaleX(1) !important;
}

.rom-card.is-loading .rom-card-foot .btn {
  cursor: wait;
}

.modal:not([hidden]) .modal-box {
  transform-origin: center center !important;
  clip-path: none !important;
  animation: romDetailPop 0.24s cubic-bezier(.16, 1, .3, 1) both !important;
}

.modal:not([hidden]) .modal-mask {
  animation: romDetailMaskIn 0.18s ease both !important;
}

@keyframes romDetailPop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.965);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes romDetailMaskIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .rom-grid:not(.no-stagger) .rom-card {
    animation: cardIn 0.42s cubic-bezier(.22,.72,.3,1) backwards !important;
  }

  .loading-panel {
    animation: skeletonFade 0.28s cubic-bezier(.2,.7,.2,1.05) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .results-loading::before,
  .brand-loading-dot,
  .modal:not([hidden]) .modal-box,
  .modal:not([hidden]) .modal-mask {
    animation: none !important;
  }
}

/* ============================================================
   丝滑交互增强 (Silk Motion Enhancements)
   统一缓动体系 + 卡片光标光晕 + 按钮涟漪 + 视图切换淡入
   + 侧栏/筛选/统计数字微交互。
   追加在文件末尾以最高级联优先生效；全部在
   prefers-reduced-motion: reduce 下自动降级为静态。
   ============================================================ */
:root {
  --ease-silk: cubic-bezier(.22, 1, .36, 1);      /* 丝滑减速 */
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);  /* 轻微回弹 */
  --dur-1: .16s;
  --dur-2: .26s;
  --dur-3: .42s;
}

html { scroll-behavior: smooth; }

/* 滚动条悬停高亮，提升滚动质感 */
::-webkit-scrollbar-thumb { transition: background .25s ease; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }

@media (prefers-reduced-motion: no-preference) {
  /* —— 卡片：更顺滑的悬停曲线 + 光标跟随光晕（--mx/--my 由 JS 实时写入）—— */
  .rom-card {
    transition:
      transform var(--dur-2) var(--ease-silk),
      border-color var(--dur-2) ease,
      box-shadow var(--dur-2) ease,
      background var(--dur-2) ease;
  }
  .rom-card::after { transition: opacity var(--dur-2) ease; }
  /* 仅上浮（不缩放：缩放会让文字与阴影抖动，纯位移最顺滑） */
  .rom-grid:not(.list-view) .rom-card:hover { transform: translateY(-6px); }
  .rom-grid.list-view .rom-card:hover { transform: translateY(-3px); }

  /* —— 按钮：按下回弹 + 主按钮悬停上浮 —— */
  .btn {
    transition:
      transform var(--dur-1) var(--ease-spring),
      box-shadow var(--dur-2) ease,
      background var(--dur-2) ease,
      color var(--dur-2) ease,
      border-color var(--dur-2) ease;
  }
  .btn:active { transform: scale(.95); }
  .btn-primary:hover,
  .search-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--primary-glow); }
  .btn-primary:active,
  .search-btn:active { transform: translateY(0) scale(.97); }

  /* —— 视图切换：容器淡入 + 切换按钮平滑 —— */
  .rom-grid.view-switching { animation: viewSwitchFade var(--dur-3) var(--ease-silk); }

  /* —— 侧栏品牌项：悬停轻微右移 —— */
  .brand-item { transition: transform var(--dur-2) var(--ease-silk), background var(--dur-2) ease, color var(--dur-2) ease, border-color var(--dur-2) ease; }
  .brand-item:hover { transform: translateX(3px); }

  /* —— 顶栏按钮 / 自定义下拉 / 原生筛选：统一顺滑 —— */
  .topbar-actions .btn,
  .cs-trigger,
  .filter-group select,
  .btn-reset {
    transition:
      transform var(--dur-1) var(--ease-spring),
      border-color var(--dur-2) ease,
      box-shadow var(--dur-2) ease,
      background var(--dur-2) ease,
      color var(--dur-2) ease;
  }
  .cs-trigger:hover,
  .filter-group select:hover { border-color: var(--line-strong); }
}

/* [屎山清理] viewSwitchFade 重复定义已删除（统一由末尾「优雅动效系统」定义）。 */

/* 视图切换按钮的激活态过渡 */
.view-btn {
  transition: color var(--dur-2) ease, background var(--dur-2) var(--ease-silk), box-shadow var(--dur-2) ease;
}

/* —— 按钮涟漪（由 JS 在点击处插入 .btn-ripple）—— */
.btn-primary,
.search-btn { position: relative; overflow: hidden; }
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  opacity: .6;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: btnRipple .6s var(--ease-silk);
}
@keyframes btnRipple {
  to { transform: scale(2.4); opacity: 0; }
}

/* —— 统计数字：递增中高亮，悬停轻微跃动 —— */
.stat strong { transition: transform var(--dur-2) var(--ease-spring), color var(--dur-2) ease; }
.stat strong.stat-counting { color: var(--accent); }
.stat:hover strong { transform: translateY(-2px) scale(1.06); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-ripple { display: none !important; }
  .rom-grid.view-switching { animation: none !important; }
}

/* ============================================================
   动效性能重写 v2 (Motion Performance Rewrite)
   解决“看起来卡”的根源：让所有持续动画只走 GPU 合成（transform/opacity），
   并移除冗余 backdrop-filter 重绘。视觉零变化、流畅度大幅提升。
   ============================================================ */

/* 1) 环境光背景：原 liquidOrbDrift 动的是 background-position，会让
   34px 模糊的超大图层每帧重绘 → 全站掉帧。这里重定义为纯 transform 合成动画
   （CSS 取同名 @keyframes 的最后一次定义），背景位置固定，模糊层只绘制一次，
   之后由合成器平移/旋转，丝滑且省电。 */
/* [屎山清理] liquidOrbDrift 重复定义已删除（统一由末尾「优雅动效系统」定义）。 */
body::before {
  background-position: 12% 18%, 82% 8%, 48% 86% !important;
  background-size: 140% 140%, 150% 150%, 130% 130% !important;
  will-change: transform;
  transform: translateZ(0);
  animation-timing-function: ease-in-out !important;
}
body::after {
  will-change: transform;
  transform: translateZ(0);
}

/* 2) ROM 卡片及其它面板：背景已是不透明（见文件末尾 !important 覆盖），
   backdrop-filter 纯属冗余重绘，是滚动/悬停掉帧主因 → 关闭，零视觉变化。 */
.rom-card,
.sidebar-card,
.filterbar,
.view-toggle,
.results-header {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 3) 全站交互过渡统一为合成友好属性 + 一致缓动，杜绝逐帧重排 */
@media (prefers-reduced-motion: no-preference) {
  .rom-card,
  .brand-item,
  .btn,
  .view-btn,
  .cs-trigger,
  .stat strong,
  .v-item,
  .v-link {
    transition-timing-function: var(--ease-silk);
  }
  /* 悬停态用 GPU 合成提示 */
  .rom-card:hover { will-change: transform; }
}

/* 4) 弹窗遮罩淡入也走 opacity 合成（已存在动画，这里补 will-change） */
.modal:not([hidden]) .modal-box { will-change: transform, opacity; }

/* ============================================================
   Q弹动效 v3 (Springy / Jelly Motion)
   入场/交互/弹窗统一带轻微过冲回弹的“Q弹”手感（spring overshoot）。
   全部尊重 prefers-reduced-motion: reduce。
   ============================================================ */
:root {
  --ease-spring: cubic-bezier(.34, 1.3, .52, 1);   /* 回弹（已柔化，原 1.55 偏僵硬） */
  --ease-bounce: cubic-bezier(.34, 1.45, .5, 1);   /* 回弹（已柔化，原 1.8 偏僵硬） */
}

/* [屎山清理] cardIn / toastPop / vItemIn / cardLoadFade 的重复定义已删除，
   统一由文件末尾「优雅动效系统」的同名关键帧（柔和无过冲）作为唯一权威定义。 */

@media (prefers-reduced-motion: no-preference) {
  /* 卡片悬停：Q弹上浮（backdrop-filter 已关，轻微缩放安全顺滑） */
  .rom-card {
    transition:
      transform var(--dur-2) var(--ease-bounce),
      border-color var(--dur-2) ease,
      box-shadow var(--dur-2) ease,
      background var(--dur-2) ease;
  }
  .rom-grid:not(.list-view) .rom-card:hover { transform: translateY(-6px) scale(1.014); }
  .rom-card:active { transform: translateY(-2px) scale(0.992); }

  /* 按钮：按下更“软”、回弹更明显 */
  .btn:active { transform: scale(.9); }
  .btn-primary:hover,
  .search-btn:hover { transform: translateY(-2px) scale(1.03); }

  /* 侧栏品牌项 / 视图切换 / 加载覆盖层：统一 Q弹 */
  .brand-item:hover { transform: translateX(4px); }
  .view-btn { transition: color var(--dur-2) ease, background var(--dur-2) var(--ease-bounce), transform var(--dur-1) var(--ease-bounce); }
  .view-btn:active { transform: scale(.92); }
  .rom-card-loading { animation: cardLoadFade .22s var(--ease-silk) both; }
}

@media (prefers-reduced-motion: reduce) {
  .rom-card-loading { animation: none !important; }
}

/* ============================================================
   动效修复 v4：盖过旧的“禁用动画”遗留块(!important) + 弹窗 Q弹 + 静默骨架
   旧块（本文件 556~619 行）用 !important 关掉了 .auth-box/.modal-box 动画、
   把卡片 transition 压成 0.12s、隐藏了 .rom-card::after 光晕，导致登录弹窗无动效、
   卡片不够丝滑。这里用更靠后的 !important 规则夺回控制权。
   ============================================================ */

/* 1) 恢复卡片光标光晕（旧块 display:none 了它） */
.rom-card::after { display: block !important; }

/* 2) 夺回卡片 Q弹 悬停/过渡（旧块把它压成 0.12s ease + translateY(-2px)） */
@media (prefers-reduced-motion: no-preference) {
  .rom-card {
    transition:
      transform var(--dur-2) var(--ease-bounce) !important,
      border-color var(--dur-2) ease !important,
      box-shadow var(--dur-2) ease !important,
      background var(--dur-2) ease !important;
  }
  .rom-grid:not(.list-view) .rom-card:hover { transform: translateY(-6px) scale(1.014) !important; }
  .rom-grid.list-view .rom-card:hover { transform: translateY(-3px) !important; }
  .rom-card:active { transform: translateY(-2px) scale(0.992) !important; }
}

/* 3) 所有弹窗 Q弹 入场（登录/账号/安全/小对话框/滑块），盖过旧块 animation:none */
/* [屎山清理] dialogPop / dialogMaskFade 重复定义已删除（统一由末尾「优雅动效系统」定义）。 */
@media (prefers-reduced-motion: no-preference) {
  .auth-box,
  .slider-box {
    animation: dialogPop .46s cubic-bezier(.22, .72, .3, 1) both !important;
    transform-origin: center center;
    will-change: transform, opacity;
  }
  .auth-mask,
  .slider-mask { animation: dialogMaskFade .28s ease both !important; }
}

/* 4) 静默加载骨架：品牌/首屏加载时用闪光占位卡片代替文字（无文案、纯视觉） */
.rom-skel-card {
  min-height: 148px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
}
.rom-skel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 28%, rgba(255, 255, 255, 0.08) 50%, transparent 72%);
  transform: translateX(-100%);
  animation: romSkelShimmer 1.25s ease-in-out infinite;
}
@keyframes romSkelShimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .auth-box, .slider-box, .auth-mask, .slider-mask { animation: none !important; }
  .rom-skel-card::after { animation: none; }
}

/* ============================================================
   动效修复 v5：弹窗入场全覆盖 + 静默加载骨架接线
   - 把 Q弹入场补全到「账号管理 / 安全态势 / 小对话框 / 滑块验证 / 封禁屏」
     等所有盒子（旧 v4 只点名了 .auth-box/.slider-box）。
   - .count-skel：结果计数在加载时显示无文字的闪光占位条（配合 app.js 静默骨架）。
   - .rom-skel-card 增加柔和淡入入场，避免占位卡片硬切。
   全部在 prefers-reduced-motion: reduce 下降级为静态。
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .auth-box,
  .slider-box,
  .accounts-box,
  .security-box,
  .mini-dialog-box,
  .captcha-box,
  .ban-box {
    animation: dialogPop .46s cubic-bezier(.22, .72, .3, 1) both !important;
    transform-origin: center center;
    will-change: transform, opacity;
  }
  .auth-mask,
  .slider-mask,
  .captcha-mask,
  .mini-dialog-mask {
    animation: dialogMaskFade .28s ease both !important;
  }
  /* 静默骨架卡片：柔和淡入 + 持续微光流过（::after 由 v4 定义） */
  .rom-skel-card {
    animation: skeletonFade .32s cubic-bezier(.22, 1, .36, 1) both;
  }
}

/* 结果计数加载占位条：纯视觉、无文案 */
.count-skel {
  display: inline-block;
  width: 132px;
  height: 14px;
  border-radius: 999px;
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
  vertical-align: -2px;
  opacity: .9;
}
.count-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 26%, rgba(255, 255, 255, 0.12) 50%, transparent 74%);
  transform: translateX(-100%);
  animation: romSkelShimmer 1.25s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .accounts-box,
  .security-box,
  .mini-dialog-box,
  .captcha-box,
  .ban-box,
  .captcha-mask,
  .mini-dialog-mask,
  .rom-skel-card { animation: none !important; }
  .count-skel::after { animation: none; }
}

/* ============================================================
   ✦ 优雅动效系统 · 重构版 (Elegant Motion System · Rebuilt)
   ------------------------------------------------------------
   目标：把全站动效统一为「优美、舒适、克制」的语言——柔和减速、
   极小位移、几乎无过冲（彻底告别旧版 Q弹 / jelly 抖动）。
   本段位于文件最末尾，是动效的唯一权威来源：
     · 重定义所有 @keyframes（CSS 同名取最后定义 → 全站自动统一）；
     · 用 !important 接管旧版带回弹 / 僵硬缓动的过渡与悬停；
     · 重新启用克制的环境光漂移；
     · 全部在 prefers-reduced-motion: reduce 下降级为静态。
   依赖的 JS 钩子保持不变：--mx/--my（卡片光标光晕）、--cd（卡片错峰）、
   .view-switching、.btn-ripple、.stat-counting、.no-stagger、.is-loading。
   ============================================================ */

/* ---------- 1. 缓动 / 时长令牌（统一口径） ---------- */
:root {
  --mo-ease:  cubic-bezier(.22, 1, .36, 1);     /* 主：优雅减速，柔和收尾 */
  --mo-soft:  cubic-bezier(.33, 1, .68, 1);     /* 小交互：温和减速 */
  --mo-inout: cubic-bezier(.65, 0, .35, 1);     /* 环境 / 循环：平滑进出 */
  --mo-emph:  cubic-bezier(.34, 1.06, .64, 1);  /* 极轻强调回弹（仅 toast） */
  --mo-1: .18s;   /* 即时反馈（按下） */
  --mo-2: .3s;    /* 悬停 / 一般过渡 */
  --mo-3: .46s;   /* 卡片 / 弹窗入场 */
  --mo-4: .6s;    /* 首屏大区块入场 */
}

/* ---------- 2. 关键帧（同名重定义，全站统一为柔和曲线） ---------- */
/* 通用入场：淡入 + 轻微上浮 + 极小缩放，无过冲 */
@keyframes heroIn         { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes cardIn         { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes vItemIn        { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes viewSwitchFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 弹窗 / 浮层：淡入 + 轻浮起 + 轻缩放（统一手感，去掉旧版位移过冲与 blur 抖动） */
@keyframes dialogPop          { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes detailPop          { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes detailPopFinal     { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes romDetailPop       { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes liquidDialogIn     { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes liquidDialogInFast { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes miniDialogIn       { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes boxIn              { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes modalIn            { from { opacity: 0; } to { opacity: 1; } }
@keyframes accountMenuIn      { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* 遮罩淡入 */
@keyframes modalMaskFade      { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalMaskFadeFinal { from { opacity: 0; } to { opacity: 1; } }
@keyframes romDetailMaskIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogMaskFade     { from { opacity: 0; } to { opacity: 1; } }

/* Toast / 提示条：居中柔和浮现（仅极轻回弹收尾，去掉旋转甩出） */
@keyframes toastPopCenter {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.92); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes toastPop {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.94); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes toastIconSpin {
  from { opacity: 0; transform: scale(.6) rotate(-60deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes feedbackIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 骨架 / 加载淡入 */
@keyframes skeletonFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cardLoadFade { from { opacity: 0; } to { opacity: 1; } }

/* 环境光：极慢、克制的位移漂移（纯 transform，走 GPU 合成，几乎零开销） */
@keyframes liquidOrbDrift {
  0%   { transform: translate3d(-1.5%, -1%, 0) scale(1);    }
  50%  { transform: translate3d( 1.5%,  1%, 0) scale(1.04); }
  100% { transform: translate3d(-1.5%, -1%, 0) scale(1);    }
}
@keyframes liquidFlow {
  from { transform: rotate(0deg)   scale(1);    }
  to   { transform: rotate(360deg) scale(1.03); }
}
@keyframes glowDrift {
  0%   { transform: translate3d(0, 0, 0)      scale(1);    }
  50%  { transform: translate3d(1.5%, -1%, 0) scale(1.03); }
  100% { transform: translate3d(-1.5%, 1%, 0) scale(.99);  }
}
@keyframes heroGlowPulse {
  from { opacity: .72; transform: scale(1);     }
  to   { opacity: .92; transform: scale(1.025); }
}

/* ---------- 3. 入场动效接管 ---------- */
@media (prefers-reduced-motion: no-preference) {

  /* 首屏区块：柔和上浮淡入（保留各自原有 stagger 延迟） */
  .hero-badge, .hero-title, .hero-sub, .searchbar, .hero-stats,
  .sidebar-card, .filterbar {
    animation-name: heroIn !important;
    animation-duration: var(--mo-4) !important;
    animation-timing-function: var(--mo-ease) !important;
    animation-fill-mode: both !important;
  }

  /* ROM 卡片：逐张柔和上浮，错峰延迟由 --cd（app.js 写入）驱动 */
  .rom-grid:not(.no-stagger) .rom-card {
    animation: cardIn var(--mo-3) var(--mo-ease) both !important;
    animation-delay: var(--cd, 0ms) !important;
  }
  .rom-grid.no-stagger .rom-card { animation: none !important; }

  /* 详情版本行 */
  .v-item { animation: vItemIn var(--mo-3) var(--mo-ease) backwards !important; }

  /* 详情弹窗 */
  .modal:not([hidden]) .modal-box {
    transform-origin: center center !important;
    animation: dialogPop var(--mo-3) var(--mo-ease) both !important;
    clip-path: none !important;
    will-change: transform, opacity !important;
  }
  .modal:not([hidden]) .modal-mask { animation: modalMaskFade var(--mo-2) ease both !important; }

  /* 登录 / 账号 / 安全 / 小对话框 / 滑块 / 封禁屏：统一柔和入场 */
  .auth-box, .slider-box, .accounts-box, .security-box,
  .mini-dialog-box, .captcha-box, .ban-box {
    animation: dialogPop var(--mo-3) var(--mo-ease) both !important;
    transform-origin: center center;
    will-change: transform, opacity;
  }
  .auth-mask, .slider-mask, .captcha-mask, .mini-dialog-mask {
    animation: modalMaskFade var(--mo-2) ease both !important;
  }

  /* 账号下拉菜单（自顶部展开） */
  .account-menu { animation: accountMenuIn var(--mo-2) var(--mo-ease) both !important; }

  /* Toast：柔和浮现 + 图标轻转入场 */
  .toast.show, .toast.toast-center.show {
    animation: toastPopCenter var(--mo-3) var(--mo-emph) forwards !important;
  }
  .auth-feedback::before {
    animation: toastIconSpin var(--mo-3) var(--mo-ease) both !important;
  }
  .auth-feedback { animation: feedbackIn var(--mo-3) var(--mo-ease) both !important; }
}

/* ---------- 4. 悬停 / 按压交互接管（柔和、克制、无 jelly） ---------- */
@media (prefers-reduced-motion: no-preference) {

  /* ROM 卡片：仅上浮，不缩放（缩放会让文字 / 阴影抖动，纯位移最顺滑） */
  .rom-card {
    transition:
      transform var(--mo-2) var(--mo-ease),
      box-shadow var(--mo-2) ease,
      border-color var(--mo-2) ease,
      background var(--mo-2) ease !important;
  }
  .rom-grid:not(.list-view) .rom-card:hover { transform: translateY(-6px) !important; }
  .rom-grid.list-view .rom-card:hover { transform: translateY(-3px) !important; }
  .rom-card:active { transform: translateY(-2px) !important; }
  .rom-card::before { transition: transform var(--mo-2) var(--mo-ease) !important; }
  /* 保留 --mx/--my 光标光晕（仅平滑显隐），去掉旧版 sheen 扫光 */
  .rom-card::after { transition: opacity var(--mo-2) ease !important; animation: none !important; }

  /* 按钮：温和按压（去掉旧版 scale(.9) 的重压僵硬感） */
  .btn {
    transition:
      transform var(--mo-1) var(--mo-soft),
      box-shadow var(--mo-2) ease,
      background var(--mo-2) ease,
      color var(--mo-2) ease,
      border-color var(--mo-2) ease !important;
  }
  .btn:active { transform: scale(.96) !important; }
  .btn-primary:hover, .search-btn:hover { transform: translateY(-2px) !important; box-shadow: 0 10px 26px var(--primary-glow) !important; }
  .btn-primary:active, .search-btn:active { transform: translateY(0) scale(.97) !important; }

  /* 视图切换：按钮平滑 + 容器淡入 */
  .view-btn { transition: color var(--mo-2) ease, background var(--mo-2) var(--mo-soft), transform var(--mo-1) var(--mo-soft) !important; }
  .view-btn:active { transform: scale(.95) !important; }
  .rom-grid.view-switching { animation: viewSwitchFade var(--mo-3) var(--mo-ease) !important; }

  /* 侧栏品牌项：悬停轻微右移 */
  .brand-item { transition: transform var(--mo-2) var(--mo-ease), background var(--mo-2) ease, color var(--mo-2) ease, border-color var(--mo-2) ease !important; }
  .brand-item:hover { transform: translateX(3px) !important; }

  /* 详情版本行 / 链接：悬停轻浮 */
  .v-item, .v-link { transition: transform var(--mo-2) var(--mo-ease), border-color var(--mo-2) ease, background var(--mo-2) ease, box-shadow var(--mo-2) ease !important; }
  .v-item:hover, .v-link:hover { transform: translateY(-2px) !important; }

  /* 统计数字：悬停轻跃 */
  .stat strong { transition: transform var(--mo-2) var(--mo-soft), color var(--mo-2) ease !important; }
  .stat:hover strong { transform: translateY(-2px) scale(1.05) !important; color: var(--accent) !important; }

  /* 顶栏按钮 / 自定义下拉 / 原生筛选 / 重置：统一顺滑 */
  .topbar-actions .btn, .cs-trigger, .filter-group select, .btn-reset {
    transition: transform var(--mo-1) var(--mo-soft), border-color var(--mo-2) ease, box-shadow var(--mo-2) ease, background var(--mo-2) ease, color var(--mo-2) ease !important;
  }
}

/* ---------- 5. 环境光背景：重新启用极慢、舒缓的漂移 ---------- */
/* 旧「runtime performance override」用 animation:none!important 整体关停了背景动效，
   这里以更靠后的 !important 恢复，并保持极慢 + 纯 transform 合成（模糊层只绘制一次，
   之后由合成器平移/旋转），优雅且几乎零开销。 */
@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: liquidOrbDrift 64s var(--mo-inout) infinite alternate !important;
    transform: translateZ(0);
    will-change: transform !important;
  }
  body::after {
    animation: liquidFlow 120s linear infinite !important;
    transform: translateZ(0);
    will-change: transform !important;
  }
  .hero-glow { animation: glowDrift 24s var(--mo-inout) infinite alternate !important; }
}

/* ---------- 6. 无障碍：尊重 prefers-reduced-motion: reduce ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  body::before, body::after, .hero-glow { animation: none !important; }
  /* toast 无入场动画时仍需复位缩放，否则会停留在初始 scale 而看不清 */
  .toast.show, .toast.toast-center.show {
    animation: none !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }
}

/* ============================================================
   ✦ 详情弹窗（点机型卡片弹出的版本列表页）· 底部抽屉抽出 / 放回
   ------------------------------------------------------------
   打开：从屏幕底部丝滑抽出；关闭：向底部平滑放回。桌面 / 移动一致。
   丝滑要点：缓动用 Material 3 emphasized——抽出 .5s 长行程平滑减速贴位、
   放回 .42s 起步柔 + 加速滑回；面板全程不透明（纯位移、零发灰），遮罩同步淡入淡出。
   纯 transform: translateY（合成器位移、零重绘），关掉毛玻璃 + 打开暂停背景环境光保帧率。
   仍用 #detailModal（ID 选择器）盖掉历史上多套互相打架的 .modal-box 动画
   （boxIn / liquidDialogIn / detailPop / romDetailPop … 及容器 modalIn）。
   ============================================================ */
#detailModal { animation: none !important; }

#detailModal .modal-box {
  animation: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  clip-path: none !important;
  opacity: 1 !important;
  transform: translateY(100%) !important;        /* 初始：停在屏幕底部之外 */
  transform-origin: center bottom !important;
  /* 抽出：Material 3 emphasized-decelerate，长行程平滑减速贴位、极丝滑不突兀 */
  transition: transform .5s cubic-bezier(.05, .7, .1, 1) !important;
  will-change: transform !important;
  backface-visibility: hidden;
}
#detailModal.is-open .modal-box { transform: translateY(0) !important; }      /* 抽到位 */
#detailModal.is-closing .modal-box {              /* 放回：Material 3 emphasized-accelerate，起步柔、加速滑回底部，全程不透明最干净 */
  transform: translateY(100%) !important;
  transition: transform .42s cubic-bezier(.3, 0, .8, .15) !important;
}

#detailModal .modal-mask {
  animation: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 0 !important;
  transition: opacity .5s ease !important;        /* 与面板同步淡入 */
}
#detailModal.is-open .modal-mask { opacity: 1 !important; }
#detailModal.is-closing .modal-mask { opacity: 0 !important; transition: opacity .42s ease !important; }

/* 版本行不单独入场，随面板整体滑入（几十行同帧动画是掉帧主因） */
#detailModal .v-item { animation: none !important; }

/* 无障碍：减少动效时直接快照式显隐 */
@media (prefers-reduced-motion: reduce) {
  #detailModal .modal-box,
  #detailModal .modal-mask { transition: none !important; }
}

/* ---------- 胶囊 / 对话框入场加速：登录、复制成功等 toast 不要慢放 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .toast.show, .toast.toast-center.show { animation-duration: .24s !important; }
  .auth-feedback::before { animation-duration: .24s !important; }
  .auth-box, .slider-box, .accounts-box, .security-box, .mini-dialog-box, .captcha-box, .ban-box { animation-duration: .26s !important; }
  .auth-mask, .slider-mask, .captcha-mask, .mini-dialog-mask { animation-duration: .2s !important; }
}

/* ============================================================
   渐进式机型详情 · 加载态
   点 summary 卡片立即开详情页，链接由后台静默加载；
   未加载出的链接行显示「正在加载链接…」+ 小转圈。
   （追加在文件最末尾：确保悬停/动效覆盖优先级最高）
   ============================================================ */
.v-list.is-progressive-loading .v-item-loading {
  pointer-events: none;
  cursor: default;
}
.v-item-loading:hover,
.v-item-loading .is-loading-link:hover {
  transform: none !important;
  border-color: var(--line) !important;
  background: var(--bg-card) !important;
  box-shadow: none !important;
}
/* 版本名占位闪光条（复用 romSkelShimmer 关键帧） */
.v-skel-line {
  display: inline-block;
  width: 150px;
  max-width: 56%;
  height: 13px;
  border-radius: 999px;
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
  vertical-align: -1px;
}
.v-skel-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 26%, rgba(255, 255, 255, 0.12) 50%, transparent 74%);
  transform: translateX(-100%);
  animation: romSkelShimmer 1.25s ease-in-out infinite;
}
/* 链接行「正在加载链接…」提示 + 小转圈 */
.v-url-loading {
  display: inline-flex;
  align-items: center;
  color: var(--text-dim) !important;
}
.link-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: spinnerRotate 0.8s linear infinite;
}
/* 加载失败 + 重新加载 */
.v-load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 16px;
  text-align: center;
  color: var(--text-dim);
}
.v-load-error svg { color: var(--text-muted); opacity: 0.85; }
.v-load-error p { margin: 0; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .v-skel-line::after,
  .link-spinner { animation: none !important; }
}

/* 渐进式详情：链接加载完成后，真实版本列表整体柔和淡入（替代生硬硬切）。
   只动列表容器，不动每行——既有丝滑感，又避开"版本行不单独入场"的性能约束。 */
@media (prefers-reduced-motion: no-preference) {
  .v-list-swap-in { animation: vListSwapIn .34s cubic-bezier(.22, 1, .36, 1) both; }
}
@keyframes vListSwapIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   机型详情 · 地区标签页（国行 / 欧洲 / 国际版 … 一张卡片内切换）
   ============================================================ */
.v-region-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.v-region-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s var(--ease-silk, ease), background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.v-region-tab em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-dim);
}
.v-region-tab:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}
.v-region-tab.is-active {
  background: var(--grad-primary, var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow, rgba(99, 102, 241, .35));
}
.v-region-tab.is-active em { background: rgba(255, 255, 255, .25); color: #fff; }

/* 切换地区时：版本列表整体快速淡入刷新（只动容器，避开逐行掉帧）+ 标签按压反馈 */
@media (prefers-reduced-motion: no-preference) {
  .v-list-region-swap { animation: vListRegionSwap .3s cubic-bezier(.22, 1, .36, 1) both; }
  .v-region-tab:active { transform: translateY(0) scale(.95); }
}
@keyframes vListRegionSwap {
  from { opacity: .25; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 版本行内的地区小标签 */
.v-region-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-3);
  color: var(--text-dim);
  border: 1px solid var(--line);
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
  .v-region-tab { transition: none !important; }
  .v-region-tab:hover { transform: none !important; }
}

/* ============================================================
   性能增量优化 v4 —— 列表虚拟化 + 后台暂停
   说明：v2/v3 已把动效收敛到 GPU 合成；本块补两项「零视觉变化」的增量优化。
   ============================================================ */
/* 1) 长列表虚拟化：屏幕外的 ROM 卡片跳过布局 / 绘制，首屏更快、滚动更省、内存更低。
   contain-intrinsic-size 用 auto 让浏览器记住每张卡的真实高度，最大限度避免滚动条跳动。
   卡片已 overflow:hidden + position:relative，且 hover 的 box-shadow 属元素自身、
   不会被 paint 容器裁剪，因此视觉零变化。用 @supports 渐进增强，老浏览器自动忽略。 */
@supports (content-visibility: auto) {
  .rom-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 210px;
  }
  .rom-grid.list-view .rom-card {
    contain-intrinsic-size: auto 96px;
  }
}

/* 2) 标签页切到后台：停掉环境光等装饰性持续动画（比浏览器默认节流更省电，
   笔记本风扇 / 续航友好）。由 JS 监听 visibilitychange 给 <html> 加 .bg-anim-paused。 */
html.bg-anim-paused body::before,
html.bg-anim-paused body::after,
html.bg-anim-paused .hero-glow {
  animation-play-state: paused !important;
}

/* ============================================================
   丝绸流光背景 · 首屏动效细化
   ------------------------------------------------------------
   #silkBg 由 app.js initSilkBackground() 创建（WebGL 丝绸褶皱 + 透视扭转光带），
   首帧画好后 <html> 加 .silk-on：画布淡入，并接管 body::before/::after 环境光层。
   WebGL 不可用时没有 .silk-on，带该前缀的规则全部不生效，页面保持原背景。
   ============================================================ */
#silkBg {
  opacity: 0;
  transition: opacity 1.4s var(--mo-ease);
}
html.silk-on #silkBg { opacity: 1; }
html.silk-on body::before,
html.silk-on body::after { display: none !important; }

/* Hero 光晕跟随主题色（原先写死蓝青，玫瑰 / 薰衣草主题下发青）；
   底部遮罩渐隐，消除 .hero overflow:hidden 在底边切出的色带断层 */
.hero-glow {
  background:
    radial-gradient(640px 320px at 30% 62%, var(--primary-glow), transparent 64%),
    radial-gradient(600px 300px at 70% 32%, var(--accent-glow), transparent 66%) !important;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
}
html.silk-on .hero-glow { opacity: .5 !important; }
html.silk-on .hero::before { display: none; }

/* 面板底色留一点透明度，让丝绸与光带隐约透出。不加 backdrop-filter：
   动态背景上逐帧重算大面积模糊正是历史掉帧的根源。 */
html.silk-on .sidebar-card,
html.silk-on .filterbar,
html.silk-on .rom-card,
html.silk-on .view-toggle {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    color-mix(in srgb, var(--bg-3) 86%, transparent) !important;
}
html.silk-on .rom-card:hover { background: var(--bg-card-hover) !important; }
html.silk-on .footer { background: color-mix(in srgb, var(--bg-2) 82%, transparent); }

/* 卡片光标光晕改用主题强调色（原先写死青色） */
.rom-card::after {
  background: radial-gradient(420px 180px at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}

@media (prefers-reduced-motion: no-preference) {
  /* 首屏错峰入场：旧「runtime override」的 animation:none!important 把各自的 delay 一并清零了，
     标题 / 搜索 / 统计 / 筛选 / 侧栏同帧弹出。这里按阅读顺序补回。 */
  .hero-title   { animation-delay: .04s !important; }
  .searchbar    { animation-delay: .12s !important; }
  .hero-stats   { animation-delay: .2s !important; }
  .filterbar    { animation-delay: .28s !important; }
  .sidebar-card { animation-delay: .34s !important; }

  /* 搜索框聚焦：一圈沿边框流动的主题色光 */
  .searchbar::after {
    content: '';
    position: absolute;
    inset: -1px;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--silk-spin, 0deg), transparent 0turn, var(--accent) .1turn, var(--primary) .2turn, transparent .32turn, transparent .5turn, var(--accent) .6turn, var(--primary) .7turn, transparent .82turn);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--mo-2) ease;
    pointer-events: none;
  }
  .searchbar:focus-within::after {
    opacity: 1;
    animation: silkSpin 3.2s linear infinite;
  }
}
@property --silk-spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes silkSpin { to { --silk-spin: 360deg; } }

/* 桌面端渐变标题：每隔几秒一道流光扫过（仅动 background-position，只重绘标题一行） */
@media (min-width: 720px) and (prefers-reduced-motion: no-preference) {
  .hero-title {
    background-image:
      linear-gradient(105deg, transparent 42%, var(--title-sweep) 50%, transparent 58%),
      var(--grad-title);
    background-size: 240% 100%, 100% 100%;
    background-repeat: no-repeat;
    background-position: 120% 0, 0 0;
    animation: heroIn var(--mo-4) var(--mo-ease) .04s both, heroTitleSheen 9s ease-in-out 1.8s infinite !important;
  }
}
@keyframes heroTitleSheen {
  0%        { background-position: 120% 0, 0 0; }
  24%, 100% { background-position: -20% 0, 0 0; }
}

/* ============================================================
   机型详情 · 展开 / 收起动效
   ------------------------------------------------------------
   · 桌面：从面板中心等比放大渐显；收起时略向外扩并淡出（向四周渐隐）；
   · 手机：保留底部抽屉，完整滑出屏幕外；
   · 收起与遮罩同时结束（app.js closeDetail 计时器与这里的时长对齐）；
   · 只用 2D transform、结束态为 none：3D 图层结束时重新栅格化会让文字「抖」一下；
   · 面板内容不做错峰入场：面板落定后内容还在动，看起来就是「顿一下再挪一下」。
   linear() 弹簧曲线不支持时，同一条规则里前面的 cubic-bezier 兜底。
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  #detailModal .modal-box {
    opacity: 0 !important;
    transform: scale(.92) !important;
    transform-origin: 50% 50% !important;
    transition: transform .5s cubic-bezier(.2, .9, .25, 1), opacity .34s cubic-bezier(.25, .8, .25, 1) !important;
    transition:
      transform .5s linear(0, .046, .15, .277, .407, .527, .632, .721, .792, .849, .892, .925, .949, .967, .979, .988, .993, .997, .999, 1.001, 1.001, 1.001, 1.002, 1.001, 1),
      opacity .34s cubic-bezier(.25, .8, .25, 1) !important;
  }
  #detailModal.is-open .modal-box {
    opacity: 1 !important;
    transform: none !important;
  }
  #detailModal.is-closing .modal-box {
    opacity: 0 !important;
    transform: scale(1.04) !important;
    transition: transform .32s cubic-bezier(.2, .7, .3, 1), opacity .28s cubic-bezier(.4, 0, .6, 1) !important;
  }
  #detailModal .modal-mask { transition: opacity .36s cubic-bezier(.2, .8, .2, 1) !important; }
  #detailModal.is-closing .modal-mask { transition: opacity .3s ease !important; }
}

/* 桌面端面板顶端对齐：上下各留 5vh，最高时与居中位置一致；
   渐进加载把骨架换成完整数据时面板会变高，居中会整块上移「跳一下」，顶端对齐只会向下延伸。 */
@media (min-width: 721px) {
  #detailModal { align-items: flex-start !important; }
  #detailModal .modal-box { margin-top: max(0px, calc(5vh - 20px)); }
}

/* 数据到位后替换版本列表：只淡入、不位移 */
@keyframes vListSwapIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
  #detailModal .modal-box {
    opacity: 1 !important;
    transform: translate3d(0, calc(100% + 24px), 0) !important;
    transition: transform .58s cubic-bezier(.2, .9, .25, 1) !important;
    transition: transform .58s linear(0, .046, .15, .277, .407, .527, .632, .721, .792, .849, .892, .925, .949, .967, .979, .988, .993, .997, .999, 1.001, 1.001, 1.001, 1.002, 1.001, 1) !important;
  }
  #detailModal.is-open .modal-box {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
  }
  #detailModal.is-closing .modal-box {
    opacity: 1 !important;
    transform: translate3d(0, calc(100% + 24px), 0) !important;
    transition: transform .32s cubic-bezier(.4, 0, .9, .5) !important;
  }
}

/* 本次视觉实验已回退：保留代码仅供追溯，不参与任何媒体环境。 */
@media not all {

/* ============================================================
   2026 视觉焕新 · Aurora Obsidian
   仅覆盖颜色、材质、边框、阴影与交互反馈；
   不修改任何布局、尺寸、间距、网格或 DOM 结构。
   ============================================================ */

/* ---------- 主题材质令牌 ---------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070a12;
  --bg-2: #0c111d;
  --bg-3: #111827;
  --bg-card: #111827;
  --bg-card-hover: #172237;
  --line: rgba(151, 169, 204, 0.13);
  --line-strong: rgba(167, 188, 226, 0.24);
  --text: #f5f7fb;
  --text-muted: #aab5c8;
  --text-dim: #718097;
  --primary: #7168ff;
  --accent: #45d7e8;
  --primary-rgb: 113, 104, 255;
  --accent-rgb: 69, 215, 232;
  --primary-glow: rgba(113, 104, 255, 0.28);
  --accent-glow: rgba(69, 215, 232, 0.2);
  --success: #35d39a;
  --warning: #f7bd55;
  --danger: #ff657a;
  --shadow-1: 0 14px 36px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 28px 80px rgba(0, 0, 0, 0.44);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --grad-primary: linear-gradient(135deg, #7967ff 0%, #5b83f5 52%, #42d7e8 100%);
  --grad-soft: linear-gradient(135deg, rgba(113, 104, 255, 0.15), rgba(69, 215, 232, 0.07));
  --grad-title: linear-gradient(110deg, #ffffff 4%, #c9ceff 46%, #76e9f3 100%);
  --surface-top: linear-gradient(180deg, rgba(15, 21, 36, 0.98), rgba(10, 15, 27, 0.96));
  --surface-panel:
    linear-gradient(145deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.008) 52%),
    #111827;
  --surface-elevated:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.012) 58%),
    #141d2f;
  --surface-control:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.008)),
    #0d1422;
  --surface-hover:
    linear-gradient(145deg, rgba(113, 104, 255, 0.1), rgba(69, 215, 232, 0.035)),
    #172237;
  --panel-highlight: rgba(255, 255, 255, 0.075);
  --ambient-a: rgba(113, 104, 255, 0.16);
  --ambient-b: rgba(69, 215, 232, 0.11);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --overlay: rgba(3, 7, 16, 0.82);
}

:root[data-theme="lavender"] {
  color-scheme: dark;
  --bg: #0d0b16;
  --bg-2: #12101f;
  --bg-3: #191528;
  --bg-card: #191528;
  --bg-card-hover: #211c35;
  --line: rgba(205, 198, 239, 0.13);
  --line-strong: rgba(211, 202, 255, 0.24);
  --text: #faf8ff;
  --text-muted: #bdb6d3;
  --text-dim: #837a9e;
  --primary: #9177ff;
  --accent: #67e5ef;
  --primary-rgb: 145, 119, 255;
  --accent-rgb: 103, 229, 239;
  --primary-glow: rgba(145, 119, 255, 0.3);
  --accent-glow: rgba(103, 229, 239, 0.18);
  --success: #45d6a2;
  --warning: #f8c866;
  --danger: #ff718b;
  --shadow-1: 0 14px 38px rgba(4, 2, 12, 0.3);
  --shadow-2: 0 30px 84px rgba(4, 2, 12, 0.52);
  --grad-primary: linear-gradient(135deg, #a277ff 0%, #7e75f5 48%, #5ddde9 100%);
  --grad-soft: linear-gradient(135deg, rgba(145, 119, 255, 0.17), rgba(103, 229, 239, 0.07));
  --grad-title: linear-gradient(110deg, #ffffff 3%, #dfd6ff 47%, #83eef5 100%);
  --surface-top: linear-gradient(180deg, rgba(22, 18, 38, 0.98), rgba(15, 12, 27, 0.97));
  --surface-panel:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.009) 54%),
    #191528;
  --surface-elevated:
    linear-gradient(145deg, rgba(255, 255, 255, 0.074), rgba(255, 255, 255, 0.012) 58%),
    #1d1830;
  --surface-control:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.008)),
    #120f20;
  --surface-hover:
    linear-gradient(145deg, rgba(145, 119, 255, 0.12), rgba(103, 229, 239, 0.035)),
    #211c35;
  --panel-highlight: rgba(255, 255, 255, 0.08);
  --ambient-a: rgba(145, 119, 255, 0.2);
  --ambient-b: rgba(75, 202, 237, 0.12);
  --shadow-color: rgba(4, 2, 12, 0.36);
  --overlay: rgba(7, 4, 16, 0.84);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-2: #edf2f8;
  --bg-3: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f9ff;
  --line: rgba(55, 72, 110, 0.1);
  --line-strong: rgba(55, 72, 110, 0.18);
  --text: #172033;
  --text-muted: #55627a;
  --text-dim: #8a96aa;
  --primary: #625bf6;
  --accent: #078ca5;
  --primary-rgb: 98, 91, 246;
  --accent-rgb: 7, 140, 165;
  --primary-glow: rgba(98, 91, 246, 0.2);
  --accent-glow: rgba(7, 140, 165, 0.14);
  --success: #098b62;
  --warning: #b86b08;
  --danger: #dc3454;
  --shadow-1: 0 14px 38px rgba(39, 52, 83, 0.09);
  --shadow-2: 0 28px 80px rgba(39, 52, 83, 0.16);
  --grad-primary: linear-gradient(135deg, #6d5df6 0%, #526fe8 54%, #159bb2 100%);
  --grad-soft: linear-gradient(135deg, rgba(98, 91, 246, 0.11), rgba(7, 140, 165, 0.055));
  --grad-title: linear-gradient(110deg, #172033 2%, #514bd4 52%, #078ca5 100%);
  --surface-top: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 254, 0.97));
  --surface-panel:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 253, 0.9)),
    #ffffff;
  --surface-elevated:
    linear-gradient(145deg, #ffffff, #f8faff 62%),
    #ffffff;
  --surface-control:
    linear-gradient(180deg, #ffffff, #f5f7fb),
    #f7f9fc;
  --surface-hover:
    linear-gradient(145deg, rgba(98, 91, 246, 0.055), rgba(7, 140, 165, 0.025)),
    #fbfcff;
  --panel-highlight: rgba(255, 255, 255, 0.96);
  --ambient-a: rgba(98, 91, 246, 0.11);
  --ambient-b: rgba(7, 140, 165, 0.075);
  --shadow-color: rgba(39, 52, 83, 0.11);
  --overlay: rgba(22, 32, 51, 0.62);
}

:root[data-theme="rose"] {
  color-scheme: dark;
  --bg: #13090f;
  --bg-2: #1a0d15;
  --bg-3: #23111d;
  --bg-card: #23111d;
  --bg-card-hover: #301624;
  --line: rgba(255, 200, 211, 0.13);
  --line-strong: rgba(255, 205, 214, 0.24);
  --text: #fff8fa;
  --text-muted: #d5b5be;
  --text-dim: #9a737e;
  --primary: #ff628f;
  --accent: #ffc278;
  --primary-rgb: 255, 98, 143;
  --accent-rgb: 255, 194, 120;
  --primary-glow: rgba(255, 98, 143, 0.28);
  --accent-glow: rgba(255, 194, 120, 0.17);
  --success: #49d3a3;
  --warning: #ffc65d;
  --danger: #ff6f7f;
  --shadow-1: 0 14px 38px rgba(8, 2, 5, 0.32);
  --shadow-2: 0 30px 84px rgba(8, 2, 5, 0.54);
  --grad-primary: linear-gradient(135deg, #ff5c92 0%, #ff747a 52%, #ffb46b 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 98, 143, 0.16), rgba(255, 194, 120, 0.07));
  --grad-title: linear-gradient(110deg, #fffdfd 4%, #ffc8d6 48%, #ffd39b 100%);
  --surface-top: linear-gradient(180deg, rgba(31, 14, 24, 0.98), rgba(21, 10, 17, 0.97));
  --surface-panel:
    linear-gradient(145deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.008) 54%),
    #23111d;
  --surface-elevated:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01) 58%),
    #291421;
  --surface-control:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.007)),
    #190c14;
  --surface-hover:
    linear-gradient(145deg, rgba(255, 98, 143, 0.11), rgba(255, 194, 120, 0.035)),
    #301624;
  --panel-highlight: rgba(255, 255, 255, 0.08);
  --ambient-a: rgba(255, 98, 143, 0.18);
  --ambient-b: rgba(255, 174, 102, 0.1);
  --shadow-color: rgba(8, 2, 5, 0.38);
  --overlay: rgba(12, 4, 8, 0.84);
}

/* ---------- 页面氛围与基础细节 ---------- */
body {
  background-color: var(--bg) !important;
  background-image:
    radial-gradient(1100px 700px at 78% -14%, var(--ambient-b), transparent 64%),
    radial-gradient(900px 640px at -10% 22%, var(--ambient-a), transparent 66%),
    linear-gradient(180deg, var(--bg), var(--bg)) !important;
  text-rendering: optimizeLegibility;
}

body::before {
  background:
    radial-gradient(circle at 18% 18%, var(--ambient-a), transparent 28%),
    radial-gradient(circle at 78% 10%, var(--ambient-b), transparent 30%),
    linear-gradient(rgba(var(--accent-rgb), 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.018) 1px, transparent 1px) !important;
  background-size: auto, auto, 48px 48px, 48px 48px !important;
  opacity: 0.72 !important;
}

::selection {
  color: #fff;
  background: rgba(var(--primary-rgb), 0.72);
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.24);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.1);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.38);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- 顶栏与品牌 ---------- */
.topbar {
  background: var(--surface-top) !important;
  border-bottom-color: var(--line) !important;
  box-shadow:
    0 1px 0 var(--panel-highlight) inset,
    0 14px 42px var(--shadow-color) !important;
}

.brand-logo {
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 8px 24px var(--primary-glow);
  filter: saturate(1.08);
}

.brand-text {
  background: var(--grad-title);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------- Hero 与搜索 ---------- */
.hero-glow {
  background:
    radial-gradient(680px 340px at 26% 56%, rgba(var(--primary-rgb), 0.19), transparent 64%),
    radial-gradient(620px 320px at 73% 34%, rgba(var(--accent-rgb), 0.13), transparent 66%) !important;
  opacity: 0.82;
}

.hero::before {
  background: linear-gradient(180deg, transparent 56%, var(--bg) 100%);
  opacity: 0.58;
}

.hero-title {
  color: var(--text);
  text-shadow: 0 18px 50px var(--primary-glow);
}

@media (min-width: 720px) {
  .hero-title {
    background: var(--grad-title) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
}

.searchbar {
  background: var(--surface-elevated) !important;
  border-color: var(--line-strong) !important;
  box-shadow:
    0 20px 58px var(--shadow-color),
    inset 0 1px 0 var(--panel-highlight),
    0 0 0 1px rgba(var(--primary-rgb), 0.04) !important;
}

.searchbar:focus-within {
  border-color: rgba(var(--accent-rgb), 0.72) !important;
  box-shadow:
    0 0 0 3px rgba(var(--accent-rgb), 0.13),
    0 24px 64px var(--shadow-color),
    inset 0 1px 0 var(--panel-highlight) !important;
}

.search-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

#searchInput::placeholder {
  color: var(--text-dim);
}

.search-clear {
  color: var(--text-muted);
  background: var(--surface-control);
  box-shadow: inset 0 0 0 1px var(--line);
}

.stat strong {
  color: var(--text);
  text-shadow: 0 8px 28px var(--primary-glow);
}

.stat-sep {
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}

/* ---------- 面板、筛选与侧栏 ---------- */
.sidebar-card,
.filterbar,
.loading-panel,
.rom-skel-card {
  background: var(--surface-panel) !important;
  border-color: var(--line) !important;
  box-shadow:
    0 14px 38px var(--shadow-color),
    inset 0 1px 0 var(--panel-highlight) !important;
}

.sidebar-title,
.filter-group label {
  color: var(--text-dim);
}

.brand-item::before {
  background: var(--grad-primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.brand-item:hover,
.brand-item.open {
  color: var(--text);
  background: rgba(var(--primary-rgb), 0.07);
}

.brand-item.active {
  color: var(--text);
  background: var(--grad-soft);
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.13),
    inset 0 1px 0 var(--panel-highlight);
}

.brand-item.active .brand-count {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.09);
}

.filter-group select,
.cs-trigger,
.view-toggle,
.v-search,
.auth-box input,
.accounts-box input,
.batch-tools input {
  color: var(--text);
  background: var(--surface-control) !important;
  border-color: var(--line-strong) !important;
  box-shadow: inset 0 1px 0 var(--panel-highlight);
}

.filter-group select:hover,
.cs-trigger:hover {
  border-color: rgba(var(--accent-rgb), 0.56) !important;
}

.filter-group select:focus,
.cs-select.open .cs-trigger,
.v-search:focus-within,
.auth-box input:focus,
.accounts-box input:focus {
  border-color: var(--accent) !important;
  box-shadow:
    0 0 0 3px rgba(var(--accent-rgb), 0.12),
    inset 0 1px 0 var(--panel-highlight) !important;
}

.cs-menu {
  background: var(--surface-elevated) !important;
  border-color: var(--line-strong) !important;
  box-shadow:
    0 24px 64px var(--shadow-color),
    inset 0 1px 0 var(--panel-highlight) !important;
}

.cs-option:hover {
  color: var(--text);
  background: rgba(var(--primary-rgb), 0.08);
}

.cs-option.active {
  color: var(--accent);
  background: var(--grad-soft);
}

.view-toggle {
  box-shadow:
    inset 0 1px 0 var(--panel-highlight),
    0 8px 24px var(--shadow-color);
}

.view-btn.active {
  color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 6px 18px var(--primary-glow);
}

/* ---------- 按钮 ---------- */
.btn-ghost {
  color: var(--text-muted);
  background: var(--surface-control) !important;
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 var(--panel-highlight);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-hover) !important;
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow:
    0 10px 28px var(--shadow-color),
    inset 0 1px 0 var(--panel-highlight);
}

.btn-primary,
.search-btn,
.v-latest-badge {
  color: #fff;
  background: var(--grad-primary) !important;
  box-shadow:
    0 10px 28px var(--primary-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover,
.search-btn:hover {
  box-shadow:
    0 14px 36px var(--primary-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* ---------- ROM 卡片 ---------- */
.rom-card {
  background: var(--surface-panel) !important;
  border-color: var(--line) !important;
  box-shadow:
    0 14px 36px var(--shadow-color),
    inset 0 1px 0 var(--panel-highlight) !important;
}

.rom-card::before {
  background: var(--grad-primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.rom-card::after {
  background:
    radial-gradient(
      440px 200px at var(--mx, 50%) var(--my, 0%),
      rgba(var(--accent-rgb), 0.105),
      transparent 70%
    ) !important;
}

.rom-card:hover {
  background: var(--surface-hover) !important;
  border-color: rgba(var(--accent-rgb), 0.5) !important;
  box-shadow:
    0 22px 54px var(--shadow-color),
    0 0 0 1px rgba(var(--accent-rgb), 0.08),
    inset 0 1px 0 var(--panel-highlight) !important;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .rom-grid:not(.list-view) .rom-card:hover {
    transform: translateY(-4px) !important;
  }

  .rom-grid.list-view .rom-card:hover {
    transform: translateY(-2px) !important;
  }
}

.rom-brand-tag {
  color: var(--accent);
  background: var(--grad-soft);
  border-color: rgba(var(--accent-rgb), 0.18);
  box-shadow: inset 0 1px 0 var(--panel-highlight);
}

.rom-version-count,
.rom-tag,
.v-region-chip {
  color: var(--text-muted);
  background: var(--surface-control);
  border-color: var(--line);
}

.rom-card:hover .rom-version-count {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.4);
}

.rom-device-name,
.results-count strong {
  color: var(--text);
}

.rom-rom-name strong,
.detail-rom,
.detail-link {
  color: var(--accent);
}

.rom-meta {
  border-top-color: var(--line);
}

.rom-meta-row svg {
  color: rgba(var(--accent-rgb), 0.62);
}

.rom-card-loading {
  color: var(--text);
  background: var(--overlay);
}

/* ---------- 弹窗、详情与版本列表 ---------- */
.modal-mask,
.auth-mask,
.slider-mask,
.captcha-mask,
.mini-dialog-mask {
  background: var(--overlay) !important;
}

.modal-box,
.auth-box,
.slider-box,
.accounts-box,
.security-box,
.mini-dialog-box,
.captcha-box,
.ban-box,
.toast {
  background: var(--surface-elevated) !important;
  border-color: var(--line-strong) !important;
  box-shadow:
    0 30px 84px var(--shadow-color),
    inset 0 1px 0 var(--panel-highlight) !important;
}

.modal-box::before,
.auth-box::before,
.slider-box::before {
  background:
    radial-gradient(420px 190px at 16% 0%, rgba(255, 255, 255, 0.09), transparent 68%),
    radial-gradient(360px 220px at 100% 12%, rgba(var(--accent-rgb), 0.1), transparent 72%);
  opacity: 0.9;
}

.detail-head {
  background:
    radial-gradient(520px 210px at 12% 0%, rgba(var(--primary-rgb), 0.18), transparent 72%),
    radial-gradient(440px 230px at 100% 18%, rgba(var(--accent-rgb), 0.09), transparent 74%),
    var(--bg-2) !important;
  border-bottom-color: var(--line);
}

.detail-body,
.v-list {
  background: var(--bg-3) !important;
}

.detail-meta-cell,
.v-item,
.v-link,
.detail-pwd-bar,
.v-region-tab {
  background: var(--surface-control) !important;
  border-color: var(--line) !important;
  box-shadow: inset 0 1px 0 var(--panel-highlight);
}

.v-item:hover,
.v-link:hover,
.v-region-tab:hover {
  color: var(--text);
  background: var(--surface-hover) !important;
  border-color: rgba(var(--accent-rgb), 0.45) !important;
  box-shadow:
    0 12px 30px var(--shadow-color),
    inset 0 1px 0 var(--panel-highlight);
}

.v-item.is-latest {
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.14), rgba(var(--accent-rgb), 0.065)),
    var(--bg-2) !important;
  border-color: rgba(var(--accent-rgb), 0.34) !important;
  box-shadow:
    inset 0 1px 0 var(--panel-highlight),
    0 0 0 1px rgba(var(--accent-rgb), 0.05);
}

.v-region-tab.is-active {
  color: #fff;
  background: var(--grad-primary) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.v-btn,
.modal-close,
.contact-copy {
  color: var(--text-muted);
  background: var(--surface-control);
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 var(--panel-highlight);
}

.v-btn:hover,
.contact-copy:hover {
  color: var(--accent);
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.modal-close:hover {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 8px 24px rgba(255, 101, 122, 0.25);
}

.toast.toast-success {
  border-color: rgba(53, 211, 154, 0.55) !important;
}

.toast.toast-error {
  border-color: rgba(255, 101, 122, 0.6) !important;
}

/* ---------- 页脚 ---------- */
.footer {
  background:
    linear-gradient(180deg, var(--bg-2), var(--bg)) !important;
  border-color: var(--line);
}

.footer-contact .contact-value {
  color: var(--text-muted);
  background: var(--surface-control);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 var(--panel-highlight);
}

.footer-contact .contact-value {
  color: var(--accent);
}

/* ============================================================
   紫晶液态玻璃 · 用户定向覆盖
   按钮保留紫蓝青渐变，其余视觉统一回归紫色。
   仅调整颜色、透明材质、模糊与阴影，不触碰布局。
   ============================================================ */

:root[data-theme="lavender"] {
  --bg: #0e0718;
  --bg-2: #160c25;
  --bg-3: #211335;
  --bg-card: rgba(34, 20, 55, 0.62);
  --bg-card-hover: rgba(52, 30, 82, 0.72);
  --line: rgba(209, 170, 255, 0.16);
  --line-strong: rgba(215, 182, 255, 0.34);
  --text: #fcf9ff;
  --text-muted: #cbb9e5;
  --text-dim: #957dad;
  --primary: #9d6cff;
  --accent: #bd8cff;
  --primary-rgb: 157, 108, 255;
  --accent-rgb: 189, 140, 255;
  --primary-glow: rgba(157, 108, 255, 0.36);
  --accent-glow: rgba(189, 140, 255, 0.26);
  --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #a96cf7 52%, #c084fc 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(192, 132, 252, 0.09));
  --grad-title: linear-gradient(110deg, #ffffff 3%, #eadcff 48%, #c995ff 100%);
  --button-grad: linear-gradient(135deg, #a277ff 0%, #747cf5 54%, #55d9e8 100%);
  --button-glow: rgba(116, 124, 245, 0.34);
  --surface-top:
    linear-gradient(180deg, rgba(31, 18, 51, 0.8), rgba(18, 10, 31, 0.68));
  --surface-panel:
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.018) 54%),
    rgba(34, 20, 55, 0.58);
  --surface-elevated:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.022) 58%),
    rgba(43, 25, 68, 0.66);
  --surface-control:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.014)),
    rgba(24, 13, 41, 0.58);
  --surface-hover:
    linear-gradient(145deg, rgba(157, 108, 255, 0.18), rgba(192, 132, 252, 0.06)),
    rgba(52, 30, 82, 0.66);
  --panel-highlight: rgba(255, 255, 255, 0.14);
  --ambient-a: rgba(139, 92, 246, 0.3);
  --ambient-b: rgba(192, 132, 252, 0.22);
  --shadow-color: rgba(7, 2, 14, 0.42);
  --overlay: rgba(9, 3, 18, 0.72);
}

/* 按钮继续使用原有的紫蓝青渐变，与全紫玻璃表面形成层级。 */
:root[data-theme="lavender"] .btn-primary,
:root[data-theme="lavender"] .search-btn,
:root[data-theme="lavender"] .view-btn.active,
:root[data-theme="lavender"] .v-region-tab.is-active,
:root[data-theme="lavender"] .v-btn-dl:hover {
  color: #fff;
  background: var(--button-grad) !important;
  box-shadow:
    0 12px 32px var(--button-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
}

:root[data-theme="lavender"] .btn-primary:hover,
:root[data-theme="lavender"] .search-btn:hover {
  box-shadow:
    0 16px 40px var(--button-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.34) !important;
}

/* 环境光只保留紫罗兰与紫晶色，不再出现青色氛围。 */
:root[data-theme="lavender"] body {
  background-image:
    radial-gradient(1100px 720px at 78% -14%, rgba(192, 132, 252, 0.2), transparent 64%),
    radial-gradient(920px 660px at -10% 22%, rgba(139, 92, 246, 0.28), transparent 66%),
    linear-gradient(180deg, var(--bg), var(--bg)) !important;
}

:root[data-theme="lavender"] body::before {
  background:
    radial-gradient(circle at 16% 20%, rgba(139, 92, 246, 0.36), transparent 29%),
    radial-gradient(circle at 80% 8%, rgba(192, 132, 252, 0.27), transparent 31%),
    radial-gradient(circle at 54% 72%, rgba(168, 85, 247, 0.18), transparent 26%) !important;
  background-size: auto !important;
  opacity: 0.9 !important;
}

:root[data-theme="lavender"] .hero-glow {
  background:
    radial-gradient(700px 360px at 24% 58%, rgba(139, 92, 246, 0.3), transparent 64%),
    radial-gradient(660px 340px at 74% 32%, rgba(192, 132, 252, 0.23), transparent 66%) !important;
  opacity: 0.94;
}

/* 主要玻璃表面：更透明、更高饱和折射、更明显的顶部高光。 */
:root[data-theme="lavender"] .topbar {
  backdrop-filter: saturate(190%) blur(28px) !important;
  -webkit-backdrop-filter: saturate(190%) blur(28px) !important;
}

:root[data-theme="lavender"] .searchbar,
:root[data-theme="lavender"] .sidebar-card,
:root[data-theme="lavender"] .filterbar,
:root[data-theme="lavender"] .rom-card,
:root[data-theme="lavender"] .loading-panel,
:root[data-theme="lavender"] .view-toggle,
:root[data-theme="lavender"] .cs-menu {
  backdrop-filter: saturate(185%) blur(24px) !important;
  -webkit-backdrop-filter: saturate(185%) blur(24px) !important;
  border-color: rgba(215, 182, 255, 0.28) !important;
  box-shadow:
    0 18px 52px rgba(7, 2, 14, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(139, 92, 246, 0.08) !important;
}

:root[data-theme="lavender"] .modal-box,
:root[data-theme="lavender"] #detailModal .modal-box,
:root[data-theme="lavender"] .auth-box,
:root[data-theme="lavender"] .slider-box,
:root[data-theme="lavender"] .accounts-box,
:root[data-theme="lavender"] .security-box,
:root[data-theme="lavender"] .mini-dialog-box,
:root[data-theme="lavender"] .captcha-box,
:root[data-theme="lavender"] .toast,
:root[data-theme="lavender"] .account-menu button {
  backdrop-filter: saturate(195%) blur(30px) !important;
  -webkit-backdrop-filter: saturate(195%) blur(30px) !important;
  border-color: rgba(222, 193, 255, 0.34) !important;
  box-shadow:
    0 34px 90px rgba(7, 2, 14, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(139, 92, 246, 0.1) !important;
}

:root[data-theme="lavender"] .detail-meta-cell,
:root[data-theme="lavender"] .v-item,
:root[data-theme="lavender"] .v-link,
:root[data-theme="lavender"] .detail-pwd-bar,
:root[data-theme="lavender"] .v-region-tab {
  backdrop-filter: saturate(175%) blur(18px) !important;
  -webkit-backdrop-filter: saturate(175%) blur(18px) !important;
}

/* 语义状态色继续保留；普通装饰、高亮与信息态统一为紫色。 */
:root[data-theme="lavender"] .auth-feedback.is-info,
:root[data-theme="lavender"] .brand-item-brand.open {
  color: var(--accent);
  background: rgba(157, 108, 255, 0.1);
  border-color: rgba(189, 140, 255, 0.3);
}

:root[data-theme="lavender"] .rom-card::after {
  background:
    radial-gradient(
      460px 210px at var(--mx, 50%) var(--my, 0%),
      rgba(192, 132, 252, 0.16),
      transparent 70%
    ) !important;
}

/* 触屏设备降低模糊半径，保留玻璃层次同时避免滚动掉帧。 */
@media (max-width: 720px), (pointer: coarse) {
  :root[data-theme="lavender"] .topbar,
  :root[data-theme="lavender"] .searchbar,
  :root[data-theme="lavender"] .sidebar-card,
  :root[data-theme="lavender"] .filterbar,
  :root[data-theme="lavender"] .rom-card,
  :root[data-theme="lavender"] .view-toggle,
  :root[data-theme="lavender"] .cs-menu,
  :root[data-theme="lavender"] .modal-box,
  :root[data-theme="lavender"] #detailModal .modal-box,
  :root[data-theme="lavender"] .auth-box,
  :root[data-theme="lavender"] .toast {
    backdrop-filter: saturate(165%) blur(14px) !important;
    -webkit-backdrop-filter: saturate(165%) blur(14px) !important;
  }
}

/* ============================================================
   连续环境光 + 机型详情抽屉流畅度修复
   ============================================================ */

/* Hero 自身的光效在底部先完全淡出，再由页面级环境光自然承接。
   这样即使 Hero 保持 overflow:hidden，边界也不会再形成水平色块断层。 */
:root[data-theme="lavender"] .hero::before {
  background: transparent !important;
  opacity: 0 !important;
}

:root[data-theme="lavender"] .hero-glow {
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 46%,
    rgba(0, 0, 0, 0.78) 66%,
    rgba(0, 0, 0, 0.28) 84%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 46%,
    rgba(0, 0, 0, 0.78) 66%,
    rgba(0, 0, 0, 0.28) 84%,
    transparent 100%
  );
}

/* 抽屉移动阶段只合成 transform；重毛玻璃在静止后恢复，
   避免大面积 backdrop-filter 跟随面板逐帧重绘。 */
#detailModal {
  animation: none !important;
}

#detailModal .modal-box {
  animation: none !important;
  transform: translate3d(0, calc(100% + 28px), 0) !important;
  transform-origin: center bottom !important;
  transition: transform 0.44s cubic-bezier(.22, 1, .36, 1) !important;
  will-change: transform !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#detailModal.is-open .modal-box {
  transform: translate3d(0, 0, 0) !important;
}

#detailModal.is-settled .modal-box {
  backdrop-filter: saturate(185%) blur(22px) !important;
  -webkit-backdrop-filter: saturate(185%) blur(22px) !important;
}

#detailModal.is-closing .modal-box {
  transform: translate3d(0, calc(100% + 28px), 0) !important;
  transition: transform 0.34s cubic-bezier(.4, 0, .6, 1) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#detailModal .modal-mask {
  animation: none !important;
  opacity: 0 !important;
  transition: opacity 0.3s cubic-bezier(.2, .8, .2, 1) !important;
  will-change: opacity !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#detailModal.is-open .modal-mask {
  opacity: 1 !important;
}

#detailModal.is-closing .modal-mask {
  opacity: 0 !important;
  transition-duration: 0.26s !important;
}

/* 上方紫晶玻璃规则特异性更高；显式覆盖，确保抽屉移动时真的关闭重模糊。
   内部版本卡片的 blur 在不透明详情底色上没有视觉收益，却会随父层移动逐帧重绘。 */
:root[data-theme="lavender"] #detailModal:not(.is-settled) .modal-box,
:root[data-theme="lavender"] #detailModal.is-closing .modal-box {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

:root[data-theme="lavender"] #detailModal.is-settled:not(.is-closing) .modal-box {
  backdrop-filter: saturate(185%) blur(22px) !important;
  -webkit-backdrop-filter: saturate(185%) blur(22px) !important;
}

#detailModal .detail-meta-cell,
#detailModal .v-item,
#detailModal .v-link,
#detailModal .detail-pwd-bar,
#detailModal .v-region-tab {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@media (max-width: 720px), (pointer: coarse) {
  :root[data-theme="lavender"] #detailModal.is-settled:not(.is-closing) .modal-box {
    backdrop-filter: saturate(160%) blur(10px) !important;
    -webkit-backdrop-filter: saturate(160%) blur(10px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #detailModal .modal-box,
  #detailModal .modal-mask {
    transition: none !important;
  }
}

}

/* ============================================================
   安全态势 · 唯一权威样式
   ------------------------------------------------------------
   上文曾有五段「最终覆盖」轮流改这块的尺寸（920 / 1180 宽、胶囊 / 方角统计卡互相 !important），
   已全部删掉：安全态势的布局、尺寸、动效只认这一段，颜色一律取主题令牌。
   结构见 app.js renderSecurityOverview：吸顶头部 → 风险 KPI → 访问 / ROM 请求趋势 →
   处置表（封禁账号、IP 封禁、风险 IP、锁定账号）→ 登录审计、审计日志 → 用量。
   ============================================================ */
.security-box {
  width: min(1120px, calc(100vw - 48px));
  max-height: min(900px, calc(100dvh - 48px));
  padding: 0 22px 22px;
  border-radius: 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* 吸顶头部：负边距铺满弹窗内边距，滚动后才上底色和分隔线，顶部时与弹窗背景融为一体 */
.security-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -22px 8px;
  padding: 18px 22px 14px;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.security-box.is-scrolled .security-head {
  background: var(--bg-3);
  box-shadow: 0 1px 0 var(--line-strong);
}
.security-title { flex: 1 1 auto; min-width: 0; }
.security-title h3 { margin: 0 0 3px; font-size: 20px; line-height: 1.25; }
.security-title p { margin: 0; color: var(--text-muted); font-size: 12.5px; }
#securityUpdated { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.security-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.security-box.is-refreshing .sec-refresh svg { animation: spinnerRotate .8s linear infinite; }
.sec-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  transition: color .18s ease, background-color .18s ease;
}
.sec-close:hover { color: var(--text); background: color-mix(in srgb, var(--text) 9%, transparent); }

/* 刷新时保留旧数据、只压暗正文，数据回来原地替换（不再闪成「正在读取…」再重排） */
.security-body { transition: opacity .2s ease; }
.security-box.is-refreshing .security-body[data-loaded="1"] { opacity: .55; pointer-events: none; }
.security-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.security-layout > .is-wide { grid-column: 1 / -1; }
.security-error {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 40px 16px;
  color: var(--danger);
  text-align: center;
}
.security-error p { margin: 0; color: inherit; }

/* ---------- 风险 KPI：有数时按色调着色，为 0 时退成中性灰；点击跳到对应表 ---------- */
.sec-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.sec-kpi {
  --tone: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px 13px;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, var(--line));
  border-radius: 20px;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--tone) 13%, transparent), transparent 64%),
    var(--bg-2);
  color: var(--text);
  text-align: left;
  transition: transform .25s var(--mo-ease), border-color .25s ease, box-shadow .25s ease;
}
.sec-kpi.tone-danger { --tone: var(--danger); }
.sec-kpi.tone-warn { --tone: var(--warning); }
.sec-kpi.is-calm { --tone: var(--text-dim); }
.sec-kpi:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tone) 60%, transparent);
  box-shadow: 0 12px 26px -16px color-mix(in srgb, var(--tone) 80%, transparent);
}
.sec-kpi:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }
.sec-kpi-label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
}
.sec-kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.sec-kpi:not(.is-calm) .sec-kpi-value { color: var(--tone); }
.sec-kpi-hint {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- 分区 ---------- */
.sec-section {
  min-width: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
}
.sec-section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-height: 26px;
  margin-bottom: 12px;
}
.sec-section-head h4 { margin: 0; color: var(--text); font-size: 14.5px; font-weight: 800; }
.sec-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sec-count.tone-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.sec-count.tone-warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.sec-meta { margin-left: auto; color: var(--text-dim); font-size: 12px; }

/* ---------- 访问 / ROM 请求：数字格 + 七日柱 ----------
   六列轨道：默认两格一行（ROM 四项 = 2 × 2）；五项时（访问区）前三格各占两列，排成 3 + 2。
   并排的两块都是两行，下面的七日柱才对得齐；一行塞五格会把六位数挤出格子 */
.sec-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.sec-stat {
  grid-column: span 3;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.sec-stats[data-n="5"] > .sec-stat:nth-child(-n+3) { grid-column: span 2; }
.sec-stat em {
  display: block;
  overflow: hidden;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sec-stat strong {
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---------- 分档切换（今日 / 近 7 天）----------
   分段控件 + 各档面板。面板全部留在 DOM 里靠 is-active 显隐：
   切回来时数字不重新播动画，也省一次重渲染。
   隐藏档用 display:none（不是 visibility/opacity），否则隐藏的表格仍占高度、
   底下那条七日柱会被推下去，切换时整块跳一下 */
.sec-switch-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.sec-switch-btn {
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.sec-switch-btn:hover { color: var(--text); }
.sec-switch-btn.is-active {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}
.sec-switch-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sec-switch-pane { display: none; }
.sec-switch-pane.is-active { display: block; }

/* ---------- 名次徽标 ---------- */
.sec-rank {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.sec-rank.is-gold { background: color-mix(in srgb, #e8b64c 22%, transparent); color: #e8b64c; }
.sec-rank.is-silver { background: color-mix(in srgb, #b9c2cf 22%, transparent); color: #b9c2cf; }
.sec-rank.is-bronze { background: color-mix(in srgb, #c98a5b 22%, transparent); color: #c98a5b; }

.sec-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  height: 128px;
  margin-top: 14px;
  padding-top: 18px;
}
.sec-bar { display: flex; flex-direction: column; min-width: 0; }
.sec-bar-track { position: relative; flex: 1 1 auto; }
.sec-bar i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 28px);
  height: var(--h);
  margin: 0 auto;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 62%, transparent), color-mix(in srgb, var(--accent) 18%, transparent));
  transform-origin: 50% 100%;
  transition: filter .2s ease;
}
.sec-bar.is-today i { background: var(--grad-primary); }
.sec-bar:hover i { filter: brightness(1.18) saturate(1.1); }
.sec-bar b {
  position: absolute;
  left: 50%;
  bottom: calc(var(--h) + 4px);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translate(-50%, 3px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.sec-bar:hover b,
.sec-bar.is-today b { opacity: 1; transform: translate(-50%, 0); }
.sec-bar em {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-style: normal;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sec-bar.is-today em { color: var(--accent); font-weight: 700; }

/* ---------- 表格：行线画在行顶，折叠掉的行不会在可见末行下面多留一道线 ---------- */
.sec-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-3);
}
.sec-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.sec-table th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.sec-table td {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
  vertical-align: middle;
  transition: background-color .16s ease;
}
.sec-table tbody tr:first-child td { border-top: 0; }
.sec-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sec-table .is-wrap { min-width: 160px; white-space: normal; line-height: 1.45; }
.sec-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.sec-table .is-ops { width: 1%; }
.sec-table .sec-empty-row td { padding: 22px 12px; color: var(--text-dim); text-align: center; white-space: normal; }
.sec-table .sec-empty-row:hover td { background: none; }
.sec-table-wrap.is-collapsed .sec-row-more { display: none; }
.sec-more {
  display: block;
  margin: 10px auto 0;
  padding: 6px 16px;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  transition: color .18s ease, border-color .18s ease;
}
.sec-more:hover { color: var(--accent); border-color: var(--accent); }

.ip-pill,
.mode-pill,
.sec-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
button.ip-pill {
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: color .18s ease, border-color .18s ease;
}
button.ip-pill:hover { color: var(--accent); border-color: var(--accent); }
.mode-soft,
.sec-pill.tone-warn {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 42%, transparent);
  background: color-mix(in srgb, var(--warning) 11%, transparent);
}
.mode-hard,
.sec-pill.tone-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, transparent);
  background: color-mix(in srgb, var(--danger) 11%, transparent);
}
.sec-pill.tone-ok {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 42%, transparent);
  background: color-mix(in srgb, var(--success) 11%, transparent);
}
.sec-pill.tone-muted { color: var(--text-muted); }
.sec-pill-sub { margin-left: 5px; opacity: .72; }
.sec-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
/* 账号名同样是标识符，折行会变成一列竖字（与 .sec-actor 同一根因） */
.sec-user {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  overflow-wrap: normal;
}
.sec-action { font-weight: 600; }
.sec-target {
  display: inline-block;
  max-width: 180px;
  margin-left: 6px;
  padding: 1px 8px;
  overflow: hidden;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text-muted);
  font-size: 11.5px;
  vertical-align: middle;
  text-overflow: ellipsis;
  /* 截断而非折行：它跟在同一行的动作文字后面，折行会把动作挤成两段 */
  white-space: nowrap;
  overflow-wrap: normal;
}
/* 来源列 = 操作账号 + IP 胶囊，两者都必须整块显示：
   actor 是账号名（ROMh8vOu0 这类），折行会变成一列竖着的单字；IP 折行则读不出。
   移动端卡片化把 .sec-table td 统一设成 white-space: normal + overflow-wrap: anywhere，
   会覆盖这里的 nowrap——所以下面 .sec-source / .sec-actor 的 nowrap 必须在媒体查询里
   再声明一次，见「移动端表格改排成卡片」段落。 */
.sec-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sec-actor {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* IP 胶囊不参与压缩：flex 默认会把它压扁，导致长 IP 折行 */
.sec-source .ip-pill { flex: 0 0 auto; }
.sec-ops { display: inline-flex; align-items: center; gap: 6px; }
.sec-ops .btn-sm { height: 26px; padding: 0 11px; font-size: 12px; }
.sec-ops .btn.is-danger:hover { color: var(--danger); border-color: var(--danger); }
.sec-remain { display: inline-flex; flex-direction: column; gap: 4px; min-width: 72px; }
.sec-remain-bar {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}
.sec-remain-bar i { display: block; height: 100%; border-radius: inherit; background: var(--danger); }
.sec-remain.tone-warn .sec-remain-bar i { background: var(--warning); }
.sec-share {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 110px;
  padding: 2px 8px;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
  isolation: isolate;
}
.sec-share::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: var(--p);
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ---------- 首次加载骨架 ---------- */
.sec-skel {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 20px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.sec-skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 26%, color-mix(in srgb, var(--text) 8%, transparent) 50%, transparent 74%);
  transform: translateX(-100%);
  animation: romSkelShimmer 1.25s ease-in-out infinite;
}
.sec-skel-kpi { height: 92px; }
.sec-skel-panel { height: 368px; border-radius: 22px; }
.sec-skel-table { height: 280px; border-radius: 22px; }

/* ---------- 动效：只在首次打开时错峰入场；刷新原地替换不重播。
   填充模式用 backwards：动画结束即交还样式，KPI 卡的悬停上浮才不会被终帧钉住 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .security-layout.is-entering .sec-kpi,
  .security-layout.is-entering > .sec-section {
    animation: secRise .5s var(--mo-ease) backwards;
    animation-delay: calc(var(--i, 0) * 40ms);
  }
  .security-layout.is-entering .sec-bar i {
    animation: secBarGrow .7s var(--mo-ease) backwards;
    animation-delay: calc(260ms + var(--i, 0) * 45ms);
  }
  .sec-section.is-flash { animation: secFlash 1.1s ease; }
  .sec-table-wrap.is-revealing .sec-row-more { animation: secRise .32s var(--mo-ease) backwards; }
  .sec-table tr.is-leaving td { animation: secRowOut .28s ease forwards; }
}
@keyframes secRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes secBarGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes secFlash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
}
@keyframes secRowOut { to { opacity: 0; transform: translateX(14px); } }

@media (max-width: 1000px) {
  .security-layout { grid-template-columns: minmax(0, 1fr); }
  /* 5 张 KPI 排成 3 + 2：六列轨道，第二行两张各占一半，不留空位 */
  .sec-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sec-kpi { grid-column: span 2; }
  .sec-kpi:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 720px) {
  .security-box {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 0 12px 14px;
    border-radius: 24px;
  }
  .security-head { margin: 0 -12px 6px; padding: 14px 12px 12px; gap: 8px; }
  .security-title h3 { font-size: 18px; }
  .security-desc { display: none; }
  .sec-refresh { width: 34px; height: 34px; padding: 0; }
  .sec-refresh span { display: none; }
  .security-layout { gap: 12px; }
  .sec-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sec-kpi,
  .sec-kpi:nth-child(n+4) { grid-column: auto; }
  .sec-kpis > .sec-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .sec-kpi { padding: 12px 14px; border-radius: 18px; }
  .sec-kpi-value { font-size: 24px; }
  .sec-section { padding: 14px 12px; border-radius: 20px; }
  .sec-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec-stats > .sec-stat,
  .sec-stats[data-n="5"] > .sec-stat:nth-child(-n+3) { grid-column: auto; }
  .sec-stats > .sec-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .sec-meta { flex-basis: 100%; margin-left: 0; }
  /* 表格改排成卡片：一行一张卡，两列网格，每格上面是列名（td 的 data-label）下面是值；
     长文本列和操作栏占满整行。免去横向滚动，也比一格一行省一半高度 */
  .sec-table-wrap { overflow: visible; border: 0; border-radius: 0; background: none; }
  .sec-table,
  .sec-table tbody { display: block; width: 100%; }
  .sec-table thead { display: none; }
  .sec-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg-3);
  }
  .sec-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .sec-table td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: 11px;
  }
  .sec-table .is-num { text-align: left; }
  .sec-table .is-wrap { grid-column: 1 / -1; min-width: 0; }
  .sec-table tbody tr td.is-ops {
    grid-column: 1 / -1;
    width: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
  }
  .sec-table .is-ops::before { content: none; }
  .sec-table .is-ops .sec-ops { width: 100%; justify-content: flex-end; }
  .sec-table .sec-empty-row td { grid-column: 1 / -1; align-items: center; }
  .sec-table .sec-empty-row td::before { content: none; }
  .sec-table tbody tr:hover td { background: none; }
  /* 来源列（账号 + IP）整块显示：td 的 white-space:normal / overflow-wrap:anywhere
     会把 .sec-actor / .ip-pill 折成逐字竖排（ROMh8vOu0 → ROMh / 8vOu0）。
     来源是标识符不是句子，折行既不美观也读不出来，故在卡片布局里恢复不折行。
     actor 过长时用省略号收尾，而不是撑破卡片或换行。 */
  .sec-source { white-space: nowrap; }
  .sec-source .sec-actor {
    white-space: nowrap;
    overflow-wrap: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sec-source .ip-pill {
    white-space: nowrap;
    overflow-wrap: normal;
  }
  /* 卡片比表格行高得多，折叠时只留 5 张（按钮文案「展开全部 N 条」不受影响） */
  .sec-table-wrap.is-collapsed tbody tr:nth-child(n+6) { display: none; }

  /* 名次徽标与账号同一格并排：独立成列会被同列的「本月」数值撑宽，
     窄屏下白占半行、账号被挤到下一行。这里只做横向对齐，不涉列宽计算。 */
  .sec-rank-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  /* 分档切换：窄屏下两档按钮均分整行，点按区域更大 */
  .sec-switch-tabs {
    display: flex;
    width: 100%;
    margin-bottom: 8px;
  }
  .sec-switch-btn { flex: 1; text-align: center; }
}

/* ============================================================
   主题层 · 颜色唯一出口
   ------------------------------------------------------------
   上文历史叠加的多套「最终覆盖」写死了深色阴影、深色遮罩、青色描边与标签色，
   浅色和非蓝色主题会被带偏（浅底一圈黑影、青字看不清、玫瑰主题里冒出青边）。
   这里只接管颜色 / 阴影 / 遮罩并全部取文件头的主题令牌，不碰布局与动效。
   必须留在文件最末：靠 !important + 靠后位置压过上文同级规则。
   ============================================================ */

/* ---------- 页面 ---------- */
body {
  background-color: var(--bg) !important;
  background-image:
    radial-gradient(1180px 760px at 78% -10%, var(--ambient-b), transparent 64%),
    radial-gradient(1000px 700px at -8% 22%, var(--ambient-a), transparent 66%) !important;
}
body::before {
  background:
    radial-gradient(circle at 18% 26%, var(--ambient-a), transparent 20vmax),
    radial-gradient(circle at 76% 16%, var(--ambient-b), transparent 22vmax) !important;
}
::selection { color: var(--on-primary); background: rgba(var(--primary-rgb), 0.8); }
::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), 0.24); }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--primary-rgb), 0.42); }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--topbar-bg) !important;
  border-bottom-color: var(--line) !important;
  box-shadow: var(--shadow-topbar) !important;
}
/* 丝绸背景亮起来以后顶栏整条不着色：--topbar-bg 那 0.86–0.9 的不透明度，在流光上就是一条
   界线分明的色带（浅色主题一条白带、深色主题一条黑带），侧栏与卡片当初按 silk-on 调过透明度，
   顶栏漏了。留一点半透明也还是「一层」——横在背景上的那道下边线与投影才是分层感的来源，
   所以底色、边线、投影一起去掉，只剩图标与按钮浮在丝绸上。
   模糊也一并写死为 none：上文有几条想给顶栏挂 backdrop-filter 的规则（都没带 !important、
   早被 .topbar{backdrop-filter:none!important} 压着），万一哪天有人给它们补上 !important，
   底色透明而模糊还在，顶栏就成了一块糊掉的丝绸贴在清晰的丝绸上，边界反而更显眼。
   WebGL 不可用时没有 .silk-on，顶栏保持上面那条实色，滚动时照旧压得住内容。 */
html.silk-on .topbar {
  background: transparent !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 顶栏透明之后，.hero 的顶边成了画面上唯一一道通栏横线：.hero 是 overflow:hidden 的，
   贴着它铺满的 .hero-glow 被齐边切掉，光晕在这一行从满强度直接跌到 0，肉眼看到的就是
   「顶栏那一条」与下面颜色不一样。遮罩原来只渐出底边，这里补一段顶部渐入，光晕从顶栏
   下沿慢慢起来，缝就没有了。只在 silk-on 下改：没有丝绸时顶栏是实色的，压根看不到这条边。 */
html.silk-on .hero-glow {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 46%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 46%, transparent 100%);
}
.brand-logo { box-shadow: 0 0 0 1px var(--line); }

/* ---------- 按钮与徽标上的文字 ---------- */
.btn-primary,
.search-btn,
.view-btn.active,
.v-latest-badge,
.v-btn-dl:hover,
.v-region-tab.is-active,
.v-region-tab.is-active em {
  color: var(--on-primary) !important;
}

/* ---------- 面板 ---------- */
.sidebar-card,
.filterbar,
.rom-card,
.view-toggle,
.loading-panel {
  border-color: var(--line) !important;
}
.sidebar-card,
.filterbar,
.rom-card,
.loading-panel {
  box-shadow: var(--shadow-card) !important;
}
html.silk-on .sidebar-card,
html.silk-on .filterbar,
html.silk-on .rom-card,
html.silk-on .view-toggle {
  background:
    linear-gradient(145deg, var(--sheen), transparent 62%),
    color-mix(in srgb, var(--bg-3) 88%, transparent) !important;
}
html.silk-on .rom-card:hover { background: var(--bg-card-hover) !important; }
.rom-card:hover {
  border-color: rgba(var(--accent-rgb), 0.5) !important;
  box-shadow: var(--shadow-card-hover) !important;
}
.rom-card::after {
  background: radial-gradient(420px 180px at var(--mx, 50%) var(--my, 0%), rgba(var(--accent-rgb), 0.1), transparent 70%) !important;
}
.rom-card:hover .rom-version-count { background: rgba(var(--accent-rgb), 0.1); }
.rom-card-loading,
[data-theme] .rom-card-loading {
  background: color-mix(in srgb, var(--bg-3) 78%, transparent);
}

/* ---------- 侧栏 / 筛选 / 下拉 ---------- */
.brand-item:hover { background: rgba(var(--primary-rgb), 0.08); }
.brand-item.active { background: var(--grad-soft); }
.brand-item-brand.open { background: rgba(var(--accent-rgb), 0.05); }
.brand-item.active .brand-count,
.brand-item.is-loading .brand-count { border-color: rgba(var(--accent-rgb), 0.26); background: rgba(var(--accent-rgb), 0.14); }
.cs-menu {
  background: var(--bg-3) !important;
  border-color: var(--line-strong) !important;
  box-shadow: var(--shadow-2) !important;
}
.cs-option.active { background: var(--grad-soft); }

/* ---------- 标签 ---------- */
.v-tag-fb,
.rom-type-tag.tag-official {
  color: var(--hue-blue);
  border-color: color-mix(in srgb, var(--hue-blue) 40%, transparent);
  background: color-mix(in srgb, var(--hue-blue) 9%, transparent);
}
.v-tag-rc,
.rom-type-tag.tag-recovery {
  color: var(--hue-orange);
  border-color: color-mix(in srgb, var(--hue-orange) 40%, transparent);
  background: color-mix(in srgb, var(--hue-orange) 9%, transparent);
}
.rom-type-tag.tag-custom {
  color: var(--hue-violet);
  border-color: color-mix(in srgb, var(--hue-violet) 40%, transparent);
  background: color-mix(in srgb, var(--hue-violet) 9%, transparent);
}
.rom-type-tag.tag-kernel {
  color: var(--hue-green);
  border-color: color-mix(in srgb, var(--hue-green) 40%, transparent);
  background: color-mix(in srgb, var(--hue-green) 9%, transparent);
}
.v-refresh-badge {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 38%, transparent);
  background: color-mix(in srgb, var(--warning) 14%, transparent);
}

/* ---------- 遮罩与弹窗 ---------- */
.modal-mask,
.auth-mask,
.slider-mask,
.captcha-mask,
.mini-dialog-mask {
  background: var(--mask) !important;
}
.modal-box,
.auth-box,
.slider-box,
.accounts-box,
.security-box,
.mini-dialog-box {
  background:
    linear-gradient(145deg, var(--sheen), transparent 58%),
    var(--bg-3) !important;
  box-shadow: var(--shadow-pop) !important;
}
.toast { background: var(--bg-3) !important; }

/* ---------- 机型详情 ---------- */
.detail-head {
  background: var(--grad-head) !important;
  border-bottom-color: var(--line) !important;
}
/* 四个参数胶囊（品牌 / 系列 / 地区 / 版本数）压在有颜色的头图上，底色却是实心 --bg-2：
   深色主题下是四块近乎纯黑的洞，浅色主题下是四块白斑，比头图本身抢眼。改成半透明，
   让头图的渐变从胶囊底下透过去，它们就只是头图上颜色略深的一块，不再是另一层。 */
.detail-meta-cell {
  background:
    linear-gradient(145deg, var(--sheen), transparent 60%),
    color-mix(in srgb, var(--bg-2) 42%, transparent) !important;
  border-color: var(--line) !important;
}
.v-link { background: color-mix(in srgb, var(--bg-3) 60%, var(--bg-2)) !important; }
.v-link:hover,
.v-item:hover { background: var(--bg-card-hover) !important; }
.v-item.is-latest {
  border-color: rgba(var(--accent-rgb), 0.45) !important;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--accent-rgb), 0.05)),
    var(--bg-2) !important;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.1) !important;
}

/* ---------- 登录 / 验证 ---------- */
.auth-link { color: var(--link); }
.auth-link:hover { color: var(--accent); text-shadow: none; }
.auth-box input { background: var(--field-bg); }
#loginPass,
#loginPass:-webkit-autofill {
  background-color: var(--field-bg) !important;
}
.auth-box input:-webkit-autofill,
.auth-box input:-webkit-autofill:hover,
.auth-box input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px var(--bg-3) inset, 0 0 0 3px var(--accent-glow);
}
.auth-feedback.is-info {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.07);
}
.captcha-fill { background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.18), rgba(var(--accent-rgb), 0.24)); }
.accounts-add { background: rgba(var(--primary-rgb), 0.05); }
.accounts-box { scrollbar-color: rgba(var(--accent-rgb), 0.5) transparent; }
.accounts-box::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb), 0.4)); }

/* ---------- 顶栏主题 / 下载器面板（app.js 动态挂到 body） ---------- */
.topbar-menu {
  position: fixed;
  z-index: 10002;
  width: max-content;
  max-width: calc(100vw - 20px);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg-3);
  box-shadow: var(--shadow-pop);
  transform-origin: center top;
  animation: themeMenuIn 0.2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes themeMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.theme-menu-group {
  padding: 8px 10px 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.topbar-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}
.topbar-menu-item:hover,
.topbar-menu-item:focus-visible {
  outline: none;
  background: rgba(var(--primary-rgb), 0.1);
}
.theme-opt.is-active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}
.theme-swatch {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sw-bg);
  box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.35);
}
.theme-swatch::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-a), var(--sw-b));
}
.theme-opt-check {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.16s ease;
}
.theme-opt.is-active .theme-opt-check { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .topbar-menu { animation: none; }
}
