/* =====================================================
   AURORA DECK · 极光指令台 — AuraKernel Admin v3
   -----------------------------------------------------
   设计契约：
   THESIS    — 打开后台像走进极光引擎舱：深空基底 + 流动极光
              + 玻璃数据面板 + 等宽数据语言，交互皆有物理反馈
   STORY     — 页面是活的：极光在背景流动、数字滚动进位、
              Tab 滑块跟随点击、按钮泛起水波、状态灯呼吸
   COLOR     — 浅色（日间纸白）· 深色（极光夜航）· 品牌极光紫→青
   MOTION    — 零依赖动效引擎（CSS + Vanilla JS）：
              入场级联 / 数字滚动 / Tab 滑块 / 水波反馈 / 实时时钟
              全部遵循 prefers-reduced-motion
   ===================================================== */

/* ================= 浅色主题（默认 · 日间纸白） ================= */
:root {
  /* 品牌 */
  --primary: #7c5cff;
  --primary-dark: #5b3df5;
  --primary-light: #a78bfa;
  --primary-subtle: rgba(124, 92, 255, 0.08);
  --primary-glow: rgba(124, 92, 255, 0.45);
  --brand-grad: linear-gradient(120deg, #7c5cff 0%, #4f9df7 55%, #22d3ee 100%);
  --brand-text: linear-gradient(120deg, #6d4dff, #2db6e0);

  /* 状态 */
  --success: #0fa968;
  --success-subtle: rgba(15, 169, 104, 0.10);
  --danger: #e5484d;
  --danger-subtle: rgba(229, 72, 77, 0.10);
  --warning: #e8940a;
  --warning-subtle: rgba(232, 148, 10, 0.10);
  --info: #3b82f6;

  /* 中性 */
  --bg: #f4f6fc;
  --card-bg: #ffffff;
  --card-border: #e7e9f4;
  --text: #1b1e35;
  --text-secondary: #5a607a;
  --text-muted: #6d7490;
  --border: #e7e9f4;
  --divider: #eef0f8;
  --input-bg: #ffffff;
  --hover-bg: #fafbfe;
  --mono-bg: rgba(124, 92, 255, 0.06);
  --shadow-color: rgba(27, 30, 53, 0.05);

  /* 阴影（带偏移 + 柔化） */
  --shadow-xs: 0 1px 2px var(--shadow-color);
  --shadow-sm: 0 1px 2px var(--shadow-color), 0 4px 12px -6px rgba(27, 30, 53, 0.08);
  --shadow: 0 1px 2px var(--shadow-color), 0 14px 32px -16px rgba(27, 30, 53, 0.14);
  --shadow-md: 0 2px 4px var(--shadow-color), 0 18px 40px -18px rgba(27, 30, 53, 0.18);
  --shadow-lg: 0 2px 4px var(--shadow-color), 0 24px 48px -20px rgba(27, 30, 53, 0.22);
  --shadow-xl: 0 4px 8px var(--shadow-color), 0 32px 64px -24px rgba(27, 30, 53, 0.28);
  --shadow-glow: 0 8px 24px -8px var(--primary-glow), 0 4px 8px var(--shadow-color);

  /* 圆角 */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* 字体 */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'HarmonyOS Sans SC', 'MiSans', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* 过渡 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fast: 150ms;
  --normal: 220ms;
  --slow: 400ms;

  /* 玻璃（顶栏/悬浮层） */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-bg-strong: rgba(255, 255, 255, 0.94);
  --glass-border: #e7e9f4;
  --glass-shadow: var(--shadow-sm);

  /* 极光背景层 */
  --orb-a: rgba(124, 92, 255, 0.30);
  --orb-b: rgba(34, 211, 238, 0.22);
  --orb-c: rgba(79, 157, 247, 0.18);
  --grid-line: rgba(27, 30, 53, 0.045);
}

/* ================= 深色主题（极光夜航） ================= */
html[data-theme="dark"] {
  --primary: #8b6dff;
  --primary-dark: #6d4dff;
  --primary-light: #b3a3ff;
  --primary-subtle: rgba(139, 109, 255, 0.15);
  --primary-glow: rgba(139, 109, 255, 0.5);
  --brand-grad: linear-gradient(120deg, #8b6dff 0%, #4f9df7 55%, #2dd4ee 100%);
  --brand-text: linear-gradient(120deg, #a78bfa, #3ed5ee);

  --success: #34d399;
  --success-subtle: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --danger-subtle: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --warning-subtle: rgba(251, 191, 36, 0.12);
  --info: #60a5fa;

  --bg: #060a17;
  --card-bg: #0e1424;
  --card-border: rgba(139, 160, 255, 0.14);
  --text: #e9edfb;
  --text-secondary: #9aa3c4;
  --text-muted: #8b93b5;
  --border: rgba(139, 160, 255, 0.14);
  --divider: rgba(139, 160, 255, 0.08);
  --input-bg: #0a0f1e;
  --hover-bg: rgba(139, 160, 255, 0.07);
  --mono-bg: rgba(139, 109, 255, 0.12);
  --shadow-color: rgba(0, 0, 0, 0.35);

  --shadow-xs: 0 1px 2px var(--shadow-color);
  --shadow-sm: 0 1px 2px var(--shadow-color), 0 4px 14px -6px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px var(--shadow-color), 0 16px 36px -18px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 2px 4px var(--shadow-color), 0 20px 44px -20px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 2px 4px var(--shadow-color), 0 26px 54px -22px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 4px 8px var(--shadow-color), 0 34px 70px -26px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 8px 26px -8px var(--primary-glow), 0 4px 10px var(--shadow-color);

  --glass-bg: rgba(10, 14, 28, 0.82);
  --glass-bg-strong: rgba(6, 10, 23, 0.94);
  --glass-border: rgba(139, 160, 255, 0.14);
  --glass-shadow: var(--shadow-sm);

  --orb-a: rgba(124, 92, 255, 0.30);
  --orb-b: rgba(34, 211, 238, 0.20);
  --orb-c: rgba(79, 157, 247, 0.16);
  --grid-line: rgba(139, 160, 255, 0.05);
}

/* 跟随系统深色（未手动指定时） */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --primary: #8b6dff;
    --primary-dark: #6d4dff;
    --primary-light: #b3a3ff;
    --primary-subtle: rgba(139, 109, 255, 0.15);
    --primary-glow: rgba(139, 109, 255, 0.5);
    --brand-grad: linear-gradient(120deg, #8b6dff 0%, #4f9df7 55%, #2dd4ee 100%);
    --brand-text: linear-gradient(120deg, #a78bfa, #3ed5ee);
    --success: #34d399;
    --success-subtle: rgba(52, 211, 153, 0.12);
    --danger: #f87171;
    --danger-subtle: rgba(248, 113, 113, 0.12);
    --warning: #fbbf24;
    --warning-subtle: rgba(251, 191, 36, 0.12);
    --info: #60a5fa;
    --bg: #060a17;
    --card-bg: #0e1424;
    --card-border: rgba(139, 160, 255, 0.14);
    --text: #e9edfb;
    --text-secondary: #9aa3c4;
    --text-muted: #8b93b5;
    --border: rgba(139, 160, 255, 0.14);
    --divider: rgba(139, 160, 255, 0.08);
    --input-bg: #0a0f1e;
    --hover-bg: rgba(139, 160, 255, 0.07);
    --mono-bg: rgba(139, 109, 255, 0.12);
    --shadow-color: rgba(0, 0, 0, 0.35);
    --shadow-xs: 0 1px 2px var(--shadow-color);
    --shadow-sm: 0 1px 2px var(--shadow-color), 0 4px 14px -6px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px var(--shadow-color), 0 16px 36px -18px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 2px 4px var(--shadow-color), 0 20px 44px -20px rgba(0, 0, 0, 0.65);
    --shadow-lg: 0 2px 4px var(--shadow-color), 0 26px 54px -22px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 4px 8px var(--shadow-color), 0 34px 70px -26px rgba(0, 0, 0, 0.75);
    --shadow-glow: 0 8px 26px -8px var(--primary-glow), 0 4px 10px var(--shadow-color);
    --glass-bg: rgba(10, 14, 28, 0.82);
    --glass-bg-strong: rgba(6, 10, 23, 0.94);
    --glass-border: rgba(139, 160, 255, 0.14);
    --glass-shadow: var(--shadow-sm);
    --orb-a: rgba(124, 92, 255, 0.30);
    --orb-b: rgba(34, 211, 238, 0.20);
    --orb-c: rgba(79, 157, 247, 0.16);
    --grid-line: rgba(139, 160, 255, 0.05);
  }
}

/* ================= 基础 & 浏览器表面 ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  transition: background var(--slow) var(--ease), color var(--slow) var(--ease);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(124, 92, 255, 0.22); color: var(--text); }
input, textarea { caret-color: var(--primary); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ================= 动态极光背景层 ================= */
.fx-bg {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.aurora {
  position: absolute; border-radius: 50%;
  will-change: transform;
}
.aurora-a {
  width: 540px; height: 540px; left: -140px; top: -170px;
  background: radial-gradient(circle at 30% 30%, var(--orb-a) 0%, transparent 62%);
  animation: driftA 26s ease-in-out infinite alternate;
}
.aurora-b {
  width: 480px; height: 480px; right: -120px; top: 18%;
  background: radial-gradient(circle at 60% 40%, var(--orb-b) 0%, transparent 62%);
  animation: driftB 32s ease-in-out infinite alternate;
}
.aurora-c {
  width: 400px; height: 400px; left: 28%; bottom: -190px;
  background: radial-gradient(circle at 50% 50%, var(--orb-c) 0%, transparent 62%);
  animation: driftC 24s ease-in-out infinite alternate;
}
@keyframes driftA { to { transform: translate(70px, 55px) scale(1.12); } }
@keyframes driftB { to { transform: translate(-80px, -45px) scale(1.08); } }
@keyframes driftC { to { transform: translate(45px, -65px) scale(1.15); } }

.fx-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 25%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 0%, black 25%, transparent 78%);
}

/* ================= 容器 ================= */
.container { max-width: 1120px; margin: 0 auto; position: relative; z-index: 1; }

/* ================= 顶栏（粘性玻璃） ================= */
.header {
  position: sticky;
  top: 10px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  padding: 10px 16px;
  margin-bottom: 16px;
  transition: box-shadow var(--normal) var(--ease), background var(--slow) var(--ease),
              transform var(--normal) var(--ease);
  animation: headerIn .55s var(--ease-out-expo) both;
}
@keyframes headerIn {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}
.header.scrolled {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
}
.header-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; min-width: 0; }

.header-logo { width: 34px; height: 34px; flex: none; display: block; }
.header-logo svg { width: 34px; height: 34px; display: block; }

.header-word { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.header-word b {
  font-size: 14.5px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap;
  background: var(--brand-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-word span { font-size: 9.5px; color: var(--text-muted); letter-spacing: 0.16em; font-weight: 600; text-transform: uppercase; }

.status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
  padding: 6px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--card-border); background: var(--card-bg);
  white-space: nowrap; box-shadow: var(--shadow-xs);
}
.status-chip .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: none;
  box-shadow: 0 0 0 3px var(--success-subtle);
  animation: breathe 2.4s ease-in-out infinite;
}
.status-chip .mono { font-family: var(--font-mono); font-weight: 700; color: var(--text); }

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-subtle); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}

