:root {
  --bg: #070b14;
  --bg-2: #0b1220;
  --panel: #0e1626;
  --panel-2: #111c30;
  --line: #1d2b45;
  --line-soft: #16223a;
  --text: #e6edf7;
  --muted: #8aa0bd;
  --muted-2: #62748f;
  --accent: #50e3c2;
  --accent-2: #5b8cff;
  --warn: #ff8b6b;
  --radius: 14px;
  --maxw: 1080px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(80, 227, 194, 0.10), transparent 60%),
    radial-gradient(700px 480px at 0% 0%, rgba(91, 140, 255, 0.10), transparent 55%),
    linear-gradient(180deg, #070b14, #060912);
}
.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 70%);
}

main, .site-head, .site-foot { position: relative; z-index: 1; }

/* Header */
.site-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { display: inline-flex; }
.brand-name { font-weight: 700; letter-spacing: 0.2px; font-size: 16px; }
.head-note {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 60px; }

/* Hero */
.hero { padding: 38px 0 26px; }
.hero h1 {
  font-size: clamp(26px, 4.4vw, 42px);
  line-height: 1.18;
  margin: 0 0 14px;
  letter-spacing: -0.3px;
  font-weight: 800;
}
.hl {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub {
  font-size: clamp(15px, 1.9vw, 17px);
  color: var(--muted);
  max-width: 760px;
  margin: 0;
}

/* Input card */
.input-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.8);
}
.input-card.shake { animation: shake 0.4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: none;
}
#hypothesis {
  width: 100%;
  resize: vertical;
  min-height: 76px;
  background: #070d18;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  padding: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#hypothesis::placeholder { color: #4d6585; }
#hypothesis:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(80, 227, 194, 0.14);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chip {
  font-size: 12.5px;
  color: var(--muted);
  background: #0c1525;
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--accent); background: #0f1d31; }

.btn-primary {
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 11px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  color: #04221c;
  background: linear-gradient(90deg, var(--accent), #6ff0d6);
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.kbd-hint { text-align: center; color: var(--muted-2); font-size: 12px; margin: 10px 0 0; }

/* Export bar */
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.export-bar.hidden { display: none; }
.export-label { font-size: 13px; color: var(--accent); font-weight: 600; }
.export-actions { display: flex; gap: 8px; }
.btn-ghost {
  background: #0c1525;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); }
.btn-ghost:disabled { opacity: 0.7; cursor: default; color: var(--accent); }

/* Output */
.output { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.output.empty { margin-top: 22px; }
.placeholder {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(14, 22, 38, 0.5);
}
.ph-icon { font-size: 30px; color: var(--accent); opacity: 0.6; letter-spacing: -4px; }
.placeholder p { margin: 12px 0 18px; font-size: 15px; }
.ph-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 560px;
  text-align: left;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
}
.ph-list li { padding-left: 22px; position: relative; color: var(--muted); }
.ph-list li::before { content: "▹"; color: var(--accent); position: absolute; left: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  animation: rise 0.4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: rgba(80, 227, 194, 0.08);
  border: 1px solid rgba(80, 227, 194, 0.25);
  padding: 3px 10px;
  border-radius: 7px;
  margin-bottom: 14px;
}
.panel-lead { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.panel h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -0.2px; }

/* Signal card */
.signal-card { background: linear-gradient(180deg, #10203a, var(--panel)); border-color: #234063; }
.card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.meta-item { background: #0c1627; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.meta-k { font-size: 11.5px; color: var(--muted-2); }
.meta-v { font-size: 14.5px; font-weight: 600; color: var(--text); }
.meta-note { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.signal-def p { margin: 0 0 8px; font-size: 14.5px; color: #cdd9e8; }
.signal-def b { color: var(--text); }

/* Bullets */
.bullet { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 9px; }
.bullet li { position: relative; padding-left: 24px; font-size: 14.5px; color: #cdd9e8; }
.bullet li::before { content: "▸"; position: absolute; left: 2px; color: var(--accent); }
.bullet.risk li::before { content: "⚠"; color: var(--warn); font-size: 12px; top: 1px; }

/* Code */
.code-block {
  background: #060c16;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 12px;
}
.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: #b9e8da;
  white-space: pre;
}

/* Metric grid */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.metric { background: #0b1424; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.metric-name { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; color: var(--text); }
.metric-desc { font-size: 13px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.metric-target { font-size: 12px; color: var(--accent); font-family: var(--mono); }

/* Checklist */
.checklist { display: grid; gap: 8px; }
.check-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 10px;
  background: #0b1424;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
}
.check-row input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.ck-k { font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--text); }
.ck-v { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.check-row:has(input:checked) { opacity: 0.55; border-color: var(--accent); }
.check-row:has(input:checked) .ck-k { text-decoration: line-through; }

.disclaimer {
  font-size: 12.5px;
  color: var(--muted-2);
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  margin: 4px 0 0;
}
.disclaimer b { color: var(--muted); }

/* How section */
.how { margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--line-soft); }
.how h3 { font-size: 20px; margin: 0 0 10px; }
.how > p { color: var(--muted); max-width: 800px; margin: 0 0 22px; font-size: 14.5px; }
.how > p strong { color: var(--text); }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.how-grid > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.how-grid .num { font-family: var(--mono); color: var(--accent); font-size: 13px; }
.how-grid b { display: block; margin: 6px 0 6px; font-size: 15px; }
.how-grid p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* Footer */
.site-foot { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 40px; }
.site-foot p { color: var(--muted-2); font-size: 12.5px; margin: 0; text-align: center; }
.site-foot strong { color: var(--warn); }

@media (max-width: 600px) {
  main { padding: 0 16px 50px; }
  .site-head { padding: 16px 16px 6px; }
  .head-note { display: none; }
  .input-card { padding: 16px; }
  .panel { padding: 16px; }
  .check-row { grid-template-columns: auto 1fr; }
  .check-row input { grid-row: span 2; }
}
