/*
 * 雨泣工作室 · 主题系统
 * 通过 html[data-theme] 覆盖各页面 CSS 变量及关键硬编码值
 * ─────────────────────────────────────────────────────────
 * dark     深色科技风（默认，无需覆盖）
 * light    学术白
 * green    护眼绿
 * contrast 高对比度
 */


/* ════════════════════════════════════════
   学术白 (light)
════════════════════════════════════════ */
html[data-theme="light"] {
  --bg:     #f0f4f8;
  --panel:  rgba(255,255,255,0.95);
  --border: #d1dce8;
  --cyan:   #1d4ed8;
  --gold:   #d97706;
  --text:   #1e293b;
  --dim:    #64748b;
  --danger: #dc2626;
  --success:#16a34a;
  --ok:     #16a34a;
  --light:  #e8f0f7;
}
html[data-theme="light"] body {
  background: #f0f4f8 !important;
  color: #1e293b !important;
}
/* 导航 & 工具栏 */
html[data-theme="light"] nav,
html[data-theme="light"] .tool-switcher {
  background: rgba(248,250,252,0.97) !important;
  border-color: #d1dce8 !important;
}
html[data-theme="light"] .nav-logo { color: #1d4ed8 !important; }
html[data-theme="light"] .tsw-item { color: #64748b !important; }
html[data-theme="light"] .tsw-item:hover { color: #1e293b !important; }
html[data-theme="light"] .tsw-item.active { color: #1d4ed8 !important; border-bottom-color: #1d4ed8 !important; }
html[data-theme="light"] .nav-links a { color: #64748b !important; }
html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a.active { color: #1d4ed8 !important; }
/* Hero */
html[data-theme="light"] .hero {
  background: linear-gradient(135deg, #1e3a6e 0%, #2563eb 100%) !important;
}
/* 卡片/面板 */
html[data-theme="light"] .card,
html[data-theme="light"] .tool-card {
  background: #ffffff !important;
  border-color: #d1dce8 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}
html[data-theme="light"] .tool-card:hover { background: #f0f7ff !important; border-color: #93c5fd !important; }
html[data-theme="light"] .left {
  background: rgba(255,255,255,0.95) !important;
  border-color: #d1dce8 !important;
}
html[data-theme="light"] .right { background: #e8f0f7 !important; }
/* 上传区 */
html[data-theme="light"] #dropZone,
html[data-theme="light"] .upload-zone,
html[data-theme="light"] .drop {
  border-color: #d1dce8 !important;
}
html[data-theme="light"] #dropZone:hover,
html[data-theme="light"] .upload-zone:hover { border-color: #1d4ed8 !important; background: rgba(29,78,216,0.03) !important; }
html[data-theme="light"] .file-info {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}
/* 输入框 */
html[data-theme="light"] input[type=text],
html[data-theme="light"] input[type=number],
html[data-theme="light"] textarea {
  background: #f8fafc !important;
  border-color: #d1dce8 !important;
  color: #1e293b !important;
}
/* 按钮 */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn.btn-primary { background: #1d4ed8 !important; color: #fff !important; }
html[data-theme="light"] .btn-primary:hover:not(:disabled) { background: #1a44c4 !important; }
html[data-theme="light"] .btn-download,
html[data-theme="light"] .btn-secondary {
  background: rgba(29,78,216,0.07) !important;
  border-color: rgba(29,78,216,0.25) !important;
  color: #1d4ed8 !important;
}
html[data-theme="light"] .btn-sm { background: #f1f5f9 !important; border-color: #d1dce8 !important; color: #334155 !important; }
/* 列表/规格 */
html[data-theme="light"] .info-list li,
html[data-theme="light"] .mitem { background: #f0f7ff !important; border-color: #d1dce8 !important; color: #475569 !important; }
/* 状态框 */
html[data-theme="light"] #statusBox.processing,
html[data-theme="light"] .status.info { background: rgba(29,78,216,0.08) !important; color: #1d4ed8 !important; }
html[data-theme="light"] #statusBox.success,
html[data-theme="light"] .status.success { background: rgba(22,163,74,0.08) !important; color: #16a34a !important; }
html[data-theme="light"] #statusBox.error,
html[data-theme="light"] .status.error { background: rgba(220,38,38,0.08) !important; color: #dc2626 !important; }
/* page-header */
html[data-theme="light"] .page-header { background: linear-gradient(135deg, #1e3a6e 0%, #2563eb 100%) !important; }
/* Tag */
html[data-theme="light"] .tag-free { background: rgba(22,163,74,0.1) !important; border-color: rgba(22,163,74,0.3) !important; color: #16a34a !important; }
html[data-theme="light"] .tag-soon { background: rgba(217,119,6,0.1) !important; border-color: rgba(217,119,6,0.3) !important; color: #d97706 !important; }
/* Footer */
html[data-theme="light"] footer { border-color: #d1dce8 !important; background: #e8eef4 !important; }
html[data-theme="light"] footer a { color: #64748b !important; }
/* section-title */
html[data-theme="light"] .section-title { color: #94a3b8 !important; }
/* 画布背景 */
html[data-theme="light"] .fft-wrap,
html[data-theme="light"] .right,
html[data-theme="light"] canvas#cv { background: #dde8f4 !important; }
html[data-theme="light"] .empty-hint { color: #94a3b8 !important; }
/* 搜索栏文字 */
html[data-theme="light"] .nav-current,
html[data-theme="light"] .upload-text { color: #475569 !important; }
html[data-theme="light"] .upload-text em { color: #1d4ed8 !important; }
html[data-theme="light"] .drop-hint strong { color: #1e293b !important; }


/* ════════════════════════════════════════
   护眼绿 (green)
════════════════════════════════════════ */
html[data-theme="green"] {
  --bg:     #0e1a0c;
  --panel:  rgba(255,255,255,0.04);
  --border: rgba(34,197,94,0.18);
  --cyan:   #22c55e;
  --gold:   #86efac;
  --text:   #dcf5e4;
  --dim:    #5a8a68;
  --danger: #f87171;
  --success:#4ade80;
  --ok:     #4ade80;
}
html[data-theme="green"] body { background: #0e1a0c !important; color: #dcf5e4 !important; }
html[data-theme="green"] nav,
html[data-theme="green"] .tool-switcher { background: rgba(8,20,8,0.97) !important; border-color: rgba(34,197,94,0.15) !important; }
html[data-theme="green"] .nav-logo { color: #22c55e !important; }
html[data-theme="green"] .hero { background: linear-gradient(135deg, #061209 0%, #0d2410 100%) !important; }
html[data-theme="green"] .hero-label { background: rgba(34,197,94,0.1) !important; border-color: rgba(34,197,94,0.25) !important; color: #4ade80 !important; }
html[data-theme="green"] .card,
html[data-theme="green"] .tool-card { background: rgba(255,255,255,0.04) !important; border-color: rgba(34,197,94,0.15) !important; }
html[data-theme="green"] .tool-card:hover { border-color: rgba(34,197,94,0.4) !important; background: rgba(34,197,94,0.04) !important; }
html[data-theme="green"] .left { background: rgba(8,20,8,0.9) !important; border-color: rgba(34,197,94,0.15) !important; }
html[data-theme="green"] .right { background: #06100a !important; }
html[data-theme="green"] #dropZone,
html[data-theme="green"] .upload-zone,
html[data-theme="green"] .drop { border-color: rgba(34,197,94,0.18) !important; }
html[data-theme="green"] #dropZone:hover,
html[data-theme="green"] .upload-zone:hover { border-color: #22c55e !important; background: rgba(34,197,94,0.04) !important; }
html[data-theme="green"] input[type=text],
html[data-theme="green"] input[type=number],
html[data-theme="green"] textarea { background: rgba(255,255,255,0.05) !important; border-color: rgba(34,197,94,0.18) !important; color: #dcf5e4 !important; }
html[data-theme="green"] .btn-primary,
html[data-theme="green"] .btn.btn-primary { background: #22c55e !important; color: #061209 !important; }
html[data-theme="green"] .btn-download,
html[data-theme="green"] .btn-secondary { background: rgba(34,197,94,0.1) !important; border-color: rgba(34,197,94,0.3) !important; color: #22c55e !important; }
html[data-theme="green"] .btn-sm { background: rgba(255,255,255,0.07) !important; border-color: rgba(34,197,94,0.18) !important; color: #dcf5e4 !important; }
html[data-theme="green"] .info-list li,
html[data-theme="green"] .mitem { background: rgba(255,255,255,0.03) !important; border-color: rgba(34,197,94,0.15) !important; }
html[data-theme="green"] .tag-free { background: rgba(34,197,94,0.1) !important; border-color: rgba(34,197,94,0.3) !important; color: #4ade80 !important; }
html[data-theme="green"] .page-header { background: linear-gradient(135deg, #061209 0%, #0d2410 100%) !important; }
html[data-theme="green"] footer { border-color: rgba(34,197,94,0.15) !important; }
html[data-theme="green"] .tip-bar { background: rgba(8,20,8,0.92) !important; border-color: rgba(34,197,94,0.18) !important; }


/* ════════════════════════════════════════
   高对比度 (contrast)
════════════════════════════════════════ */
html[data-theme="contrast"] {
  --bg:     #000000;
  --panel:  rgba(255,255,255,0.06);
  --border: rgba(251,191,36,0.35);
  --cyan:   #fbbf24;
  --gold:   #fbbf24;
  --text:   #ffffff;
  --dim:    #a3a3a3;
  --danger: #ff4444;
  --success:#00ff88;
  --ok:     #00ff88;
}
html[data-theme="contrast"] body { background: #000 !important; color: #fff !important; }
html[data-theme="contrast"] nav,
html[data-theme="contrast"] .tool-switcher { background: rgba(0,0,0,0.99) !important; border-color: rgba(251,191,36,0.35) !important; }
html[data-theme="contrast"] .nav-logo { color: #fbbf24 !important; }
html[data-theme="contrast"] .tsw-item { color: #a3a3a3 !important; }
html[data-theme="contrast"] .tsw-item:hover { color: #fff !important; }
html[data-theme="contrast"] .tsw-item.active { color: #fbbf24 !important; border-bottom-color: #fbbf24 !important; }
html[data-theme="contrast"] .hero { background: #000 !important; border-bottom: 2px solid #fbbf24 !important; }
html[data-theme="contrast"] .hero-label { background: rgba(251,191,36,0.1) !important; border-color: rgba(251,191,36,0.4) !important; color: #fbbf24 !important; }
html[data-theme="contrast"] .card,
html[data-theme="contrast"] .tool-card { background: #0a0a0a !important; border-color: rgba(251,191,36,0.3) !important; }
html[data-theme="contrast"] .tool-card:hover { border-color: #fbbf24 !important; background: rgba(251,191,36,0.04) !important; }
html[data-theme="contrast"] .left { background: #060606 !important; border-color: rgba(251,191,36,0.25) !important; }
html[data-theme="contrast"] .right { background: #000 !important; }
html[data-theme="contrast"] #dropZone,
html[data-theme="contrast"] .upload-zone,
html[data-theme="contrast"] .drop { border-color: rgba(251,191,36,0.3) !important; }
html[data-theme="contrast"] #dropZone:hover,
html[data-theme="contrast"] .upload-zone:hover { border-color: #fbbf24 !important; }
html[data-theme="contrast"] input[type=text],
html[data-theme="contrast"] input[type=number],
html[data-theme="contrast"] textarea { background: #111 !important; border-color: rgba(251,191,36,0.3) !important; color: #fff !important; }
html[data-theme="contrast"] .btn-primary,
html[data-theme="contrast"] .btn.btn-primary { background: #fbbf24 !important; color: #000 !important; font-weight: 800 !important; }
html[data-theme="contrast"] .btn-download,
html[data-theme="contrast"] .btn-secondary { background: rgba(251,191,36,0.1) !important; border-color: rgba(251,191,36,0.4) !important; color: #fbbf24 !important; }
html[data-theme="contrast"] .btn-sm { background: #111 !important; border-color: rgba(251,191,36,0.3) !important; color: #fff !important; }
html[data-theme="contrast"] .info-list li,
html[data-theme="contrast"] .mitem { background: #0a0a0a !important; border-color: rgba(251,191,36,0.25) !important; color: #e5e5e5 !important; }
html[data-theme="contrast"] .info-list li::before { color: #fbbf24 !important; }
html[data-theme="contrast"] .tag-free { background: rgba(0,255,136,0.1) !important; border-color: rgba(0,255,136,0.3) !important; color: #00ff88 !important; }
html[data-theme="contrast"] .page-header { background: #000 !important; border-bottom: 2px solid #fbbf24 !important; }
html[data-theme="contrast"] footer { border-color: rgba(251,191,36,0.25) !important; }
html[data-theme="contrast"] .section-title { color: #a3a3a3 !important; }
html[data-theme="contrast"] #statusBox.processing,
html[data-theme="contrast"] .status.info { background: rgba(251,191,36,0.1) !important; color: #fbbf24 !important; }
html[data-theme="contrast"] #statusBox.success,
html[data-theme="contrast"] .status.success { background: rgba(0,255,136,0.1) !important; color: #00ff88 !important; }
html[data-theme="contrast"] #statusBox.error,
html[data-theme="contrast"] .status.error { background: rgba(255,68,68,0.1) !important; color: #ff4444 !important; }

/* ════════════════════════════════════════
   语言切换按钮（全局）
════════════════════════════════════════ */
.lang-toggle{background:rgba(255,255,255,.04);border:1px solid rgba(0,229,255,.15);color:#6a8aaa;border-radius:20px;padding:4px 14px;font-size:.78rem;cursor:pointer;transition:all .2s;font-family:inherit;flex-shrink:0}
.lang-toggle:hover{border-color:#00e5ff;color:#00e5ff}
html[data-theme="light"] .lang-toggle{background:rgba(0,0,0,.04);border-color:#d1dce8;color:#64748b}
html[data-theme="light"] .lang-toggle:hover{border-color:#1d4ed8;color:#1d4ed8}

