:root {
  color-scheme: light;
  --ink: #24241f;
  --muted: #77776d;
  --paper: #f4f1e9;
  --card: #fffefa;
  --line: #dedbd1;
  --orange: #e76f3c;
  --orange-dark: #bd4e25;
  --green: #617c65;
  --shadow: 0 18px 55px rgba(48, 43, 32, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 86% 3%, rgba(231, 111, 60, .10), transparent 31rem),
    var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.shell { width: min(900px, calc(100% - 36px)); margin: 0 auto; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(36,36,31,.12); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.button-quiet { min-height: 36px; padding: 0 12px; color: var(--muted); border: 1px solid var(--line); background: transparent; font-size: 12px; }
.login-card { width: min(100%, 460px); margin: 56px auto; padding: 30px; }
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.login-copy { margin: 10px 0 24px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
.login-card input[type="password"] { display: block; width: 100%; height: 46px; margin-bottom: 14px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: #fbfaf6; }
.login-card .button-primary { width: 100%; }
.login-status { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.login-status[data-error="true"] { color: #b3483d; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { color: var(--orange); font: 500 20px "DM Mono", monospace; letter-spacing: -.15em; }
.local-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid #d8dfd1; border-radius: 999px; color: #586d59; background: rgba(255,255,255,.45); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #75a46f; box-shadow: 0 0 0 3px rgba(117,164,111,.13); }

.intro { padding: 66px 0 30px; }
.eyebrow { margin: 0 0 12px; color: var(--orange-dark); font: 500 10px "DM Mono", monospace; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(38px, 7vw, 66px); line-height: 1.13; letter-spacing: -.075em; font-weight: 800; }
h1 em { color: var(--orange); font-style: normal; }
.lede { max-width: 520px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }

.card { border: 1px solid rgba(36,36,31,.10); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.controls { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 20px; }
.range-fields { display: flex; align-items: end; gap: 12px; }
label { color: #55554d; font-size: 12px; font-weight: 700; }
.range-fields label { display: grid; gap: 8px; }
.source-field { display: grid; gap: 8px; min-width: 140px; }
select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: #fbfaf6; }
select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(231,111,60,.12); }
input[type="number"] { width: 132px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: #fbfaf6; font: 500 15px "DM Mono", monospace; }
input:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(231,111,60,.12); }
.range-separator { padding: 0 0 13px; color: #aaa89c; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 15px; min-height: 44px; padding: 0 17px; border: 0; border-radius: 9px; font-weight: 700; transition: transform .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button-primary { color: white; background: var(--orange); }
.button-primary:hover { background: var(--orange-dark); }
.button-arrow { font-size: 17px; }
.status-line { min-height: 24px; margin: 13px 4px 20px; color: var(--muted); font-size: 13px; }

.problem-card, .result-card { margin-top: 18px; padding: clamp(20px, 4vw, 34px); }
.section-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid #eeece5; }
.section-heading .eyebrow { margin-bottom: 6px; }
h2 { margin: 0; font-size: 25px; letter-spacing: -.045em; }
.question-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--orange-dark); background: #fff0e8; font: 500 18px "DM Mono", monospace; }
.statement { padding: 24px 0 4px; color: #383831; font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.statement-image { display: block; max-width: min(100%, 680px); max-height: 520px; height: auto; object-fit: contain; margin: 14px auto; border-radius: 7px; }
.statement-image-error { display: block; margin: 10px 0; color: var(--muted); font-size: 12px; }
.statement-section { margin: 22px 0 0; }
.statement-section h3 { margin: 0 0 8px; color: #77776d; font: 500 10px "DM Mono", monospace; letter-spacing: .14em; text-transform: uppercase; }
.statement-section p { margin: 0; white-space: pre-wrap; }
.samples { display: grid; gap: 14px; margin-top: 24px; }
.sample { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf6; }
.sample-title { padding: 9px 12px; border-bottom: 1px solid var(--line); color: #77776d; font: 500 10px "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.sample-columns { display: grid; grid-template-columns: 1fr 1fr; }
.sample-part { min-width: 0; }
.sample-part + .sample-part { border-left: 1px solid var(--line); }
.sample-label { padding: 8px 11px; border-bottom: 1px solid #e9e6dd; color: #77776d; font-size: 11px; font-weight: 700; }
.sample pre { margin: 0; padding: 12px; min-height: 60px; overflow: auto; color: #30302a; font: 12px/1.65 "DM Mono", Consolas, monospace; white-space: pre; }
.sample-explanation { padding: 10px 12px; border-top: 1px solid #e9e6dd; color: var(--muted); font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.judge-form { margin-top: 28px; padding-top: 24px; border-top: 1px solid #eeece5; }
.judge-form label { display: block; color: var(--ink); font-size: 15px; }
.field-hint { margin: 6px 0 12px; color: var(--muted); font-size: 12px; }
textarea { display: block; width: 100%; min-height: 145px; resize: vertical; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: #fbfaf6; font-size: 14px; line-height: 1.8; }
.submit-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.char-count { color: #96958b; font: 11px "DM Mono", monospace; }
.button-dark { color: white; background: var(--ink); }
.button-dark:hover { background: #48483f; }

.result-card { border-left: 4px solid var(--green); }
.result-card[data-verdict="wrong"] { border-left-color: #c75547; }
.result-card[data-verdict="partial"] { border-left-color: #d59b36; }
.result-card[data-verdict="unclear"] { border-left-color: #73809a; }
.result-card .eyebrow { margin-bottom: 7px; }
.result-copy { margin-top: 15px; color: #48483f; font-size: 14px; line-height: 1.85; white-space: pre-wrap; }
.result-details { display: grid; gap: 10px; margin-top: 15px; }
.detail-block { padding: 12px 14px; border-radius: 9px; background: #f6f4ee; }
.detail-block h3 { margin: 0 0 6px; color: #77776d; font-size: 11px; }
.detail-block p { margin: 0; color: #48483f; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
footer { display: flex; align-items: center; justify-content: space-between; padding: 28px 3px 36px; color: #939187; font-size: 11px; }
.footer-spark { color: var(--orange); font-size: 17px; }
.hidden { display: none !important; }

@media (max-width: 620px) {
  .intro { padding-top: 48px; }
  .controls { align-items: stretch; flex-direction: column; }
  .range-fields { justify-content: space-between; }
  .range-fields label { flex: 1; }
  input[type="number"] { width: 100%; }
  .button-primary { width: 100%; }
  .sample-columns { grid-template-columns: 1fr; }
  .sample-part + .sample-part { border-left: 0; border-top: 1px solid var(--line); }
}
