/* ============================================
   CYPHER-X — 科技感解码引擎 样式表
   ============================================ */

:root {
  /* 深空背景 */
  --space-dark: #0a0e17;
  --space-mid: #111827;
  --space-light: #1a2332;

  /* 霓虹主色调 */
  --neon-cyan: #00e5ff;
  --neon-cyan-dim: rgba(0, 229, 255, 0.15);
  --neon-cyan-glow: rgba(0, 229, 255, 0.32);
  --neon-blue: #448aff;
  --neon-blue-dim: rgba(68, 138, 255, 0.18);
  --neon-blue-glow: rgba(68, 138, 255, 0.35);

  /* 强调色 */
  --accent-green: #00e676;
  --accent-green-dim: rgba(0, 230, 118, 0.18);
  --accent-purple: #b388ff;
  --accent-purple-dim: rgba(179, 136, 255, 0.16);
  --accent-coral: #ff4081;
  --accent-amber: #ffab00;
  --accent-red: #ff5252;

  /* 面板 */
  --panel-bg: rgba(17, 24, 39, 0.82);
  --panel-border: rgba(255, 255, 255, 0.07);
  --panel-border-hover: rgba(0, 229, 255, 0.22);
  --panel-glow: 0 0 40px rgba(0, 229, 255, 0.05),
                0 0 80px rgba(68, 138, 255, 0.03);

  /* 文字 */
  --text-primary: #e8edf5;
  --text-secondary: #8899b4;
  --text-muted: #5c6e8a;
  --text-dim: #3d4f66;

  /* 线条 */
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);

  /* 代码区 */
  --code-bg: #060b14;
  --code-text: #c9d9f0;

  /* 阴影 */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3),
                 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.45),
                  0 0 0 1px rgba(0, 229, 255, 0.07);
}

/* ============================================
   白天主题 (light) — 高端玻璃拟态
   ============================================ */
[data-theme="light"] {
  /* 背景 — 柔和渐变 */
  --space-dark: #eef1f6;
  --space-mid: #f8fafc;
  --space-light: #e2e8f0;

  /* 霓虹主色调 — 更饱和 */
  --neon-cyan: #0088cc;
  --neon-cyan-dim: rgba(0, 136, 204, 0.12);
  --neon-cyan-glow: rgba(0, 136, 204, 0.28);
  --neon-blue: #2563eb;
  --neon-blue-dim: rgba(37, 99, 235, 0.15);
  --neon-blue-glow: rgba(37, 99, 235, 0.3);

  /* 强调色 */
  --accent-green: #059669;
  --accent-green-dim: rgba(5, 150, 105, 0.15);
  --accent-purple: #7c3aed;
  --accent-purple-dim: rgba(124, 58, 237, 0.14);
  --accent-coral: #dc2626;
  --accent-amber: #d97706;
  --accent-red: #ef4444;

  /* 面板 — 高级玻璃拟态 */
  --panel-bg: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(0, 0, 0, 0.06);
  --panel-border-hover: rgba(0, 136, 204, 0.3);
  --panel-glow: 0 8px 32px rgba(0, 0, 0, 0.06),
                0 0 0 1px rgba(255, 255, 255, 0.5) inset,
                0 0 60px rgba(37, 99, 235, 0.04);

  /* 文字 */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-dim: #cbd5e1;

  /* 线条 */
  --line: rgba(0, 0, 0, 0.05);
  --line-strong: rgba(0, 0, 0, 0.1);

  /* 代码区 */
  --code-bg: #f1f5f9;
  --code-text: #1e293b;

  /* 阴影 */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04),
                 0 4px 16px rgba(0, 0, 0, 0.04),
                 0 0 0 1px rgba(0, 0, 0, 0.02);
  --shadow-float: 0 8px 32px rgba(0, 0, 0, 0.08),
                  0 0 0 1px rgba(255, 255, 255, 0.6) inset,
                  0 0 40px rgba(37, 99, 235, 0.06);
}

/* ============================================
   霓虹幻彩主题 (neon) — 深蓝紫霓虹
   ============================================ */
[data-theme="neon"] {
  --space-dark: #070714;
  --space-mid: #0e0e28;
  --space-light: #16163a;

  --neon-cyan: #00f0ff;
  --neon-cyan-dim: rgba(0, 240, 255, 0.15);
  --neon-cyan-glow: rgba(0, 240, 255, 0.35);
  --neon-blue: #7b2ff7;
  --neon-blue-dim: rgba(123, 47, 247, 0.18);
  --neon-blue-glow: rgba(123, 47, 247, 0.35);

  --accent-green: #00ffaa;
  --accent-green-dim: rgba(0, 255, 170, 0.15);
  --accent-purple: #b24bf7;
  --accent-purple-dim: rgba(178, 75, 247, 0.16);
  --accent-coral: #ff4d8d;
  --accent-amber: #ffc400;
  --accent-red: #ff4d4d;

  --panel-bg: rgba(14, 14, 40, 0.85);
  --panel-border: rgba(123, 47, 247, 0.12);
  --panel-border-hover: rgba(0, 240, 255, 0.3);
  --panel-glow: 0 8px 32px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(123, 47, 247, 0.08) inset,
                0 0 60px rgba(123, 47, 247, 0.06);

  --text-primary: #e8e8ff;
  --text-secondary: #9ca3db;
  --text-muted: #6b6fa3;
  --text-dim: #4a4e78;

  --line: rgba(123, 47, 247, 0.08);
  --line-strong: rgba(123, 47, 247, 0.15);

  --code-bg: #0a0a22;
  --code-text: #c5c9f0;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35),
                 0 0 0 1px rgba(123, 47, 247, 0.06);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.45),
                  0 0 0 1px rgba(123, 47, 247, 0.1) inset,
                  0 0 50px rgba(123, 47, 247, 0.1);
}

