:root {
  --ink: #16191d;
  --muted: #72777d;
  --line: #e3e5e8;
  --panel: #ffffff;
  --canvas: #f7f8fa;
  --green: #16794b;
  --green-soft: #eaf7f0;
  --yellow: #a96d00;
  --yellow-soft: #fff5db;
  --red: #c93d3d;
  --red-soft: #fff0f0;
  --shadow: 0 14px 34px rgba(25, 31, 37, 0.06);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { width: min(1180px, calc(100% - 48px)); margin: 0 auto; height: 78px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 650; letter-spacing: .01em; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 9px; }
.brand-mark svg { width: 18px; height: 18px; }
.secure-label { display: inline-flex; align-items: center; gap: 7px; color: #969ba1; font-size: 12px; }
.secure-dot { width: 6px; height: 6px; border-radius: 50%; background: #31a46a; }

main { flex: 1; }
.hero { width: min(920px, calc(100% - 48px)); margin: 0 auto; padding: 72px 0 28px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #858b91; font-size: 10px; font-weight: 750; letter-spacing: .17em; }
.eyebrow-line { display: inline-block; width: 19px; height: 1px; background: #9da2a7; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 700px; margin: 17px 0 13px; font-size: clamp(32px, 5vw, 53px); line-height: 1.13; letter-spacing: -.045em; font-weight: 730; }
.hero-copy { margin-bottom: 36px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.search-card { padding: 24px; background: var(--panel); border: 1px solid #eaebed; border-radius: 15px; box-shadow: var(--shadow); }
.search-label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 700; }
.search-row { display: flex; gap: 10px; }
.input-wrap { position: relative; flex: 1; }
input { width: 100%; height: 49px; padding: 0 42px 0 15px; border: 1px solid #d9dce0; border-radius: 9px; outline: none; color: var(--ink); background: #fff; font-size: 14px; letter-spacing: .06em; transition: border-color .2s, box-shadow .2s; }
input::placeholder { color: #b0b5ba; letter-spacing: 0; }
input:focus { border-color: #555b61; box-shadow: 0 0 0 3px rgba(22, 25, 29, .08); }
.clear-button { position: absolute; top: 50%; right: 10px; width: 24px; height: 24px; transform: translateY(-50%); border: 0; background: transparent; color: #9da2a7; font-size: 21px; line-height: 1; }
.scan-button, .primary-button { height: 49px; padding: 0 17px; border-radius: 9px; white-space: nowrap; font-size: 13px; font-weight: 700; }
.scan-button { display: inline-flex; gap: 7px; align-items: center; border: 1px solid #d9dce0; color: #42474c; background: #fff; }
.scan-button:hover { background: #f6f7f8; }
.scan-button svg { width: 18px; height: 18px; }
.primary-button { min-width: 119px; border: 1px solid var(--ink); color: #fff; background: var(--ink); }
.primary-button:hover { background: #33383d; }
.primary-button span { margin-left: 7px; font-size: 16px; }
.input-hint { margin: 11px 1px 0; color: #9b9fa4; font-size: 12px; }
.input-error { margin: 10px 1px 0; color: var(--red); font-size: 12px; font-weight: 600; }

.result-section { width: min(920px, calc(100% - 48px)); margin: 0 auto; padding: 47px 0 82px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin: 10px 0 0; font-size: 25px; letter-spacing: -.03em; }
.result-code { color: #848a90; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: .08em; }
.result-card { overflow: hidden; background: var(--panel); border: 1px solid #e5e7e9; border-radius: 14px; box-shadow: var(--shadow); }
.status-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid #eceef0; }
.status-main { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.status-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.status-icon svg { width: 17px; }
.status-banner.valid { background: #fbfdfc; }
.status-banner.valid .status-icon { color: var(--green); background: var(--green-soft); }
.status-banner.warning { background: #fffdfa; }
.status-banner.warning .status-icon { color: var(--yellow); background: var(--yellow-soft); }
.status-banner.expired { background: #fffafa; }
.status-banner.expired .status-icon { color: var(--red); background: var(--red-soft); }
.status-note { color: #93989d; font-size: 12px; font-weight: 500; }
.data-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.data-item { min-height: 89px; padding: 19px 22px; border-right: 1px solid #eceef0; border-bottom: 1px solid #eceef0; }
.data-item:nth-child(3n) { border-right: 0; }
.data-item:nth-last-child(-n + 3) { border-bottom: 0; }
.data-label { margin-bottom: 9px; color: #8e9499; font-size: 12px; }
.data-value { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.data-value.small { font-size: 14px; }
.warranty { display: flex; align-items: center; gap: 8px; }
.warranty-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; }
.warranty-dot.green { background: #32a56a; }
.warranty-dot.yellow { background: #dfa72d; }
.warranty-dot.red { background: var(--red); }
.warranty-text.green { color: var(--green); }
.warranty-text.yellow { color: var(--yellow); }
.warranty-text.red { color: var(--red); }

.empty-state { width: min(920px, calc(100% - 48px)); margin: 15px auto 0; padding: 70px 20px 120px; text-align: center; color: #a0a5aa; }
.empty-icon { width: 55px; height: 55px; display: grid; place-items: center; margin: 0 auto 17px; color: #b9bec3; background: #fff; border: 1px solid #e7e9eb; border-radius: 50%; }
.empty-icon svg { width: 31px; height: 31px; }
.empty-state h2 { margin-bottom: 8px; color: #60666b; font-size: 16px; }
.empty-state p { margin: 0; font-size: 13px; }
.footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 21px 0; display: flex; justify-content: space-between; border-top: 1px solid #e7e9eb; color: #a4a9ae; font-size: 11px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(12, 16, 20, .48); }
.scanner-modal { width: min(470px, 100%); padding: 24px; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 19px; }
.modal-header h2 { margin: 9px 0 0; font-size: 22px; letter-spacing: -.03em; }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 50%; color: #6c7277; background: #f3f4f5; font-size: 22px; line-height: 1; }
.scanner-viewport { position: relative; overflow: hidden; aspect-ratio: 1.5; display: grid; place-items: center; background: #1a1f23; border-radius: 11px; }
#scanner-video { width: 100%; height: 100%; object-fit: cover; }
.scanner-corners { position: absolute; width: 73%; height: 35%; border: 2px solid rgba(255, 255, 255, .88); border-radius: 5px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .15); }
.scanner-message { position: absolute; bottom: 12px; padding: 5px 9px; border-radius: 5px; color: #fff; background: rgba(0, 0, 0, .55); font-size: 11px; }
.scanner-note { margin: 14px 0 0; color: #8d9398; font-size: 12px; line-height: 1.6; }
[hidden] { display: none !important; }

@media (max-width: 700px) {
  .topbar, .hero, .result-section, .empty-state, .footer { width: min(100% - 32px, 920px); }
  .topbar { height: 68px; }
  .secure-label { display: none; }
  .hero { padding-top: 45px; }
  h1 { font-size: 35px; }
  .hero-copy { margin-bottom: 27px; font-size: 14px; }
  .search-card { padding: 18px; }
  .search-row { flex-wrap: wrap; }
  .input-wrap { flex-basis: calc(100% - 1px); }
  .scan-button, .primary-button { flex: 1; }
  .result-section { padding-top: 35px; }
  .data-grid { grid-template-columns: repeat(2, 1fr); }
  .data-item:nth-child(3n) { border-right: 1px solid #eceef0; }
  .data-item:nth-child(2n) { border-right: 0; }
  .data-item:nth-last-child(-n + 3) { border-bottom: 1px solid #eceef0; }
  .data-item:nth-last-child(-n + 2) { border-bottom: 0; }
  .status-banner { align-items: flex-start; flex-direction: column; gap: 9px; padding: 16px 18px; }
  .data-item { padding: 17px 18px; }
  .footer { flex-direction: column; gap: 7px; }
}
