/* ============================================================
 * 卖货账本 · 新中式账本视觉
 * 宣纸底 / 墨色字 / 朱砂红强调 / 印章徽章 / 虚线账格
 * ============================================================ */

:root {
  --paper: #f4efe3;
  --paper-2: #ece5d3;
  --card: #fdfaf1;
  --ink: #2a2520;
  --ink-2: #6f6557;
  --ink-3: #9c9180;
  --line: #e0d6bf;
  --line-2: #d3c7ab;
  --red: #b3402f;
  --red-deep: #8f3123;
  --red-soft: #f6e3dd;
  --green: #3e6b4f;
  --green-soft: #e2ecdd;
  --amber: #a8720f;
  --amber-soft: #f4ead2;
  --gray-soft: #e7e2d6;
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", "宋体", serif;
  --sans: -apple-system, "PingFang SC", "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --shadow: 0 1px 2px rgba(74, 60, 34, 0.07), 0 2px 8px rgba(74, 60, 34, 0.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px; line-height: 1.5;
  overscroll-behavior-y: none;
}
/* 宣纸颗粒 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.16 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

input, button, select { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
b { font-weight: 700; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.num-profit, .pos { color: var(--red); }
.neg { color: var(--ink-2); }

/* ---------- 布局 ---------- */
.app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100dvh; }
.page { padding: 14px 14px calc(76px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 14px; }
.page-title { font-family: var(--serif); font-size: 22px; letter-spacing: 0.06em; font-weight: 700; }
.head-note { font-size: 11px; color: var(--ink-3); letter-spacing: 0.05em; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 0.08em; }
.logo-seal {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fdf6e9; font-family: var(--serif); font-size: 20px; font-weight: 700;
  border-radius: 9px; transform: rotate(-4deg);
  box-shadow: inset 0 0 0 2px rgba(253, 246, 233, 0.35), 0 2px 6px rgba(143, 49, 35, 0.35);
}

/* ---------- 通用卡片 / 标签 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.sec-label { font-size: 12px; color: var(--ink-3); letter-spacing: 0.12em; margin: 16px 4px 8px; }
.empty-inline { text-align: center; color: var(--ink-3); font-size: 13px; padding: 22px 0; }

/* 印章状态徽章（替代手工涂色） */
.seal {
  display: inline-block; font-family: var(--serif); font-size: 11px; line-height: 17px;
  padding: 0 5px; border: 1.5px solid currentColor; border-radius: 4px;
  transform: rotate(-3deg); letter-spacing: 0.1em; white-space: nowrap;
}
.seal-lg { font-size: 14px; line-height: 24px; padding: 0 9px; margin: 10px 2px; }
.st-ok { color: var(--green); }
.st-low { color: var(--amber); background: var(--amber-soft); }
.st-out { color: var(--ink-3); background: var(--gray-soft); }
.st-pause { color: var(--ink-3); border-style: dashed; }

/* ---------- 按钮 ---------- */
.btn {
  display: block; width: 100%; padding: 13px 16px; margin: 10px 0 0;
  border-radius: 12px; font-size: 16px; font-weight: 700;
  font-family: var(--serif); letter-spacing: 0.2em; text-align: center;
  transition: transform 0.08s ease, opacity 0.15s;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn-red { background: var(--red); color: #fdf6e9; box-shadow: 0 3px 10px rgba(143, 49, 35, 0.3); }
.btn-green { background: var(--green); color: #f2f6ee; box-shadow: 0 3px 10px rgba(62, 107, 79, 0.3); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-plain { background: transparent; border: 1.5px solid var(--line-2); color: var(--ink); }
.btn.sm { padding: 10px 14px; font-size: 14px; letter-spacing: 0.1em; }
.btn-big { font-size: 17px; padding: 15px; }
.text-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--red); font-size: 14px; font-weight: 600; }
.text-btn svg { width: 16px; height: 16px; }
.icon-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); border-radius: 50%; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 520px); z-index: 40;
  display: flex; background: rgba(253, 250, 241, 0.94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 7px; color: var(--ink-3); position: relative; }