/* ============================================
   赛博青锋主题 (cyber) — 暗黑青色科技
   ============================================ */
[data-theme="cyber"] {
  --space-dark: #02080a;
  --space-mid: #051014;
  --space-light: #0a1a1e;

  --neon-cyan: #00ffe5;
  --neon-cyan-dim: rgba(0, 255, 229, 0.12);
  --neon-cyan-glow: rgba(0, 255, 229, 0.35);
  --neon-blue: #00a8a8;
  --neon-blue-dim: rgba(0, 168, 168, 0.15);
  --neon-blue-glow: rgba(0, 168, 168, 0.3);

  --accent-green: #00ffaa;
  --accent-green-dim: rgba(0, 255, 170, 0.12);
  --accent-purple: #a855f7;
  --accent-purple-dim: rgba(168, 85, 247, 0.12);
  --accent-coral: #ff6b6b;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --panel-bg: rgba(5, 16, 20, 0.88);
  --panel-border: rgba(0, 255, 229, 0.1);
  --panel-border-hover: rgba(0, 255, 229, 0.35);
  --panel-glow: 0 8px 32px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(0, 255, 229, 0.06) inset,
                0 0 60px rgba(0, 255, 229, 0.04);

  --text-primary: #e0f7f7;
  --text-secondary: #88c8c8;
  --text-muted: #5a9090;
  --text-dim: #3a6a6a;

  --line: rgba(0, 255, 229, 0.06);
  --line-strong: rgba(0, 255, 229, 0.12);

  --code-bg: #040e12;
  --code-text: #b0d8d8;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4),
                 0 0 0 1px rgba(0, 255, 229, 0.05);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.5),
                  0 0 0 1px rgba(0, 255, 229, 0.08) inset,
                  0 0 50px rgba(0, 255, 229, 0.08);
}

/* ============================================
   梦幻泡影主题 (dream) — 紫蓝梦幻柔和
   ============================================ */
[data-theme="dream"] {
  --space-dark: #e4daf0;
  --space-mid: #ede8f5;
  --space-light: #ddd4ec;

  --neon-cyan: #7c3aed;
  --neon-cyan-dim: rgba(124, 58, 237, 0.12);
  --neon-cyan-glow: rgba(124, 58, 237, 0.25);
  --neon-blue: #6366f1;
  --neon-blue-dim: rgba(99, 102, 241, 0.14);
  --neon-blue-glow: rgba(99, 102, 241, 0.28);

  --accent-green: #10b981;
  --accent-green-dim: rgba(16, 185, 129, 0.12);
  --accent-purple: #a78bfa;
  --accent-purple-dim: rgba(167, 139, 250, 0.14);
  --accent-coral: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --panel-bg: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(124, 58, 237, 0.1);
  --panel-border-hover: rgba(124, 58, 237, 0.35);
  --panel-glow: 0 8px 32px rgba(0, 0, 0, 0.05),
                0 0 0 1px rgba(255, 255, 255, 0.6) inset,
                0 0 60px rgba(124, 58, 237, 0.05);

  --text-primary: #1e1b4b;
  --text-secondary: #5b5780;
  --text-muted: #8b87a8;
  --text-dim: #b5b2c8;

  --line: rgba(124, 58, 237, 0.06);
  --line-strong: rgba(124, 58, 237, 0.12);

  --code-bg: #f0ecf5;
  --code-text: #2e2a5e;

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04),
                 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  --shadow-float: 0 8px 32px rgba(0, 0, 0, 0.08),
                  0 0 0 1px rgba(255, 255, 255, 0.6) inset,
                  0 0 40px rgba(124, 58, 237, 0.06);
}

/* ============================================
   主题选择器（下拉菜单）
   ============================================ */
.theme-picker {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

.theme-picker-trigger {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--panel-border-hover);
  background: var(--panel-bg);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2), var(--shadow-card);
  position: relative;
}

.theme-picker-trigger:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 24px var(--neon-cyan-glow), var(--shadow-float);
  transform: scale(1.08);
}

.theme-picker.open .theme-picker-trigger {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 24px var(--neon-cyan-glow), var(--shadow-float);
}

.theme-picker-icon {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.5);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

.theme-picker-icon.active-icon {
  opacity: 1;
  transform: scale(1);
}

.theme-picker-chevron {
  width: 14px;
  height: 14px;
  position: absolute;
  bottom: 4px;
  right: 4px;
  opacity: 0.85;
  transition: transform 0.3s ease;
}

.theme-picker.open .theme-picker-chevron {
  transform: rotate(180deg);
}

.theme-picker-dropdown {
  position: absolute;
  top: 52px;
  right: 0;
  min-width: 160px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-picker.open .theme-picker-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.theme-picker-option svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.theme-picker-option:hover {
  background: rgba(0, 229, 255, 0.08);
  color: var(--text-primary);
}

.theme-picker-option.active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--neon-cyan);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.2);
}

/* ============================================
   全局重置
   ============================================ */

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--space-dark);
  color: var(--text-primary);
  font-family: "Inter", "SF Pro Display", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    sans-serif;
  scrollbar-color: var(--neon-cyan) rgba(0, 0, 0, 0.15);
  scrollbar-width: thin;
  letter-spacing: 0;
}

/* ========== 夜间主题背景：星空粒子 + 网格 ========== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(0, 229, 255, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(68, 138, 255, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 50% 50%, rgba(179, 136, 255, 0.03) 0%, transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 35%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 35%, black 20%, transparent 70%);
}

/* ========== 白天主题背景：柔和渐变光晕 ========== */
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 70% 50% at 15% 20%, rgba(37, 99, 235, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 75%, rgba(0, 136, 204, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(124, 58, 237, 0.04) 0%, transparent 60%);
}