/* 实时时钟（仪表感） */
.header-clock {
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  padding-left: 12px;
  border-left: 1px solid var(--divider);
  white-space: nowrap; letter-spacing: .05em;
}
.header-clock b { color: var(--primary); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.theme-toggle, .icon-btn {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--radius); display: grid; place-items: center;
  border: 1px solid var(--card-border); background: var(--card-bg);
  color: var(--text-secondary); cursor: pointer;
  position: relative; overflow: hidden;
  transition: all var(--fast) var(--ease);
}
.theme-toggle:hover, .icon-btn:hover {
  color: var(--primary); border-color: var(--primary-subtle);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.theme-toggle svg, .icon-btn svg { width: 15px; height: 15px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  padding: 6px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--card-border); background: var(--card-bg);
  white-space: nowrap; box-shadow: var(--shadow-xs);
}
.user-chip svg { width: 12px; height: 12px; color: var(--primary); }

/* ================= 导航标签（滑块指示器） ================= */
.nav-tabs {
  position: relative;
  display: flex; gap: 2px; padding: 5px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeDown .5s .08s var(--ease-out-expo) both;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

.nav-indicator {
  position: absolute; top: 5px; bottom: 5px; left: 0;
  width: 0; border-radius: 9px;
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.13), rgba(34, 211, 238, 0.10));
  border: 1px solid rgba(124, 92, 255, 0.28);
  box-shadow: 0 2px 10px -2px var(--primary-glow), inset 0 0 12px rgba(124, 92, 255, 0.06);
  transition: transform .34s cubic-bezier(0.22, 1, 0.36, 1), width .34s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none; z-index: 0;
}

