:root {
  color-scheme: light;
  --paper: #f4f0e6;
  --ink: #1c1914;
  --muted: #5e584e;
  --line: rgba(28, 25, 20, 0.16);
  --jade: #0e6b52;
  --jade-deep: #08382c;
  --seal: #b3261e;
  --card: rgba(255, 252, 246, 0.94);
  --shadow: 0 24px 60px rgba(70, 48, 12, 0.08);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 8% -10%, rgba(14, 107, 82, 0.16), transparent 55%),
    radial-gradient(800px 380px at 110% 0%, rgba(179, 38, 30, 0.08), transparent 46%),
    var(--paper);
  line-height: 1.5;
}

body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--seal) 0 42%, var(--jade) 42% 100%);
}

::selection { background: #c9eadf; }

:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 3px;
}

a { color: var(--jade-deep); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: white;
  padding: 8px 12px;
  z-index: 3;
}

.skip:focus { top: 12px; }

.top, .wrap { max-width: 1040px; margin: 0 auto; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 4px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.seal {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--seal);
  border-radius: 8px;
  color: var(--seal);
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  box-shadow: inset 0 0 0 1px rgba(179, 38, 30, 0.35);
}

.brand-text { display: grid; line-height: 1.05; }
.brand-text strong { font-size: 18px; }
.brand-text em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
}

nav a { color: var(--ink); text-decoration: none; }
nav a:hover { text-decoration: underline; }

.wrap { padding: 12px 20px 56px; }

.hero {
  display: grid;
  gap: 28px;
  align-items: start;
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    grid-template-areas:
      "intro form"
      "agent form";
  }
  .intro { grid-area: intro; }
  #upload-form { grid-area: form; align-self: start; }
  .agent { grid-area: agent; }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--seal);
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.method h2,
.agent h2 { margin: 0 0 8px; font-size: 1.15rem; }
.method p,
.agent > p { margin: 0; }
.agent { display: grid; gap: 10px; }
.quiet { color: var(--muted); }

.lede { margin: 0 0 8px; font-size: 1.05rem; }
.en, .when, .sub, .file { color: var(--muted); }
.en { font-size: 0.95rem; }

.steps {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  margin: 10px 0;
}

.steps li::before {
  content: counter(step);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5f3ed;
  color: var(--jade-deep);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.curl summary, .extra summary, .sha summary { cursor: pointer; }

pre {
  overflow: auto;
  margin: 0;
  padding: 12px 14px;
  background: #1c1914;
  color: #f4f0e6;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.card, .ticket {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.ticket { max-width: 440px; margin: 8px auto; position: relative; }

.drop {
  position: relative;
  display: grid;
  gap: 4px;
  place-items: center;
  text-align: center;
  min-height: 148px;
  padding: 22px 16px;
  border: 1.5px dashed rgba(14, 107, 82, 0.5);
  border-radius: 14px;
  background: rgba(14, 107, 82, 0.05);
  margin-bottom: 14px;
}

.drop.hot { background: rgba(14, 107, 82, 0.14); }
.drop:focus-within { outline: 2px solid var(--jade); outline-offset: 3px; }

.drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop input:focus-visible { outline: none; }

.drop-title { font-weight: 700; }
.drop-sub { color: var(--muted); font-size: 14px; }

.extra { margin: 14px 0; }

.field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 14px;
}

input[type="text"] {
  font: inherit;
  color: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.card .btn, .ticket .btn { width: 100%; }

.btn.primary { background: var(--jade); color: #f3fff9; }
.btn.primary:hover { background: var(--jade-deep); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: 0.65; cursor: progress; }

.banner {
  margin: 12px 0 0;
  background: #fde8e4;
  color: #6f1d18;
  border-radius: 12px;
  padding: 12px 14px;
}

#result { margin-top: 14px; }
#result .ok { margin: 0 0 8px; font-weight: 700; color: var(--jade-deep); }
#result img {
  width: 180px;
  height: 180px;
  background: white;
  padding: 8px;
  border-radius: 12px;
}
#result .links { display: grid; gap: 8px; margin-top: 10px; }
#result a.plain { overflow-wrap: anywhere; }

.ticket-top, .actions { display: flex; }
.ticket-top { justify-content: space-between; align-items: center; }
.actions { flex-direction: column; gap: 10px; }

.badge {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--jade-deep);
}

.stamp {
  width: 56px;
  height: 56px;
  margin: 0;
  border: 2px solid var(--seal);
  border-radius: 50%;
  color: var(--seal);
  display: grid;
  place-items: center;
  transform: rotate(-8deg);
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(179, 38, 30, 0.45);
}

.ticket h1 { font-size: 1.7rem; }
.file, .sub, .meta-line, .when { margin: 4px 0; }
.meta-line { font-weight: 700; }

.rule {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 16px 0;
}

.ticket-body { display: flex; flex-direction: column; gap: 16px; }

.qr-wrap { display: flex; justify-content: center; }

.qr-wrap img {
  width: 220px;
  height: 220px;
  background: white;
  padding: 10px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(28, 25, 20, 0.08);
}

.hint h2 { margin: 16px 0 4px; font-size: 1rem; }
.hint p { margin: 4px 0; }

.sha { margin-top: 12px; }
.sha code {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.prose { max-width: 680px; }
.prose h2 { font-size: 1.15rem; margin-top: 1.6em; }
.prose h1 + h1, .prose h1 { margin-top: 1.2em; }
.prose h1:first-child { margin-top: 0; }
.prose li { margin: 6px 0; }

.foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 20px 28px;
  color: var(--muted);
  font-size: 14px;
}

.foot p { margin: 4px 0; }

.hint-inline { color: var(--muted); font-size: 14px; }

[hidden] { display: none !important; }

@media (max-width: 720px) {
  .ticket-body .actions { order: -1; }
  .wrap { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