[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.025) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 70%);
}

/* ========== 霓虹幻彩主题背景 ========== */
[data-theme="neon"] body::before {
  background:
    radial-gradient(ellipse 70% 50% at 20% 10%, rgba(123, 47, 247, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 240, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 50% 50%, rgba(178, 75, 247, 0.04) 0%, transparent 60%);
}

[data-theme="neon"] body::after {
  background-image:
    linear-gradient(rgba(123, 47, 247, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 35%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 35%, black 20%, transparent 70%);
}

/* ========== 赛博青锋主题背景 ========== */
[data-theme="cyber"] body::before {
  background:
    radial-gradient(ellipse 70% 50% at 20% 10%, rgba(0, 255, 229, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 168, 168, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 50% 50%, rgba(0, 255, 170, 0.03) 0%, transparent 60%);
}

[data-theme="cyber"] body::after {
  background-image:
    linear-gradient(rgba(0, 255, 229, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 229, 0.02) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 35%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 35%, black 20%, transparent 70%);
}

/* ========== 梦幻泡影主题背景 ========== */
[data-theme="dream"] body {
  background: linear-gradient(135deg, #d4c8f0 0%, #e0d8f5 30%, #e8e0f8 60%, #d0c8ec 100%);
  background-attachment: fixed;
}

[data-theme="dream"] body::before {
  background:
    radial-gradient(ellipse 70% 50% at 25% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 75% 75%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(168, 139, 250, 0.06) 0%, transparent 60%);
}

[data-theme="dream"] body::after {
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.015) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 70%);
}

button,
textarea,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
  opacity: 0.55;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
  opacity: 1;
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

::-webkit-scrollbar-corner {
  background: rgba(0, 0, 0, 0.15);
}

/* ============================================
   页面容器
   ============================================ */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ============================================
   Hero 区域
   ============================================ */

.hero-shell {
  position: relative;
  min-height: 640px;
  padding: 34px 0 84px;
  background: linear-gradient(180deg,
    rgba(10, 14, 23, 0.3) 0%,
    rgba(17, 24, 39, 0.6) 58%,
    var(--space-dark) 100%);
  overflow: hidden;
}

/* 扫描线动画 */
.hero-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 229, 255, 0.015) 2px,
    rgba(0, 229, 255, 0.015) 4px
  );
  animation: scanlines 8s linear infinite;
  pointer-events: none;
}

/* 顶部光晕 */
.hero-shell::after {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(0, 229, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: heroGlow 4s ease-in-out infinite alternate;
}

/* ========== 白天主题 Hero 美化 ========== */
[data-theme="light"] .hero-shell {
  background: linear-gradient(180deg,
    rgba(224, 231, 255, 0.5) 0%,
    rgba(240, 244, 248, 0.8) 50%,
    var(--space-dark) 100%);
}

[data-theme="light"] .hero-shell::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(37, 99, 235, 0.012) 2px,
    rgba(37, 99, 235, 0.012) 4px
  );
}

[data-theme="light"] .hero-shell::after {
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
}

/* ========== 霓虹幻彩主题 Hero 美化 ========== */
[data-theme="neon"] .hero-shell {
  background: linear-gradient(180deg,
    rgba(123, 47, 247, 0.15) 0%,
    rgba(14, 14, 40, 0.7) 50%,
    var(--space-dark) 100%);
}

[data-theme="neon"] .hero-shell::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(123, 47, 247, 0.015) 2px,
    rgba(123, 47, 247, 0.015) 4px
  );
}

[data-theme="neon"] .hero-shell::after {
  background: radial-gradient(ellipse, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
}

[data-theme="neon"] .hero-content h1 {
  color: #e8e8ff;
}

[data-theme="neon"] .hero-content h1 span {
  background: linear-gradient(
    135deg,
    #00f0ff 0%,
    #b24bf7 50%,
    #7b2ff7 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ========== 赛博青锋主题 Hero 美化 ========== */
[data-theme="cyber"] .hero-shell {
  background: linear-gradient(180deg,
    rgba(0, 255, 229, 0.1) 0%,
    rgba(5, 16, 20, 0.8) 50%,
    var(--space-dark) 100%);
}

[data-theme="cyber"] .hero-shell::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 229, 0.012) 2px,
    rgba(0, 255, 229, 0.012) 4px
  );
}

[data-theme="cyber"] .hero-shell::after {
  background: radial-gradient(ellipse, rgba(0, 255, 229, 0.12) 0%, transparent 70%);
}

[data-theme="cyber"] .hero-content h1 {
  color: #e0f7f7;
}

[data-theme="cyber"] .hero-content h1 span {
  background: linear-gradient(
    135deg,
    #00ffe5 0%,
    #00a8a8 50%,
    #00ffaa 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ========== 梦幻泡影主题 Hero 美化 ========== */
[data-theme="dream"] .hero-shell {
  background: linear-gradient(180deg,
    rgba(212, 200, 240, 0.6) 0%,
    rgba(237, 232, 245, 0.8) 50%,
    var(--space-dark) 100%);
}

[data-theme="dream"] .hero-shell::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(124, 58, 237, 0.01) 2px,
    rgba(124, 58, 237, 0.01) 4px
  );
}

[data-theme="dream"] .hero-shell::after {
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
}

[data-theme="dream"] .hero-content h1 {
  color: #1e1b4b;
}