.nav-tab {
  flex: 1; min-width: 0; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
  white-space: nowrap; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.nav-tab svg { width: 15px; height: 15px; opacity: 0.75; flex: none; transition: transform var(--fast) var(--ease); }
.nav-tab:hover { color: var(--text); }
.nav-tab:hover svg { transform: translateY(-1px) scale(1.08); }
.nav-tab.active { color: var(--primary); }
.nav-tab.active svg { opacity: 1; color: var(--primary); }
.tab-count {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; line-height: 15px;
  background: var(--hover-bg); border: 1px solid var(--card-border); color: var(--text-muted);
  padding: 0 6px; border-radius: 99px;
  transition: all var(--fast) var(--ease);
}
.nav-tab.active .tab-count { background: var(--card-bg); color: var(--primary); border-color: transparent; }

/* ================= 提示消息 ================= */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500; line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid transparent;
  position: relative; overflow: hidden;
  animation: alertIn .42s var(--ease-out-expo) both;
}
.alert::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: currentColor; opacity: .35;
}
@keyframes alertIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.alert-success { background: var(--success-subtle); color: var(--success); border-color: var(--success-subtle); }
.alert-error   { background: var(--danger-subtle);  color: var(--danger);  border-color: var(--danger-subtle); }
.alert-icon {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card-bg); font-size: 11px; font-weight: 800;
}
.alert-icon svg { width: 11px; height: 11px; }
.alert-dismiss { cursor: pointer; }

/* ================= 卡片 ================= */
.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow var(--normal) var(--ease), border-color var(--normal) var(--ease),
              transform var(--normal) var(--ease);
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 2;
  background: linear-gradient(90deg, transparent, var(--primary), var(--info), transparent);
  transform: scaleX(0); transform-origin: left;
  opacity: .85;
  transition: transform .5s var(--ease-out-expo);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(124, 92, 255, 0.22);
}
.card:hover::before { transform: scaleX(1); }

.card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px 0;
}
.card-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.card-title h2 {
  font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text);
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.card-title h2 .header-icon {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--primary-subtle); color: var(--primary);
  transition: transform var(--normal) var(--spring), box-shadow var(--normal) var(--ease);
}
.card:hover .card-title h2 .header-icon {
  transform: scale(1.06) rotate(-4deg);
  box-shadow: 0 4px 12px -4px var(--primary-glow);
}
.card-title h2 .header-icon svg { width: 15px; height: 15px; }
.card-sub { font-size: 11px; color: var(--text-muted); }
.card-header .badge { margin-left: auto; }
.card-body { padding: 14px 18px 18px; }

/* ================= 徽标 ================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2.5px 9px; border-radius: var(--radius-full);
  background: var(--primary-subtle); color: var(--primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-danger  { background: var(--danger-subtle);  color: var(--danger); }

/* ================= 概览条（仪表） ================= */
.version-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.version-stat {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 13px 15px 12px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease),
              border-color var(--normal) var(--ease);
  overflow: hidden;
  min-width: 0;
}
.version-stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-border), transparent);
}
.version-stat:first-child::before {
  background: linear-gradient(90deg, transparent, var(--primary), var(--info), transparent);
  background-size: 200% 100%;
  animation: gradFlow 5s linear infinite;
}
@keyframes gradFlow { to { background-position: 200% 0; } }

.version-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(124, 92, 255, 0.25);
}

