:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --bg: #f5f7f8;
  --primary: #176b5b;
  --primary-dark: #0f5448;
  --accent: #d6a84b;
  --danger: #b42318;
  --shadow: 0 8px 24px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html { font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; letter-spacing: 0; }
.topbar { height: 64px; background: #102a32; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100% - 1180px) / 2)); }
.brand, .topbar nav { display: flex; align-items: center; gap: 14px; }
.brand { font-weight: 700; }
.topbar nav { gap: 24px; font-size: 14px; }
.brand-mark { width: 32px; height: 32px; display: inline-grid; place-items: center; background: var(--accent); color: #17202a; font-weight: 800; }
.brand-mark.large { width: 44px; height: 44px; font-size: 20px; }
.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 64px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 28px; line-height: 1.25; margin-bottom: 6px; letter-spacing: 0; }
h2 { font-size: 18px; line-height: 1.35; margin-bottom: 4px; letter-spacing: 0; }
.page-head p, .section-head p, .muted { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.back { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.button { min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 650; font-size: 14px; white-space: nowrap; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #fff; border-color: #d0d5dd; color: #344054; }
.button.small { min-height: 32px; padding: 6px 11px; font-size: 13px; }
.button.wide { width: 100%; }
.link-button { border: 0; padding: 0; background: none; color: inherit; cursor: pointer; }
.link-button.danger { color: var(--danger); font-size: 13px; }
.inline { display: inline; margin: 0; }
.table-panel { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 15px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 650; background: #fafbfb; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.product-name { font-weight: 650; margin-bottom: 3px; }
code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; background: #f2f4f7; border-radius: 4px; padding: 4px 6px; }
.status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 650; }
.status.ok { background: #e8f5ef; color: #176b5b; }
.status.warn { background: #fff5dc; color: #8a5d00; }
.status.off { background: #f2f4f7; color: #667085; }
.empty { text-align: center; padding: 50px 18px; color: var(--muted); }
.form-grid { padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 7px; color: #344054; font-size: 13px; font-weight: 650; }
input, textarea { width: 100%; border: 1px solid #d0d5dd; border-radius: 5px; padding: 10px 12px; color: var(--ink); background: #fff; outline: none; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 107, 91, .12); }
textarea { resize: vertical; }
.actions { display: flex; gap: 10px; align-items: center; }
.actions.center, .center { justify-content: center; text-align: center; }
.detail-grid { display: grid; grid-template-columns: minmax(300px, 430px) 1fr; gap: 20px; }
.qr-panel, .upload-panel { padding: 22px; }
.section-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.section-head.pad { padding: 18px 18px 10px; }
.qr { width: min(260px, 78%); display: block; margin: 18px auto; aspect-ratio: 1; }
.url-code { display: block; overflow-wrap: anywhere; text-align: center; padding: 9px; }
.top-gap { margin-top: 15px; }
.top-section { margin-top: 20px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.upload-panel .stack { margin-top: 26px; }
.narrow { max-width: 560px; padding: 24px; }
.alert { padding: 11px 13px; border-radius: 5px; font-size: 13px; margin-bottom: 16px; }
.alert.error { background: #fef3f2; color: #912018; border: 1px solid #fecdca; }
.login-wrap { min-height: calc(100vh - 106px); display: grid; place-items: center; }
.login-panel { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 34px; border-radius: 6px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-brand h1 { font-size: 22px; margin-bottom: 3px; }
.login-brand p { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.public-shell { width: min(980px, 100%); margin: 0 auto; }
.public-top { display: flex; align-items: center; gap: 11px; font-weight: 700; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.public-head { padding: 38px 0 26px; display: flex; justify-content: space-between; gap: 24px; }
.public-head h1 { font-size: 34px; }
.public-head p { color: var(--muted); margin-bottom: 0; }
.eyebrow { display: block; color: var(--primary); font-size: 12px; font-weight: 750; margin-bottom: 9px; }
.manual-meta { display: grid; grid-template-columns: repeat(3, 1fr); background: #102a32; color: #fff; border-radius: 6px; overflow: hidden; }
.manual-meta > div { padding: 18px 20px; border-right: 1px solid rgba(255,255,255,.16); }
.manual-meta > div:last-child { border-right: 0; }
.manual-meta span, .manual-meta strong { display: block; }
.manual-meta span { font-size: 12px; opacity: .68; margin-bottom: 7px; }
.manual-meta strong { font-size: 14px; }
.public-actions { display: flex; gap: 10px; margin: 18px 0; }
.pdf-frame { display: block; width: 100%; height: min(78vh, 900px); min-height: 560px; border: 1px solid var(--line); background: #e7eaec; border-radius: 6px; }
.empty-state { min-height: 360px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state h1, .empty-state h2 { color: var(--ink); }
footer { color: var(--muted); font-size: 12px; text-align: center; padding: 26px 0 0; }
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .topbar nav { gap: 14px; }
  .brand > span:last-child { display: none; }
  .page { width: min(100% - 24px, 1180px); padding-top: 26px; }
  .page-head { align-items: start; }
  .page-head h1 { font-size: 24px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .manual-meta { grid-template-columns: 1fr; }
  .manual-meta > div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.16); }
  .manual-meta > div:last-child { border-bottom: 0; }
  .public-head { padding-top: 28px; }
  .public-head h1 { font-size: 28px; }
  .public-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pdf-frame { min-height: 480px; height: 68vh; }
  .login-panel { padding: 26px 22px; }
}