[data-theme="dream"] .hero-content h1 span {
  background: linear-gradient(
    135deg,
    #7c3aed 0%,
    #6366f1 50%,
    #a78bfa 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes scanlines {
  0%   { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

@keyframes heroGlow {
  0%   { opacity: 0.6; transform: translateX(-50%) scale(1); }
  100% { opacity: 1;   transform: translateX(-50%) scale(1.15); }
}

/* ============================================
   状态指示灯
   ============================================ */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green), 0 0 16px rgba(0, 230, 118, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 8px var(--accent-green), 0 0 16px rgba(0, 230, 118, 0.4); }
  50%      { opacity: 0.5; box-shadow: 0 0 4px var(--accent-green), 0 0 8px rgba(0, 230, 118, 0.2); }
}

/* ============================================
   按钮系统
   ============================================ */

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.icon-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle at center, var(--neon-cyan-dim) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.icon-button:hover {
  border-color: var(--neon-cyan-glow);
  background: rgba(0, 229, 255, 0.08);
  color: var(--neon-cyan);
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--neon-cyan-dim);
}

.icon-button:hover::after {
  opacity: 1;
}

.icon-button svg,
.primary-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- 主按钮 (霓虹渐变) --- */
.primary-button,
.secondary-button,
.text-button,
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 680;
  letter-spacing: 0.02em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-button {
  gap: 9px;
  min-width: 142px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
  color: #0a0e17;
  font-weight: 720;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3),
              0 0 40px rgba(68, 138, 255, 0.2);
  position: relative;
  overflow: hidden;
}

/* 光泽扫过动画 */
.primary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 229, 255, 0.45),
              0 0 60px rgba(68, 138, 255, 0.3);
}

.primary-button:hover::before {
  transform: translateX(100%);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 14, 23, 0.3);
  border-top-color: #0a0e17;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* --- 次要按钮 --- */
.secondary-button {
  min-width: 86px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.secondary-button:hover {
  border-color: var(--neon-cyan-glow);
  background: rgba(0, 229, 255, 0.06);
  transform: translateY(-1px);
  box-shadow: 0 0 16px var(--neon-cyan-dim);
}

/* ========== 白天主题按钮美化 ========== */
[data-theme="light"] .primary-button {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.25),
              0 0 40px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .primary-button:hover {
  box-shadow: 0 6px 28px rgba(14, 165, 233, 0.35),
              0 0 60px rgba(37, 99, 235, 0.25);
}

[data-theme="light"] .secondary-button {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .secondary-button:hover {
  border-color: rgba(14, 165, 233, 0.4);
  background: rgba(14, 165, 233, 0.08);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.12);
}

[data-theme="light"] .icon-button {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .icon-button:hover {
  border-color: rgba(14, 165, 233, 0.4);
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.1);
}

.secondary-button.small {
  min-height: 34px;
  min-width: auto;
  padding: 0 12px;
  font-size: 13px;
}

/* ============================================
   Hero 内容
   ============================================ */

.hero-content {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 36px;
  text-align: center;
}

.hero-content h1 {
  color: #e8edf5;
  font-size: 64px;
  font-weight: 840;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-content h1 span {
  background: linear-gradient(
    135deg,
    var(--neon-cyan) 0%,
    var(--accent-purple) 50%,
    var(--neon-blue) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ========== 白天主题 Hero 标题美化 ========== */
[data-theme="light"] .hero-content h1 {
  color: #0f172a;
}

[data-theme="light"] .hero-content h1 span {
  background: linear-gradient(
    135deg,
    #1e40af 0%,
    #7c3aed 50%,
    #0e7490 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================
   Decoder 面板
   ============================================ */

.decoder-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  margin: 36px auto 0;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--panel-glow), var(--shadow-float);
  text-align: left;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.decoder-panel:hover {
  border-color: var(--panel-border-hover);
  transform: translateY(-2px);
}

/* ========== 白天主题面板增强 ========== */
[data-theme="light"] .decoder-panel {
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.65) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06),
              0 0 0 1px rgba(255, 255, 255, 0.6) inset,
              0 0 60px rgba(37, 99, 235, 0.04);
}

.decoder-head,
.panel-head,
.result-toolbar,
.action-row,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.decoder-head,
.panel-head,
.result-toolbar {
  justify-content: space-between;
}

.decoder-head {
  margin-bottom: 14px;
}

.decoder-head p,
.panel-head p {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.decoder-head h2,
.panel-head h2 {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 720;
  line-height: 1.25;
}

/* ============================================
   模式切换
   ============================================ */

.mode-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.mode-button {
  min-height: 38px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 680;
  letter-spacing: 0.03em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.mode-button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.mode-button.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--neon-cyan);
  box-shadow: 0 0 20px var(--neon-cyan-dim),
              inset 0 0 0 1px rgba(0, 229, 255, 0.2);
}

/* ========== 白天主题标签页美化 ========== */
[data-theme="light"] .mode-switch {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  padding: 8px;
  gap: 8px;
}

[data-theme="light"] .mode-button {
  color: var(--text-secondary);
  font-weight: 600;
}

[data-theme="light"] .mode-button:hover {
  background: rgba(14, 165, 233, 0.06);
  color: var(--text-primary);
}

[data-theme="light"] .mode-button.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25),
              inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

/* ============================================
   文本框
   ============================================ */

.decoder-panel textarea {
  display: block;
  width: 100%;
  min-height: 168px;
  max-height: 420px;
  padding: 16px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: rgba(6, 11, 20, 0.7);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  font-family: "SF Mono", "Fira Code", "Cascadia Code",
    Consolas, Menlo, monospace;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.decoder-panel textarea:focus {
  border-color: var(--neon-cyan);
  background: rgba(6, 11, 20, 0.9);
  box-shadow: 0 0 0 4px var(--neon-cyan-dim),
              0 0 24px var(--neon-cyan-dim);
}

.decoder-panel textarea.dragging {
  border-color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.04);
  box-shadow: 0 0 0 6px var(--neon-cyan-dim);
}

.decoder-panel textarea::placeholder {
  color: var(--text-dim);
}

/* ========== 白天主题文本框美化 ========== */
[data-theme="light"] .decoder-panel textarea {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) inset;
}

[data-theme="light"] .decoder-panel textarea:focus {
  border-color: #0ea5e9;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1),
              0 0 24px rgba(14, 165, 233, 0.08);
}

[data-theme="light"] .decoder-panel textarea::placeholder {
  color: #94a3b8;
}

/* ============================================
   加密选项
   ============================================ */

.encrypt-options {
  display: grid;
  grid-template-columns: 160px 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.encrypt-options label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.encrypt-options span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.03em;
}

.encrypt-options input,
.encrypt-options select {
  width: 100%;
  min-height: 38px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: rgba(6, 11, 20, 0.6);
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.encrypt-options input:focus,
.encrypt-options select:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--neon-cyan-dim);
}

