/* =================================================================
   5888 Premium Design System
   設計語言：Dark Luxe · Muted Champagne Gold · Glass Morphism
   ================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Background tiers */
  --bg-0: #0a0e1a;
  --bg-1: #0f1524;
  --bg-2: #141b2e;
  --bg-3: #1a2238;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(201, 169, 97, 0.4);

  /* Text */
  --text: #e8eaf0;
  --text-muted: #8b92a7;
  --text-dim: #5a6278;

  /* Accent - muted champagne gold (not Chinese-restaurant gold) */
  --accent: #c9a961;
  --accent-bright: #e8d4a2;
  --accent-dim: #8a7542;
  --accent-glow: rgba(201, 169, 97, 0.18);
  --accent-bg: rgba(201, 169, 97, 0.06);

  /* Semantic */
  --danger: #e55b6d;
  --danger-bg: rgba(229, 91, 109, 0.08);
  --success: #5fb878;
  --success-bg: rgba(95, 184, 120, 0.08);
  --warning: #e5a94e;
  --warning-bg: rgba(229, 169, 78, 0.08);

  /* Typography */
  --font-sans: "Inter", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(201, 169, 97, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv11", "ss01";
  line-height: 1.6;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 15% 0%, rgba(201, 169, 97, 0.08), transparent 60%),
    radial-gradient(ellipse 600px 800px at 85% 100%, rgba(201, 169, 97, 0.04), transparent 60%),
    radial-gradient(ellipse 400px 400px at 50% 50%, rgba(42, 54, 88, 0.3), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle grid texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container-narrow { max-width: 920px; }

/* ========== Navigation ========== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
  position: sticky;
  top: 0;
  background: rgba(10, 14, 26, 0.96);
  z-index: 10;
}

.nav-brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand .logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.nav-brand .logo-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-tagline {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}
.nav-tagline strong {
  color: var(--text);
  font-weight: 600;
}
.nav-tagline strong.accent {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .nav-tagline { display: none; }
}
@media (max-width: 640px) {
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 12px; }
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: 80px 20px 48px;
}

.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-bg);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
  background: linear-gradient(135deg, #ffffff 0%, #c9a961 60%, #8a7542 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========== Cards ========== */
.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 36px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-strong);
}

.card h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.3px;
}

.card h2::before {
  content: "";
  width: 3px;
  height: 18px;
  background: linear-gradient(180deg, var(--accent) 0%, transparent 100%);
  border-radius: 2px;
}

.card h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.card-accent {
  background: linear-gradient(135deg, rgba(201, 169, 97, 0.08), rgba(201, 169, 97, 0.02));
  border-color: var(--border-accent);
}

/* ========== Stats ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat {
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.25s ease;
}

.stat:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  margin-bottom: 10px;
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-value .unit {
  font-size: 13px;
  color: var(--text-dim);
  margin-left: 6px;
  font-weight: 400;
  letter-spacing: 0;
}

.stat-value.accent {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-delta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--accent);
  color: var(--bg-0);
  border: 1px solid var(--accent);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  letter-spacing: 0.5px;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201, 169, 97, 0.3);
  background: var(--accent-bright);
}

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  box-shadow: none;
}

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

.btn-danger:hover {
  background: #f06a7e;
  box-shadow: 0 8px 24px rgba(229, 91, 109, 0.3);
}

.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 15px; }

/* ========== Forms ========== */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.input, .select, .textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  background: rgba(201, 169, 97, 0.04);
  box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.1);
}

.input::placeholder { color: var(--text-dim); }

/* ========== Tables ========== */
.table-wrap {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 16px 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:last-child td { border-bottom: none; }

.table .mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-accent { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--border-accent); }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(95, 184, 120, 0.3); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(229, 91, 109, 0.3); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(229, 169, 78, 0.3); }
.badge-muted { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); border: 1px solid var(--border); }

/* ========== Section heads ========== */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 0;
}
.section-head h2::before { display: none; }

.section-head .subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 380px;
}

.toast.show { transform: translateX(0); }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

/* ========== Footer ========== */
.footer {
  margin-top: 120px;
  padding: 48px 24px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-meta {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.dev-signature {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
}

.dev-signature .label {
  color: var(--text-dim);
  text-transform: uppercase;
}

.dev-signature .name {
  color: var(--accent);
  font-weight: 600;
  text-shadow: 0 0 20px rgba(201, 169, 97, 0.5);
}

/* ========== Utils ========== */
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

.mono { font-family: var(--font-mono); }
.mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

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

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card { padding: 24px 20px; }
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.5s ease backwards; }
.fade-in:nth-child(1) { animation-delay: 0s; }
.fade-in:nth-child(2) { animation-delay: 0.08s; }
.fade-in:nth-child(3) { animation-delay: 0.16s; }
.fade-in:nth-child(4) { animation-delay: 0.24s; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(201, 169, 97, 0.2); }
  50% { box-shadow: 0 0 40px rgba(201, 169, 97, 0.5); }
}

.glow { animation: pulse-glow 2s ease-in-out infinite; }
