:root {
  --ink: #14221d;
  --muted: #64736d;
  --line: #dce5e1;
  --surface: #ffffff;
  --wash: #f2f6f4;
  --green: #176b4d;
  --green-dark: #0c4934;
  --mint: #dff3e9;
  --gold: #d8a93b;
  --danger: #b64343;
  --shadow: 0 14px 40px rgba(30, 63, 50, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--wash); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; line-height: 1.55; }
a { color: inherit; }
.topbar { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.topbar-inner { max-width: 1180px; height: 70px; padding: 0 24px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 11px; align-items: center; font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: var(--green); }
nav { display: flex; gap: 20px; align-items: center; }
nav a { text-decoration: none; font-weight: 650; }
nav form { margin: 0; }
.link-button { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 42px auto 70px; }
footer { color: var(--muted); text-align: center; padding: 28px 16px 38px; font-size: 13px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.15; letter-spacing: -.035em; margin-bottom: 12px; }
h2 { line-height: 1.25; }
.eyebrow { color: var(--green); font-size: 12px; letter-spacing: .16em; font-weight: 850; margin-bottom: 10px; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "SFMono-Regular", monospace; }
.strong { font-weight: 750; }
.break { overflow-wrap: anywhere; }
.small-text { font-size: 12px; }
.page-heading { margin-bottom: 28px; }
.page-heading p { color: var(--muted); max-width: 760px; }
.page-heading.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.heading-actions { display: flex; gap: 10px; align-items: center; }
.narrow-heading { max-width: 760px; margin-left: auto; margin-right: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; text-decoration: none; cursor: pointer; font: inherit; white-space: nowrap; }
.button.primary { background: var(--green); color: #fff; box-shadow: 0 7px 18px rgba(23, 107, 77, .2); }
.button.primary:hover { background: var(--green-dark); }
.button.ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.button.small { min-height: 36px; padding: 0 14px; }
.button.full { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.messages { display: grid; gap: 8px; margin-bottom: 20px; }
.message { padding: 13px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.message.success { background: var(--mint); border-color: #b7dfcc; }
.message.error { background: #fff0f0; color: #863232; border-color: #f0c0c0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.panel.compact { padding: 26px; }
.panel-title { padding: 24px 26px 18px; display: flex; justify-content: space-between; align-items: center; }
.panel-title h2 { margin-bottom: 4px; }
.panel-title p { color: var(--muted); margin-bottom: 0; font-size: 14px; }
.batch-search { display: flex; gap: 8px; align-items: center; width: min(100%, 590px); }
.search-field { flex: 1; }
.search-field input { min-width: 260px; }
.search-summary { padding: 0 26px 16px; color: var(--muted); font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.stat-card span { color: var(--muted); display: block; font-size: 13px; }
.stat-card strong { display: block; font-size: 34px; margin-top: 4px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); background: #fbfcfb; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
td { font-size: 14px; }
.text-link { color: var(--green); font-weight: 750; text-decoration: none; }
.row-actions { display: flex; gap: 14px; align-items: center; }
.text-button { padding: 0; border: 0; background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.text-button.danger { color: var(--danger); }
.delete-dialog { width: min(470px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 28px 80px rgba(15, 34, 27, .28); }
.delete-dialog::backdrop { background: rgba(15, 34, 27, .62); backdrop-filter: blur(3px); }
.delete-dialog form { padding: 28px; }
.delete-dialog h2 { margin-bottom: 8px; }
.delete-dialog p { color: var(--muted); }
.dialog-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 13px; color: #fff; background: var(--danger); font-size: 24px; font-weight: 900; }
.confirm-hint { margin-top: 22px; margin-bottom: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.button.danger-button { color: #fff; background: var(--danger); }
.button.danger-button:hover { background: #963434; }
.empty-state { text-align: center; padding: 56px 24px 64px; }
.empty-icon { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 20px; background: var(--mint); color: var(--green); font-size: 26px; font-weight: 800; }
.auth-card { max-width: 500px; margin: 80px auto; padding: 36px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.stack-form { display: grid; gap: 16px; margin-top: 24px; }
.form-panel { padding: 28px; }
.form-section { padding: 0 0 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { margin-bottom: 0; }
.optional-section { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; }
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.section-heading > span { display: grid; place-items: center; min-width: 46px; height: 32px; padding: 0 9px; border-radius: 9px; color: var(--green-dark); background: var(--mint); font-size: 12px; font-weight: 850; }
.section-heading h2 { margin: 0 0 4px; font-size: 20px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid #cbd8d2; border-radius: 10px; background: #fff; color: var(--ink); padding: 12px 13px; font: inherit; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,77,.1); }
textarea { resize: vertical; }
.required { color: var(--danger); }
.inline-choice { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 46px; font-weight: 600; }
.inline-choice input { width: 18px; height: 18px; flex: 0 0 auto; }
.switch-row { margin: -4px 0 20px; padding: 12px 14px; border-radius: 10px; background: var(--mint); }
.fixed-record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.fixed-record-grid > div, .fixed-document { min-height: 78px; padding: 15px 17px; display: grid; gap: 5px; align-content: center; background: #f8fbf9; text-decoration: none; }
.fixed-record-grid .wide { grid-column: 1 / -1; }
.fixed-record-grid span, .fixed-field > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.fixed-record-grid strong, .fixed-field strong { overflow-wrap: anywhere; }
.fixed-document { color: var(--green); }
.fixed-document:hover { background: var(--mint); }
.fixed-field { min-height: 72px; padding: 12px 13px; display: grid; gap: 3px; align-content: center; border: 1px solid #cbd8d2; border-radius: 10px; background: #f5faf7; }
.fixed-field small { color: var(--green); font-size: 11px; font-weight: 650; }
.collapsible-section { padding: 0; overflow: hidden; }
.collapsible-summary { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; list-style: none; user-select: none; }
.collapsible-summary::-webkit-details-marker { display: none; }
.collapsible-summary .section-heading { flex: 1; margin: 0; }
.collapse-indicator { flex: 0 0 auto; padding: 7px 11px; border-radius: 99px; color: var(--green); background: var(--mint); font-size: 12px; font-weight: 750; }
.collapse-indicator i { display: none; font-style: normal; }
.collapsible-section[open] .collapse-indicator b { display: none; }
.collapsible-section[open] .collapse-indicator i { display: inline; }
.collapsible-section[open] .collapsible-summary { border-bottom: 1px solid var(--line); }
.collapsible-body { padding: 24px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 26px; margin-top: 26px; border-top: 1px solid var(--line); }
.notice { display: flex; gap: 14px; align-items: center; background: #fff9e8; border: 1px solid #eed99d; padding: 14px 18px; border-radius: 13px; margin-bottom: 20px; }
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 20px; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 650; }
.check-list { display: grid; gap: 13px; padding: 0; margin: 20px 0 28px; list-style: none; }
.check-list li:before { content: "✓"; color: var(--green); margin-right: 9px; font-weight: 900; }
.badge { display: inline-flex; padding: 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 750; background: #eef2f0; }
.badge.claimed { background: var(--mint); color: var(--green-dark); }
.trace-hero { text-align: center; padding: 22px 0 26px; }
.verified-seal { width: 70px; height: 70px; display: grid; place-items: center; margin: auto auto 18px; border: 2px solid var(--green); border-radius: 50%; color: var(--green); font-size: 32px; font-weight: 900; background: var(--mint); }
.trace-hero h1 { font-size: clamp(29px, 6vw, 44px); }
.item-code { color: var(--muted); font-family: Consolas, monospace; }
.trace-panel { max-width: 800px; margin: auto; padding: 28px; }
.trace-panel.public-record { margin-top: 18px; }
.trace-school { color: var(--green); font-weight: 800; margin-bottom: 5px; }
.trace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 22px; }
.trace-grid > div { padding: 17px; background: #fff; display: grid; gap: 4px; }
.trace-grid .wide { grid-column: 1 / -1; }
.trace-grid span { color: var(--muted); font-size: 12px; }
.report-link { display: flex; justify-content: space-between; padding: 16px 2px 0; color: var(--green); font-weight: 800; text-decoration: none; }
.privacy-card, .shop-banner { max-width: 800px; margin: 18px auto 0; border-radius: 17px; padding: 24px; }
.privacy-card { display: flex; justify-content: space-between; gap: 25px; align-items: center; background: #fff; border: 1px solid var(--line); }
.privacy-card h2 { margin-bottom: 7px; }
.privacy-card p { color: var(--muted); margin: 0; max-width: 500px; }
.pin-form { display: flex; gap: 9px; min-width: 315px; }
.pin-form input { letter-spacing: .15em; text-align: center; }
.shop-banner { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: #fff; background: var(--green-dark); }
.shop-banner span { display: block; opacity: .72; font-size: 12px; }
.shop-banner strong { display: block; margin-top: 4px; }
.shop-banner b { font-size: 24px; }
.safety-note { max-width: 760px; margin: 0 auto 20px; padding: 18px 20px; border-radius: 14px; background: #fff9e8; border: 1px solid #eed99d; }
.safety-note p { margin: 5px 0 0; color: #6f5a20; }
.profile-form { max-width: 760px; margin: auto; }
.consent-row { display: flex; gap: 11px; align-items: flex-start; margin-top: 25px; padding: 16px; border-radius: 11px; background: var(--wash); font-weight: 500; }
.consent-row input { width: 18px; margin-top: 4px; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 15px; box-shadow: var(--shadow); }
.product-image { height: 210px; border-radius: 12px; background: linear-gradient(135deg, #e5efe9, #b9d8c8); display: grid; place-items: center; position: relative; margin-bottom: 18px; }
.product-image span { position: absolute; top: 12px; left: 12px; padding: 5px 9px; border-radius: 99px; background: #fff; font-size: 11px; font-weight: 800; }
.product-image b { color: rgba(23,107,77,.25); font-size: 60px; letter-spacing: -.08em; }
.product-card h2 { font-size: 18px; margin-bottom: 5px; }
.product-card p { color: var(--muted); font-size: 13px; }
.product-bottom { display: flex; justify-content: space-between; align-items: center; }
.product-bottom strong { font-size: 20px; }
@media (max-width: 800px) {
  .container { width: min(100% - 22px, 720px); margin-top: 24px; }
  .topbar-inner { padding: 0 14px; }
  nav > a:first-child, nav form { display: none; }
  .page-heading.split { align-items: stretch; flex-direction: column; }
  .heading-actions { align-items: stretch; flex-direction: column; }
  .panel-title { align-items: stretch; flex-direction: column; gap: 16px; }
  .batch-search { width: 100%; flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .search-field input { min-width: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid, .product-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .fixed-record-grid { grid-template-columns: 1fr; }
  .fixed-record-grid .wide { grid-column: auto; }
  .collapsible-summary { align-items: flex-start; padding: 18px; }
  .collapsible-body { padding: 18px; }
  .privacy-card { align-items: stretch; flex-direction: column; }
  .pin-form { min-width: 0; flex-direction: column; }
  .trace-grid { grid-template-columns: 1fr; }
  .trace-grid .wide { grid-column: auto; }
  .notice { align-items: flex-start; flex-direction: column; }
}
