:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --border: #e2e8f0;
  --accent: #be123c;
  --accent-hover: #9f1239;
  --accent-soft: #fff1f2;
  --accent-border: #fecdd3;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --surface: #131926;
    --surface-subtle: #1b2333;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-soft: #94a3b8;
    --border: #243044;
    --accent: #fb7185;
    --accent-hover: #fda4af;
    --accent-soft: rgba(251, 113, 133, 0.12);
    --accent-border: rgba(251, 113, 133, 0.28);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

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

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 500;
}

.nav a {
  color: var(--text-muted);
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
  text-decoration: none;
}

.lang-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Main */
main {
  padding: 44px 0 72px;
}

.hero {
  text-align: center;
  padding: 20px 0 40px;
}

.hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(69, 9, 26, 0.22);
  margin-bottom: 20px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 28px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Feature grid */
.section-title {
  font-size: 22px;
  margin: 40px 0 18px;
  letter-spacing: -0.01em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

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

.card h2,
.card h3 {
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.card h3 {
  font-size: 17px;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 12px;
}

/* Document / prose pages */
.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 34px;
  box-shadow: var(--shadow);
}

.doc-card h1 {
  font-size: clamp(24px, 4vw, 32px);
  margin: 0 0 6px;
  line-height: 1.25;
}

.doc-card .meta {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 24px;
}

.doc-card h2 {
  font-size: 18px;
  margin: 28px 0 10px;
  color: var(--accent);
}

.doc-card p,
.doc-card li {
  color: var(--text-muted);
  font-size: 15px;
}

.doc-card ul {
  padding-left: 20px;
  margin: 8px 0 16px;
}

.doc-card li {
  margin-bottom: 6px;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

details.faq-item {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}

details.faq-item summary {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  font-size: 18px;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

details.faq-item[open] summary::after {
  content: "−";
}

details.faq-item p {
  margin: 10px 0 0;
  font-size: 14.5px;
}

.contact-box {
  margin-top: 24px;
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.contact-box h2 {
  margin-top: 0;
}

.disclaimer {
  margin-top: 32px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-soft);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-soft);
}

.footer-links a:hover {
  color: var(--accent);
}

/* Language toggle visibility */
[data-lang="en"] {
  display: none;
}

html.lang-en [data-lang="zh"] {
  display: none;
}

html.lang-en [data-lang="en"] {
  display: revert;
}

@media (max-width: 600px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .doc-card {
    padding: 24px 20px;
  }

  .nav {
    gap: 12px;
  }
}
