:root {
  color-scheme: dark;
  --bg: #0a0b0c;
  --panel: #111315;
  --panel-strong: #171a1d;
  --line: rgba(255, 255, 255, 0.11);
  --muted: #8d959e;
  --text: #f4f2ec;
  --lime: #c8ff4a;
  --lime-dim: rgba(200, 255, 74, 0.13);
  --orange: #ff7f50;
  --blue: #7eb6ff;
  --radius: 22px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 10%, rgba(126, 182, 255, 0.09), transparent 30%),
    radial-gradient(circle at 20% 35%, rgba(200, 255, 74, 0.07), transparent 25%),
    var(--bg);
}

button, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.page-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #0a0b0c;
  background: var(--lime);
  font: 800 22px/1 Georgia, serif;
  transform: rotate(-4deg);
}

.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -0.02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }

.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #888;
  box-shadow: 0 0 0 4px rgba(136, 136, 136, 0.12);
}

.connection.ready .status-dot { background: var(--lime); box-shadow: 0 0 0 4px var(--lime-dim); }
.connection.not-ready .status-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 127, 80, 0.13); }

.hero { padding: 76px 0 54px; }
.eyebrow, .step-label { margin: 0; color: var(--lime); font-size: 11px; font-weight: 750; letter-spacing: 0.16em; }

.hero h1 {
  max-width: 920px;
  margin: 18px 0 24px;
  font: 500 clamp(48px, 7.8vw, 96px)/0.98 Georgia, "Noto Serif SC", serif;
  letter-spacing: -0.055em;
}

.hero h1 em { color: var(--lime); font-style: italic; font-weight: 400; }
.hero-copy { max-width: 620px; color: #b8bec4; font-size: 18px; line-height: 1.75; }

.model-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.model-facts span {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

.model-facts b { margin-right: 6px; color: var(--text); font-weight: 650; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  min-height: 610px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 50%), var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.composer { display: flex; flex-direction: column; padding: 26px; }
.section-heading, .result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading h2, .result-heading h2 { margin: 8px 0 0; font-size: 24px; letter-spacing: -0.03em; }
.section-heading > span { color: var(--muted); font: 12px/1.4 ui-monospace, Consolas, monospace; }

textarea {
  width: 100%;
  min-height: 250px;
  flex: 1;
  resize: vertical;
  margin: 24px 0 14px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: #0c0e10;
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea:focus { border-color: rgba(200, 255, 74, 0.5); box-shadow: 0 0 0 4px var(--lime-dim); }
textarea::placeholder { color: #5f666d; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.examples button {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  transition: 150ms ease;
}
.examples button:hover { color: var(--text); border-color: rgba(200, 255, 74, 0.5); background: var(--lime-dim); }

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.composer-footer p { max-width: 280px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-width: 174px;
  padding: 14px 17px;
  border: 0;
  border-radius: 12px;
  background: var(--lime);
  color: #090b08;
  cursor: pointer;
  font-weight: 750;
  transition: transform 150ms ease, filter 150ms ease;
}
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.05); }
.primary-button:disabled { cursor: wait; opacity: 0.6; transform: none; }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.error-message {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 127, 80, 0.35);
  border-radius: 10px;
  background: rgba(255, 127, 80, 0.09);
  color: #ffb59b;
  font-size: 13px;
}

