:root {
  --bg: #f6efe6;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-strong: #fffaf3;
  --text: #221d17;
  --muted: #776b60;
  --line: rgba(99, 73, 45, 0.14);
  --brand: #c7561f;
  --brand-dark: #8f3f19;
  --accent: #0f766e;
  --danger: #be123c;
  --shadow: 0 24px 60px rgba(74, 52, 26, 0.14);
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(199, 86, 31, 0.18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(15, 118, 110, 0.18), transparent 25%),
    linear-gradient(180deg, #f9f3eb 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--sans);
}

a { color: var(--brand-dark); text-decoration: none; }

.bg-orb {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.3;
}

.bg-orb-a { top: -16vw; left: -10vw; background: rgba(199, 86, 31, 0.4); }
.bg-orb-b { right: -15vw; bottom: -18vw; background: rgba(15, 118, 110, 0.35); }

.site-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 18px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.site-nav { display: flex; gap: 16px; align-items: center; }

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 48px;
  position: relative;
  z-index: 2;
}

.hero-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card { border-radius: 32px; padding: 32px; }
.auth-card { max-width: 720px; margin: 24px auto 0; display: grid; gap: 28px; }
.dashboard-card { display: grid; gap: 18px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

h1, h2 { margin: 0; letter-spacing: -0.04em; }
h1 { font-size: clamp(32px, 6vw, 54px); line-height: 0.95; }
h2 { font-size: 18px; }

.lead {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 58ch;
  line-height: 1.6;
}

.stack { display: grid; gap: 14px; }
.inline-row { display: flex; gap: 12px; align-items: end; }
.grow { flex: 1; }

.field { display: grid; gap: 8px; width: 100%; }
.field span { font-size: 13px; color: var(--muted); }

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  color: var(--text);
}

.field input:focus {
  outline: 2px solid rgba(199, 86, 31, 0.18);
  border-color: rgba(199, 86, 31, 0.35);
}

.primary-btn, .secondary-btn, .link-btn {
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.primary-btn:hover, .secondary-btn:hover, .link-btn:hover { transform: translateY(-1px); }
.primary-btn { background: linear-gradient(135deg, var(--brand) 0%, #e07f2c 100%); color: white; font-weight: 700; }
.secondary-btn, .link-btn { background: white; color: var(--text); border: 1px solid var(--line); }
.code-btn { min-width: 154px; }

.helper-text, .message { margin: 0; color: var(--muted); }
.message.is-error { color: var(--danger); }
.message.is-success { color: var(--accent); }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: var(--panel-strong);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong { display: block; font-size: 28px; margin-top: 8px; }

.panel { border-radius: 24px; padding: 20px; }

.json-box {
  margin: 0;
  padding: 18px;
  background: #1e1d1a;
  color: #f5f2ed;
  border-radius: 18px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
}

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { color: var(--muted); font-weight: 600; white-space: nowrap; }

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
}

.badge.badge-off { background: rgba(190, 18, 60, 0.1); color: var(--danger); }

.action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.tiny-btn {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.activity-list { display: grid; gap: 10px; }

.activity-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--panel-strong);
}

.activity-item code { font-family: var(--mono); word-break: break-all; }

@media (max-width: 820px) {
  .inline-row, .panel-header, .two-col {
    grid-template-columns: 1fr;
    display: grid;
  }

  .code-btn { min-width: 0; }
}