.encrypt-options select {
  cursor: pointer;
}

.encrypt-options select option {
  background: var(--space-mid);
  color: var(--text-primary);
}

/* ========== 白天主题加密选项美化 ========== */
[data-theme="light"] .encrypt-options {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  border-radius: 14px;
}

[data-theme="light"] .encrypt-options input,
[data-theme="light"] .encrypt-options select {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .encrypt-options input:focus,
[data-theme="light"] .encrypt-options select:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* ============================================
   操作行
   ============================================ */

.action-row {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ============================================
   Desk 区域
   ============================================ */

.desk-section {
  position: relative;
  z-index: 1;
  background: transparent;
  padding: 0 0 58px;
}

.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: min(920px, calc(100% - 48px));
  margin: 0 auto;
  transform: translateY(-36px);
}

.results-column,
.insight-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* ============================================
   面板通用
   ============================================ */

.panel {
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.panel:hover {
  border-color: var(--panel-border-hover);
  transform: translateY(-1px);
}

/* ========== 白天主题面板增强 ========== */
[data-theme="light"] .panel {
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.75) 100%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05),
              0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

[data-theme="light"] .panel:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
              0 0 0 1px rgba(255, 255, 255, 0.6) inset,
              0 0 40px rgba(37, 99, 235, 0.06);
}

[data-theme="light"] .panel-head {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.panel-head {
  min-height: 64px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.panel-actions .icon-button {
  width: 34px;
  height: 34px;
  color: var(--text-secondary);
}

/* ============================================
   指标卡片
   ============================================ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 顶部霓虹扫描线 */
.metric::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric:hover {
  border-color: var(--neon-cyan-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.metric:hover::after {
  opacity: 1;
}

/* ========== 白天主题指标卡片美化 ========== */
[data-theme="light"] .metric {
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.7) 100%);
  border-color: rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04),
              0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

[data-theme="light"] .metric:hover {
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06),
              0 0 0 1px rgba(255, 255, 255, 0.5) inset,
              0 0 30px rgba(14, 165, 233, 0.08);
}

[data-theme="light"] .metric::after {
  background: linear-gradient(90deg, transparent, #0ea5e9, transparent);
}

[data-theme="light"] .metric strong {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
}

.metric span {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 640;
  letter-spacing: 0.03em;
}

.metric strong {
  display: block;
  margin-top: 7px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
}

/* ============================================
   标签页
   ============================================ */

.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 10px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-width: 76px;
  min-height: 38px;
  padding: 0 14px;
  background: transparent;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 640;
  transition: all 0.25s ease;
  border-radius: 8px 8px 0 0;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.tab.active {
  background: rgba(0, 229, 255, 0.08);
  color: var(--neon-cyan);
  box-shadow: 0 -2px 0 var(--neon-cyan);
}

/* ========== 白天主题标签页美化 ========== */
[data-theme="light"] .tab:hover {
  background: rgba(14, 165, 233, 0.06);
  color: var(--text-primary);
}

[data-theme="light"] .tab.active {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.04) 100%);
  color: #0ea5e9;
  box-shadow: 0 -3px 0 #0ea5e9;
  font-weight: 700;
}

/* ============================================
   结果工具栏
   ============================================ */

.result-toolbar {
  padding: 13px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 640;
}

.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ============================================
   代码视图
   ============================================ */

.code-view {
  width: 100%;
  min-width: 0;
  min-height: 520px;
  max-height: 70vh;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: 0 0 12px 12px;
  background: var(--code-bg);
  color: var(--code-text);
  font: 13px/1.58 "SF Mono", "Fira Code", "Cascadia Code",
    "SFMono-Regular", Consolas, Menlo, monospace;
  white-space: pre;
}

.code-view::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.code-view::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  opacity: 0.6;
}

