:root {
  --bg-paper: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #eff3f7;
  --surface-dark: #102418;
  --ink: #111827;
  --ink-secondary: #4b5563;
  --ink-muted: #6b7280;
  --line: #d5dbe3;
  --line-strong: #9ca3af;
  --cbt-green: #195e36;
  --cbt-green-hover: #13492a;
  --cbt-green-tint: #ecf6f0;
  --cbt-green-border: #b7dec6;
  --practice-blue: #1d4ed8;
  --practice-blue-tint: #eff6ff;
  --practice-blue-border: #bfdbfe;
  --seal-red: #b7281e;
  --seal-red-tint: #fff1f0;
  --seal-red-border: #f5c2be;
  --radius-sm: 4px;
  --radius-md: 6px;
  --wrap-max: 1160px;
}

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

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

body {
  margin: 0;
  background: var(--bg-paper);
  color: var(--ink);
  font-family: "Noto Sans SC", "Noto Sans JP", "PingFang SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  overflow-x: hidden;
}

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

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2.5px solid var(--practice-blue);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 20px;
}

.promo-bar {
  background: var(--cbt-green);
  color: #fff;
  font-size: 13.5px;
  padding: 8px 16px;
  text-align: center;
  font-weight: 600;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  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(--ink);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
  flex-shrink: 0;
}

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

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  line-height: 1.2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  color: var(--ink-secondary);
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-subtle);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-switch {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.lang-switch:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  text-decoration: none;
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 20px 18px;
}

.mobile-drawer.open {
  display: grid;
  gap: 6px;
}

.mobile-drawer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--cbt-green);
  color: #fff;
  border-color: var(--cbt-green);
}

.btn-primary:hover {
  background: var(--cbt-green-hover);
  border-color: var(--cbt-green-hover);
}

.btn-blue {
  background: var(--practice-blue);
  color: #fff;
  border-color: var(--practice-blue);
}

.btn-blue:hover {
  background: #1e40af;
}

.btn-red {
  background: var(--seal-red);
  color: #fff;
  border-color: var(--seal-red);
}

.btn-red:hover {
  background: #991b1b;
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-outline:hover {
  background: var(--surface-subtle);
}

.btn-sm {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 13.5px;
}

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 40px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 36px;
  align-items: start;
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 20px;
  font-size: 16.5px;
  color: var(--ink-secondary);
  max-width: 54ch;
}

.metrics-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.metric-box {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.metric-num {
  display: block;
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.metric-label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.platform-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-secondary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--bg-paper);
  color: var(--ink-secondary);
}

.status-pill.live {
  background: var(--cbt-green-tint);
  border-color: var(--cbt-green-border);
  color: var(--cbt-green);
}

.status-pill.pending {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
}

.status-pill.red {
  background: var(--seal-red-tint);
  border-color: var(--seal-red-border);
  color: var(--seal-red);
}

.status-pill.blue {
  background: var(--practice-blue-tint);
  border-color: var(--practice-blue-border);
  color: var(--practice-blue);
}

/* Interactive CBT Exam Frame */
.app-frame {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
}

.cbt-topbar {
  background: var(--cbt-green);
  color: #fff;
  padding: 9px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.cbt-timer {
  background: rgba(0, 0, 0, 0.22);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.cbt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
}

.cbt-tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cbt-tab-btn {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cbt-tab-btn.active {
  background: var(--cbt-green);
  border-color: var(--cbt-green);
  color: #fff;
}

.cbt-body {
  padding: 16px;
}

.cbt-stem-ja {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.75;
}

.cbt-stem-ja rt {
  font-size: 10px;
  color: var(--ink-muted);
}

.cbt-stem-zh {
  font-size: 13.5px;
  color: var(--ink-secondary);
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--cbt-green-border);
}

.cbt-options {
  display: grid;
  gap: 8px;
}

.cbt-opt-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.cbt-opt-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.cbt-opt-btn.correct {
  background: var(--cbt-green-tint);
  border-color: var(--cbt-green);
}

.cbt-opt-btn.wrong {
  background: var(--seal-red-tint);
  border-color: var(--seal-red);
}

.cbt-opt-key {
  font-weight: 800;
  min-width: 22px;
  color: var(--ink);
}

.cbt-opt-zh {
  display: block;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.cbt-explain {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--practice-blue-border);
  background: var(--practice-blue-tint);
  font-size: 13px;
  color: var(--ink);
}

.cbt-explain.hidden {
  display: none;
}

.cbt-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-paper);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* Sections */
.section {
  padding: 52px 0;
  border-bottom: 1px solid var(--line);
}

.section-alt {
  background: var(--surface);
}

.section-dark {
  background: var(--surface-dark);
  color: #f9fafb;
}

.section-dark p,
.section-dark .muted {
  color: #d1d5db;
}

.section-head {
  margin-bottom: 24px;
  max-width: 68ch;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.28;
  font-weight: 800;
}

.section-head p {
  margin: 0;
  color: var(--ink-secondary);
}

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

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 14.5px;
}

.exam-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.search-input {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-width: 240px;
  background: var(--surface);
}

.exam-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.exam-card:hover {
  transform: translateY(-2px);
  border-color: var(--cbt-green);
}

.exam-card.hidden {
  display: none;
}

.exam-card-title {
  margin: 4px 0 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.exam-card-ja {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 0;
}

.exam-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.exam-stats strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
}

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

.fact-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 14.5px;
}

.fact-table th,
.fact-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.fact-table th {
  background: var(--surface-subtle);
  width: 30%;
  font-weight: 700;
  color: var(--ink);
}

.callout-red {
  background: var(--seal-red-tint);
  border: 1px solid var(--seal-red-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.callout-green {
  background: var(--cbt-green-tint);
  border: 1px solid var(--cbt-green-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

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

.faq-item summary {
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--ink-secondary);
  font-size: 14.5px;
}

.site-footer {
  background: #111827;
  color: #e5e7eb;
  padding: 40px 0 28px;
  font-size: 13.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #374151;
}

.site-footer h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #fff;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.site-footer a {
  color: #d1d5db;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding-top: 18px;
  color: #9ca3af;
  font-size: 12.5px;
}

.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .nav-links,
  .nav-actions .btn-primary {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
  .grid-3,
  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .metrics-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cta-row .btn {
    width: 100%;
  }
  .search-input {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .wrap {
    padding: 0 14px;
  }
  .metrics-bar {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
