:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e6eb;
  --border-strong: #c9cdd4;
  --text: #1d2129;
  --muted: #4e5969;
  --subtle: #86909c;
  --primary: #165dff;
  --accent: var(--primary);
  --primary-hover: #0e4bd8;
  --primary-soft: rgba(22,93,255,.08);
  --success: #10b981;
  --success-soft: rgba(16,185,129,.08);
  --warning: #f59e0b;
  --warning-soft: rgba(245,158,11,.08);
  --danger: #ef4444;
  --danger-soft: rgba(239,68,68,.08);
  --charcoal: var(--text);
  --slate: var(--subtle);
  --light: var(--border);
  --sage: var(--success);
  --sage-bg: var(--success-soft);
  --blue: var(--primary);
  --blue-bg: var(--primary-soft);
  --rust: var(--danger);
  --rust-bg: var(--danger-soft);
  --gold: var(--warning);
  --gold-bg: var(--warning-soft);
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 3px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.08);
  --shadow-overlay: 0 12px 32px rgba(0,0,0,.12);
  --shadow: var(--shadow-card);
  --on-primary: #ffffff;
  --surface-glass: rgba(255,255,255,.96);
  --surface-glass-strong: rgba(255,255,255,.97);
  --toast-glass: rgba(255,255,255,.78);
  --glass-border: rgba(255,255,255,.82);
  --row-hover: #f9fafb;
  --skeleton-base: #eceff2;
  --skeleton-shine: #f7f8fa;
  --login-start: #f1f4f9;
  --login-end: #dff1ff;
  --ambient-grid: rgba(63,94,138,.045);
  --ambient-flow-a: rgba(92,111,255,.10);
  --ambient-flow-b: rgba(41,205,197,.08);
  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-ui: cubic-bezier(0.25, 0.1, 0.25, 1);
}
:root[data-theme="dark"] {
  --bg: #0f141a;
  --surface: #171d24;
  --surface-2: #202731;
  --border: #2b3541;
  --border-strong: #465363;
  --text: #f2f5f8;
  --muted: #c2c9d2;
  --subtle: #8d99a8;
  --primary: #4c8dff;
  --primary-hover: #6ba1ff;
  --primary-soft: rgba(76,141,255,.14);
  --success: #45d1a1;
  --success-soft: rgba(69,209,161,.12);
  --warning: #f4b84a;
  --warning-soft: rgba(244,184,74,.13);
  --danger: #ff6b72;
  --danger-soft: rgba(255,107,114,.13);
  --shadow-card: 0 1px 3px rgba(0,0,0,.28);
  --shadow-hover: 0 6px 18px rgba(0,0,0,.34);
  --shadow-overlay: 0 18px 46px rgba(0,0,0,.48);
  --surface-glass: rgba(23,29,36,.95);
  --surface-glass-strong: rgba(23,29,36,.98);
  --toast-glass: rgba(28,35,44,.84);
  --glass-border: rgba(115,135,157,.28);
  --row-hover: #202832;
  --skeleton-base: #27313c;
  --skeleton-shine: #35414e;
  --login-start: #0d131a;
  --login-end: #101d29;
  --ambient-grid: rgba(117,145,181,.05);
  --ambient-flow-a: rgba(82,119,255,.13);
  --ambient-flow-b: rgba(39,211,203,.09);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: hidden; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.6 var(--font); letter-spacing: .2px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, select, textarea { min-height: 36px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 12px; outline: none; transition: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,93,255,.10); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; accent-color: var(--primary); box-shadow: none; }