.tab svg { width: 22px; height: 22px; }
.tab-label { font-size: 10px; letter-spacing: 0.15em; }
.tab.on { color: var(--red); }
.tab.on::before {
  content: ""; position: absolute; top: 0; width: 18px; height: 3px; border-radius: 0 0 3px 3px; background: var(--red);
}
.tab.on .tab-label { font-family: var(--serif); font-weight: 700; }

/* ---------- 首页：今日小结 ---------- */
.today { display: flex; align-items: center; padding: 14px 6px; margin-bottom: 12px; }
.today-item { flex: 1; text-align: center; }
.today-num { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.today-label { font-size: 11px; color: var(--ink-3); margin-top: 2px; letter-spacing: 0.08em; }
.today-div { width: 1px; align-self: stretch; margin: 2px 0; background-image: linear-gradient(var(--line-2) 55%, transparent 55%); background-size: 1px 7px; }

/* ---------- 搜索 ---------- */
.searchbox { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.search-ico svg { width: 18px; height: 18px; color: var(--ink-3); display: block; }
.searchbox input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; }
.search-clear svg { width: 16px; height: 16px; color: var(--ink-3); }

/* ---------- 最近使用 chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { min-width: 118px; padding: 9px 10px 8px; flex-shrink: 0; }
.chip-model { font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: 0.03em; }
.chip-name { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-btns { display: flex; gap: 6px; margin-top: 7px; }
.chip-btn { flex: 1; font-size: 12px; font-weight: 700; padding: 4px 0; border-radius: 7px; }
.cb-out { color: var(--red); border: 1px solid rgba(179, 64, 47, 0.45); background: var(--red-soft); }
.cb-in { color: var(--green); border: 1px solid rgba(62, 107, 79, 0.4); background: var(--green-soft); }

/* ---------- 商品行 ---------- */
.prow { display: flex; align-items: center; justify-content: space-between; padding: 12px 13px; margin-bottom: 8px; }
.prow-main { display: flex; align-items: center; gap: 7px; min-width: 0; }
.prow-model { font-family: var(--serif); font-weight: 700; font-size: 16px; letter-spacing: 0.02em; }
.prow-name { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.prow-side { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.prow-stock { font-size: 19px; font-weight: 700; }
.prow-stock.st-low { color: var(--amber); }
.prow-stock.st-out, .prow-stock.st-pause { color: var(--ink-3); }
.prow-price { font-size: 12px; color: var(--ink-2); }

/* ---------- 分段/筛选 ---------- */
.seg { display: flex; background: var(--paper-2); border-radius: 11px; padding: 3px; margin: 4px 0 10px; }
.seg button { flex: 1; padding: 9px 0; border-radius: 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; letter-spacing: 0.1em; }
.seg.small button { padding: 6px 0; font-size: 12px; }
.seg.wrap { flex-wrap: wrap; overflow-x: auto; }
.seg.wrap button { flex: 0 0 auto; padding: 6px 13px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg button.on-out { color: var(--red); }
.seg button.on-in { color: var(--green); }
.seg button.on-ret { color: var(--amber); }

/* ---------- 开屏引导 ---------- */
.onboard { text-align: center; padding: 46px 8px 0; }
.onboard-seal {
  width: 74px; height: 74px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fdf6e9; font-family: var(--serif); font-size: 40px; font-weight: 700;
  border-radius: 16px; transform: rotate(-5deg);
  box-shadow: inset 0 0 0 3px rgba(253, 246, 233, 0.35), 0 6px 18px rgba(143, 49, 35, 0.35);
}
.onboard-title { font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: 0.2em; }
.onboard-sub { font-size: 13px; color: var(--ink-2); line-height: 1.9; margin: 12px 0 26px; }

/* ---------- 表单 ---------- */
.form-card { padding: 4px 14px; margin-top: 6px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px dashed var(--line); }
.frow:last-of-type { border-bottom: none; }
.frow label { width: 82px; flex-shrink: 0; font-size: 13px; color: var(--ink-2); }
.frow input, .frow select { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 16px; }
.frow input[type="radio"], .frow input[type="checkbox"] { flex: none; width: 18px; height: 18px; accent-color: var(--red); }
.num-input { max-width: 70px; text-align: right; }
.frow-unit { font-size: 12px; color: var(--ink-3); flex-shrink: 0; }
.frow-col { flex-direction: column; align-items: stretch; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.frow-hint { font-size: 12px; color: var(--ink-3); }
.frow-big { padding: 16px 2px; }
.frow-big input { font-size: 24px; font-family: var(--serif); font-weight: 700; text-align: center; }

.qty-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.qty-btn { width: 46px; height: 46px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.qty-btn svg { width: 20px; height: 20px; }
.qty-input { flex: 1; min-width: 0; height: 46px; text-align: center; font-size: 26px; font-family: var(--serif); font-weight: 700; background: var(--card); border: 1px solid var(--line); border-radius: 12px; outline: none; }
.qty-quick { width: 40px; height: 34px; border-radius: 9px; border: 1px dashed var(--line-2); color: var(--ink-2); font-size: 13px; font-weight: 600; }

.profit-line { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px 4px; font-size: 13px; color: var(--ink-2); }
.profit-line b { font-size: 18px; }
.warn-line { margin: 10px 2px 0; font-size: 13px; color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(168, 114, 15, 0.3); border-radius: 10px; padding: 9px 12px; }

/* ---------- 流水 ---------- */
.day-group { margin-bottom: 16px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 7px; }
.day-title { font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: 0.05em; }
.day-agg { font-size: 12px; color: var(--ink-2); }
.trow { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 7px; }
.tchip { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fdf6e9; font-family: var(--serif); font-size: 13px; font-weight: 700; transform: rotate(-3deg); }
.t-out { background: var(--red); }
.t-in { background: var(--green); }
.t-ret { background: var(--amber); }
.t-adj { background: var(--ink-3); }
.trow-main { flex: 1; min-width: 0; }
.trow-line1 { display: flex; gap: 6px; align-items: baseline; }
.trow-model { font-weight: 700; font-size: 14px; }
.trow-name { font-size: 11px; color: var(--ink-3); }
.trow-line2 { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-side { text-align: right; flex-shrink: 0; }
.trow-qty { display: block; font-size: 14px; font-weight: 700; }
.trow-profit { display: block; font-size: 12px; color: var(--red); }
.trow-profit.neg { color: var(--ink-2); }
.trow-after { display: block; font-size: 10px; color: var(--ink-3); }
.load-more { margin-top: 4px; }

/* ---------- 详情 ---------- */
.detail-stats { display: flex; padding: 13px 4px; margin-bottom: 4px; }
.ds-item { flex: 1; text-align: center; }
.ds-num { font-size: 18px; font-weight: 700; }
.ds-label { font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.act-btn { padding: 11px 0; border-radius: 11px; border: 1.5px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--ink); background: var(--card); }
.act-btn:active { opacity: 0.7; }
.act-out { background: var(--red); border-color: var(--red); color: #fdf6e9; font-family: var(--serif); font-weight: 700; letter-spacing: 0.15em; }
.act-in { background: var(--green); border-color: var(--green); color: #f2f6ee; font-family: var(--serif); font-weight: 700; letter-spacing: 0.15em; }
.act-danger { color: var(--red-deep); border-color: rgba(143, 49, 35, 0.4); }
.hrow { display: flex; align-items: center; gap: 9px; padding: 9px 4px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.hrow-date { color: var(--ink-2); font-size: 12px; }
.hrow-qty { font-weight: 700; }
.hrow-profit { color: var(--red); margin-left: auto; }
.hrow-profit.neg { color: var(--ink-2); }
.hrow-after { color: var(--ink-3); font-size: 11px; width: 44px; text-align: right; }

/* ---------- 报表 ---------- */
.custom-range { display: flex; gap: 12px; padding: 10px 14px; margin-bottom: 10px; }
.custom-range label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.custom-range input { border: 1px solid var(--line-2); border-radius: 8px; background: transparent; padding: 4px 6px; font-size: 14px; }
.report-hero { padding: 18px 16px 14px; text-align: center; margin-bottom: 4px; }
.report-hero-label { font-size: 12px; color: var(--ink-3); letter-spacing: 0.3em; }
.report-hero-num { font-family: var(--serif); font-size: 38px; font-weight: 700; color: var(--red); margin: 2px 0 12px; }
.report-hero-num.neg { color: var(--ink-2); }
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 0; border-top: 1px dashed var(--line); padding-top: 12px; }
.rg-num { font-size: 15px; font-weight: 700; }
.rg-label { font-size: 10px; color: var(--ink-3); margin-top: 1px; }
.report-hint { font-size: 11px; color: var(--amber); margin-top: 10px; }
.rank { display: flex; align-items: center; gap: 11px; padding: 11px 13px; margin-bottom: 7px; }
.rank-no { width: 26px; height: 26px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--line-2); border-radius: 6px; font-family: var(--serif); font-weight: 700; font-size: 13px; color: var(--ink-2); transform: rotate(-3deg); }
.rank-no.top { background: var(--red); border-color: var(--red); color: #fdf6e9; }
.rank-main { flex: 1; min-width: 0; }
.rank-model { font-weight: 700; font-size: 14px; }
.rank-name { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.rank-sub { font-size: 11px; color: var(--ink-2); }
.rank-profit { font-weight: 700; color: var(--red); font-size: 15px; }
.rank-profit.neg { color: var(--ink-2); }

/* ---------- 设置 ---------- */
.tips-card { padding: 12px 14px; }
.tip { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-bottom: 6px; }
.about { display: flex; align-items: center; gap: 12px; margin: 26px 0 6px; }
.about-line { flex: 1; height: 1px; background-image: linear-gradient(var(--line-2) 55%, transparent 55%); background-size: 1px 5px; background-repeat: repeat-x; }
.deerflow-mark { font-size: 11px; color: var(--ink-3); text-decoration: none; opacity: 0.75; letter-spacing: 0.05em; }

/* ---------- 弹层 ---------- */
.sheet-mask, .dlg-mask { position: fixed; inset: 0; z-index: 60; background: rgba(42, 37, 32, 0.45); display: flex; justify-content: center; }
.sheet-mask { align-items: flex-end; }
.dlg-mask { align-items: center; padding: 24px; }
.sheet {
  width: min(100%, 520px); max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes up { from { transform: translateY(40%); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.sheet-title { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: 0.06em; }
.sheet-sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.sheet-body { overflow-y: auto; padding-bottom: 4px; }
.dlg { width: min(100%, 320px); background: var(--card); border-radius: 16px; padding: 20px 18px 14px; animation: pop 0.18s ease; }
@keyframes pop { from { transform: scale(0.92); opacity: 0.5; } to { transform: none; opacity: 1; } }
.dlg-title { font-family: var(--serif); font-size: 17px; font-weight: 700; text-align: center; letter-spacing: 0.1em; }
.dlg-msg { font-size: 13px; color: var(--ink-2); line-height: 1.7; text-align: center; margin: 10px 0 16px; }
.dlg-btns { display: flex; gap: 10px; }
.dlg-btn { flex: 1; margin: 0; padding: 11px !important; font-size: 14px !important; }

/* ---------- 吐司 ---------- */
.toast {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 80; max-width: 86%; display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper); font-size: 13px;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 6px 20px rgba(42, 37, 32, 0.35);
}
.toast-act { color: #e8b4a4; font-weight: 700; white-space: nowrap; }
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ---------- 空状态 / 开机 ---------- */
.c-empty { text-align: center; padding: 40px 16px; color: var(--ink-3); font-size: 13px; line-height: 2; }
.boot { height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.boot-seal { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: var(--red); color: #fdf6e9; font-family: var(--serif); font-size: 34px; font-weight: 700; border-radius: 14px; transform: rotate(-5deg); box-shadow: inset 0 0 0 3px rgba(253, 246, 233, 0.35); }
.boot-text { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 0.25em; }
.boot-sub { font-size: 12px; color: var(--ink-3); }

/* ---------- 导入向导 ---------- */
.dropzone { display: block; border: 2px dashed var(--line-2); border-radius: 14px; background: var(--paper); text-align: center; padding: 34px 16px; margin-top: 8px; }
.dropzone input { display: none; }
.dz-ico { font-size: 30px; color: var(--red); }
.dz-main { font-family: var(--serif); font-size: 16px; font-weight: 700; margin-top: 8px; }
.dz-sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.7; }
.imp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 6px 0 4px; }
.imp-stat { text-align: center; padding: 10px 2px; }
.imp-stat b { display: block; font-size: 18px; }
.imp-stat span { font-size: 10px; color: var(--ink-3); }
.map-box { margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; background: var(--paper); }
.map-box summary { font-size: 13px; color: var(--ink-2); cursor: pointer; }
.map-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.map-label { width: 70px; font-size: 13px; color: var(--ink-2); }
.map-row select { flex: 1; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); padding: 5px 8px; font-size: 14px; }
.imp-mode .radio-row { display: flex; align-items: center; gap: 9px; padding: 8px 4px; font-size: 13px; }
.imp-mode input { width: 17px; height: 17px; accent-color: var(--red); }
.imp-warn { margin: 8px 0; }
.imp-warn-item { font-size: 12px; color: var(--amber); background: var(--amber-soft); border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; line-height: 1.6; }
.imp-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.imp-tag { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 12px; font-weight: 700; font-family: var(--serif); transform: rotate(-3deg); }
.tag-new { background: var(--red); color: #fdf6e9; }
.tag-upd { background: var(--gray-soft); color: var(--ink-2); border: 1px dashed var(--ink-3); }
.imp-model { font-weight: 700; }
.imp-name { color: var(--ink-3); font-size: 12px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-stock { font-size: 12px; color: var(--ink-2); }
.imp-done { text-align: center; padding: 30px 0 8px; }
.imp-done-ico { width: 58px; height: 58px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; background: var(--green); color: #f2f6ee; font-size: 28px; border-radius: 50%; }
.imp-done-title { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 0.15em; }
.imp-done-sub { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.8; }
.imp-err { font-size: 13px; color: var(--red-deep); background: var(--red-soft); border-radius: 10px; padding: 12px 14px; margin: 8px 0; line-height: 1.7; }
.adjust-now { font-size: 13px; color: var(--ink-2); margin: 6px 0 4px; }
.adjust-diff { font-size: 13px; color: var(--amber); margin-top: 8px; }

/* ---------- 表格模式（像 Excel 一样直接改） ---------- */
.head-btns { display: flex; align-items: center; gap: 14px; }
.grid-hint { font-size: 11px; color: var(--ink-3); margin: 0 2px 8px; line-height: 1.6; }
.xtable { padding: 2px 10px; }
.xrow { display: flex; align-items: center; gap: 7px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.xrow:last-child { border-bottom: none; }
.xhead { color: var(--ink-3); font-size: 11px; border-bottom: 1px solid var(--line); padding: 7px 0 5px; letter-spacing: 0.1em; }
.x-model { flex: 1.5; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.x-model b { font-family: var(--serif); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-model i { font-style: normal; font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-num { flex: 1; text-align: center; font-size: 14px; min-width: 0; }
.x-in { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 7px 2px; width: 100%; outline: none; }
.x-in:focus { border-color: var(--red); background: var(--card); }

/* ---------- 桌面宽度时给点呼吸 ---------- */
@media (min-width: 560px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100dvh; }
}
