:root {
  --bg: #0b0e17;
  --bg-elevated: #131826;
  --bg-card: #171d2e;
  --border: #262e45;
  --text: #e7e9f2;
  --text-muted: #9aa3c0;
  --gold: #d8b877;
  --gold-bright: #f0d59a;
  --purple: #7c6bd6;
  --success: #58c98a;
  --error: #e0637a;
  --font-display: 'Cinzel', 'Noto Sans TC', serif;
  --font-body: 'Noto Sans TC', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.narrow { max-width: 760px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 14, 23, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--gold-bright);
}
.brand-mark { color: var(--gold); }
.main-nav {
  display: flex;
  gap: 20px;
  margin-left: 12px;
  flex: 1;
}
.main-nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.main-nav a:hover { color: var(--gold-bright); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.welcome { color: var(--text-muted); font-size: 14px; margin-right: 4px; }
.inline-form { display: inline; }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #241b04;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-block { width: 100%; text-align: center; }

/* ---------- Flash messages ---------- */
.flash { margin: 16px auto 0; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.flash p { margin: 0; }
.flash-success { background: rgba(88, 201, 138, 0.12); border: 1px solid rgba(88, 201, 138, 0.4); color: var(--success); }
.flash-error { background: rgba(224, 99, 122, 0.12); border: 1px solid rgba(224, 99, 122, 0.4); color: var(--error); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -10%, rgba(124, 107, 214, 0.25), transparent 60%),
    linear-gradient(180deg, #0b0e17, #0e1220);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--purple);
  font-weight: 600;
  margin: 0 0 12px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 56px);
  margin: 0 0 16px;
  color: var(--gold-bright);
}
.hero-sub {
  max-width: 560px;
  margin: 0 auto 28px;
  color: var(--text-muted);
  font-size: 17px;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  margin-bottom: 28px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot-offline { background: var(--error); }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Feature grid ---------- */
.features { padding: 64px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.feature-card h3 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  margin: 0 0 10px;
  font-size: 17px;
}
.feature-card p { color: var(--text-muted); margin: 0; font-size: 14px; }

/* ---------- Generic page section ---------- */
.page-section { padding: 56px 0 80px; }
.page-section h1 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 32px;
  margin-bottom: 8px;
}
.subhead {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 22px;
  margin: 40px 0 0;
}
.notice {
  background: rgba(216, 184, 119, 0.1);
  border: 1px solid rgba(216, 184, 119, 0.35);
  color: var(--gold-bright);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}

/* ---------- Steps list ---------- */
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-direction: column; gap: 20px; }
.steps li { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.steps h3 { margin: 0 0 6px; color: var(--gold-bright); font-size: 16px; }
.steps p { margin: 0; color: var(--text-muted); font-size: 14px; }
.steps code { background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: 14px; }
.data-table th, .data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table th { color: var(--gold-bright); font-weight: 600; }
.data-table tbody tr:hover { background: var(--bg-card); }

/* ---------- FAQ ---------- */
.faq-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.faq-list details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
}
.faq-list summary { cursor: pointer; font-weight: 600; color: var(--text); }
.faq-list p { color: var(--text-muted); margin: 10px 0 0; font-size: 14px; }

/* ---------- Auth forms ---------- */
.auth-section { padding: 56px 0 80px; display: flex; justify-content: center; }
.auth-card {
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px;
}
.auth-card h1 { font-family: var(--font-display); color: var(--gold-bright); margin: 0 0 6px; font-size: 26px; }
.auth-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.auth-form input:focus { outline: none; border-color: var(--gold); }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 14px; }
.checkbox-line input { width: auto; }
.auth-form .btn { margin-top: 20px; }
.auth-switch { margin-top: 18px; font-size: 13px; color: var(--text-muted); text-align: center; }
.form-errors {
  background: rgba(224, 99, 122, 0.1);
  border: 1px solid rgba(224, 99, 122, 0.35);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.form-errors ul { margin: 0; padding-left: 18px; color: var(--error); font-size: 13px; }

/* ---------- Error pages ---------- */
.error-page { text-align: center; padding: 60px 0; }
.error-page h1 { font-size: 64px; font-family: var(--font-display); color: var(--gold-bright); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 40px 0 0; background: var(--bg-elevated); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding-bottom: 24px; }
.footer-brand { font-family: var(--font-display); color: var(--gold-bright); font-weight: 700; }
.footer-brand p { font-family: var(--font-body); font-weight: 400; color: var(--text-muted); font-size: 12px; margin-top: 8px; max-width: 320px; }
.footer-nav { display: flex; gap: 16px; align-items: flex-start; }
.footer-nav a { color: var(--text-muted); font-size: 14px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 0; text-align: center; }
.footer-bottom p { margin: 0; font-size: 12px; color: var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px 18px;
    gap: 12px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
  .header-actions { margin-left: auto; }
}