.file-picker { display: inline-flex; align-items: center; gap: 8px; position: relative; }
.file-picker input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.file-picker .fp-label { display: inline-flex; align-items: center; gap: 8px; border: 1px dashed var(--border-strong); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--muted); font-weight: 600; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.file-picker:hover .fp-label { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.bom-drop-zone { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px; min-height:92px; padding:16px 18px; border:1px dashed var(--border-strong); border-radius:var(--radius-sm); background:linear-gradient(180deg,var(--surface-2),var(--surface)); transition:border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.bom-drop-zone:focus-visible, .bom-drop-zone.is-dragging { border-color:var(--primary); background:var(--primary-soft); outline:none; }
.bom-drop-zone strong, .bom-drop-zone small { display:block; }
.bom-drop-zone small { margin-top:4px; color:var(--muted); }
.bom-drop-zone.is-dragging { box-shadow:0 0 0 3px rgba(22,93,255,.10); }
.bom-drop-icon { display:grid; place-items:center; width:42px; height:42px; border:1px solid color-mix(in srgb,var(--primary) 28%,transparent); border-radius:12px; background:var(--primary-soft); color:var(--primary); font-size:24px; }
.bom-drop-copy { min-width:0; }
.bom-drop-copy strong { font-size:14px; }
.bom-drop-zone .file-name { min-width:0; max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); }
.bom-drop-zone .file-name.has-file { color:var(--text); font-weight:600; }
.bom-file-actions-inline { display:flex; align-items:center; justify-content:flex-end; gap:10px; min-width:0; }
.bom-file-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.file-name { color: var(--muted); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-drop-zone-compact { margin-top:12px; min-height:82px; }
.bom-multiplier-field { display:grid; grid-template-columns:auto 92px minmax(0,1fr); align-items:center; gap:9px; margin-top:12px; color:var(--muted); font-size:12px; }
.bom-multiplier-field span { color:var(--text); font-weight:600; }
.bom-multiplier-field input { min-height:34px; padding:6px 9px; }
.bom-multiplier-field small { color:var(--subtle); }
.bom-take-actions { position:sticky; bottom:12px; z-index:6; align-items:center; margin-top:12px; padding:12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); box-shadow:0 8px 24px rgba(20,30,45,.14); }
.bom-take-actions::before { content:"确认操作"; margin-right:auto; color:var(--text); font-size:13px; font-weight:700; }
.bom-availability-note { margin-top: 8px; color: var(--subtle); font-size: 12px; line-height: 1.5; }
.bom-upload-head { align-items:flex-start; margin-bottom:12px; }
.bom-upload-head > div { display:flex; flex-direction:column; align-items:flex-start; gap:5px; }
.bom-upload-head .hint { max-width:none; text-align:left; }

/* 登录页 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100dvh; overflow-x: hidden; padding: clamp(14px, 3vw, 32px); background: linear-gradient(to bottom, var(--login-start), var(--login-end)); }
.login-split { background: linear-gradient(135deg,var(--login-start),var(--bg) 48%,var(--login-end)); }
.auth-shell { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0,1.12fr) minmax(420px,.88fr); width: min(1240px,calc(100vw - 48px)); height: min(760px,calc(100dvh - 48px)); min-height: 620px; overflow: hidden; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--surface-glass); box-shadow: var(--shadow-overlay); }
.auth-showcase { position: relative; min-width: 0; overflow: hidden; padding: 36px 40px 28px; isolation: isolate; color: #eef5ff; background: radial-gradient(circle at 18% 18%,rgba(216,98,255,.42),transparent 34%), radial-gradient(circle at 84% 74%,rgba(47,221,216,.34),transparent 38%), linear-gradient(145deg,#192350 0%,#3d50be 45%,#2876d1 100%); }
.auth-showcase::before { content: ""; position: absolute; inset: 0; z-index: -2; opacity: .34; background-image: linear-gradient(rgba(255,255,255,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px); background-size: 40px 40px; -webkit-mask-image: linear-gradient(to bottom,black,transparent 88%); mask-image: linear-gradient(to bottom,black,transparent 88%); }
.auth-showcase::after { content: ""; position: absolute; right: -80px; bottom: -130px; z-index: -1; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 56px rgba(255,255,255,.035),0 0 0 112px rgba(255,255,255,.025); }
.showcase-kicker { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.78); font: 600 11px/1.2 var(--mono); letter-spacing: .12em; }
.showcase-kicker span { width: 7px; height: 7px; border-radius: 50%; background: #66f7da; box-shadow: 0 0 0 5px rgba(102,247,218,.12); }
.showcase-copy { position: relative; z-index: 2; margin-top: 34px; }
.showcase-copy p { margin: 0; font-size: clamp(25px,2.1vw,34px); line-height: 1.38; letter-spacing: -.02em; }
.showcase-copy strong { color: #fff; font-weight: 700; }
.showcase-copy small { display: block; max-width: 470px; margin-top: 12px; color: rgba(239,246,255,.72); font-size: 13px; }
.showcase-stage { position: relative; height: 410px; margin-top: 10px; perspective: 1000px; }
.showcase-orbit { position: absolute; border: 1px dashed rgba(255,255,255,.22); border-radius: 50%; }
.orbit-a { top: 52px; left: 50%; width: 280px; height: 280px; transform: translateX(-50%); }
.orbit-b { top: 96px; left: 50%; width: 190px; height: 190px; transform: translateX(-50%); }
.showcase-card { position: absolute; border: 1px solid rgba(255,255,255,.55); border-radius: var(--radius); background: rgba(248,251,255,.96); color: #1d2740; box-shadow: 0 24px 60px rgba(10,20,64,.22),inset 0 1px 0 rgba(255,255,255,.9); -webkit-backdrop-filter: none; backdrop-filter: none; }
.showcase-card-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #66728a; font-size: 11px; }
.showcase-card-label b { color: #42506c; font: 600 10px/1.2 var(--mono); }
.showcase-status-dot { width: 7px; height: 7px; margin-right: auto; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.12); }
.showcase-search-card { top: 48px; left: 9%; z-index: 3; width: 70%; padding: 16px; transform: rotate(-2.2deg); animation: none; }
.showcase-search-input { display: flex; align-items: center; gap: 8px; height: 38px; margin-top: 10px; padding: 0 11px; border: 1px solid #dce4ef; border-radius: var(--radius-sm); background: #fff; }
.showcase-search-input span { color: #77849b; font-size: 19px; }
.showcase-search-input b { font: 600 13px/1 var(--mono); }
.showcase-search-input i { margin-left: auto; color: #7c899f; font-size: 10px; font-style: normal; }
.showcase-part-result { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; margin-top: 10px; padding: 10px; border-radius: var(--radius-sm); background: #eef4ff; }
.showcase-chip { display: grid; width: 36px; height: 36px; place-items: center; border-radius: var(--radius-sm); background: #dbe8ff; color: #3168d8; font: 700 10px/1 var(--mono); }
.showcase-part-result strong,.showcase-part-result small { display: block; }
.showcase-part-result strong { font-size: 13px; }
.showcase-part-result small { margin-top: 2px; color: #77849b; font-size: 9px; }
.showcase-part-result em { color: #0b8d68; font-size: 10px; font-style: normal; font-weight: 700; }
.showcase-bom-card { top: 224px; right: 4%; z-index: 4; width: 48%; padding: 14px; transform: rotate(2.6deg); animation: none; }
.showcase-bom-card ul { margin: 9px 0 0; padding: 0; list-style: none; }
.showcase-bom-card li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid #e7ecf3; font: 500 10px/1.25 var(--mono); }
.showcase-bom-card i { font-style: normal; font-family: var(--font); font-weight: 700; }
.showcase-ok { color: #0b8d68; }
.showcase-low { color: #e34c57; }
.showcase-ledger-card { bottom: 9px; left: 2%; z-index: 2; width: 49%; padding: 14px; transform: rotate(-4deg); animation: none; }
.showcase-ledger-card > strong,.showcase-ledger-card > small { display: block; }
.showcase-ledger-card > strong { margin-top: 10px; font-size: 12px; }
.showcase-ledger-card > strong i { float: right; color: #0b8d68; font-style: normal; }
.showcase-ledger-card > small { margin-top: 4px; color: #77849b; font-size: 9px; }
:root[data-theme="dark"] .auth-showcase { background: radial-gradient(circle at 18% 18%,rgba(155,75,233,.32),transparent 34%),radial-gradient(circle at 84% 74%,rgba(36,184,181,.24),transparent 38%),linear-gradient(145deg,#111938 0%,#26377f 48%,#175785 100%); }
:root[data-theme="dark"] .showcase-card { border-color: rgba(136,167,214,.32); background: rgba(18,28,46,.84); color: #eef5ff; box-shadow: 0 24px 60px rgba(0,4,20,.34),inset 0 1px 0 rgba(255,255,255,.07); }
:root[data-theme="dark"] .showcase-card-label { color: #9eacc1; }
:root[data-theme="dark"] .showcase-card-label b { color: #c6d1df; }
:root[data-theme="dark"] .showcase-search-input { border-color: #34445d; background: #17243a; }
:root[data-theme="dark"] .showcase-search-input span,:root[data-theme="dark"] .showcase-search-input i { color: #93a1b7; }
:root[data-theme="dark"] .showcase-part-result { background: #1d3150; }
:root[data-theme="dark"] .showcase-chip { background: #294875; color: #8bb7ff; }
:root[data-theme="dark"] .showcase-part-result small,:root[data-theme="dark"] .showcase-ledger-card > small { color: #98a8be; }
:root[data-theme="dark"] .showcase-bom-card li { border-top-color: #34445d; }
.showcase-foot { position: absolute; right: 40px; bottom: 28px; left: 40px; display: flex; align-items: center; gap: 20px; color: rgba(255,255,255,.72); font-size: 11px; }
.showcase-foot span { display: flex; align-items: center; gap: 7px; }
.showcase-foot span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #66f7da; }
.auth-form-pane { display: grid; min-width: 0; place-items: center; padding: 40px clamp(28px,4vw,64px); background: color-mix(in srgb,var(--surface) 94%,transparent); }
.auth-form-pane .glass-box { width: min(410px,100%); }
.login-split .login-card { width: 100%; max-height: none; overflow: visible; padding: 0; border: 0; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.login-split .glass-sq { display: none; }
.login-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.login-blob { position: absolute; display: block; border-radius: 50%; contain: paint; }
.blob-a { width: 52vw; height: 52vw; min-width: 420px; min-height: 420px; top: -18%; left: -12%; background: radial-gradient(circle at 35% 35%, rgba(255,53,155,.5), rgba(255,53,155,0) 62%); animation: none; }
.blob-b { width: 48vw; height: 48vw; min-width: 380px; min-height: 380px; right: -14%; bottom: -16%; background: radial-gradient(circle at 40% 40%, rgba(255,253,135,.6), rgba(255,253,135,0) 62%); animation: none; }
.blob-c { width: 30vw; height: 30vw; min-width: 260px; min-height: 260px; right: 14%; top: 6%; background: radial-gradient(circle at 50% 50%, rgba(0,210,255,.5), rgba(0,210,255,0) 62%); animation: none; }
:root[data-theme="dark"] .login-blob { opacity: .54; filter: saturate(.72) brightness(.72); }
:root[data-theme="dark"] .glass-sq { background: rgba(111,143,176,.12); border-color: rgba(134,161,190,.22); }
.glass-box { position: relative; z-index: 1; }
.glass-sq { position: absolute; display: block; box-shadow: var(--shadow-hover); border: 1px solid rgba(255,255,255,.5); border-right-color: rgba(255,255,255,.2); border-bottom-color: rgba(255,255,255,.2); background: rgba(255,255,255,.3); border-radius: var(--radius-sm); animation: none; }
.glass-sq:nth-child(1) { top: -42px; right: -58px; width: 100px; height: 100px; }
.glass-sq:nth-child(2) { top: 120px; left: -104px; width: 120px; height: 120px; z-index: 2; }
.glass-sq:nth-child(3) { bottom: 42px; right: -58px; width: 80px; height: 80px; z-index: 2; }
.glass-sq:nth-child(4) { bottom: -78px; left: 92px; width: 50px; height: 50px; }
.glass-sq:nth-child(5) { top: -84px; left: 130px; width: 60px; height: 60px; }
.motion-paused .login-blob, .motion-paused .glass-sq { animation-play-state: paused; }
.login-card { position: relative; z-index: 2; width: min(400px, 92vw); max-height: 94dvh; overflow-y: auto; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: clamp(24px, 4vh, 38px) clamp(20px, 5vw, 36px) 24px; box-shadow: var(--shadow-overlay), inset 0 1px 0 rgba(255,255,255,.12); -webkit-backdrop-filter: none; backdrop-filter: none; animation: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-card { background: var(--surface); }
}
.login-logo { display: flex; align-items: center; justify-content: center; margin: -8px auto 2px; }
.login-logo img { width: min(210px, 64%); height: auto; display: block; filter: drop-shadow(0 10px 16px rgba(20, 80, 150, .14)); }
.login-logo.chroma-logo { position: relative; width: min(210px,64%); aspect-ratio: 3/2; }
.login-logo.chroma-logo img { width: 100%; }
@supports ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
  .login-logo.chroma-logo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg,#2edbd1 0%,#3d7cff 28%,#a45cff 52%,#ff6bb5 74%,#2edbd1 100%); background-position: 50% 50%; background-size: 240% 100%; -webkit-mask: url("/static/logo-transparent.png?v=20260904c") center/contain no-repeat; mask: url("/static/logo-transparent.png?v=20260904c") center/contain no-repeat; filter: drop-shadow(0 8px 13px rgba(80,90,255,.22)); animation: none; }
  .login-logo.chroma-logo img { opacity: 0; }
}
:root[data-theme="dark"] .login-logo img, :root[data-theme="dark"] .sidebar-brand img, :root[data-theme="dark"] .mobile-brand img { filter: brightness(0) invert(1) drop-shadow(0 5px 10px rgba(0,0,0,.28)); }
.brand { font-weight: 700; letter-spacing: .3px; }
.login-title { font-size: 24px; margin: 10px 0 4px; letter-spacing: .2px; text-align: center; }
.login-sub { color: var(--muted); margin: 0 0 24px; text-align: center; }
.login-card label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 11px 12px; }
.password-field { position: relative; width: 100%; }
.form-row .password-field { min-width: 180px; flex: 1; }
.password-field input { padding-right: 46px; }
.password-field input::-ms-reveal,
.password-field input::-ms-clear { display: none; }
.password-toggle { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #7b8794; cursor: pointer; }
.password-toggle:hover { background: var(--surface-2); color: var(--text); }
.password-toggle:focus-visible { outline: 2px solid rgba(62,110,142,.52); outline-offset: 1px; }
.password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.field-hint { color: var(--muted); font-size: 11.5px; line-height: 1.6; margin: 4px 0 0; }
.login-card .btn-block { width: 100%; margin-top: 22px; }
.credit { margin-top: 22px; text-align: center; color: #98a1ad; font-size: 12px; letter-spacing: .2px; }
.toast-close { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; background: none; border: 0; border-radius: var(--radius-xs); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.toast > span { flex: 1; text-align: center; padding-left: 8px; }
.toast-close:hover { color: var(--text); }
.toast { animation: none; }
.toast.error { border-left-color: var(--rust); }
.toast.success { border-left-color: var(--sage); }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; max-width: min(480px, 92vw); min-width: 220px; background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid var(--glass-border); border-left: 4px solid var(--primary); color: var(--text); border-radius: var(--radius); padding: 8px 8px 8px 12px; font-size: 14px; box-shadow: var(--shadow-overlay), inset 0 1px 0 rgba(255,255,255,.08); }
#toastBox { position: fixed; top: 12vh; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 10px; width: auto; max-width: 94vw; pointer-events: none; }
#fpsProbe { position: fixed; top: 70px; right: 14px; z-index: 400; background: rgba(20,28,35,.82); color: #fff; border-radius: 10px; padding: 7px 12px; font-family: var(--mono); font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
#fpsProbe.good { border-left: 3px solid #3fb950; }
#fpsProbe.avg { border-left: 3px solid #d29922; }
#fpsProbe.bad { border-left: 3px solid #f85149; }
#loginError { margin-top: 16px; }

/* 应用外壳 */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-header { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.app-header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-header-left img { height: 38px; width: auto; max-width: 170px; object-fit: contain; flex: none; }
.app-header-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.gh-school { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: .05em; }
.gh-product { font-size: 11px; color: var(--muted); letter-spacing: .12em; }
.app-header-right { display: flex; align-items: center; gap: 12px; }
.app-header-right #meName { color: var(--muted); font-size: 13px; }
.mobile-app-header, .mobile-bottom-nav, .mobile-drawer-head, .mobile-drawer-actions, .mobile-only-nav { display: none; }
.notif-btn { position: relative; padding: 5px 10px; }
.notif-dot { position: absolute; top: -4px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: var(--on-primary); font-size: 10px; line-height: 14px; text-align: center; font-weight: 700; border: 2px solid var(--surface); }
.app-ambient { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; opacity: .72; contain: strict; background-image: linear-gradient(var(--ambient-grid) 1px,transparent 1px),linear-gradient(90deg,var(--ambient-grid) 1px,transparent 1px); background-size: 48px 48px; -webkit-mask-image: linear-gradient(to bottom,rgba(0,0,0,.66),transparent 88%); mask-image: linear-gradient(to bottom,rgba(0,0,0,.66),transparent 88%); }
.app-ambient::before { content: ""; position: absolute; top: -48vh; left: -18vw; width: 58vw; height: 190vh; opacity: .52; background: linear-gradient(112deg,transparent 36%,var(--ambient-flow-a) 47%,var(--ambient-flow-b) 53%,transparent 65%); transform: rotate(8deg); }
.ambient-blob { position: absolute; display: block; border-radius: 50%; }
.amb-a { width: 46vw; height: 46vw; min-width: 380px; min-height: 380px; top: -16%; left: -10%; background: radial-gradient(circle at 35% 35%, rgba(255,53,155,.07), rgba(255,53,155,0) 62%); }
.amb-b { width: 42vw; height: 42vw; min-width: 360px; min-height: 360px; right: -12%; bottom: -14%; background: radial-gradient(circle at 45% 45%, rgba(255,253,135,.09), rgba(255,253,135,0) 62%); }
.amb-c { width: 28vw; height: 28vw; min-width: 260px; min-height: 260px; right: 16%; top: 4%; background: radial-gradient(circle at 50% 50%, rgba(0,210,255,.07), rgba(0,210,255,0) 62%); }
.amb-a, .amb-b, .amb-c { animation: none; }
:root[data-theme="dark"] .app-ambient { opacity: .58; }
:root[data-theme="dark"] .amb-a { background: radial-gradient(circle at 35% 35%,rgba(151,76,232,.11),rgba(151,76,232,0) 62%); }
:root[data-theme="dark"] .amb-b { background: radial-gradient(circle at 45% 45%,rgba(72,115,255,.10),rgba(72,115,255,0) 62%); }
:root[data-theme="dark"] .amb-c { background: radial-gradient(circle at 50% 50%,rgba(29,203,198,.10),rgba(29,203,198,0) 62%); }
#appShell { display: grid; grid-template-columns: clamp(208px, 17vw, 240px) minmax(0, 1fr); height: 100dvh; min-height: 0; position: relative; z-index: 1; }
#sidebar { background: var(--surface-glass); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: relative; min-height: 0; overflow: hidden; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; width: 100%; height: 72px; min-height: 72px; flex: 0 0 72px; padding: 12px 20px; cursor: pointer; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; }
.sidebar-brand img { width: 40px; height: 40px; object-fit: contain; flex: none; filter: drop-shadow(0 4px 8px rgba(22,93,255,.12)); }
.sidebar-brand-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 4px; overflow: hidden; }
.sidebar-brand-title { overflow: hidden; max-width: 100%; font-size: 15px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; letter-spacing: .1px; }
.brand-version { position: relative; display: inline-flex; align-items: center; min-height: 18px; overflow: hidden; border: 1px solid color-mix(in srgb,var(--primary) 32%,var(--border)); border-radius: 999px; padding: 1px 7px; background: linear-gradient(115deg,color-mix(in srgb,var(--primary) 10%,var(--surface)),color-mix(in srgb,#9b5cff 12%,var(--surface))); color: var(--primary); font: 700 9px/1.4 var(--mono); letter-spacing: .06em; box-shadow: 0 2px 8px rgba(22,93,255,.10); }
.brand-version::after { content: ""; width: 4px; height: 4px; margin-left: 5px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px color-mix(in srgb,#10b981 14%,transparent); }
.sidebar-brand:hover .brand-version { border-color: color-mix(in srgb,var(--primary) 55%,var(--border)); box-shadow: 0 3px 12px rgba(22,93,255,.16); }
nav { min-height: 0; padding: 16px 12px; flex: 1; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
nav::-webkit-scrollbar { width: 7px; }
nav::-webkit-scrollbar-track { background: transparent; }
nav::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: var(--border-strong); background-clip: padding-box; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; margin-bottom: 4px; text-align: left; background: none; border: 0; border-radius: var(--radius-sm); padding: 8px 12px; color: var(--muted); font-size: 14px; font-weight: 400; transition: color .15s ease, background-color .15s ease, transform .15s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary); color: var(--on-primary); font-weight: 600; box-shadow: 0 4px 10px rgba(22,93,255,.18); }
.nav-item.active::before { display: none; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; border-radius: 999px; background: var(--danger); color: var(--on-primary); font-size: 10px; line-height: 18px; text-align: center; padding: 0 4px; font-weight: 700; }
.nav-badge.is-dot-only { flex: 0 0 10px; width: 10px; min-width: 10px; height: 10px; padding: 0; box-shadow: 0 0 0 3px color-mix(in srgb,var(--danger) 16%,transparent); }
.nav-sep { color: var(--subtle); font-size: 12px; letter-spacing: .2px; padding: 20px 12px 8px; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding: 12px 20px; color: var(--subtle); font-size: 12px; }
.sidebar-foot button { min-height: 28px; padding: 3px 7px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted); font-size: 12px; }
.sidebar-foot button:hover { background: var(--primary-soft); color: var(--primary); }
.sidebar-foot button:focus-visible { outline: 2px solid rgba(22,93,255,.22); outline-offset: 2px; }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }

#main { min-width: 0; overflow-y: auto; height: 100%; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 72px; min-height: 72px; padding: 12px 24px; background: var(--surface-glass); border-bottom: 1px solid var(--border); }
.searchbox { position: relative; flex: 1; min-width: 180px; max-width: 560px; }
.searchbox > .ui-icon { position: absolute; top: 50%; left: 12px; z-index: 1; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.searchbox input { width: 100%; height: 40px; padding-left: 40px; background: var(--surface-2); border-color: transparent; }
.searchbox input:focus { background: var(--surface); border-color: var(--primary); }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; margin-left: auto; }
.top-actions .btn { white-space: nowrap; }
#view { padding: 24px; max-width: 1520px; margin: 0 auto; width: 100%; min-width: 0; }
.topbar-divider { width: 1px; height: 24px; margin: 0 4px; background: var(--border); }
.user-chip { max-width: 180px; overflow: hidden; padding: 0 4px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 16px; font-size: 14px; line-height: 1.3; font-weight: 500; transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease, opacity .15s ease; }
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary, .btn-green { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover, .btn-green:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-red { background: var(--danger); border-color: var(--danger); color: var(--on-primary); }
.btn-red:hover { background: color-mix(in srgb,var(--danger) 84%,#000); border-color: color-mix(in srgb,var(--danger) 84%,#000); color: var(--on-primary); }
.btn-ghost { background: transparent; }
.btn-xs { min-height: 28px; padding: 4px 8px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-icon { width: 36px; padding: 0; }
.btn-logout { padding-right: 12px; padding-left: 12px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { min-height: 32px; padding: 4px 12px; font-size: 12px; font-weight: 500; }
.hero-actions { display: flex; gap: 12px; margin: 8px 0 24px; flex-wrap: wrap; }
.hero-actions .btn { font-size: 15px; padding: 10px 20px; border-radius: var(--radius-sm); }

/* 布局件 */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: .2px; font-weight: 600; }
.page-head h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 600; }
.page-head > div { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; flex-wrap: wrap; }
.page-head > div:empty { display: none; }
.page-head .hint { max-width: 640px; text-align: right; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-card); overflow-x: auto; }
.sk { display: block; border-radius: 8px; background: var(--skeleton-base); animation: none; }
.sk-panel { min-height: 80px; }
.sk-line { height: 14px; margin: 12px 0; width: 100%; }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-card); }
.card.tone-sage, .card.tone-rust, .card.tone-gold, .card.tone-blue, .card.tone-slate { border-top-color: var(--border); }
.card .num { font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: .2px; font-family: var(--mono); }
.card .label { color: var(--muted); font-size: 12px; }
.card-empty-hint { margin-top: 8px; color: var(--subtle); font-size: 12px; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,360px),1fr)); gap: 16px; align-items: start; }
.category-card { display: flex; height: clamp(340px,calc(100dvh - 176px),520px); min-width: 0; padding: 0; overflow: hidden; flex-direction: column; }
.category-card-head { display: grid; grid-template-columns: minmax(0,1fr) 116px; gap: 12px; align-items: start; min-height: 61px; padding: 16px; border-bottom: 1px solid var(--border); }
.category-card-head > b { min-width: 0; padding-top: 4px; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.category-actions { display: grid; grid-template-columns: repeat(2,52px); gap: 8px; width: 112px; flex: none; }
.category-actions .btn { width: 52px; min-width: 52px; padding-right: 4px; padding-left: 4px; }
.category-list { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 8px 10px 8px 16px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.category-list::-webkit-scrollbar { width: 8px; }
.category-list::-webkit-scrollbar-track { background: transparent; }
.category-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: var(--border-strong); background-clip: padding-box; }
.category-row { display: grid; grid-template-columns: minmax(0,1fr) 112px; gap: 12px; align-items: start; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.category-row:last-child { border-bottom: 0; }
.category-name { min-width: 0; padding: 5px 0; overflow-wrap: anywhere; line-height: 1.55; }
.category-empty { display: grid; height: 100%; min-height: 96px; place-items: center; color: var(--subtle); font-size: 12px; }
.category-card-foot { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.ledger-number { color: var(--primary); font-weight: 600; white-space: nowrap; }
.ledger-query-panel { padding: 0; overflow: hidden; }
.ledger-group-tabs { display: flex; align-items: center; gap: 4px; padding: 12px 16px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.ledger-group-tabs::-webkit-scrollbar { display: none; }
.ledger-group-tabs button { min-height: 36px; padding: 7px 14px; flex: none; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.ledger-group-tabs button:hover { background: var(--surface-2); color: var(--text); }
.ledger-group-tabs button.active { border-color: color-mix(in srgb,var(--primary) 24%,var(--border)); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.ledger-filter-details > summary { display: none; }
.ledger-filter-grid { display: grid; grid-template-columns: minmax(250px,2fr) minmax(150px,1fr) repeat(2,minmax(138px,.8fr)) minmax(126px,.7fr) auto; gap: 12px; align-items: end; padding: 16px; }
.ledger-filter-grid label { display: grid; min-width: 0; gap: 6px; }
.ledger-filter-grid label > span { color: var(--muted); font-size: 12px; font-weight: 500; }
.ledger-filter-grid input,.ledger-filter-grid select { width: 100%; min-width: 0; }
.ledger-filter-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ledger-filter-actions .btn { min-height: 36px; }
.ledger-result-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 8px 16px; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12px; }
.ledger-result-meta small { color: var(--subtle); }
.ledger-results-panel { padding: 0; overflow: hidden; }
.ledger-table-scroll { width: 100%; overflow-x: auto; }
.ledger-desktop-table { min-width: 980px; }
.ledger-mobile-results { display: none; }
.ledger-empty { min-height: 180px; }
.user-identity { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.user-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.user-identity > span:last-child { min-width: 0; }
.user-identity strong, .user-identity small { display: block; }
.user-identity strong { font-size: 14px; font-weight: 600; }
.user-identity small { margin-top: 1px; color: var(--subtle); font: 400 12px/1.4 var(--mono); }
.pill.role-super { background: var(--primary-soft); color: var(--primary); }
.pill.role-admin { background: var(--success-soft); color: var(--success); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn { border: 0; background: none; color: var(--muted); padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.my-section-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.my-section-tab { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); text-align: left; box-shadow: var(--shadow-card); cursor: pointer; transition: color .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.my-section-tab > .ui-icon { width: 22px; height: 22px; justify-self: center; }
.my-section-tab > span { min-width: 0; }
.my-section-tab strong,.my-section-tab small { display: block; }
.my-section-tab strong { color: var(--text); font-size: 15px; font-weight: 600; }
.my-section-tab small { margin-top: 3px; overflow: hidden; color: var(--subtle); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.my-section-tab > b { display: grid; min-width: 32px; height: 32px; padding: 0 8px; place-items: center; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 14px; }
.my-section-tab:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.my-section-tab.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: 0 1px 3px rgba(22,93,255,.08); }
.my-section-tab.active strong,.my-section-tab.active > b { color: var(--primary); }
.my-section-tab.active > b { background: var(--surface); }
.my-workspace { padding: 0; overflow: hidden; }
.my-material-filter-bar { display: grid; grid-template-columns: minmax(220px,2fr) repeat(4,minmax(150px,1fr)) auto auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-card); }
.my-material-filter-bar input,.my-material-filter-bar select { width: 100%; min-width: 0; }
.my-material-scroll-shell { height: clamp(360px,calc(100dvh - 350px),650px); min-height: 0; overflow-x: hidden; overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; overscroll-behavior: contain; }
.my-material-scroll-shell > .my-workspace:last-child { margin-bottom: 0; }
.my-workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.my-workspace-head > div { min-width: 0; }
.my-workspace-head h3 { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; }
.my-workspace-head p { margin: 4px 0 0; color: var(--subtle); font-size: 12px; line-height: 1.5; }
.my-record-list,.my-request-list { display: grid; }
.my-record-card { display: grid; grid-template-columns: minmax(220px,1.3fr) minmax(360px,2fr) auto; align-items: center; gap: 16px; min-width: 0; padding: 16px; border-bottom: 1px solid var(--border); }
.my-record-card:last-child,.my-request-row:last-child { border-bottom: 0; }
.my-record-main { min-width: 0; }
.my-record-main > a { display: inline-block; max-width: 100%; overflow: hidden; color: var(--primary); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.my-record-main > small { display: block; margin-top: 4px; overflow: hidden; color: var(--subtle); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.my-record-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(92px,1fr)); gap: 12px; min-width: 0; }
.my-record-facts > span { min-width: 0; }
.my-record-facts > span > small,.my-record-facts > span > strong { display: block; }
.my-record-facts > span > small { margin-bottom: 4px; color: var(--subtle); font-size: 11px; }
.my-record-facts > span > strong { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.my-record-facts > span > strong.bad { color: var(--danger); }
.my-record-actions { justify-content: flex-end; flex-wrap: nowrap; }
.my-record-actions .btn { white-space: nowrap; }
.my-borrow-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.my-borrow-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
.my-borrow-summary small { color: var(--muted); font-size: 12px; }
.my-borrow-summary strong { color: var(--text); font-size: 22px; font-weight: 600; }
.my-borrow-summary strong.bad { color: var(--danger); }
.my-request-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.my-request-row > div:first-child { min-width: 0; }
.my-request-row strong,.my-request-row small { display: block; }
.my-request-row strong { overflow: hidden; color: var(--text); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.my-request-row small { margin-top: 4px; color: var(--subtle); font-size: 12px; line-height: 1.5; }
.my-request-result { display: flex; align-items: flex-end; flex: none; flex-direction: column; }
.my-request-result small { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-empty { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; min-height: 176px; }
.my-empty a { color: var(--primary); font-weight: 600; }
.upload-method-panel { overflow: visible; }
.upload-method-panel > .page-head { align-items: flex-start; }
.upload-method-panel > .page-head > div { display: block; text-align: left; }
.upload-method-panel > .page-head .hint { text-align: left; }
.upload-method-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 4px; margin: 0 0 16px; border: 0; border-radius: var(--radius); background: var(--surface-2); }
.upload-method-tabs .tab-btn { min-height: 42px; padding: 8px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); line-height: 1.35; }
.upload-method-tabs .tab-btn:hover { color: var(--text); background: var(--surface); }
.upload-method-tabs .tab-btn.active { border-color: var(--border); background: var(--surface); color: var(--primary); box-shadow: var(--shadow-card); }
.upload-method-workspace { min-height: 190px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.upload-method-workspace [data-upload-pane][hidden] { display: none; }
.upload-method-workspace h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.upload-method-workspace .textarea { background: var(--surface); }
.upload-image-dropzone { position: relative; min-height: 150px; }
.upload-image-drop-overlay { position: absolute; inset: -8px; z-index: 5; display: none; place-items: center; align-content: center; gap: 4px; border: 2px dashed var(--primary); border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); text-align: center; pointer-events: none; }
.upload-image-drop-overlay span { font: 600 28px/1 var(--font); }
.upload-image-drop-overlay strong { font-size: 15px; font-weight: 600; }
.upload-image-drop-overlay small { color: var(--muted); font-size: 12px; }
.upload-image-dropzone.is-dragover .upload-image-drop-overlay { display: grid; }
.upload-image-actions { margin-top: 16px; }
.upload-image-actions .file-name { min-width: 0; color: var(--muted); font-size: 12px; }
.upload-image-actions #parseUploadImagesBtn { margin-left: auto; }
.upload-image-queue { margin-top: 16px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.upload-image-progress { display: grid; grid-template-columns: minmax(0,1fr) minmax(160px,34%); align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.upload-image-progress-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.upload-image-progress-copy span { color: var(--text); font-size: 13px; font-weight: 600; }
.upload-image-progress-copy small { color: var(--subtle); font: 400 12px/1.4 var(--mono); white-space: nowrap; }
.upload-image-progress progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 999px; background: var(--border); accent-color: var(--primary); }
.upload-image-progress progress::-webkit-progress-bar { border-radius: 999px; background: var(--border); }
.upload-image-progress progress::-webkit-progress-value { border-radius: 999px; background: var(--primary); }
.upload-image-progress progress::-moz-progress-bar { border-radius: 999px; background: var(--primary); }
.upload-image-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(270px,1fr)); max-height: 380px; gap: 12px; overflow-y: auto; overscroll-behavior: contain; padding: 12px; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.upload-image-grid::-webkit-scrollbar { width: 8px; }
.upload-image-grid::-webkit-scrollbar-track { background: transparent; }
.upload-image-grid::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: var(--border-strong); background-clip: padding-box; }
.upload-image-item { position: relative; display: grid; grid-template-columns: 72px minmax(0,1fr) 28px; align-items: center; gap: 12px; min-width: 0; min-height: 96px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-card); }
.upload-image-item.is-processing { border-color: var(--primary); background: var(--primary-soft); }
.upload-image-thumb { width: 72px; height: 72px; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.upload-image-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.upload-image-info { min-width: 0; }
.upload-image-info > strong, .upload-image-info > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-image-info > strong { color: var(--text); font-size: 13px; font-weight: 600; }
.upload-image-info > span { margin-top: 4px; color: var(--subtle); font: 400 11px/1.4 var(--mono); }
.upload-image-info > div { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 8px; }
.upload-image-info > div small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.upload-image-remove { display: grid; width: 28px; height: 28px; place-items: center; align-self: start; padding: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--subtle); cursor: pointer; font-size: 20px; line-height: 1; }
.upload-image-remove:hover { background: var(--danger-soft); color: var(--danger); }
.upload-image-remove:disabled { cursor: not-allowed; opacity: .38; }
.upload-ocr-details { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.upload-ocr-details summary { padding: 12px; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.upload-ocr-details section { padding: 0 12px 12px; }
.upload-ocr-details section + section { padding-top: 12px; border-top: 1px solid var(--border); }
.upload-ocr-details section strong, .upload-ocr-details section code { display: block; }
.upload-ocr-details section strong { margin-bottom: 6px; color: var(--text); font-size: 12px; }
.upload-ocr-details section code { max-height: 150px; overflow: auto; color: var(--muted); font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.import-preview-panel { overflow: visible; }
.import-preview-head { align-items: flex-start; }
.import-preview-title { display: block !important; text-align: left; }
.import-preview-title h3 { margin: 0; }
.import-preview-title .hint { margin: 8px 0 0; text-align: left; }
.import-preview-actions { flex: none; flex-wrap: nowrap !important; }
.import-scroll-guide { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 2px 7px; color: var(--subtle); font-size: 11px; }
.import-preview-scroll { position: relative; max-width: 100%; max-height: clamp(340px,calc(var(--app-viewport-height,100dvh) - 280px),620px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: var(--radius-sm); scrollbar-gutter: stable; scrollbar-color: var(--border-strong) var(--surface-2); }
.import-preview-scroll::-webkit-scrollbar { width: 12px; height: 12px; }
.import-preview-scroll::-webkit-scrollbar-track { background: var(--surface-2); }
.import-preview-scroll::-webkit-scrollbar-thumb { border: 3px solid var(--surface-2); border-radius: 999px; background: var(--border-strong); }
.import-preview-scroll::-webkit-scrollbar-thumb:hover { background: var(--subtle); }
.import-preview-table { min-width: 1740px; }
.import-preview-table thead th { position: sticky; top: 0; z-index: 4; box-shadow: 0 1px 0 var(--border); }
.import-preview-table th:first-child,.import-preview-table td:first-child { position: sticky; left: 0; z-index: 3; width: 250px; min-width: 250px; max-width: 250px; background: var(--surface); box-shadow: 8px 0 14px -14px rgba(15,23,42,.65); }
.import-preview-table th:first-child { z-index: 6; background: var(--surface-2); }
.import-preview-table tbody tr:hover td:first-child { background: var(--row-hover); }
.import-name-field { display: grid; min-width: 220px; grid-template-columns: minmax(0,1fr) 30px; align-items: center; gap: 6px; }
.import-name-field input { width: 100%; min-width: 0; }
.import-name-field button,.bom-row-remove { display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); color: var(--subtle); font-size: 18px; line-height: 1; cursor: pointer; }
.import-name-field button:hover,.bom-row-remove:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.bom-row-content { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.bom-row-content > span { min-width: 0; overflow-wrap: anywhere; }
.bom-row-remove { flex: 0 0 30px; }
.import-match-box { display: grid; min-width: 220px; gap: 6px; margin-top: 7px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface-2); color: var(--subtle); font-size: 11px; line-height: 1.45; }
.import-match-box > strong { color: var(--text); font-size: 12px; }
.import-match-box.is-loading { background: var(--surface-2); }
.import-match-box.is-new { border-color: color-mix(in srgb,var(--success) 24%,var(--border)); background: var(--success-soft); color: var(--success); }
.import-match-box.has-candidate { border-color: color-mix(in srgb,var(--warning) 34%,var(--border)); background: var(--warning-soft); }
.import-match-box.has-duplicate { border-color: color-mix(in srgb,var(--danger) 30%,var(--border)); background: var(--danger-soft); }
.import-match-candidate-list { display: grid; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.import-match-candidate { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid color-mix(in srgb,var(--border) 72%,transparent); }
.import-match-candidate div,.import-match-candidate b,.import-match-candidate span,.import-match-candidate small { display: block; min-width: 0; }
.import-match-candidate b { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.import-match-candidate span,.import-match-candidate small { margin-top: 2px; color: var(--subtle); overflow-wrap: anywhere; }
.import-match-box button.is-selected { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.import-match-box.is-decided { border-color: color-mix(in srgb,var(--success) 38%,var(--border)); background: var(--success-soft); }
.import-decision-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.import-decision-summary > span { display: grid; min-width: 0; grid-template-columns: auto 1fr; column-gap: 6px; }
.import-decision-summary i { grid-row: 1 / 3; align-self: center; color: var(--success); font-size: 17px; font-style: normal; }
.import-decision-summary b { color: var(--text); font-size: 12px; }
.import-decision-summary small { overflow: hidden; color: var(--success); text-overflow: ellipsis; white-space: nowrap; }
.import-create-new { width: fit-content; }
.import-row-owner-cell { min-width: 172px; }
.import-row-owner-cell select { width: 100%; min-width: 156px; }
.import-row-owner-cell small { display: block; margin-top: 6px; color: var(--subtle); font-size: 10px; white-space: nowrap; }
.import-policy-toolbar { min-height: 52px; padding: 8px 12px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.import-policy-toolbar > label { display: inline-flex; align-items: center; gap: 8px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { height: 40px; text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: .2px; white-space: nowrap; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) { tr:hover td { background: var(--row-hover); } }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.part-identity-meta { margin-top: 3px; color: var(--subtle); font: 400 11px/1.45 var(--mono); overflow-wrap: anywhere; }
.parts-table-panel { padding: 0; overflow-x: auto; }
.parts-filter-bar { position: sticky; top: 72px; z-index: 16; min-height: 56px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: color-mix(in srgb,var(--bg) 94%,var(--surface)); box-shadow: var(--shadow-card); }
.parts-table { min-width: 980px; table-layout: fixed; }
.parts-table th:nth-child(1) { width: 27%; }
.parts-table th:nth-child(2) { width: 14%; }
.parts-table th:nth-child(3) { width: 17%; }
.parts-table th:nth-child(4) { width: 17%; }
.parts-table th:nth-child(5) { width: 10%; }
.parts-table th:nth-child(6) { width: 15%; }
.parts-table td { height: 76px; }
.parts-identity,.parts-stock,.parts-category { min-width: 0; }
.parts-identity > a { display: inline-block; max-width: 100%; color: var(--primary); font-weight: 600; overflow-wrap: anywhere; text-decoration: none; }
.parts-identity > small,.parts-stock > span,.parts-category > small { display: block; margin-top: 4px; color: var(--subtle); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.parts-stock > strong { display: block; font-size: 16px; }
.parts-stock > strong small { color: inherit; font: 400 12px/1.2 var(--font); }
.parts-stock > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parts-category { line-height: 1.45; }
.parts-row-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.parts-row-actions .btn { min-width: 0; min-height: 32px; padding: 5px 8px; }

/* 状态色 */
.ok { color: var(--sage); }
.warn, .yellow { color: var(--gold); }
.bad, .red { color: var(--rust); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-xs); font-size: 12px; font-weight: 500; border: 1px solid transparent; background: var(--surface-2); color: var(--muted); }
.pill.green { color: var(--success); background: var(--success-soft); }
.pill.blue { color: var(--primary); background: var(--primary-soft); }
.pill.yellow { color: #b76e00; background: var(--warning-soft); }
.pill.red { color: var(--danger); background: var(--danger-soft); }
.pill.gray { color: var(--muted); }
.ownership-scope { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.hint { color: var(--subtle); font-size: 12px; }
.empty { color: var(--subtle); text-align: center; padding: 40px 20px; }
.empty-state { display: grid; min-height: 184px; place-items: center; overflow: hidden; }
.empty-state p { max-width: 100%; margin: 0; color: var(--subtle); text-align: center; }
.empty-state a { color: var(--primary); font-weight: 600; text-decoration: none; }
.empty-state a:hover { color: var(--primary-hover); text-decoration: underline; }
.empty-state a:focus-visible { border-radius: var(--radius-xs); outline: 3px solid rgba(22,93,255,.16); outline-offset: 3px; }
.textarea { width: 100%; min-height: 170px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }

/* 表单 */
.form-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.form-row label { min-width: 90px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
.form-grid input[type="checkbox"] { width: auto; height: auto; }
.field-label-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; }
.field-label-actions > label { margin: 0; }
.inline-ai-button { min-height: 28px; padding: 3px 8px; border: 1px solid color-mix(in srgb,var(--primary) 24%,var(--border)); border-radius: var(--radius-xs); background: var(--primary-soft); color: var(--primary); font: 600 12px/1.4 var(--font); cursor: pointer; }
.inline-ai-button:hover { border-color: var(--primary); background: color-mix(in srgb,var(--primary) 13%,var(--surface)); }
.inline-ai-button:disabled { opacity: .55; cursor: wait; }
.field-help { display: block; margin-top: 6px; color: var(--subtle); font-size: 11px; line-height: 1.5; }
.field-help[hidden] { display: none; }
.other-category-note { padding: 12px; border: 1px solid color-mix(in srgb,var(--warning) 30%,var(--border)); border-radius: var(--radius-sm); background: var(--warning-soft); }
.other-category-note textarea { background: var(--surface); }
.import-note-input.is-required-hint { border-color: color-mix(in srgb,var(--warning) 62%,var(--border-strong)); background: var(--warning-soft); }
.field-action-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.field-action-row .hint { margin: 0; }
.field-action-row .btn { flex: none; }
.check-row { display: flex; gap: 26px; align-items: center; min-height: 42px; margin-top: 20px; }
.check-row .check-item { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 14px; cursor: pointer; }
.check-row .check-item input { width: 16px; height: 16px; margin: 0; accent-color: var(--charcoal); flex: none; }

/* 模态 */
.modal-backdrop { position: fixed; inset: 0; background: rgba(31,39,51,.42); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 6vh 16px; overflow-y: auto; }
.modal-backdrop { animation: none; }
.modal { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: min(760px, 100%); padding: 24px; box-shadow: var(--shadow-overlay); animation: none; }
.modal h3 { margin: 0 0 12px; font-size: 18px; }
.modal-corner-close { position: sticky; top: 0; z-index: 5; float: right; display: grid; width: 36px; height: 36px; margin: -8px -8px 4px 12px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); box-shadow: var(--shadow-card); font: 400 24px/1 var(--font); cursor: pointer; }
.modal-corner-close:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.guide-content { max-height: 62vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; font-size: 14px; line-height: 1.6; }
.notif-item { padding: 10px 12px; border-bottom: 1px solid var(--border); border-radius: 8px; }
.notif-item.unread { background: var(--gold-bg); }
.notif-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 3px; }
.notif-body { white-space: pre-wrap; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.notif-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.changelog-head { margin-bottom: 16px; }
.changelog-head h3 { margin-bottom: 4px; }
.changelog-head p { margin: 0; color: var(--subtle); font-size: 12px; }
.changelog-list { display: grid; max-height: 58vh; gap: 12px; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; }
.part-ledger-panel { padding: 12px; overflow: hidden; }
.part-ledger-panel .page-head { margin-bottom: 8px; }
.part-ledger-scroll { max-height: min(360px, 42vh); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.part-ledger-scroll table { min-width: 760px; margin: 0; }
.part-ledger-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
.part-ledger-scroll::-webkit-scrollbar { width: 9px; height: 9px; }
.part-ledger-scroll::-webkit-scrollbar-track { background: transparent; }
.part-ledger-scroll::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: var(--border-strong); background-clip: padding-box; }
.owner-allocation-panel { padding: 12px; overflow: hidden; }
.owner-allocation-panel .page-head { align-items: center; margin-bottom: 8px; }
.owner-allocation-list { display: grid; gap: 8px; }
.owner-allocation-item { display: grid; grid-template-columns: minmax(220px,1fr) minmax(180px,auto); gap: 8px 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.owner-allocation-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.owner-allocation-main > div { min-width: 0; }
.owner-allocation-main > div > small { display: block; margin-top: 4px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-allocation-main > div > .pill + .pill { margin-left: 6px; }
.owner-allocation-main > strong { flex: none; font: 600 20px/1.2 var(--mono); }
.owner-allocation-main > strong small { color: var(--muted); font: 400 12px/1.2 var(--font); }
.owner-allocation-meta { display: flex; align-items: center; align-content: center; gap: 6px; flex-wrap: wrap; }
.owner-allocation-actions { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--border); }
.part-management-menu { flex: 1 1 100%; min-width: 0; }
.part-management-menu > summary { width: fit-content; list-style: none; cursor: pointer; }
.part-management-menu > summary::-webkit-details-marker { display: none; }
.part-management-menu > summary::after { content: "⌄"; margin-left: 2px; transition: transform .15s ease; }
.part-management-menu[open] > summary::after { transform: rotate(180deg); }
.part-management-menu > .actions { margin-top: 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.part-custodian-line { color: var(--subtle); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notification-tabs, .task-center-tabs, .task-filters { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.notification-tabs::-webkit-scrollbar, .task-center-tabs::-webkit-scrollbar, .task-filters::-webkit-scrollbar { display: none; }
.notification-tabs { margin: 12px 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.notification-tabs button { flex: 1; min-height: 36px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted); font-weight: 600; }
.notification-tabs button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.notification-tabs i { display: inline-grid; min-width: 18px; height: 18px; margin-left: 5px; place-items: center; border-radius: 9px; background: var(--danger); color: #fff; font: 700 10px/1 var(--font); }
.notification-scroll { max-height: 56vh; overflow-y: auto; overscroll-behavior: contain; }
.notification-pref[hidden] { display: none !important; }
.system-notif.system-latest { border-color: rgba(22,93,255,.25); background: var(--primary-soft); }
.system-notif .notif-body { display: grid; gap: 4px; }

.task-center-tabs { display: inline-grid; width: auto; max-width: 100%; grid-auto-flow: column; grid-auto-columns: minmax(156px,1fr); gap: 4px; margin-bottom: 12px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.task-center-tabs button { min-width: 0; min-height: 40px; padding: 7px 14px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.task-center-tabs button.active { background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 10px rgba(22,93,255,.18); }
.task-center-tabs b { display: inline-grid; min-width: 20px; height: 20px; margin-left: 6px; place-items: center; border-radius: 10px; background: rgba(127,127,127,.16); font: 700 11px/1 var(--mono); }
.task-filters { margin-bottom: 16px; }
.task-filters button { flex: none; min-height: 32px; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); color: var(--muted); }
.task-filters button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.task-center-panel { padding: 16px; }
.task-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.task-card-grid > .empty { grid-column: 1 / -1; width: 100%; }
.purchase-request-panel .my-workspace-head { margin-bottom: 12px; }
.task-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.task-card[open] { border-color: rgba(22,93,255,.28); background: var(--surface); box-shadow: var(--shadow-hover); }
.task-card summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px 12px; padding: 14px; cursor: pointer; list-style: none; }
.task-card summary::-webkit-details-marker { display: none; }
.task-kind { padding: 3px 7px; border-radius: var(--radius-xs); background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600; }
.task-main { min-width: 0; }
.task-main strong, .task-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-main small { margin-top: 3px; color: var(--subtle); font-size: 12px; }
.task-card time { grid-column: 2 / 4; color: var(--subtle); font-size: 11px; }
.task-card-body { padding: 0 14px 14px; border-top: 1px solid var(--border); }
.task-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 16px; padding: 12px 0; }
.task-details div { min-width: 0; }
.task-details small, .task-details span { display: block; }
.task-details small { color: var(--subtle); font-size: 11px; }
.task-details span { margin-top: 2px; overflow-wrap: anywhere; }
.task-note { margin-bottom: 10px; padding: 8px; border-radius: var(--radius-xs); background: var(--surface-2); color: var(--muted); }
.task-actions { justify-content: flex-end; }
.task-history > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.task-history > summary::-webkit-details-marker { display: none; }
.task-history > summary span { color: var(--subtle); font-size: 12px; }
.task-history[open] > summary { margin-bottom: 14px; }
.replenish-note { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.replenish-note strong { flex: none; color: var(--text); }
.inventory-policy-panel .toolbar { align-items: center; }
.bulk-threshold-scroll { max-height: min(440px, 52vh); }
.bulk-threshold-scroll table { min-width: 620px; }
.bulk-threshold-scroll td:first-child { min-width: 240px; }
.bulk-threshold-scroll td:first-child small { display: block; margin-top: 4px; color: var(--subtle); font-size: 12px; }
.bulk-threshold-scroll input { width: 112px; }
.modal-save-actions { justify-content: flex-end; margin-top: 16px; }
.changelog-release { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.changelog-release.latest { border-color: rgba(22,93,255,.2); background: linear-gradient(180deg,rgba(22,93,255,.045),rgba(22,93,255,.015)); }
.changelog-release-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.changelog-release-head > div { display: flex; min-width: 0; align-items: center; gap: 8px; flex-wrap: wrap; }
.changelog-release-head strong { font-size: 14px; font-weight: 600; }
.changelog-release-head time { flex: none; color: var(--subtle); font: 400 12px/1.6 var(--mono); }
.changelog-version { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: var(--radius-xs); background: var(--primary); color: #fff; font: 600 11px/1.2 var(--mono); }
.changelog-release ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.changelog-release li + li { margin-top: 5px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-backdrop-locked {
  align-items: center;
  padding-top: 16px;
  padding-bottom: 16px;
  background: rgba(18, 26, 43, .48);
  backdrop-filter: blur(8px) saturate(115%);
  -webkit-backdrop-filter: blur(8px) saturate(115%);
}
.release-notice-modal {
  width: min(520px, 100%);
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  text-align: center;
  box-shadow: 0 20px 54px rgba(17, 35, 72, .2);
}
.release-notice-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 12px;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #165dff, #6b5cff 58%, #1aa6a6);
  box-shadow: 0 8px 22px rgba(22, 93, 255, .22);
}
.release-notice-kicker {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.1px;
}
.release-notice-modal h3 { margin-bottom: 12px; font-size: 20px; }
.release-notice-copy {
  max-width: 420px;
  margin: 0 auto;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}
.release-notice-tip {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}
.release-notice-modal .modal-footer { justify-content: center; margin-top: 20px; }
.release-notice-ack { min-width: 132px; }
.release-notice-status { min-height: 18px; margin-top: 8px; color: var(--danger); font-size: 12px; }
.import-summary { margin-top: 12px; color: var(--success); background: var(--success-soft); border-color: transparent; }
.sync-update-chip { position: fixed; top: 84px; left: 50%; z-index: 58; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 14px; border: 1px solid rgba(22,93,255,.18); border-radius: 999px; background: var(--surface-glass); color: var(--primary); box-shadow: var(--shadow-hover); font-size: 12px; font-weight: 600; transform: translateX(-50%); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sync-update-chip[hidden] { display: none; }
.sync-update-chip:hover { background: var(--surface); }

/* 首页工作台 */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.home-head h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; }
.home-head p { margin: 8px 0 0; color: var(--subtle); font-size: 12px; }
.home-mark { display: inline-flex; align-items: center; gap: 8px; color: var(--subtle); font: 500 11px/1.2 var(--mono); letter-spacing: .08em; }
.home-mark::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.home-section { margin-bottom: 24px; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.home-section-head h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 600; }
.home-section-head span { color: var(--subtle); font-size: 12px; }
.home-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 16px; }
.home-stat { position: relative; min-height: 148px; padding: 16px; cursor: pointer; overflow: hidden; color: var(--text); text-align: left; font: inherit; }
.home-stat-icon { position: absolute; top: 16px; right: 16px; display: grid; width: 36px; height: 36px; place-items: center; border-radius: var(--radius-sm); color: var(--primary); background: var(--primary-soft); }
.home-stat.warning .home-stat-icon { color: #b76e00; background: var(--warning-soft); }
.home-stat.danger .home-stat-icon { color: var(--danger); background: var(--danger-soft); }
.home-stat.success .home-stat-icon { color: var(--success); background: var(--success-soft); }
.home-stat-title { color: var(--muted); font-size: 12px; }
.home-stat-value { margin-top: 12px; font: 600 32px/1.15 var(--mono); color: var(--text); }
.home-stat-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; color: var(--subtle); font-size: 12px; }
.home-stat-foot .ui-icon { width: 14px; height: 14px; }
.quick-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.quick-card { position: relative; display: flex; align-items: center; gap: 16px; min-height: 104px; padding: 16px; cursor: pointer; color: var(--text); text-align: left; font: inherit; }
.quick-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: var(--radius); color: var(--primary); background: var(--primary-soft); }
.quick-icon .ui-icon { width: 24px; height: 24px; }
.quick-copy { min-width: 0; }
.quick-copy strong { display: block; font-size: 15px; line-height: 1.3; font-weight: 600; }
.quick-copy span { display: block; overflow: hidden; margin-top: 8px; color: var(--subtle); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.quick-card > .ui-icon { width: 15px; height: 15px; margin-left: auto; color: var(--subtle); }
.home-lower-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(260px,.75fr); gap: 16px; align-items: stretch; }
.home-lower-grid .panel { display: flex; height: 100%; margin-bottom: 0; flex-direction: column; }
.todo-empty { display: grid; min-height: 152px; flex: 1; place-items: center; }
.mobile-ledger-list { display: none; }
.home-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.home-panel-head h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 600; }
.text-link { min-height: auto; padding: 0; border: 0; background: transparent; color: var(--primary); font-size: 12px; }
.text-link:hover { color: var(--primary-hover); background: transparent; text-decoration: none; }
.todo-list { display: grid; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.todo-item:hover { border-color: var(--border); background: var(--surface); }

/* 外观模式：默认跟随系统，也允许用户在当前浏览器中覆盖。 */
.theme-switcher { display: inline-grid; grid-template-columns: repeat(3,auto); gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
.theme-switcher button { min-height: 30px; padding: 4px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.theme-switcher button:hover { background: var(--surface-2); color: var(--text); }
.theme-switcher button.active { background: var(--primary); color: var(--on-primary); }
.auth-theme-switcher { position: fixed; top: max(16px,env(safe-area-inset-top)); right: 16px; z-index: 10; }
.theme-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 16px; }
.theme-choice { display: grid; min-height: 88px; padding: 12px; place-items: center; align-content: center; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); }
.theme-choice strong { color: var(--text); font-size: 14px; }
.theme-choice.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: 0 0 0 2px rgba(76,141,255,.10); }
.theme-choice .theme-glyph { font-size: 22px; line-height: 1; }

/* 通知状态需要一眼可见，但动画只作用于红点，不触发整页重绘。 */
.notif-btn.has-unread { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb,var(--danger) 30%,var(--border)); }
.nav-item.has-alert:not(.active) { color: var(--danger); background: var(--danger-soft); }
.nav-badge.is-new, .notif-dot.is-new { animation: alert-pulse 1.6s ease-out 2; }
.notification-pref { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.notification-pref-copy strong, .notification-pref-copy small { display: block; }
.notification-pref-copy small { margin-top: 2px; color: var(--subtle); font-size: 12px; }

/* 本地智能推荐：只帮助定位现有物料，始终保留人工确认。 */
.smart-suggestions { width: 100%; margin: 0 0 16px; overflow: hidden; border: 1px solid color-mix(in srgb,var(--primary) 28%,var(--border)); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
.smart-suggestions[hidden] { display: none; }
.smart-suggestions-form { margin: 8px 0 0; }
.smart-suggestion-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--primary-soft); color: var(--muted); font-size: 12px; }
.smart-suggestion-head b { color: var(--primary); font-size: 13px; }
.smart-suggestion-head > div { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.smart-suggestion-head small { flex: none; color: var(--subtle); }
.smart-suggestion-dismiss { min-height: 28px; padding: 3px 8px; border: 1px solid color-mix(in srgb,var(--primary) 18%,var(--border)); border-radius: var(--radius-xs); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.smart-suggestion-dismiss:hover { border-color: var(--primary); color: var(--primary); }
.smart-suggestion-list { display: grid; }
.smart-suggestion-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 12px; border-bottom: 1px solid var(--border); }
.smart-suggestion-item:last-child { border-bottom: 0; }
.smart-suggestion-copy { min-width: 0; flex: 1; }
.smart-suggestion-copy strong, .smart-suggestion-copy span, .smart-suggestion-copy small { display: block; overflow-wrap: anywhere; }
.smart-suggestion-copy strong { font-size: 14px; font-weight: 600; }
.smart-suggestion-copy span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.smart-suggestion-copy small { margin-top: 4px; color: var(--subtle); font-size: 12px; }
.smart-suggestion-item > .actions { flex: none; justify-content: flex-end; }
.smart-suggestion-loading { padding: 14px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.smart-spark { display: inline-block; margin-right: 4px; color: var(--primary); animation: smart-spark 1.1s ease-in-out infinite; }
.todo-item .todo-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--subtle); }
.todo-item.warning .todo-dot { background: var(--warning); }
.todo-item.danger .todo-dot { background: var(--danger); }
.todo-item.success .todo-dot { background: var(--success); }
.todo-copy { min-width: 0; flex: 1; }
.todo-copy strong { display: block; font-size: 14px; font-weight: 500; }
.todo-copy small { display: block; margin-top: 2px; color: var(--subtle); font-size: 12px; }
.todo-count { font: 600 15px/1 var(--mono); color: var(--text); }

/* 系统设置：所有配置卡片共用同一内容轨道和操作基线 */
.settings-stack { display: grid; width: min(100%,1120px); gap: 16px; }
.settings-card { margin: 0; padding: 24px; overflow: visible; }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.settings-card-copy { min-width: 0; }
.settings-card-copy h3, .settings-security h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 600; }
.settings-card-copy p { margin: 8px 0 0; color: var(--subtle); font-size: 12px; }
.settings-card-action { flex: none; }
.settings-note { margin: 0 0 20px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.settings-field { display: block; min-width: 0; }
.settings-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.settings-field > small { display: block; margin: -1px 0 8px; color: var(--subtle); font-size: 12px; }
.settings-field input, .settings-field textarea { width: 100%; }
.settings-field-full { grid-column: 1 / -1; }
.settings-fields-stack { display: grid; gap: 20px; margin-top: 20px; }
.settings-guide-editor { font-family: var(--mono); font-size: 12.5px; }
.settings-card-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 53px; padding-top: 16px; margin-top: 20px; border-top: 1px solid var(--border); }
.settings-result { min-width: 0; margin-right: auto; color: var(--muted); font-size: 12px; }
.settings-toggle { display: flex; align-items: center; gap: 12px; width: fit-content; cursor: pointer; }
.settings-toggle input { margin: 0; }
.settings-toggle span { display: block; }
.settings-toggle strong { display: block; font-size: 14px; font-weight: 500; }
.settings-toggle small { display: block; margin-top: 2px; color: var(--subtle); font-size: 12px; }
.settings-security { width: 100%; margin: 0; padding: 20px 24px; overflow: hidden; }
.settings-security p { margin: 8px 0 0; color: var(--subtle); font-size: 12px; }
.storage-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.storage-stats > div { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.storage-stats span, .storage-stats strong, .storage-stats small { display: block; }
.storage-stats span { color: var(--muted); font-size: 12px; }
.storage-stats strong { margin-top: 8px; font: 600 24px/1.2 var(--mono); }
.storage-stats small { margin-top: 6px; overflow: hidden; color: var(--subtle); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.storage-policy { margin-top: 16px; margin-bottom: 0; }

.feedback-intro { margin: -4px 0 16px; color: var(--muted); font-size: 13px; }
.feedback-form { display: grid; gap: 16px; }
.feedback-form > label > span:first-child { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.feedback-form input, .feedback-form select, .feedback-form textarea { width: 100%; }
.feedback-form textarea { resize: vertical; }
.feedback-form label > small { display: block; margin-top: 8px; color: var(--subtle); font-size: 12px; overflow-wrap: anywhere; }
.feedback-file-picker { position: relative; display: grid; min-height: 76px; place-items: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-weight: 500; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.feedback-file-picker:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.feedback-file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.feedback-attachments { display: grid; min-width: 190px; gap: 6px; }
.feedback-attachment { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; align-items: center; gap: 6px; max-width: 300px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface-2); color: var(--text); font-size: 12px; }
.feedback-attachment > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-attachment small { color: var(--subtle); white-space: nowrap; }
.feedback-attachment:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.feedback-resolution-note { display: block; max-width: 180px; margin-top: 6px; color: var(--subtle); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.take-tab-skeleton { margin-top: 4px; }
.take-search-toolbar { display: grid; grid-template-columns: minmax(280px,420px) minmax(0,1fr); align-items: center; gap: 8px 16px; }
.take-search-toolbar input { width: 100%; min-width: 0; }
.take-search-toolbar .hint { min-width: 0; overflow-wrap: anywhere; }
.take-load-error { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 112px; }
.take-load-error strong { font-size: 15px; }
.take-load-error p { margin: 4px 0 0; color: var(--subtle); font-size: 12px; }

a { color: var(--charcoal); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 4px; border-radius: var(--radius-xs); font-size: .9em; }
#navOverlay { position: fixed; inset: 0; z-index: 90; background: rgba(31,39,51,.3); opacity: 0; pointer-events: none; transition: none; }
@keyframes card-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drift-a { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(10vw, 8vh, 0) scale(1.08); } }
@keyframes drift-b { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-9vw, -7vh, 0) scale(1.06); } }
@keyframes drift-c { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(6vw, 10vh, 0) scale(1.12); } }
@keyframes sq-float { from { transform: translate3d(0,0,0); } to { transform: translate3d(26px, -34px, 0); } }
@keyframes alert-pulse { 0%,100% { transform: scale(1); } 35% { transform: scale(1.24); box-shadow: 0 0 0 6px var(--danger-soft); } }
@keyframes smart-spark { 0%,100% { opacity: .42; transform: scale(.88); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes logo-spectrum { from { background-position: 0 50%; transform: translateZ(0) scale(.985); } to { background-position: 100% 50%; transform: translateZ(0) scale(1.015); } }
@keyframes showcase-float-a { from { transform: translate3d(0,0,0) rotate(-2.2deg); } to { transform: translate3d(7px,-6px,0) rotate(-1deg); } }
@keyframes showcase-float-b { from { transform: translate3d(0,0,0) rotate(2.6deg); } to { transform: translate3d(-6px,-5px,0) rotate(1.4deg); } }
@keyframes showcase-float-c { from { transform: translate3d(0,0,0) rotate(-4deg); } to { transform: translate3d(5px,-4px,0) rotate(-2.6deg); } }
@media (hover: hover) and (pointer: fine) {
  .card[onclick], .home-stat, .quick-card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
  .card[onclick]:hover, .home-stat:hover, .quick-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .login-blob, .glass-sq { animation: none !important; }
  .btn:active { transform: none; }
}
html.low-power .login-blob, html.low-power .glass-sq, html.low-power .sk, html.low-power .showcase-card, html.low-power .chroma-logo::before, html.low-power .ambient-blob, html.low-power .app-ambient::before { animation: none !important; }
@media (max-width: 980px) {
  .login-split { align-items: center; padding: 24px; }
  .auth-shell { display: block; width: min(520px,100%); height: auto; min-height: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .auth-showcase { display: none; }
  .auth-form-pane { min-height: min(680px,calc(100dvh - 48px)); padding: 28px clamp(20px,7vw,48px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: color-mix(in srgb,var(--surface) 96%,transparent); box-shadow: var(--shadow-overlay); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 520px) {
  .login-split { align-items: flex-start; padding: max(74px,calc(env(safe-area-inset-top) + 58px)) 14px 18px; }
  .login-split .auth-theme-switcher { top: max(12px,env(safe-area-inset-top)); right: 12px; }
  .auth-form-pane { min-height: auto; padding: 24px 20px; }
  .login-logo.chroma-logo { width: min(180px,58%); }
  .login-split .login-title { margin-top: 4px; font-size: 22px; }
  .login-split .login-sub { margin-bottom: 20px; }
}
@media (min-width: 761px) and (max-width: 1100px) and (hover: hover) {
  #appShell { grid-template-columns: 208px minmax(0, 1fr); }
  .app-header { padding-left: 14px; padding-right: 14px; }
  .app-header-right { gap: 7px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .searchbox { min-width: 0; }
  .top-action-text { font-size: 0; width: 36px; padding: 0; }
  #topBadges { display: none; }
  .user-chip { max-width: 96px; }
  .btn-logout { width: 36px; padding: 0; font-size: 0; }
  .home-stats, .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-lower-grid { grid-template-columns: 1fr; }
  .take-search-toolbar { grid-template-columns: 1fr; }
  .my-record-card { grid-template-columns: minmax(200px,1fr) minmax(300px,1.6fr); }
  .my-record-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 760px), (max-width: 920px) and (hover: none) and (pointer: coarse) {
  html, body { height: auto; min-height: 100%; overflow-x: clip; }
  body { min-height: 100dvh; }
  #appShell { display: block; height: auto; position: static; z-index: auto; }
  #main { width: 100%; min-width: 0; height: auto; overflow: visible; }
  .desktop-app-header { display: none; }
  .mobile-app-header { position: sticky; top: 0; z-index: 70; display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
  .mobile-brand img { width: auto; height: 30px; max-width: 92px; object-fit: contain; flex: none; }
  .mobile-brand > span { display: flex; min-width: 0; flex-direction: column; line-height: 1.15; }
  .mobile-brand strong { overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-brand small { overflow: hidden; max-width: 48vw; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-icon-btn { position: relative; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
  #sidebar > .sidebar-brand { display: none; }
  .mobile-icon-btn .notif-dot { top: -5px; right: -5px; }
  #sidebar { flex: none; position: fixed; left: 0; top: 0; bottom: auto; width: min(86vw, 360px); z-index: 120; height: var(--app-viewport-height, 100dvh); background: var(--surface-glass-strong); -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2); transform: translate3d(-102%,0,0); transition: transform .14s ease-out; box-shadow: 18px 0 50px -30px rgba(0,0,0,.5); will-change: transform; overscroll-behavior: contain; }
  body.nav-open #sidebar { transform: translate3d(0,0,0); }
  body.nav-open { overflow: hidden; }
  #navOverlay { background: rgba(20,28,35,.45); z-index: 110; }
  body.nav-open #navOverlay { opacity: 1; pointer-events: auto; }
  .mobile-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px 13px; border-bottom: 1px solid var(--border); }
  .mobile-drawer-head > div { display: flex; flex-direction: column; line-height: 1.2; }
  .mobile-drawer-head strong { font-size: 16px; }
  .mobile-drawer-head small { margin-top: 4px; color: var(--muted); font-size: 11px; }
  .mobile-drawer-head button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 23px; line-height: 1; }
  #sidebar nav { padding: 10px 12px; }
  #sidebar .mobile-primary-nav { display: none; }
  .mobile-only-nav { display: block; }
  .mobile-drawer-actions { display: block; padding: 10px 14px; border-top: 1px solid var(--border); }
  #view { padding: 20px 16px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { top: 56px; height: 60px; min-height: 60px; padding: 8px 12px; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .searchbox { flex: 1 1 100%; min-width: 0; max-width: none; }
  .searchbox input { height: 44px; }
  .top-actions { display: none; }
  .mobile-bottom-nav { position: fixed; right: 12px; bottom: max(8px, env(safe-area-inset-bottom)); left: 12px; z-index: 80; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); min-height: 64px; padding: 4px 6px; overflow: visible; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-overlay); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .mobile-nav-item { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; min-width: 0; min-height: 52px; padding: 4px 2px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); }
  .mobile-nav-item > span { display: grid; width: 28px; height: 28px; place-items: center; }
  .mobile-nav-item > span .ui-icon { width: 20px; height: 20px; }
  .mobile-nav-item > small { font-size: 10px; font-weight: 700; white-space: nowrap; }
  .mobile-nav-item.active, .mobile-nav-item.drawer-open { color: var(--primary); background: var(--primary-soft); }
  .mobile-nav-store > span { margin-top: 0; background: transparent; color: inherit; box-shadow: none; }
  .mobile-nav-badge { position: absolute; top: 1px; right: calc(50% - 24px); min-width: 16px; height: 16px; padding: 0 4px; border: 2px solid var(--surface); border-radius: 999px; background: var(--danger); color: var(--on-primary); font: normal 700 9px/12px var(--font); }
  .mobile-nav-badge.is-dot-only { top: 4px; right: calc(50% - 20px); width: 10px; min-width: 10px; height: 10px; padding: 0; }
  .panel { max-width: 100%; }
  table { max-width: none; }
  .user-table { min-width: 720px; }
  .user-table td:nth-child(2), .user-table td:nth-child(3), .user-table td:nth-child(4), .user-table td:nth-child(5) { white-space: nowrap; }
  .btn { min-height: 44px; }
  .btn-xs { min-height: 36px; }
  .page-head { align-items: stretch; flex-direction: column; gap: 8px; margin-bottom: 16px; }
  .page-head > div { width: 100%; justify-content: flex-start; }
  .page-head > div > input, .page-head > div > select { min-width: 0; flex: 1 1 180px; }
  .page-head .hint { max-width: none; text-align: left; }
  .parts-filter-bar { top: 116px; flex-wrap: nowrap; min-height: 60px; margin-right: -8px; margin-left: -8px; overflow-x: auto; scrollbar-width: none; }
  .parts-filter-bar::-webkit-scrollbar { display: none; }
  .parts-filter-bar > select { width: auto; min-width: 156px; flex: 0 0 auto; }
  .parts-filter-bar > .btn { flex: 0 0 auto; }
  .upload-method-panel > .page-head > span { align-self: flex-start; }
  .upload-method-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
  .upload-method-tabs .tab-btn { min-width: 0; min-height: 48px; padding: 6px 4px; font-size: 11px; }
  .upload-method-workspace { min-height: 180px; padding: 16px; }
  .upload-image-actions { align-items: stretch; }
  .upload-image-actions .file-picker, .upload-image-actions .file-picker .fp-label { width: 100%; justify-content: center; }
  .upload-image-actions .file-name { width: 100%; text-align: center; }
  .upload-image-actions #parseUploadImagesBtn { width: 100%; margin-left: 0; }
  .upload-image-progress { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .upload-image-grid { grid-template-columns: 1fr; max-height: min(420px,52vh); padding: 8px; }
  .upload-image-item { grid-template-columns: 64px minmax(0,1fr) 28px; min-height: 88px; padding: 8px; }
  .upload-image-thumb { width: 64px; height: 64px; }
  .import-preview-actions { width: 100%; }
  .import-preview-actions .btn { flex: 1 1 0; }
  .import-policy-toolbar { align-items: stretch; }
  .import-policy-toolbar > label { flex: 1 1 100%; justify-content: space-between; }
  .import-policy-toolbar > label select { min-width: 0; max-width: 72%; }
  .import-scroll-guide { justify-content: space-between; gap: 8px; }
  .import-preview-scroll { max-height: clamp(280px,calc(var(--app-viewport-height,100dvh) - 390px),460px); }
  .import-preview-table { min-width: 1660px; }
  .import-preview-table th:first-child,.import-preview-table td:first-child { width: 210px; min-width: 210px; max-width: 210px; }
  .import-name-field { min-width: 0; }
  .import-match-box { width: 100%; min-width: 0; }
  .import-match-candidate-list { max-height: min(280px,36vh); }
  .import-match-candidate { grid-template-columns: minmax(0,1fr); gap: 6px; padding: 9px 0; }
  .import-match-candidate .btn { width: 100%; min-height: 38px; }
  .import-create-new { width: 100%; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-row { align-items: stretch; flex-direction: column; gap: 4px; }
  .form-row label { min-width: 0; }
  .form-row input:not([type="checkbox"]), .form-row select, .form-row textarea { width: 100%; }
  .modal-form > .form-row:last-child { align-items: center; justify-content: flex-end; flex-direction: row; gap: 8px; }
  .check-row { align-items: flex-start; flex-direction: column; gap: 12px; margin-top: 16px; }
  #view > .grid { grid-template-columns: 1fr !important; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { height: min(460px,calc(var(--app-viewport-height,100dvh) - 180px)); min-height: 300px; }
  .category-card-head { grid-template-columns: minmax(0,1fr) 116px; padding: 12px; }
  .category-list { padding-left: 12px; }
  .category-card-foot { padding: 12px; }
  .changelog-release-head { flex-direction: column; gap: 4px; }
  .modal-backdrop { padding: 16px; }
  .modal { padding: 16px; }
  .sync-update-chip { top: 128px; max-width: calc(100vw - 32px); }
  .settings-card { padding: 16px; }
  .settings-card-head { align-items: stretch; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .settings-card-action { align-self: flex-start; }
  .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  .settings-field-full { grid-column: auto; }
  .settings-card-footer { align-items: stretch; flex-direction: column; }
  .settings-card-footer .btn { width: 100%; }
  .settings-result { margin-right: 0; }
  .settings-security { padding: 16px; }
  .storage-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .notification-pref { align-items: stretch; flex-direction: column; }
  .smart-suggestion-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .smart-suggestion-head small { flex: auto; }
  .smart-suggestion-item { align-items: stretch; flex-direction: column; gap: 10px; }
  .smart-suggestion-item > .actions { width: 100%; justify-content: flex-start; }
  .smart-suggestion-item > .actions .btn { flex: 1 1 120px; }
  .take-load-error { align-items: stretch; flex-direction: column; }
  .take-search-toolbar { grid-template-columns: 1fr; }
  .take-load-error .btn { width: 100%; }
  .my-section-tabs { grid-template-columns: 1fr; gap: 8px; }
  .my-section-tab { min-height: 68px; padding: 10px 12px; }
  .my-material-filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); margin-right: -4px; margin-left: -4px; }
  .my-material-filter-bar > input,.my-material-filter-bar > select:nth-of-type(1),.my-material-filter-bar > select:nth-of-type(4) { grid-column: 1 / -1; }
  .my-material-filter-bar .btn { min-width: 0; padding-right: 8px; padding-left: 8px; }
  .my-material-scroll-shell { height: clamp(300px,calc(var(--app-viewport-height,100dvh) - 520px),480px); padding-right: 2px; -webkit-overflow-scrolling: touch; }
  .my-workspace-head { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px; }
  .my-workspace-head > .btn,.my-workspace-head > .pill { align-self: flex-start; }
  .field-action-row { align-items: flex-start; flex-direction: column; }
  .my-record-card { grid-template-columns: 1fr; gap: 12px; padding: 14px 12px; }
  .my-record-main > a,.my-record-main > small { white-space: normal; overflow-wrap: anywhere; }
  .my-record-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .my-record-actions { grid-column: auto; justify-content: flex-start; }
  .my-record-actions .btn { flex: 1 1 88px; }
  .my-borrow-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .my-borrow-summary > div { min-height: 58px; padding: 10px 12px; }
  .my-request-row { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px; }
  .my-request-result { align-items: flex-start; width: 100%; }
  .my-request-result small { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .my-empty { min-height: 140px; padding: 28px 16px; }
  .home-head { align-items: flex-start; margin-bottom: 24px; }
  .home-mark { display: none; }
  .home-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .home-stat { min-height: 132px; padding: 12px; }
  .home-stat-icon { top: 12px; right: 12px; width: 32px; height: 32px; }
  .home-stat-value { margin-top: 16px; font-size: 28px; }
  .home-stat-foot { margin-top: 12px; }
  .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .quick-card { min-height: 112px; align-items: flex-start; flex-direction: column; gap: 12px; padding: 12px; }
  .quick-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: var(--radius-sm); }
  .quick-icon .ui-icon { width: 21px; height: 21px; }
  .quick-card > .ui-icon { display: none; }
  .quick-copy span { white-space: normal; line-height: 1.5; }
  .home-lower-grid { grid-template-columns: 1fr; gap: 16px; }
  .home-lower-grid .panel { height: auto; }
  .todo-empty { min-height: 112px; }
  .desktop-ledger { display: none; }
  .mobile-ledger-list { display: grid; gap: 0; }
  .mobile-ledger-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .mobile-ledger-item:last-child { border-bottom: 0; }
  .mobile-ledger-main, .mobile-ledger-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-ledger-main strong { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-ledger-main > span { flex: none; color: var(--muted); font-size: 12px; }
  .mobile-ledger-meta { margin-top: 4px; color: var(--subtle); font-size: 12px; }
  .mobile-ledger-meta b { color: var(--text); font-weight: 500; }
}

@media (max-width: 350px) {
  .mobile-app-header { padding-right: 8px; padding-left: 8px; }
  .mobile-brand img { max-width: 78px; }
  .mobile-bottom-nav { right: 6px; left: 6px; }
  .mobile-nav-item > small { font-size: 9px; }
}

@media (max-width: 760px) {
  .owner-allocation-item { grid-template-columns: 1fr; }
  .owner-allocation-actions { grid-column: 1; }
  .owner-allocation-main > div > small { white-space: normal; }
  .task-card-grid { grid-template-columns: 1fr; }
  .task-center-tabs { display: grid; width: 100%; grid-auto-columns: minmax(0,1fr); }
  .task-center-tabs button { min-width: 0; }
  .task-details { grid-template-columns: 1fr; }
  .replenish-note { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (min-width: 761px) and (max-width: 1240px) {
  .ledger-filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ledger-keyword-field { grid-column: span 2; }
  .ledger-filter-actions { justify-content: flex-end; }
  .my-material-filter-bar { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .my-material-filter-bar > input { grid-column: span 2; }
}

@media (max-width: 760px), (max-width: 920px) and (hover: none) and (pointer: coarse) {
  .modal-backdrop { align-items: center; padding: max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom)); overflow: hidden; }
  .modal { width: 100%; max-height: calc(var(--app-viewport-height,100dvh) - max(16px,env(safe-area-inset-top)) - max(16px,env(safe-area-inset-bottom))); padding: 16px; overflow-x: hidden; overflow-y: auto; border-radius: var(--radius); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .modal h3 { margin-bottom: 12px; font-size: 18px; }
  .modal-corner-close { top: 0; width: 40px; height: 40px; margin: -8px -8px 4px 10px; background: var(--surface); }
  .modal .form-grid { gap: 12px; }
  .modal input:not([type="checkbox"]),.modal select,.modal textarea { font-size: 16px; }
  .smart-suggestion-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .smart-suggestion-head > div { width: 100%; justify-content: space-between; }
  .smart-suggestion-item { padding: 10px 12px; }

  .ledger-query-panel { margin-right: -4px; margin-left: -4px; }
  .ledger-group-tabs { padding: 8px; }
  .ledger-group-tabs button { min-height: 36px; padding: 7px 11px; }
  .ledger-filter-details { border-top: 1px solid var(--border); }
  .ledger-filter-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 12px; color: var(--text); cursor: pointer; list-style: none; }
  .ledger-filter-details > summary::-webkit-details-marker { display: none; }
  .ledger-filter-details > summary > span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
  .ledger-filter-details > summary > span .ui-icon { width: 17px; height: 17px; color: var(--primary); }
  .ledger-filter-details > summary > small { min-width: 0; overflow: hidden; color: var(--subtle); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .ledger-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
  .ledger-keyword-field,.ledger-filter-grid label:nth-child(2),.ledger-filter-grid label:nth-child(5),.ledger-filter-actions { grid-column: 1 / -1; }
  .ledger-filter-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ledger-filter-actions .btn { min-width: 0; }
  .ledger-result-meta { align-items: flex-start; padding: 9px 12px; flex-direction: column; gap: 2px; }
  .ledger-table-scroll { display: none; }
  .ledger-mobile-results { display: grid; }
  .ledger-mobile-card { min-width: 0; padding: 14px 12px; border-bottom: 1px solid var(--border); }
  .ledger-mobile-card:last-child { border-bottom: 0; }
  .ledger-mobile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .ledger-mobile-head > div { min-width: 0; }
  .ledger-mobile-head strong,.ledger-mobile-head small { display: block; }
  .ledger-mobile-head strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .ledger-mobile-head small { margin-top: 3px; font-size: 11px; }
  .ledger-mobile-head > span { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
  .ledger-mobile-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
  .ledger-mobile-facts span,.ledger-mobile-facts small,.ledger-mobile-facts b { display: block; min-width: 0; }
  .ledger-mobile-facts small { color: var(--subtle); font-size: 10px; }
  .ledger-mobile-facts b { margin-top: 3px; overflow: hidden; color: var(--text); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
  .ledger-mobile-card > p { margin: 10px 0 0; padding: 8px; border-radius: var(--radius-xs); background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
  .ledger-mobile-card > .btn { margin-top: 10px; }
}

@media (max-width: 350px) {
  .ledger-filter-grid { grid-template-columns: 1fr; }
  .ledger-filter-grid > label,.ledger-filter-actions { grid-column: 1; }
  .ledger-mobile-facts { grid-template-columns: 1fr 1fr; }
}

/* 游客只读体验 */
.guest-entry-separator { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; color: var(--subtle); font-size: 11px; }
.guest-entry-separator::before,.guest-entry-separator::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-card .guest-login-btn { margin-top: 12px; border-color: color-mix(in srgb,var(--primary) 38%,var(--border)); background: color-mix(in srgb,var(--primary) 8%,var(--surface)); color: var(--primary); font-weight: 700; }
.login-card .guest-login-btn:hover { border-color: var(--primary); background: color-mix(in srgb,var(--primary) 13%,var(--surface)); }
.guest-entry-hint { margin: 8px 0 0; color: var(--subtle); font-size: 11px; line-height: 1.55; text-align: center; }
.guest-register-notice { margin: -10px 0 18px; padding: 11px 12px; border: 1px solid color-mix(in srgb,var(--primary) 24%,var(--border)); border-radius: var(--radius-xs); background: color-mix(in srgb,var(--primary) 7%,var(--surface)); color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.guest-register-notice button { padding: 0; border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; }
.guest-notice-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; border-color: color-mix(in srgb,var(--primary) 25%,var(--border)); background: color-mix(in srgb,var(--primary) 6%,var(--surface)); }
.guest-notice-banner > span { flex: none; font-size: 28px; }
.guest-notice-banner > div { flex: 1; min-width: 0; }
.guest-notice-banner strong,.guest-notice-banner small { display: block; }
.guest-notice-banner small { margin-top: 3px; color: var(--muted); line-height: 1.5; }
.guest-notice-banner > .actions { flex: none; flex-wrap: wrap; }
.guest-entry-notice { text-align: center; }
.guest-entry-icon { font-size: 42px; }
.guest-entry-notice h3 { margin-top: 8px; }
.guest-entry-notice p { color: var(--muted); line-height: 1.75; }
.guest-detail-lock { margin-top: 12px; color: var(--muted); line-height: 1.65; }
.guest-import-notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; border-color: color-mix(in srgb,var(--primary) 25%,var(--border)); background: color-mix(in srgb,var(--primary) 6%,var(--surface)); }
.guest-import-notice b { flex: none; color: var(--primary); }
.guest-import-notice span { color: var(--muted); line-height: 1.55; }
.guest-import-policy { justify-content: flex-start; }
.guest-parts-table .btn:disabled { cursor: not-allowed; opacity: .46; }
.guest-mode #adminNav,.guest-mode #superNav { display: none !important; }

@media (max-width: 760px), (max-width: 920px) and (hover: none) and (pointer: coarse) {
  .bom-drop-zone { grid-template-columns: auto minmax(0,1fr); gap: 10px 12px; min-height: 0; padding: 14px; }
  .bom-drop-copy small { line-height: 1.45; }
  .bom-file-actions-inline { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; width: 100%; }
  .bom-file-actions-inline .file-picker, .bom-file-actions-inline .fp-label { width: 100%; justify-content: center; }
  .bom-file-actions-inline .file-name { max-width: none; min-height: 38px; display: flex; align-items: center; justify-content: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: center; }
  .bom-file-actions { display: grid; grid-template-columns: 1fr; }
  .bom-file-actions .btn { min-width: 0; }
  .bom-multiplier-field { grid-template-columns:auto 82px; }
  .bom-multiplier-field small { grid-column: 1 / -1; }
  .bom-take-actions { display:grid; grid-template-columns:1fr; gap:8px; }
  .bom-take-actions::before { margin:0 0 2px; }
  .guest-notice-banner { align-items: flex-start; flex-wrap: wrap; }
  .guest-notice-banner > div { flex-basis: calc(100% - 54px); }
  .guest-notice-banner > .actions { width: 100%; }
  .guest-notice-banner > .actions .btn { flex: 1 1 120px; }
  .guest-mode .parts-table-panel { padding: 0; overflow: visible; }
  .guest-parts-table,.guest-parts-table tbody { display: block; width: 100%; min-width: 0; }
  .guest-parts-table thead { display: none; }
  .guest-parts-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px 12px; padding: 14px 12px; border-bottom: 1px solid var(--border); }
  .guest-parts-table tr:last-child { border-bottom: 0; }
  .guest-parts-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .guest-parts-table td:first-child,.guest-parts-table td:last-child { grid-column: 1 / -1; }
  .guest-parts-table td:nth-child(4) { display: none; }
  .guest-parts-table .parts-row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
  .guest-parts-table .parts-row-actions .btn { flex: 1 1 70px; min-width: 0; }
}

/* Public registration link stays in document flow on mobile and desktop. */
.site-filing { padding: 0 12px 16px; }
.site-filing a { color: var(--muted); text-decoration: none; }
.site-filing a:hover { text-decoration: underline; }
.login-card .site-filing { padding-bottom: 0; }

.take-bom-table { overflow-x: auto; }
.take-bom-table table { min-width: 780px; }
.take-bom-table td { vertical-align: top; }
.take-bom-table small { display: block; margin-top: 5px; color: var(--muted); }
.bom-row-qty { width: 100px; }
.bom-row-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 130px; }
.bom-take-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bom-match-search { display: flex; gap: 8px; margin: 12px 0; }
.bom-match-search input { min-width: 0; flex: 1; }
.bom-match-results { max-height: 52dvh; overflow-y: auto; }
.bom-match-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.bom-match-card > div { min-width: 0; overflow-wrap: anywhere; }
.bom-match-card button { flex-shrink: 0; }
.bom-match-card small { color: var(--muted); }
.bom-match-modal { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); overflow: hidden; }
.bom-match-modal p { margin: 6px 0; }
.bom-match-modal h3, .bom-match-modal p { flex-shrink: 0; }
.bom-match-modal h3 { padding-right: 40px; }
.bom-match-modal .modal-corner-close { position: absolute; top: 12px; right: 12px; margin: 0; }
.bom-match-modal .bom-match-search, .bom-match-modal .modal-footer { flex-shrink: 0; }
.bom-match-modal .bom-match-results { flex: 1 1 auto; min-height: 0; max-height: none; }
@media (max-width: 600px) {
  .bom-match-card { align-items: stretch; flex-direction: column; }
  .bom-match-card button { align-self: flex-start; }
  .take-bom-table { overflow: visible; }
  .take-bom-table table, .take-bom-table tbody { display: block; min-width: 0; width: 100%; }
  .take-bom-table thead { display: none; }
  .take-bom-table tr { display: grid; grid-template-columns: 1fr; position: relative; margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
  .take-bom-table td { display: block; min-width: 0; height: auto; white-space: normal; overflow-wrap: anywhere; padding: 10px 12px; }
  .take-bom-table td:first-child { position: absolute; top: 0; left: 0; border: 0; }
  .take-bom-table td:nth-child(2) { padding-left: 44px; }
  .take-bom-table td:nth-child(3)::before { content: '本次总需求'; display: block; margin-bottom: 6px; color: var(--muted); }
  .take-bom-table td:last-child { border-bottom: 0; }
  .bom-row-actions { min-width: 0; }
}

/* Filing stays with the desktop toolbar or the mobile drawer, outside scrolling content. */
.header-filing { flex-shrink: 0; white-space: nowrap; color: var(--muted); font-size: 12px; margin-right: 6px; text-decoration: none; }
.header-filing:hover, .sidebar-filing:hover { text-decoration: underline; }
.sidebar-filing { display: none; color: var(--muted); text-decoration: none; }
@media (max-width: 760px), (max-width: 920px) and (hover: none) and (pointer: coarse) {
  .sidebar-foot { flex-wrap: wrap; }
  .sidebar-filing { display: block; flex-basis: 100%; font-size: 11px; padding-top: 4px; }
}
