:root {
  --paper: #f7f2e7;
  --card: #fffaf0;
  --ink: #1a2926;
  --muted: #58645b;
  --red: #932f27;
  --red-dark: #7b201a;
  --rule: #d5c9b2;
  --serif: "Noto Serif SC","Songti SC","STSong","SimSun",serif;
  --sans: "PingFang SC","Microsoft YaHei","Noto Sans SC",sans-serif;
  --mono: ui-monospace,"Cascadia Code",monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; image-rendering: pixelated; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 4; top: 10px; left: 10px; background: var(--ink); color: white; padding: .6rem; }
.wrap { max-width: 1120px; width: calc(100% - 88px); margin-inline: auto; }
.header { background: #fbf6ea; border-bottom: 1px solid var(--rule); }
.topbar { min-height: 70px; align-items: center; display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; }
.brand { display: inline-flex; gap: 10px; align-items: center; width: fit-content; font: 700 1.25rem/1.2 var(--serif); white-space: nowrap; }
.seal { color: #fff3dc; background: var(--red); border: 3px double #f5d6b2; display: grid; place-content: center; width: 39px; height: 39px; font-size: .85rem; letter-spacing: -.04em; }
nav { display: flex; align-items: center; gap: clamp(13px, 3vw, 38px); font-size: .875rem; }
nav a, .back-link { padding: 3px 0; white-space: nowrap; }
nav a:hover, .back-link:hover, .foot-inner a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 4px; }
nav a[aria-current] { color: var(--red); font-weight: 700; }
.back-link { justify-self: end; font-size: .875rem; color: var(--muted); }
.hero { display: grid; grid-template-columns: minmax(0,1.13fr) minmax(0,.92fr); gap: clamp(30px,7vw,94px); padding-block: clamp(37px,6vw,82px); align-items: center; }
.hero-copy { min-width: 0; }
.eyebrow { color: var(--red); font-weight: 700; font-size: .875rem; letter-spacing: .15em; }
h1 { font-size: clamp(3.2rem,7.1vw,6rem); letter-spacing: .065em; line-height: 1.1; margin: .65rem 0 .8rem; }
.lead { max-width: 30rem; color: var(--muted); font-size: 1.025rem; }
.query { margin-top: 1.75rem; background: var(--card); border: 1px solid var(--rule); box-shadow: 0 5px 0 #e4d9c4; padding: 14px 18px 16px; }
.modes { display: flex; gap: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.modes button { border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; padding: 5px 3px 8px; color: var(--muted); font-size: .925rem; }
.modes [aria-pressed="true"] { color: var(--red); border-color: var(--red); font-weight: 700; }
#id-form > label { display: block; font-size: .875rem; margin-bottom: 6px; font-weight: 700; }
.query-row { display: flex; gap: 8px; }
.query-row input { width: 100%; min-width: 0; border: 1px solid #bcb09a; background: #fffdf7; border-radius: 3px; padding: 9px 11px; color: var(--ink); }
.query-row input::placeholder { color: #656d63; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 8px 15px; font-size: .875rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; border-radius: 3px; line-height: 1.3; }
.filled { background: var(--red); color: #fff8eb; }
.filled:hover { background: var(--red-dark); }
.outline { border-color: var(--rule); background: var(--card); }
.outline:hover { color: var(--red); border-color: var(--red); }
.text-button { background: none; padding: 3px 0; border: 0; color: var(--red); text-decoration: underline; text-underline-offset: 3px; font-size: .875rem; }
.example-query { margin-top: 8px; }
.status { margin-top: 9px; font-size: .875rem; color: var(--red-dark); }
.status:empty { display: none; }
.drop-zone { display: grid; place-items: center; min-height: 91px; gap: 1px; align-content: center; padding: 12px; text-align: center; color: var(--red); cursor: pointer; background: #f7eedf; border: 1px dashed #b28b75; border-radius: 3px; }
.drop-zone span, .query-hint { color: var(--muted); font-size: .875rem; }
.drop-zone:hover, .drop-zone.dragging, #image-form:focus-within .drop-zone { background: #eedbc7; border-color: var(--red); }
.query-hint { margin-top: 6px; }
.feature { width: 100%; max-width: 450px; min-width: 0; padding: 13px; border: 1px solid #2f4240; background: #202f32; color: #f6edda; box-shadow: 12px 12px 0 #e3d6be; text-align: left; }
.feature:hover { outline: 2px solid var(--red); outline-offset: 4px; }
.feature-picture { display: block; padding: 9px; background: #394849; border: 1px solid #63716c; }
.feature img { width: 100%; height: auto; aspect-ratio: 1; }
.feature-caption { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 14px 4px 3px; }
.feature-caption strong { font: 700 clamp(1.375rem, 2.2vw, 1.8rem)/1.25 var(--serif); letter-spacing: .1em; }
.feature-caption small { display: block; margin-top: 3px; color: #cfdbcd; font-size: .875rem; }
.feature-id, .index-id { font-family: var(--mono); letter-spacing: .055em; font-size: .875rem; }
.feature-id { padding: 5px 7px; border: 1px solid #71817a; color: #f3deb4; white-space: nowrap; }
.catalog-section, .method-section, .result-section { padding: clamp(38px,5vw,67px) 0; border-top: 1px solid var(--rule); }
.result-section { background: #eee6d6; }
.catalog-section { background: #fcf7eb; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.section-head h2, .method-section h2 { font-size: clamp(1.9rem,4vw,3rem); letter-spacing: .035em; line-height: 1.18; }
.section-head p:not(.eyebrow) { color: var(--muted); margin-top: 6px; font-size: .875rem; }
.result-section .section-head h2 { padding-top: 4px; }
.result-section .section-head h2:focus { outline: none; }
.result-card { display: grid; grid-template-columns: minmax(155px,.75fr) minmax(0,1.6fr); align-items: start; gap: clamp(16px, 3vw, 36px); padding: clamp(14px, 3vw, 31px); border: 1px solid var(--rule); background: var(--card); }
.result-visual img { width: 100%; height: auto; background: #192726; }
.result-visual p { color: var(--muted); font-size: .875rem; margin-top: 8px; }
.result-header { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.index-id { color: var(--red); }
.source { color: var(--muted); font-size: .875rem; margin-top: 3px; }
.tier-badge { display: inline-block; padding: 4px 8px; border: 1px solid currentColor; font-size: .8rem; line-height: 1.3; white-space: nowrap; }
[data-tier="普通款"] .tier-badge, .tier-badge[data-tier="普通款"] { color: #255c52; background: #e2efe7; }
[data-tier="稀有款"] .tier-badge, .tier-badge[data-tier="稀有款"] { color: #725116; background: #f5ead1; }
[data-tier="隐藏款"] .tier-badge, .tier-badge[data-tier="隐藏款"] { color: #8b342f; background: #f5e1dc; }
.numbers { display: grid; grid-template-columns: repeat(3,1fr); border-block: 1px solid var(--rule); gap: 8px; margin: 10px 0 8px; padding: 10px 0; }
.numbers div { min-width: 0; }
.numbers span, .result-hint { color: var(--muted); font-size: .875rem; }
.numbers strong { display: block; color: var(--red); font: 700 clamp(1.2rem,3vw,1.85rem)/1.35 var(--serif); }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--rule); }
th { color: var(--muted); font-weight: 700; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; text-align: right; }
td:nth-child(n+2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.trait-label { display: block; font-size: .81rem; color: var(--muted); }
.trait-value { font-weight: 700; }
.result-hint { margin-top: 8px; }
.tier-controls { display: flex; flex-wrap: wrap; gap: 5px; }
.tier-controls button { background: transparent; border: 1px solid var(--rule); border-radius: 3px; padding: 6px 10px; min-height: 38px; font-size: .875rem; }
.tier-controls button:hover { border-color: var(--red); }
.tier-controls [aria-pressed="true"] { background: var(--ink); color: #fff5e3; border-color: var(--ink); }
.catalog-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 13px; }
.catalog-card { display: block; width: 100%; min-width: 0; border: 1px solid var(--rule); background: var(--card); padding: 6px; text-align: left; }
.catalog-card:hover { border-color: var(--red); }
.catalog-card img { width: 100%; height: auto; }
.catalog-card strong { display: block; font: 700 1.1rem/1.35 var(--serif); margin: 7px 2px 4px; }
.tile-meta { display: flex; align-items: start; flex-wrap: wrap; justify-content: space-between; gap: 5px; padding: 0 2px 2px; }
.tile-meta small { color: var(--muted); font-family: var(--mono); font-size: .78rem; }
.tile-meta .tier-badge { padding: 2px 5px; }
.method-grid { display: grid; grid-template-columns: 1fr minmax(220px,.66fr); gap: clamp(20px,5vw,80px); align-items: start; }
.method-grid p { color: var(--muted); max-width: 38rem; margin-top: 9px; }
.distribution { background: var(--card); border: 1px solid var(--rule); padding: 15px 18px; }
.distribution h3 { font-size: 1.25rem; }
.tier-row { margin-top: 12px; }
.tier-row div { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .875rem; }
.tier-row span { color: var(--muted); white-space: nowrap; }
.tier-row meter { appearance: none; width: 100%; height: 7px; border: 0; display: block; margin-top: 5px; }
meter::-webkit-meter-bar { background: #eee5d7; border: 0; border-radius: 0; }
meter::-webkit-meter-optimum-value { background: #4c7165; }
.tier-row[data-tier="稀有款"] meter::-webkit-meter-optimum-value { background: #a67d42; }
.tier-row[data-tier="隐藏款"] meter::-webkit-meter-optimum-value { background: #9b4943; }
.footer { background: var(--ink); color: #eee4cc; }
.foot-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .875rem; }
.foot-inner a:hover { color: #f8d298; }
@media (max-width: 820px) {
  .wrap { width: calc(100% - 46px); }
  .catalog-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hero { gap: 30px; }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 32px); }
  .topbar { grid-template-columns: 1fr auto; gap: 7px; padding: 8px 0 9px; }
  .brand span:last-child { font-size: 1.1rem; }
  .seal { width: 34px; height: 34px; }
  nav { grid-row: 2; grid-column: 1 / -1; gap: 22px; }
  .back-link { grid-column: 2; grid-row: 1; }
  .hero { grid-template-columns: minmax(0,1fr); gap: 23px; }
  .hero .feature { max-width: 325px; }
  h1 { font-size: clamp(3rem,10vw,4.5rem); }
  .query { margin-top: 1.15rem; padding: 12px; }
  .section-head { align-items: start; flex-direction: column; gap: 11px; }
  .result-card, .method-grid { grid-template-columns: minmax(0,1fr); }
  .result-visual { max-width: 200px; }
}
@media (max-width: 440px) {
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .query-row .button { padding-inline: 9px; }
  .feature { box-shadow: 7px 7px 0 #e3d6be; }
  .result-card { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.pagination { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.pagination span { color: var(--muted); font-size: .875rem; }
.pagination button:disabled { opacity: .48; cursor: default; color: var(--muted); border-color: var(--rule); }
.feature img:not([src]) { visibility: hidden; }
