:root {
  --black: #070809;
  --panel: #0e1012;
  --panel-deep: #090a0c;
  --line: #282b30;
  --line-soft: #1c1f23;
  --text: #f0eee9;
  --muted: #898d93;
  --muted-deep: #60646a;
  --gold: #c8ad82;
  --gold-deep: #9d855f;
  --green: #75b99c;
  --amber: #d3a869;
  --red: #cf7777;
  color: var(--text);
  background: var(--black);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  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,.024) 50%, transparent calc(50% + .5px)),
    radial-gradient(circle at 77% 3%, #191a1d 0, #0d0e10 22rem, transparent 40rem),
    var(--black);
}
button, input, textarea, select { 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 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .18em;
  text-decoration: none;
}
.brand img { display: block; width: 54px; height: 39px; }
.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(980px, calc(100% - 48px)); margin: 0 auto; padding: 86px 0 90px; }
.hero { margin-bottom: 52px; }
.eyebrow, .section-label {
  color: var(--gold);
  font: 600 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .17em;
}
.eyebrow { margin: 0 0 18px; }
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: 700px; margin: 22px 0 0; color: var(--muted); font-size: 15px; line-height: 1.85; }

.query-panel {
  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);
}
.query-panel::before { content: ""; position: absolute; inset: -1px 34px auto; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-deep), transparent); }
.query-head, .input-meta { display: flex; align-items: center; justify-content: space-between; }
.query-head { margin-bottom: 18px; }
.query-head > div { display: flex; align-items: baseline; gap: 12px; }
.field-index { color: var(--gold); font: 600 10px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.query-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: 170px;
  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, input::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; }

.field-grid { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 12px; margin-top: 12px; }
.field label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.field input, .field select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  color: #d8d5cf;
  background: var(--panel-deep);
}
.field input:focus, .field select:focus { border-color: #5e523f; }

.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: not-allowed; opacity: .52; }
.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; }
.primary-button:hover:not(:disabled) .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: grid; min-height: 108px; grid-template-columns: auto 1fr; align-items: center; gap: 24px; padding: 22px; border: 1px solid var(--line-soft); background: rgba(11,12,14,.52); }
.empty-index { color: var(--gold-deep); font: 600 10px/1 ui-monospace, "Cascadia Mono", monospace; letter-spacing: .15em; writing-mode: vertical-rl; }
.empty-result h2 { margin: 0 0 7px; color: #aaa69d; font-size: 14px; }
.empty-result p { margin: 0; color: var(--muted-deep); font-size: 11px; line-height: 1.65; }
.result-panel { position: relative; padding: 28px; border: 1px solid var(--line); background: linear-gradient(145deg, #111315, #0b0c0e 72%); box-shadow: 0 24px 70px rgba(0,0,0,.28); animation: reveal .35s ease both; }
.result-panel::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--green); }
.result-title { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.result-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }

.error-card { display: grid; grid-template-columns: 48px 1fr; gap: 18px; align-items: center; padding: 24px; border: 1px solid #4a3030; background: #130e0f; animation: reveal .3s ease both; }
.error-mark { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--red); border-radius: 50%; color: var(--red); font-size: 18px; }
.error-card h2 { margin: 0 0 7px; font-size: 15px; }
.error-card p { margin: 0; color: #9c7c7c; font-size: 11px; line-height: 1.65; }
.error-card div > span { display: inline-block; margin-top: 8px; color: #6d5557; font: 9px/1 ui-monospace, "Cascadia Mono", monospace; }

.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 { display: flex; align-items: center; justify-content: space-between; 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; overflow-wrap: anywhere; }
.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; } }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 660px) {
  .topbar, .page-shell, .site-footer { width: min(100% - 30px, 560px); }
  .topbar { height: 72px; }
  .brand { gap: 9px; font-size: 15px; }
  .brand img { width: 44px; height: 32px; }
  .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; }
  .query-panel { padding: 24px 18px; }
  textarea { min-height: 190px; padding: 16px; }
  .input-meta { padding-left: 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .result-panel { padding: 24px 18px; }
  .session-link { align-items: stretch; flex-direction: column; }
  .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; }
}
