: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 76% 4%, #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 {
  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(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 86px 0 90px;
}

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

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;
}

.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, .session-link, .plan-head, .renewal-line {
  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", 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: 172px;
  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: 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; }

.subscription-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  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;
}
.subscription-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--green); }
.subscription-card[data-tone="inactive"]::before { background: var(--muted-deep); }
.subscription-card[data-tone="warning"]::before { background: var(--amber); }

.plan-head { align-items: flex-start; gap: 24px; }
.plan-copy h2 { margin: 0; font-size: clamp(42px, 7vw, 68px); line-height: .95; letter-spacing: -.055em; text-transform: uppercase; }
.plan-copy > p:not(.card-eyebrow) { margin: 17px 0 0; color: var(--muted); font-size: 12px; }
.plan-code { display: inline-block; margin-top: 13px; color: var(--muted-deep); font: 10px/1.4 ui-monospace, "Cascadia Mono", monospace; overflow-wrap: anywhere; }
.status-chip { padding: 8px 10px; border: 1px solid currentColor; color: var(--green); font-size: 10px; white-space: nowrap; }
[data-tone="inactive"] .status-chip { color: var(--muted); }
[data-tone="warning"] .status-chip { color: var(--amber); }

.renewal-line {
  position: relative;
  min-height: 76px;
  gap: 16px;
  margin-top: 30px;
  padding: 16px 18px 16px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.renewal-line::before { content: ""; position: absolute; top: 50%; left: 5px; right: 5px; height: 1px; background: linear-gradient(90deg, var(--gold-deep), transparent 58%); opacity: .24; }
.timeline-mark { position: relative; z-index: 1; width: 8px; height: 8px; border: 1px solid var(--gold); background: var(--panel); transform: rotate(45deg); }
.renewal-line > div { position: relative; z-index: 1; display: grid; gap: 5px; margin-right: auto; background: #0e1012; padding: 0 8px; }
.timeline-label { color: var(--muted-deep); font-size: 10px; }
.renewal-line strong { font-size: 14px; font-weight: 600; }
.days-left { position: relative; z-index: 1; padding: 7px 9px; color: var(--gold); background: #0e1012; font: 10px/1 ui-monospace, "Cascadia Mono", monospace; }

.facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin: 0; }
.fact { min-height: 92px; padding: 18px 16px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.fact:nth-child(3n) { border-right: 0; }
.fact dt { color: var(--muted-deep); font-size: 10px; }
.fact dd { margin: 12px 0 0; color: #d4d1ca; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }

.extras { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 22px; }
.extra-block { min-height: 92px; padding: 16px; border: 1px solid var(--line-soft); background: rgba(7,8,9,.4); }
.extra-block h3 { margin: 0 0 13px; color: var(--muted); font-size: 11px; font-weight: 500; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-list span { padding: 6px 8px; border: 1px solid #3b372f; color: #bca883; font: 10px/1.25 ui-monospace, "Cascadia Mono", monospace; }

.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 { 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; } }
@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; }
  .subscription-card { padding: 24px 18px; }
  .plan-head { align-items: flex-start; flex-direction: column-reverse; gap: 18px; }
  .plan-copy h2 { font-size: 47px; }
  .renewal-line { align-items: flex-start; flex-wrap: wrap; }
  .days-left { margin-left: 24px; }
  .facts-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fact:nth-child(3n) { border-right: 1px solid var(--line-soft); }
  .fact:nth-child(2n) { border-right: 0; }
  .extras { grid-template-columns: 1fr; }
  .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; }
}
