:root {
  --bg: #0f1419;
  --card: #1a222c;
  --text: #e8eef4;
  --muted: #9aa8b5;
  --accent: #3d9aed;
  --border: #2a3542;
  --ok: #3dba7a;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Helvetica Neue", sans-serif;
  background: linear-gradient(160deg, #0f1419 0%, #15202b 50%, #0d1a14 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 20px 64px; }
.wrap.wide { max-width: 1080px; }
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 90vw;
  margin: 0 0 20px;
  margin-left: calc(50% - 45vw);
  background: #0f1419;
  padding: 12px 0 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}
header h1 { font-size: 1.75rem; margin: 0 0 8px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { display: block; line-height: 0; }
.brand img { width: 56px; height: 56px; border-radius: 12px; }
.brand h1,
.brand-name { margin: 0; font-size: 1.75rem; font-weight: 700; line-height: 1.25; }
.brand .muted { margin: 4px 0 0; }
.muted { color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 20px 0 32px; font-size: 0.95rem; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text) !important; }
.btn:disabled,
.btn.disabled { opacity: 0.5; cursor: not-allowed; }
label { display: block; margin: 12px 0 4px; font-size: 0.9rem; color: var(--muted); }
input[type=email], input[type=password], input[type=text], input[type=search],
input[type=number], input[type=datetime-local], select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
}
.price-box { margin: 16px 0; border-top: 1px solid var(--border); padding-top: 10px; }
.price-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); }
.price-row.ok { color: var(--ok); }
.price-row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 10px;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.btn.small { padding: 6px 10px; font-size: 0.85rem; }
.btn.danger { background: #c44c4c; }
.btn.ok { background: var(--ok); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1e3d2f;
  color: var(--ok);
  font-size: 0.8rem;
  margin: 2px 4px 2px 0;
}
.badge.off { background: #2a3542; color: var(--muted); }
table.users { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.users th, table.users td {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.search-row { display: flex; gap: 8px; align-items: end; }
.search-row input { flex: 1; }
.grow { flex: 1; min-width: 0; }
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}
.check-inline input { width: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.error { color: #f07178; margin-top: 8px; }
.ok { color: var(--ok); }
footer { margin-top: 48px; font-size: 0.85rem; color: var(--muted); }
ul.compact li { margin: 6px 0; }
html.i18n-loading body { visibility: hidden; }
.site-head nav.tabs { width: 100%; margin: 12px 0 0; }
nav.tabs {
  width: 100%;
  background: #3f8f86;
  border-radius: 12px;
  padding: 8px 12px;
  gap: 4px 6px;
  align-items: center;
  margin: 20px 0 24px;
  font-size: 1.05rem;
}
nav.tabs.sub {
  margin-top: 6px;
  background: #2f6f68;
  padding: 5px 10px;
  font-size: 0.8rem;
}
nav.tabs.sub a {
  font-weight: 500;
  padding: 4px 10px;
}
nav.tabs a {
  color: #eaf5f3 !important;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
}
nav.tabs a:hover, nav.tabs a.active { background: rgba(255, 255, 255, 0.18); }
nav.tabs .lang-select {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.18);
  color: #eaf5f3;
}
nav.tabs #userBox { color: #eaf5f3; font-size: 0.85rem; }
nav.tabs #userBox a { color: #fff !important; }
nav.tabs #userEmail { color: #d7eeea; }
.language-support {
  flex: 1 0 100%;
  order: 10;
  margin: 1px 8px 0;
  color: #d7eeea;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
}
.language-support strong { color: #f1faf8; font-weight: 600; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}
.layout > * { min-width: 0; }
.side { display: flex; flex-direction: column; gap: 16px; }
.cert-tile {
  display: block;
  border-radius: 12px;
  padding: 18px 16px;
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}
.cert-tile small { display: block; font-weight: 400; font-size: 0.8rem; margin-top: 6px; opacity: 0.92; }
.cert-tile.ai901 { background: #c0453a; }
.cert-tile.aifc01 { background: #e0a03c; }
.cert-tile.more { background: #8fb95c; }
.article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.article h1 { font-size: 1.5rem; margin: 0 0 8px; }
.article h2 { font-size: 1.2rem; }
.article h1:first-child,
.article h2:first-child,
.card > h2:first-child { margin-top: 0; }
.article table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 12px 0; }
.article th, .article td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: left;
  white-space: nowrap;
}
.article td:nth-child(2) { white-space: normal; }
.table-scroll { overflow-x: auto; }
.fig-wide { margin: 0 0 20px; }
.fig-wide img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.fig-wide figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 8px; }
.fig-right {
  float: right;
  width: 360px;
  max-width: 45%;
  margin: 4px 0 16px 22px;
}
.fig-right img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.fig-right figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 6px; text-align: center; }
.article h2 { clear: none; }
.stack { margin: 18px 0; padding-left: 16px; border-left: 2px solid var(--border); }
.stack p { margin: 8px 0; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, .7fr);
  gap: 24px;
  align-items: center;
  padding: 44px 40px;
  margin: 0 0 24px;
  border: 1px solid #326f59;
  border-radius: 18px;
  background: radial-gradient(circle at 85% 15%, rgba(61,186,122,.2), transparent 34%), linear-gradient(135deg, #152c27, #19232d 65%);
  overflow: hidden;
}
.hero-kicker, .section-kicker {
  margin: 0 0 8px;
  color: #64d69a;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.home-hero h2 { max-width: 720px; margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -.035em; }
.hero-lead { max-width: 680px; margin: 20px 0 0; color: #c5d0d9; font-size: 1.08rem; }
.hero-note { margin: 10px 0 0; color: var(--muted); font-size: .82rem; }
.proof-card { padding: 24px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(8,16,19,.55); }
.proof-card p { margin: 8px 0; }
.proof-card a { display: inline-block; margin-top: 2px; }
.proof-divider { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 16px 0; }
.proof-score { margin: 0 !important; color: #fff; font-size: 3.2rem; font-weight: 800; line-height: 1; }
.proof-score-sm { font-size: 2.4rem !important; }
.proof-score span { color: var(--muted); font-size: 1rem; font-weight: 500; }
.system-section { margin: 24px 0 32px; }
.system-section > h2 { margin: 0 0 14px; font-size: 1.8rem; }
.system-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.system-grid article { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.system-grid span { display: block; color: #64d69a; font-size: .75rem; font-weight: 800; }
.system-grid strong { display: block; margin-top: 4px; font-size: 1.08rem; }
.system-grid p { margin: 6px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.choose-section { padding: 32px 0 8px; scroll-margin-top: 180px; }
.choose-section > h2 { margin: 0 0 18px; font-size: 1.8rem; }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.product-card { position: relative; padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); overflow: hidden; }
.product-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: #c0453a; }
.product-card.aifc-product::before { background: #e0a03c; }
.product-label { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.product-card h3 { margin: 4px 0 10px; font-size: 2rem; }
.availability { min-height: 2.8em; color: #efbd71; font-size: .88rem; font-weight: 700; }
.availability.live { color: #64d69a; }
.product-card .text-link { display: inline-block; margin-left: 12px; }
.final-cta { margin-top: 34px; padding: 34px; text-align: center; border: 1px solid #326f59; border-radius: 16px; background: linear-gradient(135deg, #152c27, #19232d); }
.final-cta h2 { margin: 0; font-size: 1.8rem; }
.final-cta p { color: var(--muted); }
.footer-links { margin: 32px 0 0; }
.product-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 28px; align-items: center; margin-bottom: 24px; padding: 38px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(135deg, #19232d, #152c27); }
.product-hero > div:only-child { grid-column: 1 / -1; max-width: 760px; }
.product-hero h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1.05; }
.result-card { margin: 0; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: #fff; color: #334; }
.result-card img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.result-card figcaption { padding: 8px 4px 0; font-size: .75rem; text-align: center; }
/* Keep certificate / score report native aspect ratio */
.ai901-hero .result-card img,
#exam-report .fig-right img {
  aspect-ratio: auto;
  object-fit: contain;
  height: auto;
}
.product-story { scroll-margin-top: 180px; }
@media (max-width: 820px) {
  .home-hero { grid-template-columns: 1fr; padding: 30px 22px; }
  .system-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
  .product-hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .article { padding: 18px 16px; }
  .fig-right { float: none; width: 100%; max-width: 100%; margin: 12px 0 16px; }
  .side { flex-direction: row; flex-wrap: wrap; }
  .side > * { flex: 1 1 160px; }
}
@media (max-width: 480px) {
  .system-grid { grid-template-columns: 1fr; }
  .home-hero .btn { width: 100%; text-align: center; }
}
.lang-select {
  margin-left: auto;
  width: auto;
  padding: 4px 8px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
h2 { font-size: 1.25rem; margin-top: 28px; }
.free-banner {
  background: linear-gradient(135deg, #143325 0%, #1a222c 70%);
  border: 1px solid #2e6b4a;
  border-radius: 12px;
  padding: 18px 20px 16px;
  margin: 28px 0 24px;
}
.free-banner-kicker {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ok);
}
.free-banner-h {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}
.free-banner .muted { margin: 0; }
.free-banner .btn-row { margin-top: 12px; }
.feat-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.feat-list li {
  margin: 0;
  padding: 0;
}
.feat-list strong {
  display: block;
  color: #e8f5ee;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}
.feat-list .muted {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.tips {
  margin: 0 0 28px;
  padding: 4px 16px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tips h2 { margin-top: 16px; }
.faq { margin-top: 8px; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style-position: outside;
}
.faq details > div { margin-top: 8px; color: var(--muted); }

/* AIF-C01 topic hub and fixed free practice set */
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 24px; }
.topic-card { display: block; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #151d25; color: var(--text) !important; text-decoration: none; }
.topic-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.topic-card strong { display: block; margin-bottom: 5px; color: #fff; }
.topic-card span { color: var(--muted); font-size: .9rem; }
.study-plan-table td:first-child { width: 72px; font-weight: 700; color: #efbd71; }
.editorial-box { margin: 24px 0; padding: 18px; border: 1px solid #326f59; border-radius: 12px; background: #152c27; }
.editorial-box h2 { margin-top: 0; }
.practice-section { margin: 30px 0; padding: 22px; border: 1px solid #735d2d; border-radius: 14px; background: linear-gradient(145deg, #241f17, #1a222c 65%); scroll-margin-top: 170px; }
.practice-section > h2 { margin-top: 0; }
.quiz-shell { min-height: 330px; margin-top: 18px; }
.quiz-progress { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .88rem; }
.quiz-score { color: #efbd71; font-weight: 700; }
.quiz-domain { margin-bottom: 6px; color: #efbd71; font-size: .85rem; font-weight: 700; }
.quiz-stem { margin: 0 0 18px; font-size: 1.08rem; }
.quiz-choices { display: grid; gap: 9px; }
.quiz-choice { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: #111820; color: var(--text); cursor: pointer; }
.quiz-choice:hover { border-color: #587086; }
.quiz-choice input { margin-top: 5px; }
.quiz-choice.correct { border-color: var(--ok); background: #143325; }
.quiz-choice.wrong { border-color: #c44c4c; background: #351c20; }
.quiz-feedback { margin-top: 14px; padding: 14px; border-radius: 9px; background: #111820; }
.quiz-feedback.correct { border-left: 3px solid var(--ok); }
.quiz-feedback.incorrect { border-left: 3px solid #f07178; }
.quiz-feedback p { margin: 8px 0; color: #c5d0d9; }
.quiz-result-kicker { color: var(--ok); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.quiz-result-score { font-size: 1.8rem; }
.domain-page .domain-lead { font-size: 1.08rem; color: #c5d0d9; }
.domain-page .checklist { padding: 18px 20px; border-left: 3px solid #efbd71; background: #151d25; }
@media (max-width: 620px) {
  .topic-grid { grid-template-columns: 1fr; }
  .practice-section { padding: 18px 14px; }
  .quiz-progress { display: block; }
  .quiz-score { display: block; margin-top: 4px; }
}