.code-view .inline-url,
.asset-item .inline-url {
  color: var(--neon-cyan);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.asset-item .inline-url {
  color: var(--neon-cyan);
  overflow-wrap: anywhere;
}

.code-view .inline-url:hover,
.asset-item .inline-url:hover {
  text-decoration-thickness: 2px;
  text-shadow: 0 0 8px var(--neon-cyan-dim);
}

/* ========== 白天主题代码视图美化 ========== */
[data-theme="light"] .code-view {
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #0ea5e9;
  opacity: 0.65;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

[data-theme="light"] .code-view::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] {
  scrollbar-color: #0ea5e9 rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .code-view .inline-url,
[data-theme="light"] .asset-item .inline-url {
  color: #2563eb;
}

[data-theme="light"] .code-view .inline-url:hover,
[data-theme="light"] .asset-item .inline-url:hover {
  text-shadow: none;
}

/* ============================================
   解析接口测试面板
   ============================================ */

.parse-panel {
  padding: 0;
}

.parse-empty {
  padding: 40px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.parse-sources-manager {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 229, 255, 0.02);
}

.parse-sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 640;
  color: var(--text-secondary);
}

.parse-source-add {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--panel-border-hover);
  background: transparent;
  color: var(--neon-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.parse-source-add:hover {
  background: var(--neon-cyan-dim);
}

.parse-sources-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.parse-source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  transition: all 0.2s ease;
}

.parse-source-item:hover {
  border-color: var(--panel-border-hover);
}

.parse-source-item input[type="radio"] {
  accent-color: var(--neon-cyan);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

.parse-source-item label {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.parse-source-del {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.parse-source-del:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
}

.parse-list-header {
  padding: 12px 16px 8px;
  font-size: 13px;
  font-weight: 640;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.parse-test-all-btn {
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--neon-cyan);
  background: var(--neon-cyan-dim);
  color: var(--neon-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.parse-test-all-btn:hover {
  background: var(--neon-cyan);
  color: var(--bg-base);
  box-shadow: 0 0 16px var(--neon-cyan-glow);
}

.parse-test-all-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.parse-list {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.parse-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  transition: all 0.2s ease;
}

.parse-item:hover {
  border-color: var(--panel-border-hover);
  box-shadow: var(--shadow-card);
}

.parse-item-url {
  flex: 1;
  font-size: 13px;
  color: var(--neon-cyan);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
}

.parse-item-url:hover {
  text-decoration: underline;
}

.parse-test-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border-hover);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.parse-test-btn:hover {
  background: var(--neon-cyan-dim);
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

.parse-test-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.parse-test-result {
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 80px;
  text-align: right;
}

.parse-test-result.success {
  color: var(--accent-green);
}

.parse-test-result.fail {
  color: var(--accent-red);
}

.parse-test-result.testing {
  color: var(--accent-amber);
}

/* ========== 白天主题解析面板美化 ========== */
[data-theme="light"] .parse-sources-manager {
  background: rgba(14, 165, 233, 0.02);
}

[data-theme="light"] .parse-source-item,
[data-theme="light"] .parse-item {
  background: #ffffff;
}

/* ============================================
   摘要列表
   ============================================ */

.summary-list {
  margin: 0;
  padding: 4px 18px 18px;
}

.summary-list div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.summary-list div:last-child {
  border-bottom: 0;
}

.summary-list dt {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================
   批量 / 资源列表
   ============================================ */

.batch-list,
.asset-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.assets-panel.collapsed .panel-head {
  border-bottom: 0;
}

.assets-panel.collapsed .asset-list {
  display: none;
}

.batch-item,
.asset-item,
.asset-empty {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.25s ease;
}

.batch-item:hover,
.asset-item:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.batch-item.success {
  border-color: rgba(0, 230, 118, 0.25);
  background: rgba(0, 230, 118, 0.04);
}

.batch-item.success:hover {
  border-color: rgba(0, 230, 118, 0.4);
}

.batch-item.error {
  border-color: rgba(255, 82, 82, 0.25);
  background: rgba(255, 82, 82, 0.04);
}

.batch-item.error:hover {
  border-color: rgba(255, 82, 82, 0.4);
}

/* ========== 白天主题列表项美化 ========== */
[data-theme="light"] .batch-item,
[data-theme="light"] .asset-item,
[data-theme="light"] .asset-empty {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.05);
  border-radius: 14px;
}

[data-theme="light"] .batch-item:hover,
[data-theme="light"] .asset-item:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(14, 165, 233, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .batch-item.success {
  border-color: rgba(5, 150, 105, 0.2);
  background: rgba(5, 150, 105, 0.06);
}

[data-theme="light"] .batch-item.error {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
}

.batch-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 640;
}

.batch-item strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
}

.batch-item p,
.asset-empty {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

/* ============================================
   资源项
   ============================================ */

.asset-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.asset-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.1);
  color: var(--neon-cyan);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(0, 229, 255, 0.2);
}

/* ========== 白天主题资源标签美化 ========== */
[data-theme="light"] .asset-kind {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
  border-color: rgba(14, 165, 233, 0.25);
}

.asset-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.35;
}

.asset-item p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

/* ============================================
   日志面板
   ============================================ */

.logs-panel {
  overflow: hidden;
  border-color: var(--line);
  background: var(--panel-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.logs-panel .panel-head {
  border-bottom-color: var(--line);
}

.logs-panel .panel-head h2 {
  color: var(--text-primary);
}

.logs-panel .panel-head p {
  color: var(--text-muted);
}

.text-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 13px;
  transition: all 0.25s ease;
}

.text-button:hover {
  background: rgba(0, 229, 255, 0.08);
  color: var(--neon-cyan);
}

.log-list {
  display: grid;
  gap: 10px;
  max-height: 580px;
  overflow: auto;
  padding: 14px;
}

.log-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.25s ease;
}

.log-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
}

.log-item strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
}

.log-item p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.log-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.log-status {
  font-weight: 720;
}

.log-status.success {
  color: var(--accent-green);
  text-shadow: 0 0 8px rgba(0, 230, 118, 0.3);
}

.log-status.error {
  color: var(--accent-red);
  text-shadow: 0 0 8px rgba(255, 82, 82, 0.3);
}

/* ========== 白天主题日志美化 ========== */
[data-theme="light"] .text-button {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
}

[data-theme="light"] .text-button:hover {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

[data-theme="light"] .log-item {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.05);
  border-radius: 14px;
}

[data-theme="light"] .log-item:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(14, 165, 233, 0.15);
}

