:root {
  --bg: #08090c;
  --bg-2: #0e1016;
  --card: #12151c;
  --card-2: #171b24;
  --line: rgba(212, 175, 106, 0.16);
  --line-2: rgba(244, 239, 230, 0.08);
  --gold: #d4af6a;
  --gold-2: #f0d9a0;
  --ink: #f3eee4;
  --muted: #9a9386;
  --faint: #6f6a61;
  --up: #5ecf9a;
  --down: #e15d6a;
  --cyan: #8fd0c8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --serif: "Newsreader", "Songti TC", "Noto Serif TC", serif;
  --sans: "Outfit", "PingFang TC", "Noto Sans TC", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(212, 175, 106, 0.08), transparent 55%),
    radial-gradient(800px 400px at 0% 100%, rgba(143, 208, 200, 0.05), transparent 50%),
    linear-gradient(180deg, transparent, rgba(255,255,255,0.015));
  z-index: 0;
}

a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--ink); }
img { max-width: 100%; }
button, input, textarea, select { font-family: inherit; }

.tape {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: #0a0c11;
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}
.tape-track {
  display: flex;
  gap: 28px;
  white-space: nowrap;
  animation: marquee 48s linear infinite;
  padding-left: 20px;
}
.tape-item {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.tape-item b { color: var(--ink); font-weight: 500; padding: 0 6px; }
.tape-item .up { color: var(--up); }
.tape-item .down { color: var(--down); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  backdrop-filter: blur(16px);
  background: rgba(8, 9, 12, 0.78);
  border-bottom: 1px solid var(--line-2);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
}
.brand-mark {
  width: 34px;
  height: 34px;
}
.brand-name {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.brand-name span {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-top: 1px;
}
nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
nav a {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
nav a.active, nav a:hover { color: var(--ink); }
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.pill.on, .pill:hover { color: var(--ink); border-color: var(--gold); }
.live {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 4px rgba(94, 207, 154, 0.15);
  display: inline-block;
}
.live.bad i { background: var(--down); box-shadow: 0 0 0 4px rgba(225, 93, 106, 0.15); }
.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

main { position: relative; z-index: 1; }
.view { display: none; }
.view.on { display: block; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  padding: 72px 28px 40px;
  max-width: 1240px;
  margin: 0 auto;
  align-items: end;
}
.kicker {
  color: var(--gold);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5.4vw, 68px);
  line-height: 1.08;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.hero p.lead {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  max-width: 640px;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.btn.gold { background: var(--gold); color: #1a140c; }
.btn.gold:hover { background: var(--gold-2); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn:disabled { opacity: 0.55; cursor: wait; }
.fine {
  margin-top: 16px;
  color: var(--faint);
  font-size: 12px;
}

.hero-panel {
  background: linear-gradient(180deg, rgba(212,175,106,0.08), transparent 40%), var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.hero-panel h3 {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}
.mini-row:last-child { border-bottom: 0; }
.px { font-family: var(--mono); }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 12px 28px 64px; }
.section-head { margin: 28px 0 18px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: 34px;
  margin: 0 0 8px;
  font-weight: 500;
}
.section-head p { margin: 0; color: var(--muted); }

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 20px;
  color: inherit;
  display: block;
  transition: border-color 0.2s, transform 0.2s;
}
a.card:hover { border-color: var(--gold); transform: translateY(-2px); color: inherit; }
.card.span-4 { grid-column: span 4; }
.card.span-6 { grid-column: span 6; }
.card.span-8 { grid-column: span 8; }
.card.span-12 { grid-column: span 12; }
.card .idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.14em;
}
.card h3 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 10px 0 8px;
  font-weight: 500;
}
.card p { color: var(--muted); margin: 0; line-height: 1.55; font-size: 14px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.step {
  padding: 22px;
  border-top: 1px solid var(--gold);
  background: var(--bg-2);
  border-radius: 0 0 16px 16px;
}
.step h3 { margin: 0 0 8px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.warn {
  margin: 36px 28px 0;
  max-width: 1184px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(225, 93, 106, 0.25);
  color: #f0c7cb;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 13px;
}

.board { display: grid; gap: 28px; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  font-weight: 500;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 10px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.name-cell { display: flex; flex-direction: column; }
.name-cell small { color: var(--faint); font-size: 11px; }

.desk-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  align-items: start;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 20px;
}
label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 6px;
}
input, textarea, select {
  width: 100%;
  background: #0c0e13;
  border: 1px solid var(--line-2);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--gold); }
.prompt-box {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  padding: 12px;
  border-left: 2px solid var(--gold);
  margin: 8px 0 16px;
  background: rgba(212, 175, 106, 0.04);
}

.output .md {
  line-height: 1.65;
  font-size: 15px;
}
.output .md h1, .output .md h2, .output .md h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 1.2em 0 0.4em;
}
.output .md h1 { font-size: 28px; }
.output .md h2 { font-size: 22px; }
.output .md h3 { font-size: 18px; }
.output .md p { margin: 0.6em 0; color: #e6e0d4; }
.output .md li { margin: 0.25em 0; }
.output .md code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: #0c0e13;
  padding: 0 5px;
  border-radius: 4px;
}
.output .md pre {
  background: #0c0e13;
  padding: 14px;
  border-radius: 12px;
  overflow: auto;
  border: 1px solid var(--line-2);
}
.output .md table { font-size: 13px; }
.output .md a { text-decoration: underline; }
.empty {
  color: var(--faint);
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.status-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  min-height: 18px;
  margin-bottom: 8px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}
.metric {
  background: #0c0e13;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px;
}
.metric span {
  display: block;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.metric b {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-family: var(--mono);
  font-weight: 500;
}
.curve {
  width: 100%;
  height: 140px;
  background: #0c0e13;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  margin-bottom: 16px;
}
.sources { font-size: 12px; color: var(--muted); }
.sources li { margin: 4px 0; }

.desk-index {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
footer {
  border-top: 1px solid var(--line-2);
  padding: 28px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  position: relative;
  z-index: 1;
}
.legal p { color: var(--muted); line-height: 1.7; max-width: 760px; }

.nav-open nav { display: flex; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .card.span-4, .card.span-6, .card.span-8 { grid-column: span 12; }
  .steps, .desk-grid, .desk-index, .admin-grid { grid-template-columns: 1fr; }
  nav { display: none; position: absolute; top: 70px; right: 16px; flex-direction: column; background: var(--card); padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
  body.nav-open nav { display: flex; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .site-header { padding: 12px 16px; }
  .wrap, .hero { padding-left: 16px; padding-right: 16px; }
}

@media print {
  .tape, .site-header, .toolbar, .desk-grid > :first-child, footer, .chips { display: none !important; }
  .desk-grid { display: block; }
  body { background: #fff; color: #111; }
  .output .md p { color: #111; }
  .panel { border: 0; }
}

.tick-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.06em;
  max-width: 160px;
}
#auth-slot { display: flex; gap: 8px; align-items: center; }
.px.flash { animation: flash 0.8s ease; }
@keyframes flash {
  from { color: var(--gold-2); }
  to { color: var(--ink); }
}
.feed-live { color: var(--up); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.feed-delayed { color: var(--faint); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.auth-wrap { max-width: 460px; padding-top: 48px; }
.auth-card h2 { font-family: var(--serif); font-weight: 500; margin-top: 0; }
.auth-card .lead { color: var(--muted); }
.auth-card .btn { width: 100%; margin-top: 16px; }
.gate {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--card);
  text-align: center;
}
.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}
.run-card {
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card);
}
.run-card summary { cursor: pointer; color: var(--gold-2); }
.run-card .md { margin-top: 12px; }
