:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b66;
  --line: #e2e2dc;
  --accent: #1f5eff;
  --accent-soft: #eaf0ff;
  --ok: #16794a;
  --warn: #b4530a;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --panel: #1a1a1a;
    --fg: #ededed;
    --muted: #9a9a94;
    --line: #2c2c2c;
    --accent: #6f9bff;
    --accent-soft: #182441;
    --ok: #4ade80;
    --warn: #f0a35e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

.top {
  padding-block: 40px 20px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

h1 {
  font-size: 21px;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.01em;
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 60ch;
}

main {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1.15fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 40px;
}

@media (max-width: 820px) {
  main { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
}

.tab.on {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.pane { display: none; }
.pane.on { display: block; }

.drop {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}

.drop:hover, .drop:focus-visible, .drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.drop-idle svg { color: var(--muted); }

.drop p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.drop strong { color: var(--fg); font-weight: 600; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 10px 0 0; }

#preview {
  width: 224px;
  height: 224px;
  border-radius: 10px;
  background: #fff;
  image-rendering: auto;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.ex {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.ex:hover { border-color: var(--accent); color: var(--accent); }

#q {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
}

#q:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── results ───────────────────────────────────────────── */

.status {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}

.bar {
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s;
}

.verdict {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 11px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.verdict.yes { border-color: var(--ok); }
.verdict.no { border-color: var(--warn); }

.verdict-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 15px;
}

.verdict.yes .verdict-main { color: var(--ok); }
.verdict.no .verdict-main { color: var(--warn); }

.verdict-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.threshold { margin-top: 18px; }

.threshold label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.threshold b { color: var(--fg); font-variant-numeric: tabular-nums; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 8px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  position: relative;
}

.card.below { opacity: .42; }

.card svg {
  width: 34px; height: 34px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card .nm {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

.card .sc {
  position: absolute;
  top: 6px; right: 7px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.card .sc.hi { color: var(--ok); font-weight: 600; }

.foot {
  border-top: 1px solid var(--line);
  padding-block: 28px 60px;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 26px;
}

.foot h3 {
  font-size: 13px;
  margin: 0 0 7px;
  font-weight: 650;
}

.foot p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 5px;
}
