:root {
  --black: #070809;
  --panel: #0e1012;
  --panel-deep: #0a0b0d;
  --line: #272a2f;
  --line-soft: #1b1e22;
  --text: #f0eee9;
  --muted: #888c92;
  --muted-deep: #5e6268;
  --gold: #c8ad82;
  --gold-deep: #9d855f;
  --green: #75b99c;
  --amber: #d3a869;
  --red: #cf7777;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--black);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(255,255,255,.025) 50%, transparent calc(50% + .5px)),
    radial-gradient(circle at 74% 6%, #191a1d 0, #0d0e10 22rem, transparent 40rem),
    var(--black);
}

button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar {
  display: flex;
  width: min(1160px, calc(100% - 48px));
  height: 86px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  position: relative;
  padding-left: 16px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .18em;
  text-decoration: none;
}

.brand::before {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 2px;
  background: var(--gold);
}

.back-link {
  display: inline-flex;
  height: 36px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid #3b372f;
  color: #bda982;
  background: rgba(18, 19, 21, .72);
  font-size: 11px;
  letter-spacing: .06em;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.back-arrow { font-size: 15px; transition: transform .2s ease; }
.back-link:hover { border-color: #6f6049; color: var(--text); background: #15171a; }
.back-link:hover .back-arrow { transform: translateX(-2px); }

.page-shell {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 86px 0 90px;
}

.hero { margin-bottom: 52px; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font: 600 11px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .17em;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5.6vw, 60px);
  line-height: 1.14;
  letter-spacing: -.045em;
  font-weight: 650;
}

.mobile-break { display: none; }

.subtitle {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.checker {
  position: relative;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(18,20,23,.96), rgba(10,11,13,.98));
  box-shadow: 0 30px 90px rgba(0,0,0,.38);
}

.checker::before {
  content: "";
  position: absolute;
  inset: -1px 34px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}

.checker-head, .input-meta, .result-summary, .session-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checker-head { margin-bottom: 18px; }
.checker-head > div { display: flex; align-items: baseline; gap: 12px; }
.field-index { color: var(--gold); font: 600 10px/1 ui-monospace, "Cascadia Mono", monospace; }
.checker-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.limit { color: var(--muted-deep); font-size: 11px; }

.input-wrap { border: 1px solid var(--line); background: var(--panel-deep); transition: border-color .2s ease; }
.input-wrap:focus-within { border-color: #5e523f; }

textarea {
  display: block;
  width: 100%;
  min-height: 210px;
  resize: vertical;
  padding: 19px 20px;
  border: 0;
  outline: 0;
  color: #dedbd4;
  background: transparent;
  font: 13px/1.75 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

textarea::placeholder { color: #4f5359; }

.input-meta {
  min-height: 42px;
  padding: 0 12px 0 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-deep);
  font-size: 11px;
}

.text-button { padding: 7px 8px; border: 0; color: var(--gold); background: transparent; cursor: pointer; }

.primary-button {
  position: relative;
  overflow: hidden;
  display: flex;
  width: 100%;
  height: 54px;
  margin-top: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 20px;
  border: 1px solid #3b372f;
  border-radius: 2px;
  color: #e8e4db;
  background: linear-gradient(180deg, #181a1d, #111315);
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 8px 28px rgba(0,0,0,.18);
  cursor: pointer;
  font-weight: 650;
  letter-spacing: .02em;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.button-label { display: inline-flex; align-items: center; gap: 13px; }
.button-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}
.primary-button:hover {
  border-color: #706047;
  background: linear-gradient(180deg, #1d1f22, #131517);
  box-shadow: inset 0 1px rgba(255,255,255,.035), 0 12px 34px rgba(0,0,0,.24);
  transform: translateY(-1px);
}
.primary-button:disabled { transform: none; cursor: wait; opacity: .72; }
.button-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #4b4235;
  color: #d5ba8f;
  background: linear-gradient(135deg, rgba(200,173,130,.16), rgba(200,173,130,.06));
  font-size: 18px;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.primary-button:hover .button-arrow {
  border-color: var(--gold);
  color: #15120d;
  background: var(--gold);
}
.primary-button.is-loading .button-arrow { animation: pulse 1s ease-in-out infinite alternate; }

.privacy-line { margin: 17px 0 0; color: var(--muted-deep); font-size: 11px; text-align: center; }
.privacy-line span { margin-right: 5px; color: var(--gold-deep); }

.results { margin-top: 14px; }
.empty-result { display: flex; min-height: 74px; align-items: center; gap: 13px; padding: 0 20px; border: 1px solid var(--line-soft); color: var(--muted-deep); background: rgba(11,12,14,.52); }
.empty-result p { margin: 0; font-size: 12px; }
.empty-line { width: 24px; height: 1px; background: var(--gold-deep); }

.result-summary { flex-wrap: wrap; gap: 12px; margin-bottom: 10px; padding: 14px 18px; border: 1px solid var(--line); background: var(--panel); }
.summary-title { font-size: 13px; font-weight: 700; }
.summary-counts { display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 11px; }
.summary-counts b { color: var(--text); }
.result-list { display: grid; gap: 10px; }

.result-card { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 19px; border: 1px solid var(--line); background: var(--panel); }
.result-icon { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 18px; font-weight: 700; }
.result-card.success .result-icon { color: var(--green); }
.result-card.warning .result-icon { color: var(--amber); }
.result-card.danger .result-icon { color: var(--red); }
.result-card.neutral .result-icon { color: var(--muted); }
.result-main h3 { margin: 0 0 6px; font-size: 15px; }
.result-main p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.result-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.result-meta span { padding: 4px 7px; border: 1px solid var(--line-soft); color: #71757b; background: #0a0b0c; font: 10px/1 ui-monospace, "Cascadia Mono", monospace; }
.result-badge { align-self: start; padding: 6px 8px; border: 1px solid currentColor; font-size: 10px; white-space: nowrap; }
.success .result-badge { color: var(--green); }
.warning .result-badge { color: var(--amber); }
.danger .result-badge { color: var(--red); }
.neutral .result-badge { color: var(--muted); }

.guide { margin-top: 38px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guide summary { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 20px; list-style: none; color: #c7c4bd; cursor: pointer; font-size: 13px; }
.guide summary::-webkit-details-marker { display: none; }
.summary-icon { color: var(--gold); font-size: 20px; transition: transform .2s ease; }
.guide[open] .summary-icon { transform: rotate(45deg); }
.guide-body { padding: 0 0 26px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.guide-body ol { margin: 0 0 18px; padding-left: 21px; }
.guide-body li { padding-left: 6px; margin: 5px 0; }
.session-link { gap: 18px; padding: 12px 12px 12px 16px; border: 1px solid var(--line); background: var(--panel-deep); }
.session-link code { color: #aaa69d; font: 11px/1.5 ui-monospace, "Cascadia Mono", monospace; }
.session-actions { display: flex; gap: 7px; }
.session-actions button, .session-actions a { padding: 8px 11px; border: 1px solid var(--line); color: var(--gold); background: #121315; cursor: pointer; font-size: 11px; text-decoration: none; white-space: nowrap; }
.guide-warning { margin: 15px 0 0; color: var(--muted-deep); font-size: 11px; }

.site-footer { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 27px 0 35px; border-top: 1px solid var(--line); color: #4f5358; font-size: 10px; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: min(340px, calc(100% - 48px)); padding: 12px 15px; border: 1px solid #514633; color: var(--text); background: #151310; box-shadow: 0 16px 50px rgba(0,0,0,.45); font-size: 12px; }

.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; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }

@media (max-width: 660px) {
  .topbar, .page-shell, .site-footer { width: min(100% - 30px, 560px); }
  .topbar { height: 72px; }
  .back-link { height: 34px; gap: 7px; padding: 0 10px; font-size: 10px; }
  .page-shell { padding: 62px 0 70px; }
  .hero { margin-bottom: 38px; }
  h1 { font-size: 38px; line-height: 1.18; }
  .mobile-break { display: block; }
  .subtitle { font-size: 13px; line-height: 1.8; }
  .checker { padding: 24px 18px; }
  textarea { min-height: 230px; padding: 16px; }
  .input-meta { padding-left: 16px; }
  .result-card { grid-template-columns: 40px minmax(0,1fr); padding: 16px; }
  .result-icon { width: 40px; height: 40px; }
  .result-badge { grid-column: 2; justify-self: start; }
  .session-link { align-items: stretch; flex-direction: column; }
  .session-link code { overflow-wrap: anywhere; }
  .session-actions > * { flex: 1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
