:root {
  --ink: #14231e;
  --ink-soft: #4a5b54;
  --muted: #8a978f;
  --bg: #f3f1ea;
  --card: #ffffff;
  --line: #e6e1d6;
  --brand: #0f3d32;
  --brand-2: #1f7a5e;
  --brand-soft: #e5f2ec;
  --gold: #b58b3f;
  --gold-soft: #f7efdc;
  --danger: #b4453a;
  --danger-soft: #fbeae8;
  --blue-soft: #e8effa;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(18, 35, 30, 0.07);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body { padding-bottom: 68px; }

h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 16px; }

button { font-family: inherit; font-size: 14px; cursor: pointer; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.hint { color: var(--ink-soft); font-size: 12.5px; margin: 8px 0; }

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #0d3429 0%, #165844 100%);
  color: #f4efe2;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #2f9576, #0f3d32);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 19px; font-weight: 600; color: #f6efd8;
}
.brand-title { font-size: 17px; font-weight: 600; letter-spacing: 2px; }
.brand-sub { font-size: 11px; opacity: 0.72; letter-spacing: 1px; }
.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 8px 14px;
}
.topbar .ghost-btn { border-color: rgba(255,255,255,.35); background: transparent; color: #f4efe2; }
.ghost-btn.small { padding: 5px 10px; font-size: 12.5px; }
.ghost-btn.wide { width: 100%; margin-top: 10px; }
.primary-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 600;
}
.primary-btn:active { background: #0a2c24; }
.primary-btn.small { padding: 9px 14px; font-size: 13px; }
.primary-btn.wide { width: 100%; margin-top: 14px; }
.primary-btn:disabled { opacity: .55; }

/* 视图 */
.view { padding: 14px 14px 8px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.tag {
  font-size: 11px; color: var(--brand-2); background: var(--brand-soft);
  padding: 3px 8px; border-radius: 999px;
}

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.stat {
  --stat-accent: #9aa79f;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: 0 1px 2px rgba(18, 40, 32, 0.04);
  position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 15px; bottom: 15px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--stat-accent);
}
.stat .stat-label { font-size: 12px; color: var(--muted); letter-spacing: .2px; }
.stat .value {
  font-size: 26px; font-weight: 650; margin-top: 5px; letter-spacing: -.6px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat .value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat .stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.stat.accent { --stat-accent: var(--brand-2); background: linear-gradient(180deg, #f6fbf8 0%, var(--card) 72%); }
.stat.gold { --stat-accent: var(--gold); background: linear-gradient(180deg, #fdfaf2 0%, var(--card) 72%); }
.stat.out { --stat-accent: #4b76c2; background: linear-gradient(180deg, #f6f8fd 0%, var(--card) 72%); }
.stat.danger { --stat-accent: var(--danger); background: linear-gradient(180deg, #fdf8f5 0%, var(--card) 72%); }

.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.quick-btn {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 10px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.quick-btn:hover {
  transform: translateY(-1px); border-color: var(--brand-2);
  box-shadow: 0 6px 16px rgba(18, 40, 32, 0.08);
}
.quick-btn:active { transform: translateY(0); box-shadow: var(--shadow); }
.quick-btn:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
#quick-customers { grid-column: span 2; }
.quick-icon {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700;
}

/* 区块标题 */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin: 4px 2px 14px;
}
.page-head h2 { font-size: 20px; letter-spacing: .5px; }
.page-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); margin: 0; }
.check-inline input { width: 15px; height: 15px; accent-color: var(--brand-2); }
.seg {
  display: inline-flex; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; box-shadow: var(--shadow);
}
.seg-btn {
  border: none; background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px;
}
.seg-btn.active { background: var(--brand); color: #fff; font-weight: 600; }

/* 仪表盘栅格 */
.dash-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.chart-card { display: flex; flex-direction: column; }
.chart { width: 100%; margin-top: 4px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-empty { padding: 34px 0; text-align: center; color: var(--muted); font-size: 13px; }
.chart-legend { display: flex; align-items: center; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-legend .lg-in { background: var(--brand-2); }
.chart-legend .lg-out { background: var(--gold); }

/* 品类环形图 */
.donut-wrap { display: flex; align-items: center; gap: 18px; min-height: 150px; }
.donut {
  position: relative; width: 136px; height: 136px; border-radius: 50%; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(20, 35, 30, .06);
}
.donut-hole {
  position: absolute; inset: 27%; border-radius: 50%; background: var(--card);
  display: grid; place-items: center; text-align: center;
  box-shadow: 0 0 0 1px rgba(20, 35, 30, .04);
}
.donut-hole b { font-size: 19px; line-height: 1.1; color: var(--brand); }
.donut-hole span { font-size: 10.5px; color: var(--muted); }
.donut-legend { flex: 1; min-width: 0; display: grid; gap: 7px; }
.dl-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dl-row .dl-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.dl-row .dl-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-row .dl-val { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dl-row.clickable { cursor: pointer; border-radius: 8px; padding: 3px 6px; margin: 0 -6px; transition: background .15s ease, color .15s ease; }
.dl-row.clickable:hover, .dl-row.clickable:active { background: rgba(15, 61, 50, .06); }
.dl-row.clickable:hover .dl-name { color: var(--brand); }

/* 表格（货主管理 / 桌面台账） */
.table-card { padding: 16px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid #f0ece2; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fbfaf5; }
.data-table .code-cell { font-family: "Courier New", monospace; font-weight: 700; color: var(--brand); white-space: nowrap; }
.data-table .name-cell { font-weight: 600; white-space: nowrap; }
.data-table .num-cell { font-variant-numeric: tabular-nums; }
.data-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.data-table tr.is-inactive td { color: var(--muted); }
.data-table tr.is-inactive .code-cell, .data-table tr.is-inactive .name-cell { color: var(--muted); }
.tbl-empty td { text-align: center; color: var(--muted); padding: 30px 10px; }

/* 批量导入 / 导出 */
.batch-bar { display: flex; gap: 8px; justify-content: flex-end; margin: 0 2px 10px; }
.import-table-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-table-wrap .data-table { font-size: 12.5px; }
.import-table-wrap .data-table td { padding: 8px 10px; white-space: nowrap; }
.data-table tr.row-error td { background: var(--danger-soft); color: var(--danger); }
.data-table tr.row-error:hover td { background: var(--danger-soft); }
.err-cell { max-width: 200px; white-space: normal !important; font-size: 12px; }
.link-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 8px; padding: 4px 10px; font-size: 12px;
}
.link-btn:hover { border-color: var(--brand-2); color: var(--brand); }
.link-btn.danger { color: var(--danger); border-color: #f0d6d2; }
.link-btn.danger:hover { background: var(--danger-soft); }
.status-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--brand-2); }
.status-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); }
.status-tag.off { color: var(--muted); }
.status-tag.off::before { background: #c3bda9; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.form-actions .primary-btn { min-width: 108px; }

/* 品类条 */
.bars .bar-row { margin: 9px 0; }
.bar-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.bar-track { height: 8px; background: #eeebe1; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #2f9576, #0f3d32); border-radius: 999px; }

/* 最近动态 */
.recent-list .recent {
  display: flex; gap: 10px; padding: 9px 8px; margin: 0 -8px;
  border-bottom: 1px solid var(--line); border-radius: 10px;
  transition: background .15s ease;
}
.recent-list .recent:hover { background: #f7f5ee; }
.recent-list .recent:last-child { border-bottom: none; }
.recent:last-child { border-bottom: none; }
.recent .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 auto; }
.dot.in { background: var(--brand-2); }
.dot.out { background: var(--gold); }
.dot.state { background: #4b76c2; }
.recent .recent-main { flex: 1; min-width: 0; }
.recent .name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent .sub { font-size: 11.5px; color: var(--muted); }

/* 搜索与筛选 */
.search-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.search-bar input {
  flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 14px; outline: none;
}
.scan-icon-btn {
  border: 1px solid var(--line); background: #fff; color: var(--brand); border-radius: 12px;
  padding: 0 14px; font-weight: 600;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.filter-row { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1.4fr; gap: 6px; margin-bottom: 10px; }
.filter-row select, .filter-row input {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px;
  font-size: 13px; outline: none; width: 100%; min-width: 0;
}
.date-range, .price-range { display: flex; align-items: center; gap: 3px; }
.date-range input, .price-range input { padding: 8px 6px; font-size: 12px; }
.date-range input[type="date"] { font-size: 11px; }
.range-sep { color: var(--muted); font-size: 11px; flex: 0 0 auto; padding: 0 1px; user-select: none; }
.list-meta { font-size: 12px; color: var(--muted); margin: 2px 2px 8px; }

/* 商品列表 */
.item-list { display: grid; gap: 10px; }
.item-card {
  display: flex; gap: 12px; background: var(--card); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); border: 1px solid transparent;
}
.item-card:active { border-color: var(--brand-soft); }
.card-thumb {
  width: 92px; height: 92px; border-radius: 14px; flex: 0 0 auto;
  background: linear-gradient(145deg, #dcefe8, #f3efe2);
  display: grid; place-items: center; color: var(--brand);
  font-weight: 600; font-size: 24px; overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-main { flex: 1; min-width: 0; }
.item-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.item-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-code { font-size: 11.5px; color: var(--muted); margin-top: 2px; letter-spacing: .3px; }
.item-code.tag { color: var(--ink-soft); }
.item-code.inner { color: var(--muted); margin-top: 1px; }
.item-meta { font-size: 12px; color: var(--ink-soft); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }
.item-price { font-size: 15px; font-weight: 650; color: var(--gold); white-space: nowrap; }
.item-price small { font-size: 11px; color: var(--muted); font-weight: 400; }

/* 出库 / 借出表单 */
.outbound-item-card {
  display: flex; gap: 12px; padding: 12px; border-radius: 14px;
  background: #f7f5ee; border: 1px solid var(--line); margin-bottom: 12px;
}
.outbound-prices { display: flex; gap: 16px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.outbound-prices b { color: var(--gold); font-size: 13.5px; }
.section-label { font-size: 12px; color: var(--ink-soft); margin: 4px 0 8px; letter-spacing: .5px; }
.field-group {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  margin-bottom: 10px; background: #fcfbf6;
}
.field-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field-group-head span { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field-group > label { display: block; margin: 0; }
.field-group .field-row { margin: 0; }
.deposit-summary { font-size: 12px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }
.status-hint {
  margin: 10px 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--brand-soft); color: var(--brand);
}
.status-hint.error { background: var(--danger-soft); color: var(--danger); }
.confirm-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin: 10px 0; border-radius: 10px;
  background: #f5f2e8; font-size: 12.5px; color: var(--ink-soft);
}
.confirm-type {
  background: var(--brand); color: #fff; border-radius: 999px;
  padding: 2px 10px; font-size: 11.5px; font-weight: 600;
}
.bar-fill.gold { background: linear-gradient(90deg, #d9b872, #b58b3f); }
.loan-total { font-size: 12px; color: var(--muted); white-space: nowrap; }

.pill {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-2); white-space: nowrap;
}
.pill.in_stock { background: var(--brand-soft); color: var(--brand-2); }
.pill.loaned { background: var(--gold-soft); color: #8a641f; }
.pill.consignment { background: #eaf0fb; color: #3c62a8; }
.pill.out_stock { background: #f0eee8; color: #7b7a72; }

.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 13px; }
.load-more { text-align: center; margin: 12px 0; }

/* 表单 */
form label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; }
form input, form select {
  display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; padding: 10px 11px; font-size: 14px;
  color: var(--ink); outline: none;
}
form input:focus, form select:focus { border-color: var(--brand-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.code-row { display: flex; gap: 8px; }
.code-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px;
  font-size: 14px; outline: none; background: #fff;
}
.lookup-hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; min-height: 18px; }
.lookup-hint.error { color: var(--danger); }
.existing-summary {
  background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px;
  margin-bottom: 10px; color: var(--brand);
}
.photo-field { margin-top: 4px; }
.photo-btn {
  display: inline-block; margin-top: 5px; border: 1px dashed var(--brand-2); color: var(--brand-2);
  border-radius: 10px; padding: 9px 14px; font-size: 13px;
}
.photo-preview { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.photo-preview img { width: 68px; height: 68px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.inline-add { display: flex; gap: 8px; margin: -4px 0 10px; }
.inline-add input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px;
}

/* 出库 */
#outbound-item { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }

/* 底 tab */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  border: none; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 12px;
}
.tab-dot { width: 18px; height: 4px; border-radius: 999px; background: #d9d6cc; }
.tab.active { color: var(--brand); font-weight: 600; }
.tab.active .tab-dot { background: var(--brand-2); }

/* 详情抽屉 */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 22, 18, 0.45); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .22s ease-out;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.detail-cover { width: 100%; height: 190px; border-radius: 14px; background: linear-gradient(145deg, #dcefe8, #f3efe2); object-fit: cover; display: block; }
.image-manager { margin-bottom: 10px; }
.image-manager .detail-cover { margin-bottom: 8px; }
.image-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.thumb {
  flex: 0 0 auto; position: relative; width: 68px; height: 68px; border-radius: 8px;
  overflow: hidden; border: 2px solid transparent; background: #f5f5f5; cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.primary { border-color: var(--primary, #177a53); }
.thumb-actions {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  opacity: 0; transition: opacity .15s;
}
.thumb:hover .thumb-actions { opacity: 1; }
.thumb-actions button, .thumb-actions .primary-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 4px; border: none; cursor: pointer;
  background: #fff; color: #333; font-weight: 600;
}
.thumb-actions .thumb-del { background: #e74c3c; color: #fff; width: 18px; height: 18px; padding: 0; font-size: 14px; line-height: 1; }
.thumb-actions .primary-tag { background: var(--primary, #177a53); color: #fff; }
.thumb-add {
  flex: 0 0 auto; width: 68px; height: 68px; border-radius: 8px;
  border: 2px dashed #ccc; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #aaa; font-size: 28px; background: #fafafa;
}
.thumb-add:hover { border-color: var(--primary, #177a53); color: var(--primary, #177a53); background: #f0f8f4; }
.detail-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 12px 0 4px; }
.detail-title h3 { font-size: 18px; }
.detail-code { font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.detail-code.tag { color: var(--ink-soft); }
.detail-code.inner { margin-top: 3px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.detail-grid .kv { background: #fff; border-radius: 10px; padding: 9px 11px; }
.detail-grid .k { font-size: 11px; color: var(--muted); }
.detail-grid .v { font-size: 13.5px; margin-top: 1px; word-break: break-all; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.detail-actions button { flex: 1 1 auto; min-width: 30%; }
.chain-summary { display: flex; gap: 8px; margin-top: 12px; }
.chain-summary .cs {
  flex: 1; background: #fff; border-radius: 10px; padding: 8px 10px; text-align: center;
}
.chain-summary .cs b { display: block; font-size: 17px; color: var(--brand); }
.chain-summary .cs span { font-size: 11px; color: var(--muted); }

/* 时间线 */
.timeline { margin-top: 12px; position: relative; padding-left: 20px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(#cfe4da, #e7e2d6);
}
.tl-item { position: relative; padding: 0 0 16px 6px; }
.tl-item::before {
  content: ""; position: absolute; left: -18px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--brand-2); border: 2px solid #fff; box-shadow: 0 0 0 2px #d7e9e1;
}
.tl-item.out::before { background: var(--gold); box-shadow: 0 0 0 2px #f4e8cd; }
.tl-item.state::before { background: #4b76c2; box-shadow: 0 0 0 2px #dbe4f5; }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tl-title { font-size: 14px; font-weight: 600; }
.tl-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-sub { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.6; }
.tl-status { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 11px; color: var(--muted); }
.tl-status .arrow { color: #bbb; }
.tl-note { color: var(--muted); }

/* 扫码弹层 */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 14, 11, 0.72); }
.modal-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
}
#reader { width: 100%; border-radius: 14px; overflow: hidden; background: #0b1a16; min-height: 220px; }

/* 货主管理弹窗 */
.owner-panel { display: flex; flex-direction: column; gap: 10px; }
.owner-head-actions { display: flex; gap: 8px; }
.owner-toolbar { display: flex; align-items: center; gap: 10px; }
.owner-toolbar input { flex: 1; margin: 0; }
.owner-table-scroll { max-height: 46vh; overflow: auto; }
.owner-form { border-top: 1px solid var(--line); padding-top: 12px; }
.name-sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
#reader video { width: 100% !important; border-radius: 12px; }
.scan-fallback { margin-top: 12px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(15, 45, 38, 0.94); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; z-index: 60; max-width: 82vw; text-align: center;
}
.toast.error { background: rgba(150, 55, 45, 0.94); }

/* 标签打印 */
.label-preview { position: fixed; left: -9999px; top: 0; }
.label {
  width: 50mm; padding: 1mm 1.5mm; background: #fff; color: #000;
  font-family: "Courier New", monospace;
  border: 0.3mm solid #ddd; box-sizing: border-box;
}
.label-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 0 0.2mm;
}
.label-owner {
  font-size: 28pt; font-weight: 900; letter-spacing: -0.5px; line-height: 1;
}
.label-cat {
  font-size: 13pt; font-weight: 700; line-height: 1;
}
.label-barcode { margin: 0.3mm 0; }
.label-barcode svg { width: 100%; height: auto; display: block; }
.label-short {
  font-size: 14pt; font-weight: 800; letter-spacing: -1px;
  padding-top: 0.2mm; line-height: 1;
  white-space: nowrap;
}

/* 侧栏基础（移动端隐藏） */
.sidebar { display: none; }
.topbar-title { display: none; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-clock { display: none; color: rgba(244, 239, 226, 0.7); font-size: 12.5px; }
.tabbar { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .data-table { min-width: 660px; }
  .owner-table-scroll .data-table { min-width: 520px; }
}

@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head .seg { align-self: stretch; justify-content: center; }
}

/* ============ 桌面端布局 ============ */
@media (min-width: 1024px) {
  body { padding: 0 0 0 236px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 22px;
    position: fixed; top: 0; bottom: 0; left: 0; width: 236px; z-index: 35;
    padding: 22px 14px 18px; color: #efe9d9;
    background: linear-gradient(170deg, #0c3128 0%, #114333 55%, #0d2e26 100%);
    box-shadow: 2px 0 16px rgba(12, 34, 27, 0.18);
  }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
  .side-brand .brand-mark { width: 40px; height: 40px; }
  .side-brand .brand-title { font-size: 18px; letter-spacing: 3px; }
  .side-brand .brand-sub { font-size: 11px; opacity: 0.66; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-item {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    border: none; background: transparent; color: rgba(239, 233, 217, 0.72);
    padding: 11px 12px; border-radius: 10px; font-size: 14px;
    transition: background .16s ease, color .16s ease;
  }
  .side-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
  .side-item.active { background: rgba(255, 255, 255, 0.13); color: #fff; font-weight: 600; }
  .si-ico {
    width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.08); font-size: 13px;
  }
  .side-item.active .si-ico { background: #2f9576; }
  .side-foot {
    margin-top: auto; padding: 12px 8px 0; font-size: 11.5px; letter-spacing: .5px;
    border-top: 1px solid rgba(255, 255, 255, 0.12); color: rgba(239, 233, 217, 0.45);
  }
  .side-group {
    margin: 14px 6px 2px; font-size: 11.5px; letter-spacing: .18em;
    color: rgba(239, 233, 217, 0.4);
  }
  .topbar { position: sticky; padding: 0 32px; height: 64px; }
  .topbar .brand { display: none; }
  .topbar-title { display: block; font-size: 17px; font-weight: 600; letter-spacing: 1px; }
  .topbar-clock { display: inline; }
  .tabbar { display: none; }
  .view { max-width: 1400px; margin: 0 auto; padding: 22px 32px 36px; }
  .page-head { margin-top: 0; }
  .page-head h2 { font-size: 22px; }
  .card { padding: 18px 20px; margin-bottom: 14px; }
  .card-head h2 { font-size: 16.5px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .stat { padding: 18px; }
  .stat .value { font-size: 30px; }
  .quick-row { grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 780px; }
  #quick-customers { grid-column: auto; }
  .quick-btn { justify-content: flex-start; padding: 14px 16px; }
  .dash-grid { grid-template-columns: 1.75fr 1fr; gap: 14px; }
  .item-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-thumb { width: 96px; height: 96px; }
  .detail-cover { height: 260px; }
  .sheet-panel {
    left: auto; right: 0; top: 0; bottom: 0; width: 540px; max-height: 100vh;
    border-radius: 0; padding: 18px 22px 28px; animation: slideLeft .22s ease-out;
  }
  .modal-panel {
    left: 50%; right: auto; top: 50%; bottom: auto; width: 560px; max-height: 86vh;
    border-radius: 18px; padding: 18px 20px; transform: translate(-50%, -50%);
    box-shadow: 0 18px 60px rgba(6, 14, 11, 0.35);
  }
  #scan-modal .modal-panel { width: 640px; }
  .owner-panel { width: 760px; }
  .batch-out-panel { width: 680px; }
  .toast { bottom: 32px; }
}

@keyframes slideLeft { from { transform: translateX(24px); opacity: .5; } to { transform: none; opacity: 1; } }

@media print {
  body { padding: 0; background: #fff; }
  body > * { display: none !important; }
  .print-area { display: block !important; }
  @page { margin: 0; }
}

/* ============ 登录层 ============ */
.login-layer {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 30% 20%, #17483a 0%, #0a231c 60%, #07170f 100%);
}
.login-card {
  width: 100%; max-width: 360px; background: var(--card); border-radius: 20px;
  padding: 26px 22px 20px; box-shadow: 0 22px 64px rgba(0, 0, 0, 0.4);
}
.login-brand { display: flex; justify-content: center; margin-bottom: 8px; }
.login-brand .brand-mark { width: 46px; height: 46px; font-size: 22px; }
.login-card h2 {
  margin: 0; text-align: center; font-size: 19px; letter-spacing: 2px; color: var(--brand);
}
.login-sub { margin: 6px 0 18px; text-align: center; font-size: 12.5px; color: var(--muted); }
.login-card label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; }
.login-card input {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #faf8f2; color: var(--ink);
}
.login-card select {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #faf8f2; color: var(--ink);
}
.pw-wrap { position: relative; margin-top: 5px; }
.pw-wrap input { padding-right: 40px; margin-top: 0; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; background: transparent; cursor: pointer;
  color: var(--muted); padding: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.pw-toggle:hover { color: var(--brand); background: rgba(0,0,0,0.04); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.visible .eye-eye { display: none; }
.pw-toggle.visible .eye-off { display: block; }
.login-card input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
.login-error {
  margin: 4px 0 10px; font-size: 12.5px; color: var(--danger);
  background: var(--danger-soft); padding: 8px 10px; border-radius: 8px;
}
.login-foot { margin: 14px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); }

/* ============ 账号弹窗 ============ */
.account-panel { display: flex; flex-direction: column; gap: 12px; }
.account-info {
  background: var(--brand-soft); border-radius: 12px; padding: 12px 14px;
}
.account-name { font-size: 16px; font-weight: 700; color: var(--brand); }
.account-role { margin-top: 3px; font-size: 12.5px; color: var(--ink-soft); }

/* ============ 货主明细页 ============ */
.bar-row.clickable { cursor: pointer; border-radius: 8px; padding: 4px 6px; margin: 0 -6px; transition: background .15s ease; }
.bar-row.clickable:hover { background: var(--brand-soft); }
.owner-head { display: flex; align-items: center; gap: 14px; }
.page-picker { margin-left: auto; max-width: 220px; }
.owner-title { min-width: 0; }
.owner-title h2 { margin: 0; font-size: 19px; letter-spacing: -.2px; }
.owner-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.owner-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 12px 0; }
#borrower-stats { grid-template-columns: repeat(4, 1fr); }
.owner-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.owner-tile .ot-label { font-size: 12px; color: var(--muted); }
.owner-tile .ot-value { font-size: 22px; font-weight: 650; color: var(--ink); margin-top: 4px; letter-spacing: -.5px; }
.owner-tile .ot-value small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.owner-tile .ot-cost { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.owner-tile.total { background: linear-gradient(180deg, #f6fbf8 0%, var(--card) 72%); border-color: #cfe6dc; }
.owner-tile.loaned { background: linear-gradient(180deg, #fdf8f5 0%, var(--card) 72%); }
.owner-tile.consignment { background: linear-gradient(180deg, #fdfaf2 0%, var(--card) 72%); }
@media (max-width: 700px) {
  .owner-stats { grid-template-columns: repeat(2, 1fr); }
  #borrower-stats { grid-template-columns: repeat(2, 1fr); }
  #borrower-stats .owner-tile.total { grid-column: auto; }
  .owner-tile.total { grid-column: span 2; }
}

/* ============ 出入库明细（单日） ============ */
.daily-head { flex-wrap: wrap; }
.daily-datebar { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.daily-datebar input[type="date"] { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 13px; color: var(--ink); background: var(--card); }
.owner-tile.in { background: linear-gradient(180deg, #f6fbf8 0%, var(--card) 72%); }
.owner-tile.out { background: linear-gradient(180deg, #fdfaf2 0%, var(--card) 72%); }
.owner-tile.deposit { background: linear-gradient(180deg, #f7f9fd 0%, var(--card) 72%); }
.owner-tile.moves { background: linear-gradient(180deg, #faf8f6 0%, var(--card) 72%); }
.daily-list { display: flex; flex-direction: column; }
.daily-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px dashed var(--line); }
.daily-row:last-child { border-bottom: 0; }
.dr-main { min-width: 0; }
.dr-title { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dr-code { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; letter-spacing: .3px; }
.dr-code.tag { color: var(--ink-soft); }
.dr-code.inner { color: var(--muted); margin-top: 1px; }
.dr-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.dr-right { text-align: right; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.dr-right span { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.chip.tiny { padding: 1px 7px; font-size: 10.5px; }
@media (max-width: 700px) {
  .daily-datebar { margin-left: 0; width: 100%; flex-wrap: wrap; }
}

/* ============ 下拉框统一圆润样式 ============ */
select,
.filter-row select,
form select,
.page-picker {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%237b8a82' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 11px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 34px 9px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
select:hover,
.filter-row select:hover,
form select:hover,
.page-picker:hover { border-color: var(--brand-2); background-color: #fbfdfc; }
select:focus,
.filter-row select:focus,
form select:focus,
.page-picker:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(15, 61, 50, 0.1);
}
select:disabled { opacity: 0.55; cursor: not-allowed; }
select option { color: var(--ink); }

/* ============ 商品入库入口 ============ */
.entry-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.entry-actions > button { min-width: 150px; }
.entry-lookup { margin-top: 2px; }
@media (max-width: 700px) {
  .entry-actions > button { flex: 1 1 140px; min-width: 0; }
}

/* ============ 批量出库 ============ */
.batch-toolbar { display: flex; gap: 10px; align-items: center; margin: 12px 0 8px; }
.batch-toolbar input { flex: 1; }
.batch-list {
  max-height: 300px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfaf6;
}
.batch-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background .15s ease;
}
.batch-row:last-child { border-bottom: 0; }
.batch-row:hover { background: #f2f7f4; }
.batch-row input[type="checkbox"] {
  width: 17px; height: 17px; flex: none; margin: 0;
  accent-color: var(--brand-2); cursor: pointer;
}
.br-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.br-main b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.br-main em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.br-price { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.batch-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.batch-count { font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* ============ Todo 待办 ============ */
.side-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.5;
  min-width: 18px;
  text-align: center;
}

/* 右下角浮层 */
.todo-alert {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 50;
  animation: todoSlideIn .3s ease-out;
}
@keyframes todoSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.todo-alert-inner {
  position: relative;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(18, 35, 30, 0.18);
  border: 1px solid var(--line);
  border-left: 4px solid var(--danger);
  padding: 16px 16px 14px;
}
.todo-alert-close {
  position: absolute;
  top: 8px; right: 10px;
  width: 24px; height: 24px;
  border: none; background: transparent;
  color: var(--muted); font-size: 18px;
  line-height: 1; border-radius: 6px;
}
.todo-alert-close:hover { background: var(--bg); color: var(--ink); }
.todo-alert-icon {
  font-size: 22px;
  margin-bottom: 6px;
}
.todo-alert-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.todo-alert-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.todo-alert-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* Todo 列表页 */
.todo-summary {
  margin-bottom: 16px;
}
.todo-summary-warn, .todo-summary-ok {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid;
}
.todo-summary-warn {
  background: var(--danger-soft);
  border-color: #f3cdc8;
}
.todo-summary-ok {
  background: var(--brand-soft);
  border-color: #cfe5dc;
}
.todo-summary-icon {
  font-size: 28px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  flex: none;
}
.todo-summary-warn .todo-summary-icon { background: rgba(180, 69, 58, 0.15); }
.todo-summary-ok .todo-summary-icon { background: rgba(31, 122, 94, 0.15); }
.todo-summary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.todo-summary-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.todo-list { display: flex; flex-direction: column; gap: 16px; }
.todo-group { }
.todo-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.todo-group-icon { font-size: 15px; }
.todo-group-title { flex: 1; }
.todo-group-count {
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 1px 8px;
  border-radius: 10px;
}
.todo-group-list { display: flex; flex-direction: column; gap: 8px; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.todo-item:hover {
  border-color: var(--brand-2);
  box-shadow: 0 2px 8px rgba(15, 61, 50, 0.06);
}
.todo-item-thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  flex: none;
  display: flex; align-items: center; justify-content: center;
}
.todo-item-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.todo-thumb-empty {
  font-size: 22px;
  opacity: 0.35;
}
.todo-item-info { flex: 1; min-width: 0; }
.todo-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.todo-item-meta {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  flex-wrap: wrap;
}
.todo-item-category {
  color: var(--brand-2);
  font-weight: 500;
}
.todo-item-detail {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.todo-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}

/* ============ 标签模板管理 ============ */
.lt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.lt-card {
  background: #fff;
  border: 1px solid #e5ede8;
  border-radius: 12px;
  padding: 16px 18px;
  transition: all .15s;
}
.lt-card:hover { border-color: #177a53; box-shadow: 0 2px 10px rgba(23,122,83,.08); }
.lt-default { border-color: #e8c866; background: #fffaf0; }

.lt-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.lt-title {
  font-size: 15px; font-weight: 600; color: #0f5a3d;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.lt-default-tag {
  background: #e8c866; color: #3b2f00; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 4px;
}
.lt-builtin-tag {
  background: #e6f5ec; color: #177a53; font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 4px; border: 1px solid #b8d8c5;
}
.lt-actions { display: flex; gap: 6px; flex-shrink: 0; }
.lt-actions .danger-btn { border-color: #d9534f; color: #d9534f; background: #fff; }

.lt-meta {
  font-size: 12px; color: #6b847b; margin: 8px 0 10px;
}
.lt-preview {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12px;
}
.lt-fld {
  padding: 2px 8px; border-radius: 10px; font-weight: 600;
}
.lt-fld.on  { background: #e6f5ec; color: #0f5a3d; border: 1px solid #b8d8c5; }
.lt-fld.off { background: #f3f5f4; color: #999; text-decoration: line-through; }
.lt-scale { color: #7c9188; font-size: 11px; margin-left: auto; }

.lt-editor-panel { max-width: 520px; }
.lt-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0;
}
.lt-switches {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 8px 0; padding: 12px; background: #f3f7f5; border-radius: 8px;
}
.lt-switches label {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: #16302a;
  cursor: pointer;
}
.lt-switches input[type="checkbox"] { accent-color: #177a53; }

/* 移动端适配 */
@media (max-width: 640px) {
  .todo-alert {
    right: 12px;
    left: 12px;
    bottom: 76px;
  }
  .todo-alert-inner {
    width: auto;
  }
  .todo-item-actions {
    flex-direction: row;
  }
}

/* Todo 类型颜色区分 */
.todo-item.todo-type-danger {
  border-left: 4px solid var(--danger);
  background: linear-gradient(to right, #fef6f5, #ffffff 40%);
}
.todo-item.todo-type-warn {
  border-left: 4px solid var(--gold);
  background: linear-gradient(to right, #fdf8ec, #ffffff 40%);
}

/* 状态标签 */
.todo-status-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
}
.todo-status-tag.status-loaned { background: #fbeae8; color: var(--danger); }
.todo-status-tag.status-consignment { background: var(--gold-soft); color: #8a6420; }
.todo-status-tag.status.in_stock { background: var(--brand-soft); color: var(--brand-2); }
.todo-status-tag.status.out_stock { background: var(--bg); color: var(--muted); }

.todo-owner-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 8px;
  margin-left: 4px;
  background: var(--blue-soft);
  color: #2b5797;
  vertical-align: middle;
}

