:root {
  --background: #f2f3f0;
  --foreground: #111111;
  --muted-foreground: #666666;
  --border: #cbccc9;
  --card: #ffffff;
  --secondary: #e7e8e5;
  --primary: #1d4ed8;
  --primary-foreground: #ffffff;
  --white: #ffffff;
  --dark: #0a0a0a;
  --warm: #fff2e8;
  --warm-text: #804200;
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --font-heading: 'JetBrains Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  --font-body: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 72px;
}

.topbar,
.hero,
.meta-strip,
.grid-row,
.faq-cta-row,
.cta-row,
.meta-grid,
.subject-grid,
.resource-grid,
.flow-list,
.chip-row,
.stack-cards,
.stack-right,
.lang-switcher {
  display: flex;
}

.topbar,
.cta-row,
.grid-row,
.faq-cta-row,
.meta-grid,
.subject-grid,
.resource-grid,
.chip-row {
  gap: 16px;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand img {
  width: 230px;
  height: auto;
  display: block;
}

.lang-switcher {
  gap: 8px;
}

.lang-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}

.section-card,
.section-block,
.footer-card {
  margin-bottom: 24px;
}

.hero {
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.tile,
.info-card,
.subject-card,
.resource-card,
.faq-card,
.stack-card,
.note-card,
.footer-card {
  border-radius: var(--radius-md);
}

.hero-copy {
  flex: 1 1 0;
}

.hero-panel {
  width: 46%;
  min-width: 360px;
}

.hero-copy,
.section-block {
  display: flex;
  flex-direction: column;
}

.badge,
.subject-tag,
.pill,
.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 13px;
}

.badge,
.pill-warm,
.subject-tag,
.chip {
  background: var(--warm);
  color: var(--warm-text);
  padding: 8px 12px;
}

.badge-dark {
  background: rgba(255, 255, 255, 0.08);
  color: #ffb17a;
}

.hero-title,
.section-title,
.panel-title,
.tile-title,
.footer-title {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1.12;
}

.hero-title {
  font-size: clamp(40px, 4vw, 60px);
  margin-top: 14px;
}

.section-title {
  font-size: clamp(28px, 2.4vw, 40px);
}

.panel-title {
  font-size: 32px;
}

.tile-title {
  font-size: 34px;
}

.footer-title {
  font-size: 26px;
}

.hero-text,
.section-body,
.panel-text,
.mini-text,
.resource-card p,
.faq-card p,
.note-card p,
.cta-note,
.footer-body,
.footer-note p,
.flow-item span,
.plain-list,
.stack-card p {
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0;
}

.hero-text {
  font-size: 18px;
  margin-top: 14px;
}

.section-body {
  font-size: 16px;
}

.panel-text,
.mini-text,
.resource-card p,
.faq-card p {
  font-size: 15px;
}

.mini-title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 16px;
}

.three-col > *,
.two-col > *,
.four-col > * {
  flex: 1 1 0;
}

.info-card,
.subject-card,
.resource-card,
.tile,
.footer-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 20px;
}

.wide-card {
  background: var(--secondary);
  border-color: transparent;
}

.subject-card {
  min-height: 154px;
}

.subject-card p,
.resource-card p {
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 24px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

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

.dark-panel {
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.light,
.dark-panel .tile-title,
.dark-panel .section-title,
.dark-panel h3 {
  color: var(--white);
}

.light-body,
.dark-panel p {
  color: rgba(255, 255, 255, 0.78);
}

.stack-cards,
.stack-right,
.flow-list,
.faq-list {
  flex-direction: column;
}

.stack-cards,
.stack-right,
.flow-list,
.faq-list {
  gap: 12px;
}

.stack-card,
.note-card,
.flow-item,
.faq-card {
  background: rgba(255, 255, 255, 0.08);
  padding: 16px;
  border-radius: 14px;
}

.tile-soft .note-card,
.tile-soft .flow-item,
.faq-tile .faq-card {
  background: #f7f8fa;
}

.stack-card h3,
.faq-card h3,
.resource-card h3,
.flow-item strong,
.note-card strong {
  margin: 0 0 6px;
  display: block;
  font-family: var(--font-heading);
  font-size: 16px;
  color: inherit;
}

.meta-strip,
.row-main,
.row-services,
.row-last,
.faq-cta-row {
  align-items: stretch;
}

.tile-large {
  flex: 1.5 1 0;
}

.stack-right {
  flex: 1 1 0;
}

.tile-soft {
  background: #f7f8fa;
}

.tile-warm {
  background: var(--warm);
  border-color: transparent;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
}

.section-block {
  gap: 18px;
}

.plain-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-list {
  margin: 0;
}

.flow-item {
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compact-cta,
.cta-tile {
  justify-content: space-between;
}

.cta-note {
  color: #ffb17a;
  font-weight: 600;
}

.text-link {
  font-weight: 600;
}

.light-link {
  color: var(--white);
}

.left-align {
  justify-content: flex-start;
}

.site-footer.footer-card {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--foreground);
  box-shadow: none;
}

.footer-shell {
  display: block;
  padding-top: 28px;
  border-top: 1px solid rgba(17, 17, 17, 0.12);
}

.footer-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.footer-detail-row {
  min-width: 0;
}

.footer-label {
  display: block;
  margin-bottom: 6px;
  color: var(--foreground);
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.footer-value,
.footer-value a {
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.75;
  font-size: 14px;
}

.footer-value a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-link,
.subject-link,
.resource-link,
.faq-link,
.stack-link,
.tile-link {
  display: block;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card-link:hover,
.subject-link:hover,
.resource-link:hover,
.faq-link:hover,
.stack-link:hover,
.tile-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(17, 17, 17, 0.08);
  border-color: rgba(29, 78, 216, 0.35);
}

.stack-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.faq-tile .faq-link:hover,
.tile-soft.tile-link:hover,
.tile-link .flow-item:hover {
  background: #ffffff;
}

.card-link:focus-visible,
.subject-link:focus-visible,
.resource-link:focus-visible,
.faq-link:focus-visible,
.stack-link:focus-visible,
.tile-link:focus-visible,
.btn:focus-visible,
.text-link:focus-visible,
.brand:focus-visible,
.lang-btn:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.45);
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .hero,
  .grid-row,
  .meta-strip,
  .faq-cta-row,
  .subject-grid,
  .resource-grid,
  .meta-grid {
    flex-direction: column;
  }

  .hero-panel,
  .hero-copy,
  .tile-large,
  .stack-right,
  .wide-card,
  .subject-card,
  .resource-card {
    width: 100%;
  }

  .brand img {
    width: 200px;
  }

  .footer-shell {
    padding-top: 24px;
  }

  .footer-details {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 16px 16px 48px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero-title {
    font-size: 34px;
  }

  .panel-title,
  .tile-title,
  .section-title {
    font-size: 26px;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .site-footer.footer-card {
    padding: 0;
  }
}