.version-stat .stat-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted);
  margin-bottom: 7px; white-space: nowrap;
}
.version-stat .stat-label svg { width: 11px; height: 11px; transition: transform var(--normal) var(--spring); }
.version-stat:hover .stat-label svg { transform: scale(1.2) rotate(-8deg); color: var(--primary); }

.version-stat .stat-value {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-weight: 800;
  font-size: 16px; letter-spacing: -0.02em; color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.version-stat .stat-value small { font-size: 11px; color: var(--text-muted); font-weight: 500; font-family: var(--font); }

/* 渐变版本号（品牌签名时刻） */
.version-stat .stat-value.version-tag {
  background: var(--brand-text);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-mono);
  font-size: 17px;
  animation: gradFlow 6s linear infinite;
}

/* 状态指示灯 */
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.status-dot.active   { background: var(--success); box-shadow: 0 0 0 3px var(--success-subtle); animation: breathe 2.4s infinite; }
.status-dot.inactive { background: var(--text-muted); box-shadow: 0 0 0 3px var(--divider); }

/* ================= 主网格 ================= */
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col .card { margin-bottom: 0; }

/* ================= 表单 ================= */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group-full { grid-column: 1 / -1; }

.form-group label {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
}
.form-group label .field-icon {
  width: 18px; height: 18px; flex: none; border-radius: 5px;
  display: grid; place-items: center;
  background: var(--primary-subtle); color: var(--primary);
}
.form-group label .field-icon svg { width: 10px; height: 10px; }
.form-group label .label-tip {
  font-size: 10px; font-weight: 500; color: var(--text-muted);
  background: var(--hover-bg); border: 1px solid var(--card-border);
  padding: 0 7px; border-radius: 99px; font-family: var(--font-mono);
}
.form-group label .label-badge {
  font-size: 10px; font-weight: 700; color: var(--primary);
  background: var(--primary-subtle); padding: 0 8px; border-radius: 99px;
}

.form-control {
  width: 100%;
  font-family: inherit; font-size: 13px; color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.form-control::placeholder { color: var(--text-muted); font-size: 12px; }
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle), 0 4px 16px -6px var(--primary-glow);
}
.form-control:read-only, .form-control[readonly] {
  background: var(--hover-bg); border-style: dashed; color: var(--text-secondary); cursor: not-allowed;
}
textarea.form-control { resize: vertical; min-height: 96px; line-height: 1.7; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236d7490' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

/* 编辑态高亮 */
.field-editable .form-control { border-color: var(--primary-light) !important; }
.field-editable .form-control:focus { box-shadow: 0 0 0 3px var(--primary-subtle) !important; }

/* 输入+复制按钮行 */
.field-hash { display: flex; gap: 8px; min-width: 0; }
.field-hash .form-control { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12px; }
.field-hash .icon-btn { width: 34px; height: 34px; }

/* 分隔线 */
.form-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 17px 0 13px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted);
}
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--divider); }
.form-divider-text { display: inline-flex; align-items: center; gap: 6px; }
.form-divider-text svg { width: 12px; height: 12px; }

.form-footer {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--divider);
}
.form-tip { font-size: 11px; color: var(--text-muted); }

/* 行内表单 */
.form-inline { display: flex; flex-direction: column; gap: 12px; }
.inline-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.inline-row .form-control { flex: 1; min-width: 160px; }
.form-inline label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; color: var(--text-muted); }
.form-inline .input-group { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; flex: 1; min-width: 0; }

/* ================= 下载链接模式开关 ================= */
.url-mode-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--hover-bg); border: 1px solid var(--divider);
  border-radius: var(--radius-full);
}
.url-mode-btn {
  padding: 6px 14px; border: 0; border-radius: var(--radius-full);
  font-family: inherit; font-size: 12px; font-weight: 600;
  background: transparent; color: var(--text-secondary); cursor: pointer;
  transition: all var(--fast) var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
  position: relative; overflow: hidden;
}
.url-mode-btn svg { width: 12px; height: 12px; }
.url-mode-btn.active { background: var(--card-bg); color: var(--primary); box-shadow: var(--shadow-xs); }
.url-mode-btn:hover:not(.active) { color: var(--text); }
.url-mode-hint { font-size: 11px; color: var(--text-muted); margin-left: 10px; display: inline-flex; align-items: center; gap: 5px; }

/* ================= 哈希块 ================= */
.hash-box {
  background: var(--hover-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 10px 13px;
  margin-top: 9px;
}
.hash-box .hash-label {
  display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase;
}
.hash-box code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); word-break: break-all; line-height: 1.65; }

/* ================= 键值行 ================= */
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--divider); }
.kv:last-child { border-bottom: 0; }
.kv .k { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.kv .k svg { width: 13px; height: 13px; color: var(--text-muted); }
.kv .v { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.mono-chip {
  font-family: var(--font-mono); font-size: 11px; color: var(--primary);
  background: var(--primary-subtle); padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 9px 18px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--fast) var(--ease);
  white-space: nowrap; line-height: 1; min-height: 36px;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
  position: relative; overflow: hidden;
}
.btn svg { width: 14px; height: 14px; flex: none; transition: transform var(--fast) var(--spring); }
.btn:hover svg { transform: scale(1.12); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand-grad);
  background-size: 170% 100%;
  background-position: 0% 0;
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--primary-glow);
  transition: all var(--fast) var(--ease), background-position .45s var(--ease);
}
.btn-primary:hover {
  background-position: 95% 0;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px var(--primary-glow);
}