[data-theme="light"] .log-status.success {
  text-shadow: none;
}

[data-theme="light"] .log-status.error {
  text-shadow: none;
}

/* ============================================
   Builder 模式
   ============================================ */

.builder-active {
  background: var(--space-dark);
}

.builder-active .hero-shell {
  min-height: 360px;
  padding: 30px 0 70px;
  background: linear-gradient(180deg,
    var(--space-mid) 0%,
    var(--space-dark) 100%);
}

.builder-active .hero-shell::before {
  opacity: 0.5;
}

.builder-active .hero-content {
  padding-top: 28px;
}

.builder-active .hero-content h1 {
  font-size: 34px;
  line-height: 1.18;
}

.builder-active .hero-content h1 span {
  display: block;
  margin-top: 10px;
  background: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 520;
}

.builder-active .decoder-panel {
  width: min(720px, 100%);
  margin-top: 24px;
  padding: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.builder-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  transform: translateY(-36px);
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: start;
}

.builder-forms {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.builder-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.builder-card:hover {
  border-color: var(--panel-border-hover);
  transform: translateY(-1px);
}

/* ========== 白天主题 Builder 卡片美化 ========== */
[data-theme="light"] .builder-card {
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.75) 100%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05),
              0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

[data-theme="light"] .builder-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
              0 0 0 1px rgba(255, 255, 255, 0.6) inset,
              0 0 40px rgba(37, 99, 235, 0.06);
}

[data-theme="light"] .builder-card-head {
  background: rgba(0, 0, 0, 0.02);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .builder-item {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.05);
  border-radius: 14px;
}

[data-theme="light"] .builder-item:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(14, 165, 233, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .builder-field input,
[data-theme="light"] .builder-field select,
[data-theme="light"] .builder-json-editor,
[data-theme="light"] .builder-modal-body textarea {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .builder-field input:focus,
[data-theme="light"] .builder-field select:focus,
[data-theme="light"] .builder-json-editor:focus,
[data-theme="light"] .builder-modal-body textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1),
              0 0 16px rgba(14, 165, 233, 0.08);
}

[data-theme="light"] .builder-field select option {
  background: #ffffff;
  color: #1e293b;
}

.builder-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.builder-card-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.builder-card-head p {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.builder-card-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.builder-list {
  display: grid;
  gap: 14px;
}

.builder-item {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
}

.builder-item:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.builder-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.builder-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.builder-field span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 640;
}

.builder-field input,
.builder-field select,
.builder-json-editor,
.builder-modal-body textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: rgba(6, 11, 20, 0.6);
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.builder-field input,
.builder-field select {
  min-height: 40px;
  padding: 0 12px;
  font-size: 14px;
}

.builder-field select {
  cursor: pointer;
}

.builder-field select option {
  background: var(--space-mid);
  color: var(--text-primary);
}

.builder-field input:focus,
.builder-field select:focus,
.builder-json-editor:focus,
.builder-modal-body textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--neon-cyan-dim),
              0 0 16px var(--neon-cyan-dim);
}

.builder-field em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.builder-checks {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 13px;
}

.builder-checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  cursor: pointer;
}

.builder-checks input {
  width: 16px;
  height: 16px;
  accent-color: var(--neon-cyan);
}

/* --- Builder 按钮 --- */
.builder-add-button,
.builder-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
  color: #0a0e17;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.2);
}

.builder-add-button:hover,
.builder-download-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.4);
}

.builder-remove-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.builder-remove-button:hover {
  background: rgba(255, 82, 82, 0.15);
  color: var(--accent-red);
}

.builder-remove-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.builder-preview-wrap {
  position: sticky;
  top: 18px;
  min-width: 0;
}

.builder-preview-card .builder-card-body {
  gap: 12px;
}

.builder-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 640;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.builder-copy-button:hover {
  border-color: var(--neon-cyan-glow);
  background: rgba(0, 229, 255, 0.06);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-dim);
}

.builder-json-editor {
  min-height: 360px;
  max-height: 58vh;
  padding: 16px;
  resize: vertical;
  overflow: auto;
  background: var(--code-bg);
  font: 13px/1.58 "SF Mono", "Fira Code", "Cascadia Code",
    "SFMono-Regular", Consolas, Menlo, monospace;
  white-space: pre;
  color: var(--code-text);
}

.builder-error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 82, 82, 0.3);
  border-radius: 8px;
  background: rgba(255, 82, 82, 0.08);
  color: var(--accent-red);
  font-size: 13px;
  line-height: 1.4;
}

.builder-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.danger-soft {
  border-color: rgba(255, 82, 82, 0.25);
  color: var(--accent-red);
}

.danger-soft:hover {
  border-color: rgba(255, 82, 82, 0.5);
  background: rgba(255, 82, 82, 0.1);
  color: #ff5252;
  box-shadow: 0 0 16px rgba(255, 82, 82, 0.15);
}

/* ============================================
   模态框
   ============================================ */

.builder-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
}

.builder-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.builder-modal-card {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  overflow: hidden;
  border-radius: 16px;
  background: var(--space-mid);
  border: 1px solid var(--panel-border);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5),
              0 0 40px var(--neon-cyan-dim);
}

.builder-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

/* ========== 白天主题模态框美化 ========== */
[data-theme="light"] .builder-modal-backdrop {
  background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .builder-modal-card {
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.15),
              0 0 40px rgba(14, 165, 233, 0.08);
}

[data-theme="light"] .builder-modal-head {
  background: rgba(0, 0, 0, 0.02);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.builder-modal-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
}

.builder-modal-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.builder-modal-body textarea {
  min-height: 220px;
  padding: 14px;
  resize: vertical;
  font: 13px/1.55 "SF Mono", "Fira Code", "Cascadia Code",
    "SFMono-Regular", Consolas, Menlo, monospace;
  background: var(--code-bg);
  color: var(--code-text);
}

