:root {
  color-scheme: light; --bg: #f3f5f9; --paper: #fff; --ink: #172641; --muted: #52647d;
  --line: #dce3ed; --blue: #2456da; --blue-dark: #1944b9; --nav: #13254a; --nav-light: #aebfdf;
  --green: #146954; --red: #a42740; --amber: #855600; --shadow: 0 1px 2px #233c6310;
  font: 15px/1.5 system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); }
button, input, select { font: inherit; }
a { color: var(--blue-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #6d91f7; outline-offset: 3px; }
button, a.button, summary { cursor: pointer; }
button:disabled { opacity: .58; cursor: not-allowed; }
.app { display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 26px 14px 16px; display: flex; flex-direction: column; background: var(--nav); color: #fff; overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; margin: 0 8px 28px; }
.brand strong { display: block; font-size: 1.22rem; font-weight: 740; line-height: 1.1; letter-spacing: .08em; }
.brand small { color: var(--nav-light); font-size: .78rem; }
.brand-mark { display: inline-grid; min-width: 38px; height: 38px; place-items: center; background: #3c69ee; color: #fff; font-weight: 800; border-radius: 10px; letter-spacing: -.07em; }
.nav-label { color: #9baed0; font-weight: 650; font-size: .73rem; padding: 7px 12px 6px; }
.nav-label:not(:first-child) { margin-top: 19px; }
.nav-link { display: flex; gap: 10px; align-items: center; min-height: 43px; margin: 2px 0; padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; color: #e0e8f9; text-decoration: none; white-space: nowrap; font-size: .91rem; }
.nav-link:hover { background: #1c355e; }
.nav-link.selected { border-color: #4864a3; background: #294a93; color: #fff; font-weight: 650; }
.nav-icon { color: #a6c0ff; width: 18px; text-align: center; font-size: 1.1rem; }
.sidebar-footer { margin-top: auto; padding: 18px 12px 4px; display: flex; align-items: center; gap: 7px; color: var(--nav-light); font-size: .79rem; }
.live-dot, .badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 7px; }
.live-dot { color: #6ce0ae; }
.topbar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px clamp(14px,4vw,36px); background: var(--paper); border-bottom: 1px solid var(--line); }
.profile-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.profile-link:hover .identity { text-decoration: underline; }
.top-context, .identity { font-weight: 650; }
.top-context { font-size: .9rem; }
.top-controls, .page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-divider { height: 21px; border-left: 1px solid var(--line); margin: 0 3px; }
.avatar { height: 31px; width: 31px; border-radius: 50%; background: #e9efff; color: var(--blue-dark); display: grid; place-items: center; font-weight: 730; }
.mobile-toggle { display: none !important; }
.workspace, .content { min-width: 0; }
.content { max-width: 1440px; padding: 29px clamp(14px,4vw,36px) 52px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; margin-bottom: 24px; flex-wrap: wrap; }
h1,h2 { margin: 0; letter-spacing: -.035em; line-height: 1.25; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.35rem); font-weight: 750; }
h2 { font-size: 1.12rem; }
p { margin: 0; }
.page-head p, .panel-head p, .login-body p { color: var(--muted); margin-top: 7px; }
.page-head p { font-size: .97rem; }
.button, .ghost { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); display: inline-flex; justify-content: center; align-items: center; gap: 5px; padding: 9px 13px; min-height: 42px; font-weight: 650; font-size: .9rem; line-height: 1.25; text-decoration: none; }
.button:hover, .ghost:hover { background: #f0f4fc; }
.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.ghost { background: transparent; border-color: transparent; padding: 6px 8px; min-height: 35px; }
.ghost.quiet, .muted, small { color: var(--muted); }
.danger { color: var(--red); }
.button.compact { padding: 6px 9px; min-height: 35px; }
.textlink { color: var(--blue-dark); font-weight: 650; text-decoration: none; }
.strong-link { font-weight: 710; color: var(--ink); text-decoration: none; }
.textlink:hover, .strong-link:hover, .back:hover { text-decoration: underline; }
.back { display: inline-block; margin-bottom: 14px; font-weight: 650; text-decoration: none; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 22px; }
.metric { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: 3px 9px; align-items: center; min-height: 132px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); background: var(--paper); text-decoration: none; color: var(--muted); }
.metric:hover { border-color: #8ea8ed; }
.metric strong { grid-column: 1; color: var(--ink); font-size: 2rem; letter-spacing: -.06em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.metric small { grid-column: 1/-1; font-size: .8rem; }
.metric-icon { grid-area: 1 / 2 / 3 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; font-size: 1.2rem; font-weight: 750; }
.blue { background: #ecf1ff; color: #2456da; }.amber { background: #fff4d7; color: var(--amber); }.red { background: #fcebee; color: var(--red); }.green { background: #e4f6eb; color: var(--green); }
.dashboard-grid, .split, .equal-grid { display: grid; gap: 17px; align-items: start; }
.dashboard-grid { grid-template-columns: minmax(0, 1.44fr) minmax(0, 1fr); }
.split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.equal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel-head { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; flex-wrap: wrap; }
.panel-head p { font-size: .83rem; }
.panel-body { padding: 16px 18px; }
.panel-head + .panel-body { border-top: 1px solid var(--line); }
.panel-foot { padding: 12px 18px; color: var(--muted); font-size: .82rem; }
.narrow { max-width: 740px; }.spaced, .queue { margin-top: 17px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; text-align: left; }
th, td { padding: 11px 15px; border-top: 1px solid var(--line); text-align: left; }
th { background: #f8fafd; color: #52647d; font-weight: 640; font-size: .81rem; white-space: nowrap; }
tbody tr:hover { background: #f9fbff; }
td form input:not([type=hidden]) { min-width: 95px; max-width: 180px; }
.sub { display: block; color: var(--muted); font-size: .77rem; margin-top: 3px; overflow-wrap: anywhere; }
.code { font: .84rem/1.45 ui-monospace, "Cascadia Code", Consolas, monospace; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 99px; color: #3e5472; background: #ebf0f7; font-size: .77rem; font-weight: 660; white-space: nowrap; }
.badge.ok { color: var(--green); background: #e6f5ee; }.badge.low { color: var(--amber); background: #fff3d7; }.badge.critical { color: var(--red); background: #fcebee; }
.empty { padding: 30px 18px; color: var(--muted); border-top: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 10px 16px; font-size: .85rem; }
.timeline li:has([data-return]) { grid-template-columns: auto minmax(0,1fr) auto auto; }
.movement-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; font-size: 1.05rem; font-weight: 750; }
.incoming { color: var(--green); background: #e6f5ee; }.outgoing { color: var(--amber); background: #fff3db; }
.change { font-weight: 650; white-space: nowrap; }.positive { color: var(--green); }
label { display: grid; align-content: start; gap: 5px; font-size: .86rem; font-weight: 650; color: var(--ink); }
input:not([type=checkbox]), select { border: 1px solid #bac8dc; background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 10px; min-height: 42px; min-width: 0; width: 100%; }
input:disabled,select:disabled { background: #f2f5fa; }
input[type=checkbox] { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
input::placeholder { color: #657690; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; padding: 14px 18px; }
.filters input { flex: 1 1 230px; width: auto; }.filters select { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 15px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.form-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.form-row label, .form-row > input:not([type=hidden]), .form-row > select { flex: 1 1 128px; width: auto; }
.stack { display: grid; gap: 14px; align-content: start; }
.input-action { display: flex; gap: 7px; align-items: stretch; margin-top: 5px; }.input-action button { flex: none; }
.lookup { margin-top: 7px; font-size: .87rem; overflow-wrap: anywhere; }
.scan-video { width: 100%; max-height: 245px; object-fit: contain; border-radius: 8px; background: var(--ink); margin-top: 8px; }
.notice { border: 1px solid #b7c9ef; background: #eef4ff; color: #183f9e; padding: 11px 13px; border-radius: 8px; margin: 0 0 13px; overflow-wrap: anywhere; }
.notice.success { border-color: #a3d8c6; background: #e8f7f0; color: var(--green); }.notice.error { border-color: #e8b4bd; background: #fff1f3; color: var(--red); }
[data-result] { margin: 12px 0 0; }
.facts { display: grid; grid-template-columns: minmax(110px,.62fr) minmax(120px,1fr); gap: 8px 12px; }
.facts dt { color: var(--muted); }.facts dd { margin: 0; overflow-wrap: anywhere; }
.part-photo { display: block; max-width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; }
.plain-list { padding-left: 18px; margin: 0; }.plain-list li + li { margin-top: 6px; }.plain-list.panel-body { list-style: none; }
.inline { display: inline; }.collapsible { margin-bottom: 17px; }.collapsible summary { padding: 16px 18px; font-weight: 730; }
.order-line { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.labels { display: grid; gap: 7px; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); }
.print-label { display: flex; align-items: center; min-height: 95px; padding: 7px; border: 1px solid #afb9c9; border-radius: 8px; background: #fff; font-size: .83rem; break-inside: avoid; overflow-wrap: anywhere; }
.print-label img { width: 76px; height: 76px; flex: none; }
.bar-row { display: grid; grid-template-columns: 36px 1fr minmax(100px,max-content); align-items: center; gap: 8px; font-size: .85rem; }
progress { width: 100%; accent-color: var(--blue); }
.public-wrap { background: radial-gradient(ellipse at top right,#e4edff 0,transparent 55%); min-height: 100vh; }
.public-top { padding: 16px 24px; display: flex; justify-content: end; }
.public .content { max-width: 518px; padding-top: min(12vh,95px); }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 16px 50px #233c6320; }
.login-banner { padding: 17px 22px; display: flex; align-items: center; gap: 9px; background: var(--nav); color: #fff; font-weight: 740; }
.login-banner-text { margin-left: auto; color: #d5e3ff; font-weight: 500; font-size: .84rem; text-align: right; }
.login-body { padding: 24px 24px 27px; }.login-body h1 { font-size: 1.7rem; }.login-body .stack { margin-top: 20px; }
.account-link, .login-body .account-link { margin-top: 16px; }
.offline-wrap { max-width: 640px; }
.sr-only { position: absolute; height: 1px; width: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }.metrics { gap: 9px; }.metric { padding: 12px; }.metric-icon { height: 30px; width: 30px; }
}
@media (max-width: 800px) {
  .app { display: block; }.mobile-toggle { display: inline-flex !important; font-size: 1.17rem; margin-right: -5px; }
  .sidebar { position: fixed; z-index: 5; width: min(245px,84vw); top: 61px; left: 0; height: calc(100dvh - 61px); visibility: hidden; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); visibility: visible; box-shadow: 0 10px 30px #10234550; }
  .topbar { position: sticky; top: 0; z-index: 4; min-height: 61px; }
  .top-context { flex: 1; }.identity,.top-divider { display: none; }.top-controls { gap: 2px; }
}
@media (max-width: 575px) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }.metric { min-height: 113px; }
  .split, .equal-grid { grid-template-columns: minmax(0,1fr); }
  .form-grid.three { grid-template-columns: minmax(0,1fr); }
  .panel-head,.panel-body { padding: 12px; }.timeline li { padding: 10px 12px; }
  .content { padding-top: 19px; }.page-head { margin-bottom: 16px; }
  html[lang=en] .top-context { font-size: .8rem; }
}
@media print {
  .sidebar,.topbar,.page-actions,.back,.notice { display: none !important; }
  .app { display: block; }.content { padding: 0; }.paper,.panel,.print-label { box-shadow: none; }
  .labels { grid-template-columns: repeat(2,1fr); }.print-label { color: #000; }.page-head { margin-bottom: 10px; }
}