.btn-outline, .btn-line {
  background: var(--card-bg); border-color: var(--card-border); color: var(--text-secondary);
}
.btn-outline:hover, .btn-line:hover { color: var(--primary); border-color: var(--primary-subtle); box-shadow: 0 0 0 3px var(--primary-subtle); }

.btn-danger { background: var(--card-bg); border-color: var(--card-border); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 8px 18px -8px var(--danger); }

.btn-sm { padding: 6px 12px; min-height: 29px; font-size: 11.5px; border-radius: 8px; }
.btn-xs { padding: 5px 10px; min-height: 25px; font-size: 11px; border-radius: 7px; }
.btn-lg { padding: 11px 24px; min-height: 42px; font-size: 13.5px; }

.btn-uploading { opacity: 0.65; pointer-events: none; position: relative; }
.btn-uploading::after {
  content: ''; display: inline-block; width: 12px; height: 12px;
  border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%;
  animation: spin 0.6s linear infinite; margin-left: 5px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 水波反馈 */
.ripple {
  position: absolute; border-radius: 50%;
  background: currentColor;
  opacity: .16;
  transform: scale(0);
  animation: rippleAnim .65s var(--ease-out) forwards;
  pointer-events: none; z-index: 2;
}
@keyframes rippleAnim {
  to { transform: scale(1); opacity: 0; }
}

/* ================= 开关 ================= */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 34px; height: 20px; flex: none; position: relative;
  border-radius: 99px; background: var(--border); border: 1px solid var(--divider);
  transition: all var(--normal) var(--ease);
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--card-bg); box-shadow: 0 1px 3px rgba(27, 30, 53, 0.25);
  transition: all var(--normal) var(--spring);
}
.switch input:checked + .track { background: var(--brand-grad); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--primary-subtle); }
.switch .sw-label { font-size: 13px; font-weight: 700; color: var(--text); }
.switch .sw-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ================= 复选框 ================= */
.check {
  position: relative; width: 16px; height: 16px; flex: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; display: inline-block; vertical-align: middle;
  border: 1.5px solid var(--text-muted); border-radius: 5px; background: var(--card-bg);
  transition: all var(--fast) var(--ease);
}
.check:checked { background: var(--brand-grad); border-color: transparent; }
.check:checked::after {
  content: ''; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  animation: checkPop 0.18s var(--ease);
}
@keyframes checkPop { from { transform: rotate(45deg) scale(0.4); opacity: 0; } to { transform: rotate(45deg) scale(1); opacity: 1; } }
.check:focus-visible { box-shadow: 0 0 0 3px var(--primary-subtle); }

/* ================= 文件上传（拖放区） ================= */
.file-upload { display: flex; flex-direction: column; gap: 10px; }
.file-upload .file-input-wrapper { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.file-upload input[type="file"] {
  flex: 1; min-width: 180px;
  padding: 26px 16px; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius-md);
  font-size: 12.5px; font-family: inherit; font-weight: 600; color: var(--text-secondary);
  background: var(--hover-bg); cursor: pointer;
  transition: all var(--normal) var(--ease);
}
.file-upload input[type="file"]:hover { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary); }
.file-upload input[type="file"]::file-selector-button {
  padding: 8px 16px; border: 0; border-radius: 8px;
  background: var(--primary-subtle); color: var(--primary);
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  margin-right: 14px; transition: all var(--fast) var(--ease);
}
.file-upload input[type="file"]::file-selector-button:hover { background: var(--primary); color: #fff; }

.limit-hint { font-size: 11px; color: var(--text-muted); }
.limit-hint code {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--primary);
  background: var(--mono-bg); padding: 1px 7px; border-radius: 6px;
}

/* ================= 表格 ================= */
.tablewrap { overflow-x: auto; }

.file-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.file-table th {
  text-align: left; white-space: nowrap;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
  padding: 9px 14px;
  border-bottom: 1px solid var(--divider);
  background: var(--hover-bg);
  font-variant-numeric: tabular-nums;
}
.file-table td { padding: 10px 14px; border-bottom: 1px solid var(--divider); color: var(--text); vertical-align: middle; }
.file-table tbody tr {
  transition: background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  animation: rowIn .4s var(--ease-out) both;
}
.file-table tbody tr:nth-child(1)  { animation-delay: .02s; }
.file-table tbody tr:nth-child(2)  { animation-delay: .04s; }
.file-table tbody tr:nth-child(3)  { animation-delay: .06s; }
.file-table tbody tr:nth-child(4)  { animation-delay: .08s; }
.file-table tbody tr:nth-child(5)  { animation-delay: .10s; }
.file-table tbody tr:nth-child(6)  { animation-delay: .12s; }
.file-table tbody tr:nth-child(7)  { animation-delay: .14s; }
.file-table tbody tr:nth-child(8)  { animation-delay: .16s; }
.file-table tbody tr:nth-child(9)  { animation-delay: .18s; }
.file-table tbody tr:nth-child(n+10) { animation-delay: .20s; }
/* 行数过多时只动画前 10 行，其余直接显示（防大表格卡顿） */
.file-table tbody tr:nth-child(n+11) { animation: none; }
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}
.file-table tbody tr:hover {
  background: var(--hover-bg);
  box-shadow: inset 3px 0 0 var(--primary);
}
.file-table tbody tr:last-child td { border-bottom: 0; }

