:root {
  --bg: #ffffff;
  --fg: #1a1a2e;
  --muted: #6b7280;
  --accent: #2563eb;
  --border: #e5e7eb;
  --code-bg: #f8fafc;
  --radius: 10px;
  --maxw: 820px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
header.site {
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
}
header.site .wrap, main, footer.site .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.brand { font-weight: 700; font-size: 18px; color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand .logo { flex: 0 0 auto; }
.brand-name { line-height: 1; }
nav.site a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 14px; }
nav.site a:hover { color: var(--accent); }
main { display: block; padding: 24px 16px; }
h1 { font-size: 26px; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
section { margin: 28px 0; }
h2 { font-size: 20px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.tool-panel {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
textarea, input[type=text], input[type=number], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fff;
  resize: vertical;
}
textarea { min-height: 140px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.row > * { flex: 1; min-width: 140px; }
button.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}
button.btn:hover { opacity: .9; }
button.ghost { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.output {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  min-height: 40px;
}
.error { color: #dc2626; font-size: 13px; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: 13px; }
th, td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
th { background: var(--code-bg); }
.diff-add { background: #dcfce7; }
.diff-del { background: #fee2e2; }
.ad-slot {
  margin: 22px 0;
  text-align: center;
  min-height: 0;
}
/* 未启用广告时,空槽位不占空间、不留任何痕迹 */
.ad-slot:empty {
  display: none;
}
footer.site { border-top: 1px solid var(--border); padding: 20px 16px; color: var(--muted); font-size: 13px; }
footer.site a { color: var(--muted); text-decoration: none; margin-right: 14px; }
footer.site a:hover { color: var(--accent); }
.local-badge { display: inline-block; background: #ecfdf5; color: #047857; font-size: 12px; padding: 4px 10px; border-radius: 999px; margin-top: 10px; }
.grid-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 12px; }
.grid-links a { color: var(--accent); text-decoration: none; font-size: 14px; padding: 6px 0; }
.grid-links a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .row { flex-direction: column; }
  nav.site a { margin-left: 10px; font-size: 13px; }
}
