:root {
  color-scheme: light dark;
  --bg: #f6f8f8;
  --surface: #ffffff;
  --surface-alt: #eef3f3;
  --text: #162020;
  --muted: #4b5d5e;
  --border: #d5e0e0;
  --accent: #00696d;
  --accent-soft: #e0f2f2;
  --accent-text: #004f52;
  --warn-bg: #fff8e6;
  --warn-border: #e6c677;
  --shadow: 0 2px 10px rgba(0, 40, 42, 0.06);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1515;
    --surface: #172021;
    --surface-alt: #1e2a2b;
    --text: #e6eded;
    --muted: #9eb2b3;
    --border: #2a3a3b;
    --accent: #4fd8dc;
    --accent-soft: #133638;
    --accent-text: #8ceef1;
    --warn-bg: #2a2312;
    --warn-border: #7a6021;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  }
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "PingFang TC",
    "Hiragino Sans", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-alt);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  word-break: break-word;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

@media (prefers-color-scheme: dark) {
  .brand-badge {
    color: #072021;
  }
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--muted);
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 6px;
}

.nav-links a[aria-current="page"] {
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 600;
}

.lang-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lang-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.lang-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  line-height: 1.25;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

.card h2,
.card h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: var(--accent-text);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--accent-text);
}

.panel h3 {
  margin: 16px 0 6px;
  font-size: 1.02rem;
}

.panel ul,
.panel ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.panel li + li {
  margin-top: 6px;
}

.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 14px 0;
}

.callout.warn {
  background: var(--warn-bg);
  border-left-color: var(--warn-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.94rem;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-alt);
}

details.faq {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 16px;
  background: var(--surface);
}

details.faq + details.faq {
  margin-top: 10px;
}

details.faq summary {
  font-weight: 600;
  cursor: pointer;
}

details.faq[open] summary {
  margin-bottom: 8px;
  color: var(--accent-text);
}

pre.template {
  background: var(--surface-alt);
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

.footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 20px 36px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}

@media print {
  .topbar,
  .lang-switcher {
    display: none;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .panel,
  .hero,
  .card {
    box-shadow: none;
    border-color: #cccccc;
  }
}
