:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-alt: #f3f4f6;
  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-subtle: #64748b;
  --border: #e2e8f0;
  --brand: #1e3a8a;
  --brand-hover: #172554;
  --brand-soft: #eff6ff;
  --accent: #2563eb;
  --ok-bg: #ecfdf5;
  --ok-ink: #065f46;
  --ok-border: #a7f3d0;
  --warn-bg: #fffbeb;
  --warn-ink: #92400e;
  --warn-border: #fde68a;
  --danger-bg: #fef2f2;
  --danger-ink: #991b1b;
  --danger-border: #fecaca;
  --vintage-bg: #f5f3ff;
  --vintage-ink: #5b21b6;
  --vintage-border: #ddd6fe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07);
  --max-w: 1120px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: 6px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 249, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-zh {
  color: var(--ink);
  font-weight: 800;
}

.brand-domain {
  display: inline-flex;
  align-items: baseline;
  font-family: "Segoe UI", -apple-system, sans-serif;
  letter-spacing: -0.01em;
}

.brand-domain .bd-i,
.brand-domain .bd-lily {
  color: var(--brand);
  font-weight: 800;
}

.brand-domain .bd-am {
  color: var(--accent);
  font-weight: 700;
}

.brand-domain .bd-tld {
  color: var(--ink-subtle);
  font-weight: 600;
  font-size: 0.92em;
}

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

.brand-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-subtle);
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
}

.lang-switch {
  font-size: 0.85rem !important;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 1rem;
}

@media (max-width: 820px) {
  .brand-sub {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 12px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open {
    display: flex;
  }
}

/* Hero & Interactive Generator */
.hero {
  padding: 40px 0 32px;
  background: linear-gradient(180deg, #eff6ff 0%, #fafaf9 100%);
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid #bfdbfe;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 24px;
  color: var(--ink-muted);
  font-size: 1.06rem;
  max-width: 760px;
}

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

.gen-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

@media (max-width: 860px) {
  .gen-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gen-submit-wrap {
    grid-column: span 2;
  }
}

@media (max-width: 540px) {
  .gen-grid {
    grid-template-columns: 1fr;
  }
  .gen-submit-wrap {
    grid-column: span 1;
  }
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.input,
.select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 0.96rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.gen-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--brand);
  color: #fff;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  background: var(--surface-alt);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.quick-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chip-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  cursor: pointer;
  font-family: inherit;
}

.chip-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* Results Grid */
.gen-results {
  margin-top: 22px;
  display: none;
}

.gen-results.active {
  display: block;
}

.gen-summary {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.name-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.name-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.name-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.name-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.name-title a {
  color: var(--ink);
}

.name-meta-line {
  font-size: 0.86rem;
  color: var(--ink-subtle);
  margin-top: 2px;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-recommended {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-color: var(--ok-border);
}

.badge-common_in_cn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-color: var(--warn-border);
}

.badge-caution {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border-color: var(--danger-border);
}

.badge-vintage {
  background: var(--vintage-bg);
  color: var(--vintage-ink);
  border-color: var(--vintage-border);
}

.name-verdict {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.name-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--surface-alt);
}

/* Sections */
.section {
  padding: 40px 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

.section-sub {
  margin: 4px 0 0;
  color: var(--ink-subtle);
  font-size: 0.95rem;
}

/* Compare boxes (Anti-trap vs Recommended) */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 720px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

.compare-box {
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.compare-bad {
  background: #fffafa;
  border-color: var(--danger-border);
}

.compare-good {
  background: #f7fdf9;
  border-color: var(--ok-border);
}

.compare-box h3 {
  margin: 0 0 12px;
  font-size: 1.08rem;
}

.compare-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-muted);
}

.compare-box li + li {
  margin-top: 8px;
}

/* Detail Page */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-subtle);
  margin: 18px 0 14px;
}

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

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.detail-h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
}

.detail-zh {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink-subtle);
  margin-left: 10px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bluf-box {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
}

.bluf-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  display: block;
  margin-bottom: 4px;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 780px) {
  .facts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fact-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.fact-k {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-subtle);
}

.fact-v {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
  margin-top: 2px;
}

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

.content-panel h2 {
  margin: 0 0 14px;
  font-size: 1.32rem;
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0 16px;
}

.chart-wrap svg {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

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

/* Directory Filter & A-Z */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.alpha-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-muted);
}

.alpha-btn.active,
.alpha-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
}

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

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.faq-item p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

/* Modal for Canvas Card Preview */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.modal-card canvas {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 12px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 36px 0 28px;
  color: var(--ink-subtle);
  font-size: 0.9rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

