: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; }
.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%;
  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; }
@media (max-width: 820px) {
  .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; }
}
.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; }
.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); }