.results { padding: 26px; overflow: hidden; }
.empty-state, .loading-state {
  height: 100%;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.empty-state h2, .loading-state h2 { margin: 12px 0 8px; font: 400 34px/1.1 Georgia, serif; }
.empty-state > p:last-child, .loading-state > p:last-child { color: var(--muted); }

.orbit {
  width: 88px;
  height: 88px;
  position: relative;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.orbit::before, .orbit::after { content: ""; position: absolute; inset: 13px; border: 1px solid var(--line); border-radius: 50%; }
.orbit::after { inset: 30px; background: var(--lime); border: none; box-shadow: 0 0 28px rgba(200, 255, 74, 0.5); }
.orbit span { position: absolute; width: 8px; height: 8px; top: 7px; left: 40px; border-radius: 50%; background: var(--blue); }

.latency { padding: 7px 10px; border-radius: 8px; background: var(--lime-dim); color: var(--lime); font: 12px ui-monospace, Consolas, monospace; }

.result-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 12px; }
.result-summary > div { padding: 17px; border-radius: 14px; background: var(--panel-strong); border: 1px solid var(--line); }
.result-summary span, .result-summary small { display: block; color: var(--muted); font-size: 11px; }
.result-summary strong { display: block; margin: 6px 0 5px; font-size: 27px; letter-spacing: -0.04em; }
.summary-owner strong { color: var(--lime); }
.summary-priority strong { color: var(--orange); }

.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-card { padding: 17px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.16); }
.answer-card.wide { grid-column: span 1; }
.answer-card-header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.answer-card-header h3 { margin: 0; font-size: 14px; }
.answer-type { color: var(--muted); font: 9px ui-monospace, Consolas, monospace; letter-spacing: 0.1em; }

.probability-list { display: grid; gap: 9px; }
.probability-label { display: flex; justify-content: space-between; margin-bottom: 4px; color: #c6cbd0; font-size: 11px; }
.probability-label b { color: var(--text); font-family: ui-monospace, Consolas, monospace; }
.bar-track { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lime), #83d971); box-shadow: 0 0 15px rgba(200, 255, 74, 0.3); }

.boolean-body { display: flex; gap: 14px; align-items: center; }
.probability-gauge {
  --probability: 0deg;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--probability), rgba(255, 255, 255, 0.08) 0);
}
.probability-gauge::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--panel); }
.probability-gauge strong { position: relative; z-index: 1; font: 700 12px ui-monospace, Consolas, monospace; }
.verdict b { display: block; margin-bottom: 5px; font-size: 13px; }
.verdict .yes { color: var(--orange); }
.verdict .no { color: var(--blue); }
.verdict p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.result-footer { display: flex; gap: 15px; margin-top: 12px; color: #687079; font: 10px ui-monospace, Consolas, monospace; }
.failed-state { min-height: 520px; }

.loading-bars { width: min(300px, 70%); display: grid; gap: 9px; margin: 28px 0 14px; }
.loading-bars i { height: 6px; border-radius: 999px; background: linear-gradient(90deg, transparent, var(--lime), transparent); background-size: 200% 100%; animation: loading 1.1s linear infinite; opacity: 0.75; }
.loading-bars i:nth-child(2) { animation-delay: 100ms; }
.loading-bars i:nth-child(3) { animation-delay: 200ms; }
.loading-bars i:nth-child(4) { animation-delay: 300ms; }
@keyframes loading { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.explanation { padding: 90px 0 75px; }
.explanation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 20px; border: 1px solid var(--line); background: var(--line); border-radius: 16px; overflow: hidden; }
.explanation article { padding: 25px; background: var(--bg); }
.explanation article > span { color: var(--lime); font: 12px ui-monospace, Consolas, monospace; }
.explanation h3 { margin: 14px 0 8px; }
.explanation p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

footer { display: flex; justify-content: space-between; padding: 25px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--lime); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .panel { min-height: auto; }
  .empty-state, .loading-state { min-height: 460px; }
  .hero h1 { font-size: clamp(48px, 12vw, 78px); }
}

@media (max-width: 700px) {
  .page-shell { width: min(100% - 24px, 1240px); }
  .topbar { min-height: 72px; }
  .brand small { display: none; }
  .connection { font-size: 11px; }
  .hero { padding: 55px 0 38px; }
  .hero h1 { font-size: 42px; line-height: 1.04; letter-spacing: -0.045em; }
  .hero-copy { font-size: 15px; }
  .composer, .results { padding: 18px; }
  .composer-footer { align-items: stretch; flex-direction: column; }
  .composer-footer p { max-width: none; }
  .primary-button { width: 100%; }
  .result-summary, .answer-grid, .explanation-grid { grid-template-columns: 1fr; }
  .explanation-grid { gap: 1px; }
  .result-footer { flex-direction: column; gap: 4px; }
  footer { gap: 20px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