/* ============================================
   Assist 模态框
   ============================================ */

.assist-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 22px;
}

.assist-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.assist-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--space-mid);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5),
              0 0 40px var(--neon-cyan-dim);
}

/* ========== 白天主题辅助模态框美化 ========== */
[data-theme="light"] .assist-modal-backdrop {
  background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .assist-modal-card {
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.15),
              0 0 40px rgba(14, 165, 233, 0.08);
}

[data-theme="light"] .assist-url {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
  color: #2563eb;
}

[data-theme="light"] .assist-modal textarea {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .assist-modal textarea[readonly] {
  background: rgba(241, 245, 249, 0.95);
}

[data-theme="light"] .assist-modal textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1),
              0 0 16px rgba(14, 165, 233, 0.08);
}

.assist-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.assist-modal-head h2 {
  margin: 0 0 5px;
  color: var(--text-primary);
  font-size: 19px;
}

.assist-modal-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.assist-url {
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(6, 11, 20, 0.6);
  color: var(--neon-cyan);
  font: 12px/1.5 "SF Mono", "Fira Code", "Cascadia Code",
    "SFMono-Regular", Consolas, Menlo, monospace;
}

.assist-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.assist-modal textarea {
  width: 100%;
  min-height: 180px;
  padding: 13px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: rgba(6, 11, 20, 0.6);
  color: var(--text-primary);
  font: 13px/1.55 "SF Mono", "Fira Code", "Cascadia Code",
    "SFMono-Regular", Consolas, Menlo, monospace;
  transition: all 0.25s ease;
}

.assist-modal textarea[readonly] {
  background: rgba(6, 11, 20, 0.9);
}

.assist-modal textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--neon-cyan-dim),
              0 0 16px var(--neon-cyan-dim);
}

/* ============================================
   Toast 提示
   ============================================ */

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border: 1px solid var(--neon-cyan-glow);
  border-radius: 8px;
  background: var(--space-mid);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 0 16px var(--neon-cyan-dim);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ========== 白天主题 Toast 美化 ========== */
[data-theme="light"] .toast {
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
  border-color: rgba(14, 165, 233, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
              0 0 16px rgba(14, 165, 233, 0.08);
}

/* ============================================
   站点底部
   ============================================ */

.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(10, 14, 23, 0.8);
  border-top: 1px solid var(--line);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.site-footer-inner span {
  background: linear-gradient(135deg, var(--neon-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.site-footer-inner a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.25s ease;
}

/* ========== 白天主题底部美化 ========== */
[data-theme="light"] .site-footer {
  background: rgba(255, 255, 255, 0.7);
  border-top-color: rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="light"] .site-footer-inner span {
  background: linear-gradient(135deg, #0ea5e9, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
}

.site-footer-inner a:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan-dim);
}

/* ========== 白天主题底部链接美化 ========== */
[data-theme="light"] .site-footer-inner a:hover {
  color: #0ea5e9;
  text-shadow: none;
}

/* ============================================
   工具类
   ============================================ */

[hidden] {
  display: none !important;
}

/* ============================================
   关键帧动画
   ============================================ */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 光标闪烁 */
.typing-cursor::after {
  content: "|";
  animation: blink 1s step-end infinite;
  color: var(--neon-cyan);
  font-weight: 100;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================
   响应式
   ============================================ */

@media (max-width: 1120px) {
  .desk-grid {
    grid-template-columns: 1fr;
  }

  .builder-layout {
    grid-template-columns: 1fr;
  }

  .builder-preview-wrap {
    position: static;
  }

  .insight-column {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .hero-shell {
    min-height: 600px;
    padding-bottom: 76px;
  }

  .hero-content {
    width: min(100% - 32px, 980px);
    padding-top: 34px;
  }

  .hero-content h1 {
    font-size: 48px;
  }

  .desk-grid {
    width: min(100% - 32px, 920px);
  }

  .builder-shell {
    width: min(100% - 32px, 1180px);
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .encrypt-options {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .hero-shell {
    min-height: auto;
    padding-top: 14px;
  }

  .hero-content {
    padding-top: 28px;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .decoder-panel {
    margin-top: 30px;
    padding: 16px;
  }

  .decoder-head,
  .panel-head,
  .result-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-button {
    grid-column: 1 / -1;
  }

  .mode-switch,
  .encrypt-options {
    grid-template-columns: 1fr;
  }

  .builder-active .hero-content h1 {
    font-size: 30px;
  }

  .builder-card-head,
  .builder-form-row,
  .builder-action-grid {
    grid-template-columns: 1fr;
  }

  .builder-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .builder-copy-button {
    width: 100%;
  }

  .panel-actions,
  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .asset-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .insight-column {
    grid-template-columns: 1fr;
  }

  .code-view {
    min-height: 380px;
  }

  .assist-modal {
    align-items: start;
    padding: 12px;
  }

  .assist-modal-card {
    max-height: calc(100vh - 24px);
    padding: 14px;
    border-radius: 10px;
  }

  .assist-modal-head {
    gap: 10px;
  }

  .assist-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .assist-modal textarea {
    min-height: 150px;
    font-size: 12px;
  }
}

@media (max-width: 430px) {
  .hero-content h1 {
    font-size: 30px;
  }

  .action-row,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .secondary-button,
  .primary-button,
  .asset-item .secondary-button {
    width: 100%;
  }

  .assist-actions {
    grid-template-columns: 1fr;
  }

  .assist-url {
    font-size: 11px;
  }

  .assist-modal textarea {
    min-height: 130px;
  }
}