.file-table .file-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-table .file-icon {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--primary-subtle); color: var(--primary);
  transition: transform var(--normal) var(--spring), box-shadow var(--normal) var(--ease);
}
.file-table tbody tr:hover .file-icon {
  transform: scale(1.08) rotate(-5deg);
  box-shadow: 0 4px 12px -4px var(--primary-glow);
}
.file-table .file-icon svg { width: 14px; height: 14px; }
.file-table .file-meta { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 1px; font-variant-numeric: tabular-nums; }
.file-table .file-size { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* 行悬停浮现操作按钮（桌面）；触屏恒显 */
.file-table td .btn { opacity: 0; transform: translateX(4px); transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease); }
.file-table tr:hover td .btn,
.file-table td .btn:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .file-table td .btn { opacity: 1; transform: none; } }

/* ================= 空状态 ================= */
.empty-state { padding: 38px 20px; text-align: center; }
.empty-state svg {
  width: 52px; height: 52px; color: var(--text-muted); opacity: 0.55; margin-bottom: 10px;
  animation: floatY 3.2s ease-in-out infinite;
}
@keyframes floatY { 50% { transform: translateY(-6px); } }
.empty-state p { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }
.empty-state .empty-icon { display: block; }

/* ================= 说明卡片 ================= */
.guide { font-size: 12.5px; line-height: 1.9; color: var(--text-secondary); }
.guide b { color: var(--text); }
.guide code {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--primary);
  background: var(--mono-bg); padding: 1px 6px; border-radius: 5px; word-break: break-all;
}
pre.code {
  background: var(--hover-bg); border: 1px solid var(--divider); border-radius: var(--radius);
  padding: 11px 13px; font-family: var(--font-mono); font-size: 11px; line-height: 1.8;
  color: var(--text-secondary); overflow-x: auto; margin: 8px 0;
}

/* ================= 上传模态框 ================= */
.upload-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  align-items: center; justify-content: center;
  background: rgba(10, 14, 28, 0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.upload-overlay.active { display: flex; }

.upload-modal {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  max-width: 460px; width: 90%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  animation: modalIn 0.4s var(--spring);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.upload-modal .modal-icon {
  width: 50px; height: 50px; margin: 0 auto 13px;
  border-radius: 14px; display: grid; place-items: center;
  background: var(--primary-subtle); color: var(--primary);
  transition: all var(--normal) var(--ease);
}
.upload-overlay.active .modal-icon svg { animation: iconPop .5s var(--spring); }
@keyframes iconPop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.upload-modal .modal-icon svg { width: 22px; height: 22px; }
.upload-modal .modal-title { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.upload-modal .modal-subtitle { font-size: 12px; color: var(--text-secondary); margin-bottom: 20px; font-family: var(--font-mono); }

.progress-track {
  background: var(--border); border-radius: var(--radius-full);
  height: 6px; overflow: hidden; margin-bottom: 12px; position: relative;
}
.progress-track .progress-fill {
  height: 100%; width: 0%;
  background: var(--brand-grad); border-radius: var(--radius-full);
  transition: width 0.3s ease; position: relative;
}
.progress-track .progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.progress-info { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: var(--text-muted); }
.progress-percent { font-family: var(--font-mono); font-weight: 800; color: var(--primary); font-size: 20px; }
.progress-speed { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); }

.upload-modal .modal-status {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius);
  font-size: 12px; text-align: left; display: none;
}
.upload-modal .modal-status.success { display: block; background: var(--success-subtle); color: var(--success); border: 1px solid var(--success-subtle); animation: statusIn .4s var(--ease-out); }
.upload-modal .modal-status.error   { display: block; background: var(--danger-subtle);  color: var(--danger);  border: 1px solid var(--danger-subtle);  animation: statusIn .4s var(--ease-out); }
@keyframes statusIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ================= Toast ================= */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 9999;
  transform: translateX(-50%) translateY(14px);
  display: flex; align-items: center; gap: 8px;
  background: var(--text); color: var(--bg);
  font-size: 12.5px; font-weight: 600;
  padding: 10px 18px; border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: all 0.28s var(--ease);
  max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 14px; height: 14px; color: var(--info); }
.toast.show svg { animation: iconPop .4s var(--spring); }
.toast::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--info));
  transform: scaleX(0); transform-origin: left;
}
.toast.show::after { animation: toastBar 2.2s linear forwards; }
@keyframes toastBar { to { transform: scaleX(1); } }

/* ================= 公告按钮行 / 通用 ================= */
.notice-btn-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.notice-btn-row .form-control { flex: 1; }

