:root {
  --ink: #17202a;
  --muted: #65717d;
  --line: #dce1e5;
  --surface: #ffffff;
  --canvas: #f4f6f7;
  --primary: #176b5b;
  --primary-dark: #105247;
  --accent: #c97727;
  --danger: #b6413b;
  --blue: #2d608c;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(23, 32, 42, 0.06);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; letter-spacing: 0; }

.topbar { background: #202a31; color: white; border-bottom: 3px solid var(--primary); }
.topbar-inner { max-width: 1240px; min-height: 62px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 28px; }
.brand { color: white; display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; display: inline-grid; place-items: center; background: var(--primary); color: white; border-radius: 4px; font-size: 12px; }
.brand-mark.large { width: 44px; height: 44px; font-size: 15px; }
.top-search { flex: 1; max-width: 560px; display: flex; }
.top-search input { width: 100%; min-width: 0; border: 1px solid #52616c; border-right: 0; border-radius: 4px 0 0 4px; background: #fff; padding: 9px 12px; }
.top-search button { flex: 0 0 auto; border: 0; border-radius: 0 4px 4px 0; padding: 0 17px; background: var(--primary); color: white; white-space: nowrap; cursor: pointer; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.top-actions a, .link-button { color: #e8edef; font-size: 14px; }
.top-actions form { display: contents; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; }

.page-shell { max-width: 1240px; margin: 0 auto; padding: 34px 24px 64px; }
.page-heading, .box-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 30px; line-height: 1.2; }
h2 { margin-bottom: 3px; font-size: 19px; }
h3 { margin-bottom: 5px; font-size: 18px; }
.eyebrow { margin-bottom: 6px; color: var(--primary); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.page-heading p, .box-header p, .form-heading p, .section-heading p { margin-bottom: 0; color: var(--muted); }

.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 32px; background: #25323a; color: white; border-left: 5px solid var(--accent); }
.summary-strip div { min-height: 94px; padding: 19px 24px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid #44515a; }
.summary-strip div:last-child { border-right: 0; }
.summary-strip strong { font-size: 27px; line-height: 1.2; }
.summary-strip span { margin-top: 4px; color: #c8d1d6; font-size: 13px; }

.content-section { margin-top: 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-heading.compact { margin-bottom: 16px; }
.count-badge, .box-code { display: inline-block; padding: 3px 8px; border: 1px solid #b9c4ca; border-radius: 4px; background: #edf1f3; color: #3d4a52; font-family: Consolas, monospace; font-size: 12px; font-weight: 700; }

.box-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.box-card { min-width: 0; min-height: 168px; padding: 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.box-card:hover { border-color: #8aa49f; text-decoration: none; box-shadow: 0 3px 10px rgba(23, 32, 42, 0.08); }
.box-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.box-card p { color: var(--muted); overflow-wrap: anywhere; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #3f946f; box-shadow: 0 0 0 3px #e5f2eb; }
.box-metrics { display: flex; gap: 20px; padding-top: 11px; border-top: 1px solid #edf0f1; color: var(--muted); font-size: 13px; }
.box-metrics strong { color: var(--ink); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e8ebed; text-align: left; vertical-align: middle; }
th { background: #f0f3f4; color: #53606a; font-size: 12px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfb; }
td small { display: block; margin-top: 3px; color: var(--muted); }
.align-right { text-align: right; }
.quantity { font-weight: 750; color: var(--primary-dark); }
.large-number { font-size: 18px; }
.part-link::after { content: " \2197"; color: var(--muted); font-size: 11px; font-weight: 400; }
.bulk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.bulk-toolbar select, .bulk-toolbar input[type="number"] { height: 36px; padding: 6px 8px; border: 1px solid #c5cdd1; border-radius: 4px; background: white; }
.bulk-toolbar .quantity-input { width: 86px; }
.bulk-check { display: inline-flex; align-items: center; gap: 6px; color: #34434c; font-weight: 650; }
.select-column { width: 54px; text-align: center; }
.part-select, .inventory-select, .bulk-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.part-select, .inventory-select { margin: 0; }
.library-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.category-panel { min-width: 0; padding: 16px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.category-list { display: grid; gap: 5px; }
.category-link { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid transparent; border-radius: 4px; color: var(--ink); }
.category-link:hover { background: #f4f7f7; text-decoration: none; }
.category-link.active { border-color: #9fc7bd; background: #e9f4f0; color: var(--primary-dark); font-weight: 700; }
.category-link strong { color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
.part-library-panel { min-width: 0; }
.box-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.box-chip { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 7px; border: 1px solid #b9c4ca; border-radius: 4px; background: #edf1f3; color: #3d4a52; font-family: Consolas, monospace; font-size: 12px; font-weight: 700; }
.box-chip:hover { background: #e3e9ec; text-decoration: none; }
.text-danger-link { color: var(--danger); font-weight: 650; }
.text-action-link { color: var(--blue); font-weight: 650; white-space: nowrap; }
.confirm-chip-list { margin-top: 10px; }
.per-page-form { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.per-page-form select { height: 34px; padding: 5px 28px 5px 9px; border: 1px solid #b9c3c8; border-radius: 4px; background: white; color: var(--ink); }
.pagination { scroll-margin-top: 86px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.page-link, .page-status, .page-jump-form { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 11px; border: 1px solid #bfc8cd; border-radius: 4px; background: white; color: #34434c; font-size: 13px; }
.page-link:hover { background: #f3f5f6; text-decoration: none; }
.page-link.disabled { color: #9aa4aa; background: #eef1f2; cursor: not-allowed; }
.page-status { border-color: transparent; background: transparent; color: var(--muted); }
.page-jump-form { gap: 6px; }
.page-jump-form select { height: 26px; min-width: 58px; border: 1px solid #b9c3c8; border-radius: 3px; background: white; color: var(--ink); }

.breadcrumb { display: flex; gap: 9px; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.title-line { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; }
.title-line h1 { margin: 0; }
.header-actions, .form-actions { display: flex; gap: 9px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 246px; gap: 18px; align-items: start; }
.inventory-panel, .qr-panel { min-width: 0; }
.qr-panel { padding: 17px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.qr-image { aspect-ratio: 1; margin: 8px 0 14px; border: 1px solid #edf0f1; background: white; }
.qr-image img { width: 100%; height: 100%; display: block; object-fit: contain; }
.qr-panel form { margin-bottom: 8px; }
.stock-actions { display: flex; justify-content: flex-end; gap: 7px; }
.stock-actions form { margin: 0; }
.stock-quantity-input { width: 82px; height: 36px; padding: 6px 8px; border: 1px solid #b9c3c8; border-radius: 4px; color: var(--primary-dark); font-weight: 750; }
.stock-quantity-input:focus { outline: 2px solid rgba(23, 107, 91, 0.18); border-color: var(--primary); }

.public-box-page { min-height: 100vh; }
.public-box-bar { background: #202a31; color: white; border-bottom: 3px solid var(--primary); }
.public-box-bar-inner { max-width: 1180px; min-height: 58px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 10px; }
.public-box-shell { width: min(100%, 1180px); margin: 0 auto; padding: 28px 24px 48px; }
.public-box-heading { margin-bottom: 20px; }
.public-box-heading p { margin: 7px 0 10px; color: var(--muted); }
.public-box-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; color: var(--muted); font-size: 13px; }
.public-part-list { display: grid; gap: 12px; }
.public-part-item { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.public-part-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.public-part-number { overflow-wrap: anywhere; color: var(--primary-dark); font-family: Consolas, "Microsoft YaHei", monospace; font-size: 16px; }
.public-part-top h2 { margin-top: 3px; color: #34434c; font-size: 15px; font-weight: 600; }
.public-stock { flex: 0 0 auto; min-width: 64px; padding: 6px 9px; border-left: 3px solid var(--primary); background: #edf5f2; color: var(--primary-dark); text-align: center; font-weight: 750; white-space: nowrap; }
.public-part-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 0; padding-top: 11px; border-top: 1px solid #edf0f1; }
.public-part-details div { min-width: 0; padding-right: 10px; }
.public-part-details dt { color: var(--muted); font-size: 12px; }
.public-part-details dd { margin: 2px 0 0; overflow-wrap: anywhere; color: #35434b; }
.public-part-note { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid #edf0f1; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

@media (min-width: 900px) {
  .public-part-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-part-item { height: 100%; }
}

.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 15px; border: 1px solid transparent; border-radius: 4px; font-weight: 650; cursor: pointer; }
.button:hover { text-decoration: none; }
.button.primary { color: white; background: var(--primary); border-color: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: #34434c; background: white; border-color: #bfc8cd; }
.button.secondary:hover { background: #f3f5f6; }
.button.danger { color: white; background: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: #91342f; }
.button.full { width: 100%; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 4px; background: white; font-size: 20px; line-height: 1; cursor: pointer; }
.icon-button.minus { color: var(--danger); border: 1px solid #ddb9b6; }
.icon-button.plus { color: var(--primary); border: 1px solid #9fc7bd; }
.icon-button.edit { color: var(--blue); border: 1px solid #aebfce; font-size: 13px; font-weight: 700; }
.icon-button:hover { background: #f4f7f7; }

.form-page { max-width: 760px; }
.form-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.stack-form { display: grid; gap: 17px; }
.data-form { margin-top: 22px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.two-column-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 6px; color: #35434b; font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #b9c3c8; border-radius: 4px; background: white; color: var(--ink); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .top-search input:focus { outline: 2px solid rgba(23, 107, 91, 0.2); border-color: var(--primary); }
.field-error, .form-error { display: block; margin-top: 5px; color: var(--danger); font-size: 13px; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.field-help ul { margin: 4px 0 0; padding-left: 18px; }
.form-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 5px; }
.edit-form-actions { width: 100%; }
.form-action-spacer { flex: 1; }
.confirm-page { max-width: 660px; }
.confirm-panel { padding: 26px; border: 1px solid #dfc2c0; border-top: 4px solid var(--danger); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.danger-text { color: var(--danger); }
.confirm-name { color: var(--muted); }
.confirm-details { margin: 22px 0; border: 1px solid var(--line); border-radius: 4px; }
.confirm-details div { display: grid; grid-template-columns: 130px 1fr; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.confirm-details div:last-child { border-bottom: 0; }
.confirm-details dt { color: var(--muted); }
.confirm-details dd { margin: 0; font-weight: 650; }
.confirm-warning { padding: 12px 14px; border-left: 3px solid var(--danger); background: #fff1f0; color: #71322f; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

.login-layout { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.login-panel { width: min(100%, 410px); padding: 30px; background: white; border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(23, 32, 42, 0.08); }
.login-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 27px; }
.login-heading h1 { margin: 0; font-size: 22px; }
.login-heading p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.message-stack { position: fixed; z-index: 10; top: 74px; right: 20px; width: min(380px, calc(100vw - 40px)); }
.message { margin-bottom: 8px; padding: 11px 14px; border: 1px solid #aecdc3; border-radius: 4px; background: #e9f4f0; box-shadow: var(--shadow); }
.message.error { border-color: #ddb5b2; background: #f9eae9; }
.empty-state { padding: 34px; color: var(--muted); background: white; border: 1px dashed #bcc5ca; border-radius: var(--radius); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.batch-heading { align-items: flex-end; }
.batch-table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.batch-table { min-width: 1300px; table-layout: fixed; }
.batch-table th, .batch-table td { padding: 6px; }
.batch-table th { padding-top: 10px; padding-bottom: 10px; }
.batch-table th:nth-child(2) { width: 112px; }
.batch-table th:nth-child(3) { width: 120px; }
.batch-table th:nth-child(4) { width: 110px; }
.batch-table th:nth-child(5) { width: 156px; }
.batch-table th:nth-child(6) { width: 132px; }
.batch-table th:nth-child(7) { width: 154px; }
.batch-table th:nth-child(8) { width: 90px; }
.batch-table th:nth-child(9) { width: 102px; }
.batch-table .row-number { width: 38px; text-align: center; }
.batch-table .quantity-column { width: 94px; }
.batch-table .unit-column { width: 64px; }
.batch-table .remove-column { width: 38px; }
.batch-table input, .batch-table select { width: 100%; min-width: 0; height: 36px; padding: 6px 8px; border: 1px solid #c5cdd1; border-radius: 3px; background: white; }
.batch-table input:focus, .batch-table select:focus { outline: 2px solid rgba(23, 107, 91, 0.18); border-color: var(--primary); }
.batch-table .row-index { text-align: center; color: var(--muted); font-family: Consolas, monospace; }
.batch-row.row-has-error { background: #fff4f3; }
.batch-row { position: relative; }
.row-errors { position: absolute; left: 38px; right: 38px; top: calc(100% - 3px); z-index: 2; padding: 4px 8px !important; border: 1px solid #e2b3af !important; background: #fff0ef; color: var(--danger); font-size: 12px; }
.remove-row { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: #7b858c; font-size: 20px; cursor: pointer; }
.remove-row:hover { color: var(--danger); }
.batch-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.batch-error { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #e2b3af; border-radius: 4px; background: #fff0ef; }
.inventory-add-page { max-width: none; }
.inventory-add-table { min-width: 1500px; }
.inventory-add-table th:nth-child(2) { width: 220px; }
.inventory-add-table th:nth-child(3) { width: 160px; }
.inventory-add-table th:nth-child(4) { width: 132px; }
.inventory-add-table th:nth-child(5) { width: 160px; }
.inventory-add-table th:nth-child(6) { width: 92px; }
.inventory-add-table th:nth-child(7) { width: 104px; }
.inventory-add-table th:nth-child(10) { width: 230px; }
.inventory-add-table th:nth-child(11) { width: 160px; }
.right-actions { display: flex; gap: 9px; }

.import-page { max-width: 820px; }
.import-spec { margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.import-spec div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 12px 15px; border-bottom: 1px solid #e8ebed; }
.import-spec div:last-child { border-bottom: 0; }
.import-spec span { color: var(--muted); font-size: 13px; }
.import-spec strong { overflow-wrap: anywhere; font-family: Consolas, "Microsoft YaHei", monospace; font-size: 13px; font-weight: 600; }
.upload-form { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.file-picker { display: block; padding: 24px; border: 1px dashed #9eabb2; border-radius: 4px; background: #f7f9f9; }
.file-picker span { display: block; margin-bottom: 10px; font-weight: 700; }
.file-picker input { width: 100%; }
.upload-form .form-actions { margin-top: 20px; }
.import-errors { margin-bottom: 18px; padding: 15px 17px; border: 1px solid #e2b3af; border-left: 4px solid var(--danger); border-radius: 4px; background: #fff0ef; }
.import-errors h2 { font-size: 16px; }
.import-errors ul { margin: 0; padding-left: 21px; color: #71322f; }
.lcsc-preview-dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; color: var(--ink); box-shadow: 0 16px 45px rgba(23, 32, 42, 0.24); }
.lcsc-preview-dialog::backdrop { background: rgba(23, 32, 42, 0.62); }
.lcsc-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.dialog-close { width: 34px; height: 34px; flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); font-size: 25px; line-height: 1; cursor: pointer; }
.lcsc-preview-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.lcsc-preview-fields div { min-width: 0; padding: 11px 8px; border-bottom: 1px solid #edf0f1; }
.lcsc-preview-fields dt { color: var(--muted); font-size: 12px; }
.lcsc-preview-fields dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 650; }
.lcsc-preview-fields .span-two { grid-column: 1 / -1; }
.lcsc-preview-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 16px; }
.lcsc-preview-list { max-height: min(60vh, 560px); overflow-y: auto; border-bottom: 1px solid var(--line); }
.lcsc-preview-item { padding: 12px 8px; border-bottom: 1px solid #edf0f1; }
.lcsc-preview-item:last-child { border-bottom: 0; }
.lcsc-preview-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lcsc-preview-item-heading strong { overflow-wrap: anywhere; }
.lcsc-preview-item-heading span { flex: 0 0 auto; padding: 2px 7px; border: 1px solid #a8c8c0; border-radius: 3px; background: #edf5f2; color: var(--primary-dark); font-size: 12px; font-weight: 700; }
.lcsc-preview-item > p { margin: 3px 0 7px; color: #35434b; }
.lcsc-preview-item dl { display: flex; flex-wrap: wrap; gap: 5px 20px; margin: 0; }
.lcsc-preview-item dl div { display: flex; gap: 5px; }
.lcsc-preview-item dt { color: var(--muted); font-size: 12px; }
.lcsc-preview-item dd { margin: 0; font-size: 12px; }
.model-import-page { max-width: 1180px; }
.model-import-form { max-width: 820px; }
.model-import-form textarea { min-height: 380px; font-family: Consolas, "Microsoft YaHei", monospace; line-height: 1.65; }
.model-import-summary { margin-bottom: 12px; padding: 11px 14px; border-left: 4px solid var(--primary); background: #edf5f2; color: #35434b; }
.model-import-preview { max-height: 65vh; }
.model-import-preview table { min-width: 980px; }
.model-import-preview td { vertical-align: top; }
.model-candidate-select { min-width: 190px; padding: 7px 9px; border: 1px solid #b9c3c8; border-radius: 4px; background: white; }
.match-status { display: inline-block; padding: 3px 7px; border-radius: 3px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.match-status.matched { background: #e5f2eb; color: var(--primary-dark); }
.match-status.unmatched { background: #f3f0e8; color: #68552d; }
.candidate-detail { margin-bottom: 4px; color: #46545c; font-size: 12px; }
.muted-text { color: var(--muted); font-size: 12px; }

@media (max-width: 820px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .top-search { order: 3; max-width: none; flex-basis: 100%; }
  .top-actions { gap: 12px; }
  .top-actions .desktop-only { display: none; }
  .page-shell { padding: 25px 16px 48px; }
  .box-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
  .library-layout { grid-template-columns: 1fr; }
  .category-panel { padding: 13px; }
  .category-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-panel { max-width: 280px; }
}

@media (max-width: 560px) {
  .brand > span:last-child { display: none; }
  .page-heading, .box-header { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 25px; }
  .summary-strip { grid-template-columns: 1fr 1fr 1fr; }
  .summary-strip div { min-height: 78px; padding: 13px 12px; }
  .summary-strip strong { font-size: 22px; }
  .box-grid { grid-template-columns: 1fr; }
  .category-list { grid-template-columns: 1fr; }
  .box-card { min-height: 150px; }
  .two-column-form { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .data-form { padding: 17px; }
  .login-panel { padding: 23px; }
  th, td { padding: 12px 11px; }
  .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .public-box-bar { display: none; }
  .public-box-shell { padding: 10px 8px 24px; }
  .public-box-heading { margin-bottom: 8px; padding: 0 3px 8px; border-bottom: 1px solid var(--line); }
  .public-box-heading .title-line { gap: 8px; margin-bottom: 2px; }
  .public-box-heading h1 { max-width: calc(100% - 80px); overflow: hidden; font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
  .public-box-heading p { margin: 2px 0; overflow: hidden; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
  .public-box-meta { justify-content: space-between; gap: 4px 10px; font-size: 11px; }
  .public-part-list { gap: 3px; }
  .public-part-item { min-height: 58px; padding: 6px 8px; border-radius: 3px; box-shadow: none; }
  .public-part-top { align-items: center; gap: 8px; }
  .public-part-top > div { min-width: 0; display: flex; align-items: baseline; gap: 7px; }
  .public-part-number { max-width: 55%; overflow: hidden; font-size: 13px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
  .public-part-top h2 { min-width: 0; margin: 0; overflow: hidden; font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
  .public-stock { min-width: 52px; padding: 2px 5px; border-left-width: 2px; font-size: 12px; }
  .public-part-details { display: flex; gap: 10px; margin-top: 4px; padding-top: 4px; overflow: hidden; }
  .public-part-details div { min-width: 0; display: flex; gap: 3px; padding: 0; white-space: nowrap; }
  .public-part-details div:first-child { max-width: 42%; }
  .public-part-details dt, .public-part-details dd { overflow: hidden; font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .public-part-details dt::after { content: ":"; }
  .public-part-details dd { margin: 0; }
  .public-part-note { display: none; }
  .lcsc-preview-dialog { padding: 15px; }
  .lcsc-preview-fields { grid-template-columns: 1fr; }
  .lcsc-preview-fields .span-two { grid-column: auto; }
  .lcsc-preview-actions .button { flex: 1; }
}
