:root {
  --bg: #060a14;
  --bg-glow: #0b2b45;
  --card: #0d1524;
  --card-2: #111c2f;
  --line: #1e2c44;
  --text: #e6eefc;
  --muted: #8b9db8;
  --accent: #38e1ff;
  --yes: #2ee6a8;
  --no: #ff5c8a;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 520px at 15% -10%, rgba(56, 225, 255, 0.16), transparent 60%),
    radial-gradient(900px 460px at 110% 10%, rgba(120, 90, 255, 0.13), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 20px 72px;
}

/* ---------- hero ---------- */
.hero {
  margin-bottom: 28px;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(56, 225, 255, 0.35);
  background: rgba(56, 225, 255, 0.07);
  border-radius: 999px;
  padding: 3px 12px;
}

.hero h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 4.6vw, 42px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-sub {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 15px;
}

.hero-sub strong {
  color: var(--yes);
  font-weight: 600;
}

.hero-sub strong + strong {
  color: var(--no);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: var(--accent);
  background: rgba(56, 225, 255, 0.08);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)) , var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea::placeholder {
  color: #5d6f8c;
}

textarea:focus {
  border-color: rgba(56, 225, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 225, 255, 0.12);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  appearance: none;
  border: 0;
  border-radius: 11px;
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #04121a;
  background: linear-gradient(135deg, #6ff0ff, #38e1ff 55%, #2ec9ff);
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s, opacity 0.12s;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: progress;
}

.kbd-hint,
.char-count {
  font-size: 12px;
  color: var(--muted);
}

.char-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.chip {
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(56, 225, 255, 0.45);
  background: rgba(56, 225, 255, 0.08);
}

/* ---------- type tabs ---------- */
.type-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #0a1220;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.tab {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 7px 18px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--text);
  background: rgba(56, 225, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(56, 225, 255, 0.35);
}

.tab-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.type-hint {
  margin: 10px 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.field-hint {
  margin-left: 8px;
  font-size: 11.5px;
  color: #5f728f;
  font-weight: 400;
}

.input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: #5d6f8c;
}

.input:focus {
  border-color: rgba(56, 225, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 225, 255, 0.12);
}

.sub-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row-opt {
  display: grid;
  grid-template-columns: minmax(84px, 150px) 1fr 30px;
  gap: 8px;
  align-items: center;
}

.row-opt.is-level {
  grid-template-columns: 26px 1fr 30px;
}

.opt-id,
.opt-desc,
.lvl-desc {
  min-width: 0;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.opt-id:focus,
.opt-desc:focus,
.lvl-desc:focus {
  border-color: rgba(56, 225, 255, 0.5);
}

.opt-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--accent);
}

.lvl-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 30px;
  border-radius: 8px;
  background: rgba(56, 225, 255, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.row-del {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.row-del:hover {
  color: var(--no);
  border-color: rgba(255, 92, 138, 0.5);
}

.sub-note {
  font-size: 11.5px;
  color: #5f728f;
}

.drop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px dashed #2a3d5c;
  border-radius: 12px;
  background: rgba(56, 225, 255, 0.02);
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.drop:hover,
.drop.is-dragging {
  border-color: rgba(56, 225, 255, 0.55);
  background: rgba(56, 225, 255, 0.07);
  color: var(--text);
}

.drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(56, 225, 255, 0.12);
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  flex: none;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.thumbs:empty {
  margin-top: 0;
}

.thumb {
  position: relative;
  margin: 0;
  width: 132px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--card-2);
}

.thumb img {
  display: block;
  width: 100%;
  height: 86px;
  object-fit: cover;
}

.thumb figcaption {
  padding: 5px 8px 6px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 0;
  background: rgba(6, 10, 20, 0.78);
  color: #ffd4dd;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.thumb-del:hover {
  background: var(--no);
  color: #12040a;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.mini-toggle input {
  accent-color: var(--accent);
  margin: 0;
}

/* ---------- verdict ---------- */
.verdict {
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr;
  gap: 24px 28px;
  align-items: center;
  transition: border-color 0.2s;
}

.verdict.is-yes {
  border-color: rgba(46, 230, 168, 0.45);
  box-shadow: 0 0 0 1px rgba(46, 230, 168, 0.12), 0 18px 48px -28px rgba(46, 230, 168, 0.55);
}

.verdict.is-no {
  border-color: rgba(255, 92, 138, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 92, 138, 0.12), 0 18px 48px -28px rgba(255, 92, 138, 0.5);
}

.verdict.is-accent {
  grid-template-columns: 1fr;
  align-items: start;
  border-color: rgba(56, 225, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(56, 225, 255, 0.12), 0 18px 48px -28px rgba(56, 225, 255, 0.5);
}

.verdict-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.verdict-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.verdict-answer {
  font-size: 64px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #4a5b76;
}

.verdict.is-yes .verdict-answer {
  color: var(--yes);
}

.verdict.is-no .verdict-answer {
  color: var(--no);
}

.verdict.is-accent .verdict-answer {
  font-size: 44px;
  word-break: break-word;
  color: var(--accent);
}

.verdict-sub {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.verdict-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(22px, auto) 1fr 52px;
  align-items: center;
  gap: 10px;
}

.bar-name {
  font-size: 13px;
  color: var(--muted);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #17233a;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-yes {
  background: linear-gradient(90deg, #16c992, var(--yes));
}

.bar-no {
  background: linear-gradient(90deg, #e0325f, var(--no));
}

.bar-accent {
  background: linear-gradient(90deg, #1fb6d8, var(--accent));
}

.bar-dim {
  background: linear-gradient(90deg, #22304a, #3a5175);
}

.bar-pct {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
}

.verdict-meta {
  grid-column: 1 / -1;
  display: flex;
  gap: 32px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.verdict-meta div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.verdict-meta dt {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.verdict-meta dd {
  margin: 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ---------- error ---------- */
.error {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 92, 138, 0.4);
  background: rgba(255, 92, 138, 0.09);
  color: #ffb7c9;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden {
  display: none !important;
}

/* ---------- panels ---------- */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

.btn-ghost {
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  flex: none;
}

.btn-ghost:hover {
  color: var(--accent);
  border-color: rgba(56, 225, 255, 0.4);
}

.json {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: #070d18;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.62;
  color: #cfe3ff;
  overflow: auto;
  max-height: 420px;
  min-height: 220px;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.json.is-error {
  color: #ffb7c9;
}

.foot {
  margin-top: 26px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .wrap {
    padding: 36px 16px 56px;
  }
  .panels {
    grid-template-columns: 1fr;
  }
  .verdict {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .verdict-answer {
    font-size: 48px;
  }
  .verdict-meta {
    gap: 22px;
  }
}
