*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #16203a;
  --muted: #5d6880;
  --line: #e2e7f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff5ff;
  --ok: #15803d;
  --err: #dc2626;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 6px 18px rgba(16, 24, 40, .08);
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部 ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.tagline { margin: 0; color: var(--muted); font-size: 13px; }

.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 9px 20px;
  display: flex;
  gap: 10px 28px;
  flex-wrap: wrap;
  font-size: 13px;
  align-items: center;
}
.nav-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-cat {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--ink);
  background: var(--brand-soft);
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  padding: 4px 12px;
}
.site-nav a:hover { background: #dbe7ff; border-color: var(--brand); text-decoration: none; }

/* ---------- 主体 ---------- */
.wrap { max-width: 880px; margin: 0 auto; padding: 26px 20px 60px; }
h1 { font-size: 29px; line-height: 1.28; margin: 0 0 10px; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 34px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 15px; margin: 0 0 20px; }

.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 26px;
}
.hero h1 { margin-top: 0; }
.hero .lead { margin-bottom: 0; }
.badge {
  display: inline-block;
  background: #e8f7ee;
  color: var(--ok);
  border: 1px solid #bfe6cd;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px;
}
.cat { margin-top: 26px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 12px; }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #bcd0fb;
  text-decoration: none;
}
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.prose { margin-top: 32px; }
.prose p { margin: 0 0 12px; color: #37415c; }
.steps { padding-left: 20px; color: #37415c; }
.steps li { margin-bottom: 7px; }

.faq-item { border-bottom: 1px solid var(--line); padding: 11px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item summary:hover { color: var(--brand); }
.faq-item p { margin: 9px 0 4px; color: var(--muted); font-size: 14px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.pill:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

.feedback {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.feedback h2 { margin-top: 0; }
.feedback textarea { background: #fff; }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.site-footer p { margin: 5px 0; }

/* ---------- 工具组件 ---------- */
.drop {
  border: 2px dashed #c9d4e6;
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: #fafcff;
  transition: border-color .14s ease, background .14s ease;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.row label { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="number"], input[type="datetime-local"], select, textarea {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid #d6dce8;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
textarea { width: 100%; min-height: 148px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; resize: vertical; }
input[type="range"] { flex: 1; min-width: 160px; accent-color: var(--brand); }
button {
  font: inherit;
  font-weight: 500;
  padding: 9px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .14s ease, transform .1s ease;
}
button:hover:not(:disabled) { background: var(--brand-dark); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: default; }
button.ghost { background: #eef2f9; color: var(--ink); }
button.ghost:hover:not(:disabled) { background: #e2e8f3; }
.out {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
  word-break: break-word;
}
.out.err { color: var(--err); }
.out.ok { color: var(--ok); }
.preview { margin-top: 16px; display: none; }
.preview.show { display: block; }
.preview img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }
.kv { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.kv b { color: var(--ink); font-weight: 600; }
.hidden { display: none; }