.text-right { text-align: right !important; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.divider { height: 1px; background: var(--divider); margin: 16px 0; }

.section-hidden { display: none !important; }

/* ================= Tab 内容入场 ================= */
.tab-enter { animation: tabIn .38s var(--ease-out-expo); }
@keyframes tabIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ================= 入场级联（JS 驱动） ================= */
.js .reveal { opacity: 0; }
.js .reveal.in { animation: revealIn .55s var(--ease-out-expo) both; }
@keyframes revealIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ================= 登录页（极光引擎舱） ================= */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
  overflow: hidden;
}
.login-wrap { width: min(420px, 100%); position: relative; }
.login-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow), var(--shadow-xl);
  padding: 44px 40px 36px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: center;
  animation: cardIn .65s var(--ease-out-expo) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(26px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.login-brand { position: relative; width: 76px; height: 76px; margin: 0 auto 20px; animation: fadeUp .5s .1s var(--ease-out-expo) both; }
.login-logo {
  position: relative; z-index: 1;
  width: 76px; height: 76px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-grad);
  box-shadow: 0 10px 30px var(--primary-glow), 0 0 0 1px rgba(255, 255, 255, .15) inset;
  color: #fff;
  animation: logoFloat 4.5s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.login-logo svg { width: 34px; height: 34px; }
/* 旋转虚线光环 + 呼吸光晕 */
.login-aura {
  position: absolute; inset: -16px; border-radius: 32px; z-index: 0;
  border: 1.5px dashed var(--primary-light);
  opacity: .5;
  animation: auraSpin 10s linear infinite;
}
.login-aura::after {
  content: ''; position: absolute; inset: -5px; border-radius: 36px;
  border: 1px solid var(--primary-glow);
  animation: auraPulse 3.2s var(--ease) infinite;
}
@keyframes auraSpin {
  to { transform: rotate(360deg); }
}
@keyframes auraPulse {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%      { opacity: .9;  transform: scale(1.05); }
}
.login-title {
  font-size: 1.3rem; font-weight: 800; color: var(--text);
  margin-bottom: 4px; letter-spacing: .02em;
  background: var(--brand-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeUp .5s .18s var(--ease-out-expo) both;
}
.login-subtitle {
  font-size: .82rem; color: var(--text-muted); margin-bottom: 28px; letter-spacing: .04em;
  animation: fadeUp .5s .24s var(--ease-out-expo) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.login-field { text-align: left; margin-bottom: 16px; animation: fadeUp .5s .32s var(--ease-out-expo) both; }
.login-field label { display: block; font-size: .80rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.login-input {
  width: 100%; padding: 12px 14px; font-size: .92rem; border-radius: var(--radius);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}
.login-input:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px var(--primary-subtle), 0 8px 20px -8px var(--primary-glow);
}
.password-wrap { position: relative; }
.password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  opacity: .55; padding: 4px; line-height: 1; color: var(--text-secondary);
  display: flex; align-items: center;
  transition: opacity var(--fast) var(--ease), color var(--fast) var(--ease);
}
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle:hover { opacity: 1; color: var(--primary); }
.login-submit {
  width: 100%; padding: 13px; margin-top: 6px; font-size: .92rem;
  animation: fadeUp .5s .4s var(--ease-out-expo) both;
}
.login-submit:disabled { cursor: wait; }
.login-submit:disabled::after {
  content: ''; width: 14px; height: 14px; flex: none;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}
.login-meta {
  margin-top: 18px; font-size: .70rem; line-height: 1.8; color: var(--text-muted);
  animation: fadeUp .5s .48s var(--ease-out-expo) both;
}
.login-footer {
  margin-top: 16px; text-align: center; font-size: .68rem;
  color: var(--text-muted); opacity: .5; letter-spacing: .05em;
  animation: fadeUp .5s .55s var(--ease-out-expo) both;
}
.login-card .alert { margin-bottom: 18px; text-align: left; }
.login-card .alert, .login-card .setup-box { animation: fadeUp .5s .3s var(--ease-out-expo) both; }
.setup-box {
  text-align: left; background: var(--warning-subtle);
  border: 1px solid var(--warning-subtle); border-radius: var(--radius);
  padding: 14px 16px; font-size: .80rem; line-height: 1.8; color: var(--text-secondary);
}
.setup-box code {
  background: var(--card-bg); padding: 2px 8px; border-radius: 6px;
  font-family: var(--font-mono); font-size: .74rem; word-break: break-all;
}
/* 登录页主题切换按钮 */
.login-theme-toggle {
  position: absolute; top: -14px; right: 0;
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer; display: grid; place-items: center;
  transition: all var(--fast) var(--ease);
  box-shadow: var(--glass-shadow);
  z-index: 5;
  overflow: hidden;
}
.login-theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.login-theme-toggle svg { width: 17px; height: 17px; }
.login-theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .login-theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .login-theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .login-theme-toggle .icon-sun { display: block; }
  html:not([data-theme="light"]) .login-theme-toggle .icon-moon { display: none; }
}

/* ================= 响应式 ================= */
@media (max-width: 920px) {
  .grid-main { grid-template-columns: 1fr; }
  .version-strip { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .status-chip { display: none; }
  .col { gap: 12px; }
}

@media (max-width: 700px) {
  .version-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .version-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .field-hash { flex-wrap: wrap; }
  .field-hash .form-control { flex: 1 1 100%; }
  .inline-row .form-control { flex: 1 1 100%; min-width: 0; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .form-footer .btn { width: 100%; }

  .card-header { flex-wrap: wrap; row-gap: 6px; }

  /* 表格横向滚动时固定首列 */
  .file-table th:first-child,
  .file-table td:first-child {
    position: sticky; left: 0;
    background: var(--card-bg); z-index: 2;
    box-shadow: 6px 0 10px -8px var(--shadow-color);
  }
  .file-table tbody tr:hover td:first-child { background: var(--hover-bg); }
  .file-table th, .file-table td { padding: 9px 10px; }

  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 4px; }
  .nav-tab { flex: 0 0 auto; padding: 9px 13px; font-size: 12.5px; }
}

@media (max-width: 600px) {
  body { padding: 10px 8px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); font-size: 13px; }
  .header { top: 8px; padding: 8px 10px; gap: 8px; }
  .header-logo, .header-logo svg { width: 28px; height: 28px; }
  .header-word b { font-size: 13px; }
  .header-word span { display: none; }
  .header-actions { gap: 6px; }
  .header-clock { display: none; }
  .user-chip { display: none; }
  .theme-toggle { width: 30px; height: 30px; }
  .logout-btn { padding: 6px 9px; min-height: 30px; }
  .logout-btn .lbl { display: none; }

  .nav-tabs { position: sticky; top: 60px; z-index: 40; border-radius: 12px; margin-bottom: 12px; }

  .card-header { padding: 12px 13px 0; }
  .card-body { padding: 11px 13px 15px; }
  .card-title h2 { font-size: 13px; }
  .card-title h2 .header-icon { width: 26px; height: 26px; border-radius: 8px; }
  .card-title h2 .header-icon svg { width: 13px; height: 13px; }
  .card-sub { font-size: 10.5px; }

  .version-stat { padding: 11px 12px 10px; }
  .version-stat .stat-value { font-size: 15px; }
  .version-stat .stat-value.version-tag { font-size: 16px; }

  .file-upload .file-input-wrapper { flex-direction: column; align-items: stretch; }
  .file-upload input[type="file"] { min-width: 0; padding: 22px 12px; }
  .alert { padding: 10px 12px; }
  .btn { min-height: 38px; }
  .btn-sm { min-height: 32px; }
  .btn-xs { min-height: 28px; }
  .kv .v { flex-wrap: wrap; justify-content: flex-end; }
  .form-control { padding: 10px 11px; }
  .hash-box { padding: 9px 11px; }

  .login-body { padding: 20px 14px; }
  .login-card { padding: 32px 22px; border-radius: var(--radius-xl); }
  .login-title { font-size: 21px; }
  .login-subtitle { font-size: 12px; }
  .login-logo, .login-logo svg { width: 30px; height: 30px; }
  .login-meta { font-size: 11px; }
  .login-footer { font-size: 10.5px; }
}

/* 触屏设备：加大点击目标 */
@media (hover: none) {
  .check { width: 18px; height: 18px; }
  .check:checked::after { left: 5px; top: 2px; width: 4.5px; height: 9px; }
  .file-table td .btn { opacity: 1; }
  .btn-sm, .btn-xs { min-height: 34px; }
  .theme-toggle, .icon-btn { width: 36px; height: 36px; }
}

/* 无障碍：减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal { opacity: 1; }
  .header-clock { animation: none; }
}

/* ================= 大表格分页条 ================= */
.pager-hidden { display: none !important; }
.table-pager {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 5px; padding: 10px 14px;
    border-top: 1px solid var(--divider);
}
.table-pager .pager-info {
    font-size: 11px; color: var(--text-muted);
    font-family: var(--font-mono); margin-right: 8px; white-space: nowrap;
}
.table-pager .pager-btn {
    min-width: 30px; height: 27px; padding: 0 9px;
    border: 1px solid var(--card-border); background: var(--card-bg);
    color: var(--text-secondary); border-radius: 8px; cursor: pointer;
    font-size: 11px; font-family: inherit;
    transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
                background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
    position: relative; overflow: hidden;
}
.table-pager .pager-btn:hover:not(:disabled) {
    color: var(--primary); border-color: var(--primary);
}
.table-pager .pager-btn.active {
    background: var(--brand-grad); color: #fff; border-color: transparent;
    box-shadow: 0 3px 10px -3px var(--primary-glow); font-weight: 700;
}
.table-pager .pager-btn:disabled { opacity: .38; cursor: not-allowed; }

/* ================= GSAP 增强（渐进增强） =================
   当 gsap 加载成功（html.gsap-ready）时，关闭与之冲突的
   CSS 动画/过渡，交还给 GSAP 驱动；gsap 失败则全部失效。 */
.gsap-ready .aurora,
.gsap-ready .header,
.gsap-ready .nav-tabs,
.gsap-ready .alert,
.gsap-ready .card,
.gsap-ready .version-stat,
.gsap-ready .empty-state,
.gsap-ready .tab-enter,
.gsap-ready .upload-modal,
.gsap-ready .login-card,
.gsap-ready .login-brand,
.gsap-ready .login-logo,
.gsap-ready .login-aura,
.gsap-ready .login-title,
.gsap-ready .login-subtitle,
.gsap-ready .login-field,
.gsap-ready .login-submit,
.gsap-ready .login-meta,
.gsap-ready .login-footer,
.gsap-ready .setup-box {
  animation: none !important;
}
.gsap-ready .reveal { opacity: 1 !important; animation: none !important; }
.gsap-ready .file-table tbody tr { animation: none !important; }
.gsap-ready .card,
.gsap-ready .version-stat { transition: box-shadow var(--normal) var(--ease), border-color var(--normal) var(--ease); }
.gsap-ready .header { transition: box-shadow var(--normal) var(--ease), background var(--slow) var(--ease); }
.gsap-ready .nav-indicator { transition: none; }
.gsap-ready .toast { transform: none; transition: opacity .28s var(--ease); }
/* 交互元素：解除 transition:all 与 GSAP 的冲突（transform 交给 GSAP 驱动，避免双重平滑卡顿） */
.gsap-ready .btn,
.gsap-ready .theme-toggle,
.gsap-ready .nav-tab,
.gsap-ready .url-mode-btn,
.gsap-ready .icon-btn,
.gsap-ready .login-theme-toggle,
.gsap-ready .password-toggle {
  transition: box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease),
              background-color var(--fast) var(--ease), color var(--fast) var(--ease),
              opacity var(--fast) var(--ease);
}

/* 卡片 3D 倾斜光斑（GSAP 驱动，--gx/--gy 由脚本写入） */
.gsap-ready .card::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(560px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.09), transparent 45%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.gsap-ready .card:hover::after { opacity: 1; }
