/* ============================================================
   CZC Tools Design System v1.1 — light/dark dual theme
   Light: default   Dark: [data-theme="dark"]
   Accent: #d9467b (pink) + #8b5cf6 (violet)
   ============================================================ */

:root {
  --bg: #f7f7fa;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f0f0f5;
  --border: #e4e4ec;
  --text: #17171f;
  --text-dim: #5b5b6b;
  --text-faint: #8b8b9c;
  --accent: #d9467b;
  --accent-2: #7c3aed;
  --accent-3: #0891b2;
  --gradient: linear-gradient(135deg, #d9467b 0%, #8b5cf6 50%, #06b6d4 100%);
  --shadow-card: 0 4px 24px rgba(23,23,31,.08);
  --shadow-glow: 0 0 40px rgba(217,70,123,.12);
  --code-bg: rgba(23,23,31,.04);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

[data-theme="dark"] {
  --bg: #0d0d12;
  --bg-soft: #14141a;
  --bg-card: #1a1a24;
  --bg-elevated: #22222e;
  --border: #2a2a38;
  --text: #f5f5f7;
  --text-dim: #a0a0b0;
  --text-faint: #6b6b7a;
  --shadow-card: 0 4px 24px rgba(0,0,0,.35);
  --shadow-glow: 0 0 40px rgba(217,70,123,.15);
  --code-bg: rgba(255,255,255,.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background .3s, color .3s;
}

/* Background aurora glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(217,70,123,.10), transparent 60%),
    radial-gradient(600px 300px at 10% 0%, rgba(139,92,246,.08), transparent 60%);
  pointer-events: none;
}

/* ---------- Layout ---------- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ---------- Navbar ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}
.nav-brand .logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
  font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 32px 0 56px; }
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(217,70,123,.08);
  border: 1px solid rgba(217,70,123,.25);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero h1 .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-dim);
  font-size: clamp(16px, 2vw, 19px);
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- Tool Grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 40px 0;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(217,70,123,.5);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.tool-card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(217,70,123,.08);
  border: 1px solid rgba(217,70,123,.25);
  color: var(--accent);
}
.tool-card .icon svg { width: 22px; height: 22px; }
.tool-card h3 { font-size: 17px; font-weight: 650; }
.tool-card p { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.tool-card .go {
  margin-top: auto;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Section title */
.section-title {
  font-size: 24px;
  font-weight: 700;
  margin: 48px 0 8px;
  letter-spacing: -0.02em;
}
.section-sub { color: var(--text-dim); font-size: 15px; margin-bottom: 24px; }

/* ---------- Tool Page ---------- */
.tool-header { text-align: center; padding: 8px 0 32px; }
.tool-header h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 10px 0 10px;
}
.tool-header .sub { color: var(--text-dim); max-width: 560px; margin: 0 auto; font-size: 15.5px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13.5px;
  text-decoration: none;
  transition: color .2s;
}
.back-link:hover { color: var(--text); }

/* Tool workbench card */
.workbench {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .25s, background .25s;
  display: block;
}
.drop-zone:hover, .drop-zone-active {
  border-color: var(--accent);
  background: rgba(217,70,123,.04);
}
.drop-zone .dz-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(217,70,123,.08);
  color: var(--accent);
}
.drop-zone .dz-icon svg { width: 26px; height: 26px; }
.drop-zone .dz-main { font-weight: 600; font-size: 15.5px; }
.drop-zone .dz-hint { color: var(--text-faint); font-size: 13px; margin-top: 4px; }
.drop-zone .dz-hint em { color: var(--accent); font-style: normal; font-weight: 600; }

/* Controls */
.controls { margin-top: 24px; }
.ctrl-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.ctrl-select, .ctrl-input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
}
.ctrl-select:focus, .ctrl-input:focus { border-color: var(--accent); }

/* Slider */
.ctrl-range {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  outline: none;
  margin: 10px 0;
}
.ctrl-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gradient);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* Preview row */
.preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.preview-row img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.preview-row .meta { flex: 1; min-width: 0; }
.preview-row .fname { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-row .fsize { font-size: 12.5px; color: var(--text-faint); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 650;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(217,70,123,.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 26px rgba(217,70,123,.35); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }
.btn-row { display: flex; gap: 12px; margin-top: 20px; }
.btn-row .btn { flex: 1; }

/* Error */
.error-msg {
  display: none;
  color: #e11d48;
  background: rgba(225,29,72,.08);
  border: 1px solid rgba(225,29,72,.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-top: 16px;
  text-align: center;
}

/* ---------- Steps / Features / FAQ ---------- */
.info-block { max-width: 680px; margin: 56px auto 0; }
.info-block h2 { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 24px; letter-spacing: -0.02em; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.step .num {
  font-size: 12px; font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.step h3 { font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.feat-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.feat {
  display: flex; gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}
.feat .f-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(139,92,246,.08);
  border: 1px solid rgba(139,92,246,.25);
  color: var(--accent-2);
}
.feat .f-icon svg { width: 20px; height: 20px; }
.feat h3 { font-size: 15px; font-weight: 650; margin-bottom: 3px; }
.feat p { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color .2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 20px;
  color: var(--accent);
  transition: transform .25s;
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 20px 18px; font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 72px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}
.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer .f-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav { margin-bottom: 28px; }
  .nav-links { gap: 12px; }
  .workbench { padding: 22px 18px; }
  .btn-row { flex-direction: column; }
  .drop-zone { padding: 32px 16px; }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tool-card { padding: 18px 16px; }
  .tool-card h3 { font-size: 15px; }
  .tool-card p { font-size: 12px; }
}
@media (max-width: 420px) {
  .tool-grid { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
