/* ============================================================
   印盟 · 报价与客户
   ============================================================ */

:root {
  --bg: #f4f6f3;
  --card: #ffffff;
  --ink: #15211b;
  --ink2: #3c4a43;
  --muted: #7c8880;
  --line: #e3e8e2;
  --line2: #eef1ed;
  --brand: #146b46;
  --brand-dark: #0f5637;
  --brand-soft: #e9f3ed;
  --amber: #b3752d;
  --amber-soft: #fbf1e2;
  --danger: #b24141;
  --danger-soft: #fbeceb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 40, 30, .04), 0 10px 30px rgba(21, 40, 30, .055);
  --shadow-sm: 0 1px 2px rgba(21, 40, 30, .06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.r { text-align: right; }

/* ============================ 登录 ============================ */

.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--card);
}

.login-art {
  background: radial-gradient(120% 90% at 10% 0%, #1c7d55 0%, #146b46 42%, #0d4a31 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 8vh 8%;
  position: relative;
  overflow: hidden;
}

.login-art::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% -10%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .14), transparent 70%);
}

.la-inner { position: relative; z-index: 1; max-width: 380px; }

.la-logo {
  width: 54px; height: 54px; border-radius: 15px;
  display: grid; place-items: center;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 30px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  margin-bottom: 26px;
}

.login-art h2 {
  font-size: 30px;
  letter-spacing: .5px;
  font-weight: 600;
}

.login-art p {
  margin-top: 8px;
  color: rgba(255, 255, 255, .7);
  letter-spacing: 3px;
  font-size: 13px;
}

.la-random {
  display: inline-block;
  margin-top: 34px !important;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1);
  color: #fff !important;
  font-size: 13px !important;
  letter-spacing: 1px !important;
  min-height: 36px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.la-list { margin-top: 40px; display: grid; gap: 14px; }
.la-list li {
  color: rgba(255, 255, 255, .82);
  font-size: 13.5px;
  padding-left: 22px;
  position: relative;
}
.la-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .55);
}

.login-form {
  display: grid;
  place-items: center;
  padding: 6vh 8%;
  background: var(--card);
}

.lcard { width: 100%; max-width: 330px; }

.lm-brand { display: none; align-items: center; gap: 10px; margin-bottom: 30px; }
.lm-brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 22px;
}
.lm-brand b { display: block; font-size: 15px; letter-spacing: .3px; }
.lm-brand small { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: 1px; margin-top: 2px; }
.lcard h1 { font-size: 22px; font-weight: 600; }
.lsub { color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.lerr { color: var(--danger); font-size: 13px; margin-top: 12px; }

/* ============================ 字段 ============================ */

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .3px;
}

input[type=text], input[type=password], input[type=number], input[type=date],
input:not([type]), select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20, 107, 70, .1);
}

input::placeholder, textarea::placeholder { color: #a9b3ac; }

/* ============================ 按钮 ============================ */

.btn {
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .06s, color .15s;
}
.btn:hover { background: #f7f9f6; border-color: #d5dcd4; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f1f4f0; color: var(--ink); }
.btn.danger { color: var(--danger); border-color: #f0d6d4; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.block { width: 100%; height: 42px; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12.5px;
}
.linkbtn:hover { color: var(--brand); }

/* ============================ 布局 ============================ */

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
}

.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 19px;
}

.bname { font-size: 15.5px; letter-spacing: .5px; font-weight: 600; }
.bname em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }

.nav { display: grid; gap: 3px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink2);
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.nav a:hover { background: #f5f8f4; }
.nav a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }
.nav a.on svg { opacity: 1; }

.side-foot {
  margin-top: auto;
  border-top: 1px solid var(--line2);
  padding: 14px 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.who { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink2); min-width: 0; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3fae73; flex: none; box-shadow: 0 0 0 3px rgba(63, 174, 115, .15); }

.main { min-width: 0; padding: 0 0 60px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 246, 243, .88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 18px 34px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 { font-size: 20px; font-weight: 600; letter-spacing: .3px; }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.view { padding: 24px 34px 0; max-width: 1120px; }
/* 报价编辑页：明细表 12 列，放宽到 1440，别再把「材质 / 后道 / 金额」挤成省略号 */
body.edit-mode .view { max-width: 1620px; }

.tabbar { display: none; }

/* ============================ 卡片 / 概览 ============================ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.stat .v {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.4px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat .v small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.stat.hi { background: linear-gradient(160deg, #f0f8f3, #fff 60%); border-color: #d8e8de; }
.stat.hi .v { color: var(--brand-dark); }

/* ============================ 月份选择 ============================ */

.mon-box { flex: none; }
.mon-pick { display: inline-flex; }
.mon-pick select {
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a72' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 11px center;
  -webkit-appearance: none;
  appearance: none;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.mon-pick select:hover { border-color: #c8d6cc; }
.hud-head-r { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.hud-head-r .mon-pick select { height: 34px; background-color: #f7fbf9; }

/* 导出弹窗 */
.exp-hint { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 14px; }
.exp-hint.sm { margin: 10px 0 0; }
.exp-quick { margin-bottom: 16px; }
.exp-row { display: flex; gap: 14px; flex-wrap: wrap; }
.exp-row .field { flex: 1 1 170px; margin-bottom: 0; }
.exp-scope {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 8px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbf9;
  cursor: pointer;
}
.exp-scope input { width: 16px; height: 16px; accent-color: var(--brand); }
.exp-scope span { font-size: 13.5px; color: var(--ink); }
.exp-scope small { grid-column: 2; font-size: 12px; color: var(--muted); }

/* ============================ 工具条 ============================ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
}
.search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round;
}
.search input { padding-left: 33px; height: 38px; background: #fff; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
  font-size: 12.5px;
}
.chip:hover { border-color: #cfd8cf; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ============================ 列表 ============================ */

.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }

.lhead, .lrow {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) 78px 98px 126px 84px 62px 88px;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.lhead {
  height: 40px;
  font-size: 12px;
  color: var(--muted);
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
  letter-spacing: .3px;
}

.lrow {
  height: 62px;
  border-bottom: 1px solid var(--line2);
  cursor: pointer;
  transition: background .12s;
}
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: #fafcf9; }

.lrow .no { font-size: 13px; color: var(--ink2); letter-spacing: .2px; }
.lrow .cust { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .cust small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .cust .who {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--brand-dark);
  background: var(--brand-soft);
  vertical-align: 1px;
}
.lrow .sales { font-size: 12.5px; color: var(--ink2); background: var(--brand-soft); border-radius: 20px; padding: 3px 8px; text-align: center; justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .sales small { font-size: 11.5px; font-weight: 400; color: var(--ink2); }
.lrow .date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lrow .amt { text-align: right; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.lrow .amt i { font-style: normal; font-size: 11.5px; font-weight: 400; color: var(--muted); margin-right: 1px; }

.lhead .att-col { text-align: right; }
.lrow .attcol { text-align: right; }
.att-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.att-badge:hover { filter: brightness(1.05); }
.att-badge.thumb:hover { filter: none; box-shadow: 0 0 0 2px var(--brand); }
.att-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.att-badge em { font-style: normal; font-variant-numeric: tabular-nums; }
.att-badge.none { background: transparent; color: var(--muted); font-weight: 400; padding: 0; }
.att-badge.thumb {
  position: relative;
  padding: 0;
  gap: 0;
  background: none;
  height: 40px;
  width: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.att-badge.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.att-badge.thumb em {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: rgba(15, 86, 55, .88);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
}

/* 列表行选中 + 单号可点击 */
.lrow.sel { background: var(--brand-soft) !important; }
.lrow .no[data-edit] { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: transparent; }
.lrow .no[data-edit]:hover { text-decoration-color: var(--brand); color: var(--brand); }

/* 附件大图预览面板 */
.att-panel {
  margin: 14px 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.att-panel[hidden] { display: none; }
.ap-loading, .ap-empty {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 120px; color: var(--muted); font-size: 13px;
}
.ap-empty svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ap-wrap { display: flex; gap: 0; min-height: 320px; }
.ap-thumbs {
  width: 92px; flex: none; padding: 12px; overflow-y: auto;
  background: #fafbf9; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; max-height: 460px;
}
.ap-thumb {
  width: 100%; aspect-ratio: 1; border: 2px solid transparent; border-radius: 8px;
  background: #fff; overflow: hidden; cursor: pointer; padding: 0; display: flex;
  align-items: center; justify-content: center; flex: none;
}
.ap-thumb.on { border-color: var(--brand); }
.ap-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-t-pdf { font-size: 11px; font-weight: 700; color: #b24141; letter-spacing: .5px; }
.ap-t-file { font-size: 9px; font-weight: 700; color: #5b6b60; }
.ap-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ap-stage {
  flex: 1; min-height: 300px; background: #f2f4f1; display: flex;
  align-items: center; justify-content: center; overflow: hidden;
}
.ap-stage-img { max-width: 100%; max-height: 460px; object-fit: contain; cursor: zoom-in; display: block; }
.ap-stage-frame { width: 100%; height: 460px; border: 0; background: #fff; }
.ap-stage-file { text-align: center; padding: 30px; }
.ap-file-ico {
  display: inline-flex; align-items: center; justify-content: center; min-width: 72px; height: 72px;
  padding: 0 12px; border-radius: 14px; background: var(--brand-soft); color: var(--brand);
  font-size: 16px; font-weight: 700; letter-spacing: 1px; margin-bottom: 14px;
}
.ap-file-name { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; word-break: break-all; }
.ap-file-size { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.ap-info {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-top: 1px solid var(--line); background: var(--card);
}
.ap-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-meta { font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.ap-ops { display: flex; gap: 8px; flex: none; }

@media (max-width: 860px) {
  .ap-wrap { flex-direction: column-reverse; }
  .ap-thumbs { width: 100%; flex-direction: row; max-height: none; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .ap-thumb { width: 64px; }
  .ap-stage, .ap-stage-frame { min-height: 240px; height: auto; }
  .ap-stage-img { max-height: 320px; }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  background: #f1f3f0;
  color: var(--ink2);
  white-space: nowrap;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill.draft { background: #f1f3f0; color: #6d7871; }
.pill.sent { background: #eef3fb; color: #3a6ba8; }
.pill.won { background: var(--brand-soft); color: var(--brand-dark); }
.pill.lost { background: #f6efef; color: #9a6a6a; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 0; color: var(--muted); font-size: 12.5px; }
.pager .pg { display: flex; gap: 6px; }

/* 骨架屏 */
.skel {
  height: 62px;
  border-bottom: 1px solid var(--line2);
  background: linear-gradient(90deg, #f7f9f6 25%, #f1f4f0 37%, #f7f9f6 63%);
  background-size: 400% 100%;
  animation: shim 1.3s ease infinite;
}
.skel:last-child { border-bottom: 0; }
@keyframes shim { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* 空状态 */
.empty {
  padding: 62px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.empty .ei {
  width: 54px; height: 54px; margin: 0 auto 14px;
  border-radius: 16px;
  background: #f2f5f1;
  display: grid; place-items: center;
}
.empty .ei svg { width: 26px; height: 26px; fill: none; stroke: #a7b3ab; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty b { display: block; color: var(--ink2); font-size: 14.5px; font-weight: 500; margin-bottom: 4px; }

/* ============================ 报价详情 ============================ */

.dhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dhead .dno { display: flex; align-items: baseline; gap: 10px; }
.dhead .dno strong { font-size: 17px; letter-spacing: .3px; }
.dhead .dno span { font-size: 12.5px; color: var(--muted); }

.seg {
  display: inline-flex;
  background: #eef1ed;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink2);
}
.seg button.on { background: #fff; box-shadow: var(--shadow-sm); font-weight: 500; color: var(--ink); }
.seg button.on[data-st=sent] { color: #2f629e; }
.seg button.on[data-st=won] { color: var(--brand-dark); }
.seg button.on[data-st=lost] { color: #8d5c5c; }

.form-card { padding: 20px 22px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 120px 120px; gap: 14px; }
.field-tight { margin-bottom: 0; }

/* 明细表 */
.items-card { overflow: hidden; margin-bottom: 14px; }
.items-scroll { overflow-x: auto; }

table.items { width: 100%; border-collapse: collapse; min-width: 1040px; }
table.items th {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  padding: 11px 8px;
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.items th:first-child, table.items td:first-child { padding-left: 18px; }
table.items th:last-child, table.items td:last-child { padding-right: 14px; }
table.items td { padding: 7px 8px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.items tr:last-child td { border-bottom: 0; }
table.items input {
  height: 44px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14.5px;
}
table.items input:hover { border-color: var(--line); }
table.items input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(20, 107, 70, .08); }
table.items td.amt { text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--ink2); white-space: nowrap; padding-right: 4px; }
table.items td.amt input {
  text-align: right;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--brand-dark);
  background: #f7fbf8;
  border: 1px solid var(--line);
}
table.items td.amt input:focus { background: #fff; border-color: var(--brand); }
table.items td.c-price { text-align: right; }
table.items td.c-sup { text-align: right; padding-right: 4px; }
table.items td.c-sup input {
  height: 44px; font-size: 15.5px; font-weight: 500; text-align: right;
  background: #fdf9f3; border-color: #ecdfca; color: #8a6428;
  padding: 0 10px;
}
table.items td.c-sup input:focus { background: #fff; border-color: #c38a34; box-shadow: 0 0 0 3px rgba(195, 138, 52, .12); }
table.items th.th-sup { color: #9a7029; }
table.items .price-val {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  color: var(--muted);
  padding: 0 8px;
  white-space: nowrap;
}
table.items td.del { width: 84px; padding-left: 3px; padding-right: 3px; text-align: center; white-space: nowrap; }
table.items tr[data-tier] td.tier-cell { background: #fbfdfb; }
table.items .tier-mark { font-size: 11px; color: var(--brand); white-space: nowrap; }
.row-act {
  display: block;
  width: 100%;
  height: 30px;
  margin: 0 auto 4px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f6f9f6;
  color: var(--ink2);
  font-size: 12.5px;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.row-act:last-child { margin-bottom: 0; }
.row-act:hover { background: #fff; border-color: #cfdccf; }
.row-act.add-tier { color: var(--brand-dark); background: var(--brand-soft); border-color: #cfe4d7; font-weight: 600; }
.row-act.add-tier:hover { background: #dcefe3; border-color: #b9d9c7; }
.row-act.danger:hover { background: var(--danger-soft); border-color: #f0cfcb; color: var(--danger); }
.items-tip {
  padding: 9px 18px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.items-tip b { color: var(--brand-dark); font-weight: 600; }
.iconbtn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #b6bfb8;
  display: grid; place-items: center;
}
.iconbtn:hover { background: var(--danger-soft); color: var(--danger); }
.iconbtn.add-tier { color: var(--brand); }
.iconbtn.add-tier:hover { background: var(--brand-soft); color: var(--brand-dark); }
.iconbtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.items-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #fafbf9; border-top: 1px solid var(--line); }
.addrow { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: 13px; background: none; border: 0; padding: 6px 4px; }
.addrow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.addrow:hover { color: var(--brand-dark); }

.totals { display: flex; align-items: baseline; gap: 8px; }
.totals .tk { font-size: 12.5px; color: var(--muted); }
.totals .tv { font-size: 22px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.totals .tv i { font-style: normal; font-size: 13px; font-weight: 400; margin-right: 2px; }
.cn-amt { font-size: 12px; color: var(--muted); margin-left: 4px; }

.savebar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 0 0;
}

/* ============================ 客户 ============================ */

.ctable .lhead, .ctable .crow {
  grid-template-columns: minmax(0, 1fr) 84px 128px 76px;
}
.ctable.admin .lhead, .ctable.admin .crow {
  grid-template-columns: minmax(0, 1fr) 76px 78px 122px 76px;
}
.crow .c-owner { font-size: 11.5px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 20px; padding: 3px 8px; text-align: center; justify-self: start; }
.crow {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line2);
  transition: background .12s;
}
.crow:last-child { border-bottom: 0; }
.crow:hover { background: #fafcf9; }
.cmain { min-width: 0; }
.cname {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cname:hover { color: var(--brand); }
.cmeta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cstat { text-align: right; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.cstat.strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.rowacts { display: flex; gap: 2px; justify-content: flex-end; }
.ccount {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--brand-dark);
  background: var(--brand-soft);
}
/* 客户弹窗：一个客户多个联系人 */.cc-list { display: flex; flex-direction: column; gap: 8px; }
.ccrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; gap: 8px; align-items: center; }
.ccrow input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  font: inherit;
  font-size: 13.5px;
  background: #fff;
  min-width: 0;
}
.ccrow input:focus { border-color: var(--brand); outline: none; }
.cc-del {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.cc-del:hover { color: #b3261e; background: #fdecea; }
.cc-add { margin-top: 9px; }
/* 报价表单：选联系人 */
.cinline { display: flex; gap: 6px; align-items: center; }
.cinline input { flex: 1; min-width: 0; }
.cinline .pickbtn { flex: none; white-space: nowrap; padding: 0 10px; height: 34px; }
.chint { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.chint:empty { display: none; }
.cpick-list { display: flex; flex-direction: column; gap: 8px; }
.cpick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cpick-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.cpick-row b { font-size: 14px; font-weight: 600; }
.cpick-row span { font-size: 12.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }

/* ============================ 弹窗 ============================ */

.mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 32, 25, .38);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 35, 25, .22);
  animation: pop .16s cubic-bezier(.2, .9, .3, 1);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
}
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }

.modal h3 { font-size: 16px; font-weight: 600; padding: 20px 22px 0; }
.modal .mbody { padding: 16px 22px 4px; overflow-y: auto; }
.modal .mfoot { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.modal .mfoot .btn.danger { margin-right: auto; }
.mnote { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ============================ Toast ============================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(21, 33, 27, .94);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
  animation: tin .18s ease;
  max-width: 80vw;
  text-align: center;
  pointer-events: none;
}
@keyframes tin { from { opacity: 0; transform: translate(-50%, 6px); } }
.toast.ok { background: rgba(15, 86, 55, .96); }
.toast.err { background: rgba(150, 48, 48, .96); }

/* ============================ 附件上传 ============================ */

.att-card { margin-top: 16px; }

.att-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.att-head > div:first-child { flex: 1; }
.att-head b { display: block; font-size: 15px; }
.att-head .muted { font-size: 12.5px; }

.att-list { display: flex; flex-direction: column; gap: 10px; }
.att-empty { font-size: 12.5px; padding: 8px 0 2px; }

.att-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: #fbfcfb;
}
.att-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1ed;
  flex: 0 0 auto;
  display: block;
  overflow: hidden;
}
.att-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.att-thumb.att-file {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .5px;
}
.att-thumb.pdf-thumb { background: #fbeceb; color: #b24141; }
.att-thumb.pdf-thumb span { font-size: 9px; letter-spacing: .5px; }
.att-thumb.pdf-thumb.is-img { background: #fff; padding: 0; }
.att-thumb.pdf-thumb.is-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 8px; }
.att-meta { flex: 1; min-width: 0; }
.att-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { font-size: 11.5px; margin-top: 2px; }
.att-item .iconbtn { color: var(--muted); }
.att-item .iconbtn:hover { color: var(--danger); }

/* ============================ 打印单据 ============================ */

.print-root { display: none; }

.sheet {
  width: 210mm;
  min-height: 280mm;
  padding: 16mm 14mm;
  background: #fff;
  color: #111;
  font-size: 12px;
  line-height: 1.6;
  box-sizing: border-box;
}

.sheet .sh-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #146b46;
  padding-bottom: 12px;
  margin-bottom: 6px;
}

.sheet .sh-co { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: #0f5637; }
.sheet .sh-co small { display: block; font-size: 9.5px; color: #777; letter-spacing: 2px; font-weight: 400; margin-top: 4px; }
.sheet .sh-title { text-align: right; }
.sheet .sh-title b { font-size: 22px; letter-spacing: 6px; font-weight: 700; }
.sheet .sh-title div { font-size: 10.5px; color: #666; margin-top: 4px; }

.sheet .sh-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 20px;
  padding: 12px 0 14px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 11.5px;
}
.sheet .sh-meta span { color: #777; }
.sheet .sh-meta b { font-weight: 500; color: #222; }

.sheet table { width: 100%; border-collapse: collapse; margin-top: 12px; table-layout: fixed; }
.sheet th {
  background: #f2f6f2;
  border: 1px solid #d9e0d9;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 6px;
  text-align: center;
}
.sheet td {
  border: 1px solid #e0e4e0;
  padding: 6px 5px;
  font-size: 10.5px;
  line-height: 1.5;
  vertical-align: middle;
  word-break: break-all;
}
.sheet td.c { text-align: center; }
.sheet td.n { text-align: right; font-variant-numeric: tabular-nums; }
/* 报价单是客户版：9 列，不含成本/供应商价（成本只在编辑页与统计里） */
.sheet tr.total td { background: #f7faf7; font-weight: 600; }

.sheet .sh-sum {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 14px;
  gap: 20px;
}
.sheet .sh-words { font-size: 11.5px; color: #333; }
.sheet .sh-words span { color: #777; }
.sheet .sh-amount { font-size: 20px; font-weight: 700; color: #0f5637; white-space: nowrap; }
.sheet .sh-amount span { font-size: 11px; color: #777; font-weight: 400; margin-right: 4px; }

.sheet .sh-note { margin-top: 16px; border-top: 1px dashed #dcdcdc; padding-top: 10px; font-size: 10.5px; color: #666; white-space: pre-wrap; line-height: 1.8; }

.sheet .sh-att {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed #dcdcdc;
}
.sheet .sh-att-title {
  font-size: 11px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}
.sheet .sh-att-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.sheet .sh-att-img {
  margin: 0;
  text-align: center;
}
.sheet .sh-att-img img {
  width: 100%;
  max-height: 150mm;
  object-fit: contain;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
}
.sheet .sh-att-img figcaption {
  font-size: 9.5px;
  color: #888;
  margin-top: 4px;
  word-break: break-all;
}
.sheet .sh-att-files {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sheet .sh-att-files li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 10.5px;
  color: #333;
  border-bottom: 1px dotted #eee;
}
.sheet .sh-att-files li::before { content: "📎"; font-size: 11px; }
.sheet .sh-att-files li span { word-break: break-all; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  #login, #shell, #toast, #modalRoot { display: none !important; }
  .print-root { display: block; }
  .sheet { box-shadow: none; page-break-after: always; }
}

/* ============================ 响应式 ============================ */

@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-form { padding: 12vh 22px; align-items: start; }
  .lm-brand { display: flex; }

  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 4px 0;
    color: var(--muted);
    font-size: 10.5px;
  }
  .tabbar a svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--brand); }

  .main { padding-bottom: 84px; }
  .topbar { padding: 14px 16px 12px; }
  .topbar h1 { font-size: 18px; }
  .top-actions .btn span.lbl { display: none; }
  .view { padding: 16px 16px 0; }

  .stats { gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat .v { font-size: 20px; }

  .toolbar { gap: 8px; }
  .search { max-width: none; flex: 1 1 100%; order: -1; }

  .lhead { display: none; }
  .list { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .lrow {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "cust amt" "no st" "sales att" "act act";
    gap: 2px 10px;
    height: auto;
    padding: 13px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
  }
  .lrow:last-child { border-bottom: 1px solid var(--line); }
  .lrow .cust { grid-area: cust; }
  .lrow .amt { grid-area: amt; font-size: 15px; }
  .lrow .no { grid-area: no; font-size: 12px; color: var(--muted); }
  .lrow .date { display: none; }
  .lrow .sales { grid-area: sales; justify-self: start; font-size: 11.5px; padding: 2px 8px; }
  .lrow .st { grid-area: st; justify-self: end; }
  .lrow .attcol { grid-area: att; justify-self: start; margin-top: 2px; }
  .lrow .act { grid-area: act; justify-self: stretch; margin-top: 6px; }
  .lrow .act .btn-won, .lrow .act .won-check { width: 100%; justify-content: center; height: 34px; }

  .ctable .lhead { display: none; }
  .crow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name acts" "s1 s2" "owner owner";
    gap: 2px 10px;
    padding: 13px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
  }
  .crow:last-child { border-bottom: 1px solid var(--line); }
  .cmain { grid-area: name; }
  .crow .rowacts { grid-area: acts; }
  .crow .c-count { grid-area: s1; text-align: left; margin-top: 4px; }
  .crow .c-total { grid-area: s2; text-align: right; margin-top: 4px; }
  .crow .c-owner { grid-area: owner; justify-self: start; margin-top: 2px; }

  .items-scroll { overflow: visible; }
  table.items { min-width: 0; display: block; }
  table.items thead { display: none; }
  table.items tbody { display: block; }
  table.items tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--line2);
    position: relative;
  }
  table.items tr:last-child { border-bottom: 0; }
  table.items td { display: block; padding: 0 !important; border: 0; }
  table.items td::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    color: var(--muted);
    margin-bottom: 4px;
  }
  table.items td input { border: 1px solid var(--line); background: #fff; height: 42px; font-size: 15px; }
  table.items td.amt input { height: 48px; font-size: 17px; background: #f7fbf8; }
  table.items td.c-sup input { height: 44px; font-size: 15px; }
  table.items td.c-name, table.items td.c-spec { grid-column: 1 / -1; }
  table.items td.amt { text-align: left; font-size: 15px; font-weight: 600; color: var(--ink); align-self: end; }
  table.items td.del { position: absolute; right: 8px; top: 8px; width: auto; display: flex; gap: 6px; }
  table.items td.del .row-act { width: auto; height: 28px; margin: 0; padding: 0 9px; font-size: 12px; }
  table.items td.del::before { display: none; }
  table.items tr[data-tier] td.tier-cell { display: none; }
  table.items tr[data-tier] { background: #fbfdfb; }
  table.items tr[data-tier] td.c-qty::before { content: "数量 · 同款"; color: var(--brand); }
  .items-foot { flex-wrap: wrap; gap: 4px; padding: 10px 14px; }
  .totals { margin-left: auto; }

  .form-card { padding: 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; gap: 0; }
  .grid2 .field, .grid3 .field { margin-bottom: 14px; }
  .dhead { gap: 10px; }
  .dhead .dno strong { font-size: 15px; }
  .savebar {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(62px + env(safe-area-inset-bottom));
    z-index: 45;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 10px 16px;
    margin: 0;
    box-shadow: 0 -6px 18px rgba(21, 40, 30, .05);
  }
  .savebar .btn { flex: 1; height: 42px; }
  .view { padding-bottom: 26px; }
  .main { padding-bottom: 150px; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat .v { font-size: 18px; }
  .sheet { width: 100%; padding: 10mm; }
}

/* ============================ 附件预览层 ============================ */
.att-view { cursor: zoom-in; }
.att-view img { pointer-events: none; }
.att-item .iconbtn[data-att-view] { color: var(--muted); }
.att-item .iconbtn[data-att-view]:hover { color: var(--accent); }

.pv-mask {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: rgba(10, 16, 12, .72);
  backdrop-filter: blur(3px);
}

/* 查看报价表面板 */
.qv-mask { display: flex; padding: 0; background: rgba(10, 16, 12, .55); }
.qv-panel {
  width: min(920px, 96vw);
  height: 94vh;
  background: #ececec;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.qv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e4e4e4;
  flex: 0 0 auto;
}
.qv-title { font-size: 15px; font-weight: 700; color: #222; }
.qv-actions { display: flex; gap: 8px; }
.qv-body { flex: 1 1 auto; overflow: auto; padding: 20px; -webkit-overflow-scrolling: touch; }
.qv-sheet {
  width: 100%;
  background: #fff;
  padding: 12px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .1);
  transform-origin: top center;
}
@media (max-width: 860px) {
  .qv-panel { width: 100vw; height: 100vh; border-radius: 0; }
  .qv-bar { padding: 10px 12px; gap: 8px; }
  .qv-title { font-size: 14px; white-space: nowrap; }
  .qv-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .qv-actions .btn { padding: 7px 10px; font-size: 13px; }
  .qv-body { padding: 10px; }
  .qv-sheet { padding: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 手机上别把 A4 报价单压成一条一条的字：保持纸张宽度，左右滑动看 */
  .qv-sheet .sheet { width: 760px; min-height: 0; padding: 12mm 8mm; }
}
.pv-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  flex: 0 0 auto;
}
.pv-title {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.pv-bar .btn { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }
.pv-bar .btn:hover { background: rgba(255,255,255,.24); }
.pv-bar .btn.sm { padding: 6px 12px; }
.pv-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  padding: 20px;
}
.pv-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: transform .18s ease;
  transform-origin: center center;
  user-select: none;
}
.pv-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  border-radius: 6px;
}
.pv-unsupported {
  text-align: center;
  color: #fff;
  padding: 40px;
}
.pv-unsupported p { margin: 0 0 16px; font-size: 14px; opacity: .85; }
.pv-unsupported .btn { background: #fff; color: #1a2b22; }

/* 附件列表预览层 */
.pv-list { align-items: flex-start; }
.pv-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 720px;
}
.pv-list-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  color: #fff;
  font-family: inherit;
}
.pv-list-item:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
.pv-list-thumb {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-list-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-list-pdf { background: #fbeceb; color: #b24141; font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.pv-list-file { background: #eef1ed; color: #5b6b60; font-size: 11px; font-weight: 700; }
.pv-list-name {
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv-list-size { font-size: 11px; opacity: .6; }

/* ================= 员工账号 ================= */
.uc-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.uc-head h3 { font-size: 15px; }
.uc-head .muted { font-size: 12px; }
.user-list { display: grid; gap: 8px; margin-bottom: 16px; }
.uempty { padding: 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 12.5px; text-align: center; }
.urow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line2); border-radius: 11px; background: #fafcf9;
}
.uav { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.umeta { min-width: 0; display: grid; line-height: 1.35; }
.umeta b { font-size: 13.5px; }
.umeta span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uacts { margin-left: auto; display: flex; gap: 7px; }
.ureset { width: 100%; display: flex; gap: 8px; }
.ureset input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: #fff; }
.uadd { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; padding-top: 14px; border-top: 1px dashed var(--line); }
.uadd .btn { height: 38px; }
@media (max-width: 860px) {
  .uadd { grid-template-columns: 1fr; }
  .uacts { width: 100%; margin-left: 0; }
  .urow { padding: 12px; }
}

/* ================= 一点点情绪价值 ================= */
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20, 107, 70, .18); }
.btn.primary { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.totals .tv b { display: inline-block; color: var(--brand-dark); }
.totals .tv b.bump { animation: amtBump .32s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes amtBump { 0% { transform: scale(1); } 45% { transform: scale(1.08); color: #1d8a5b; } 100% { transform: scale(1); } }
.lrow:active { transform: scale(.995); }

/* ============================================================
   v13 · 视觉升级：纸感底色 + 深墨绿侧栏 + 更精致的层次
   ============================================================ */

:root {
  --bg: #f6f8f5;
  --card: #ffffff;
  --ink: #16251d;
  --ink2: #405048;
  --muted: #849087;
  --line: #e5ebe5;
  --line2: #f0f3ef;
  --brand: #127253;
  --brand-dark: #0b563e;
  --brand-soft: #e9f5ee;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(18, 48, 32, .04), 0 14px 36px rgba(18, 48, 32, .06);
  --shadow-sm: 0 1px 2px rgba(18, 48, 32, .05), 0 3px 12px rgba(18, 48, 32, .035);
}

body {
  background: radial-gradient(110% 55% at 100% 0%, #edf5ee 0%, rgba(237, 245, 238, 0) 62%),
              radial-gradient(90% 45% at 0% 100%, #f3f0e7 0%, rgba(243, 240, 231, 0) 58%),
              var(--bg);
  background-attachment: fixed;
  color: var(--ink);
}

/* ---------- 登录 ---------- */
.login { background: transparent; }
.login-art {
  background: radial-gradient(130% 90% at 5% 5%, #1d825e 0%, #126a4b 40%, #0a3a2a 100%);
}
.login-art::before {
  content: "";
  position: absolute;
  width: 560px; height: 560px;
  right: -210px; top: -190px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, .035), 0 0 0 140px rgba(255, 255, 255, .025), 0 0 0 210px rgba(255, 255, 255, .018);
  pointer-events: none;
}
.login-art::after {
  content: "";
  position: absolute;
  inset: auto -25% -45% -15%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .12), transparent 72%);
  pointer-events: none;
}
.la-inner { max-width: 420px; }
.la-logo {
  width: 58px; height: 58px; border-radius: 17px;
  font-size: 31px; margin-bottom: 30px;
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .38);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .1);
}
.login-art h2 { font-size: 34px; font-weight: 650; letter-spacing: 1px; }
.login-art p { font-size: 12.5px; letter-spacing: 4px; }
.la-list { margin-top: 46px; gap: 16px; }
.la-list li { font-size: 14px; }
.la-list li::before { border-color: rgba(255, 255, 255, .7); }
.la-random {
  margin-top: 38px !important;
  padding: 10px 17px;
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .32);
  backdrop-filter: blur(4px);
}
.login-form {
  background: linear-gradient(165deg, #ffffff 0%, #f8faf7 100%);
  padding: 4vh 8% 10vh;
}
.lcard { max-width: 360px; }
.lcard h1 { font-size: 29px; font-weight: 700; letter-spacing: -.5px; }
.lsub { font-size: 13px; margin: 8px 0 30px; }
.lcard .field { margin-bottom: 18px; }
.lcard .field > span { font-size: 12px; font-weight: 600; color: #5c6b61; }
.lcard input[type=text], .lcard input[type=password] {
  height: 46px; border-radius: 12px; border-color: #dfe6df;
  background: #fff; box-shadow: 0 1px 3px rgba(18, 48, 32, .035);
  font-size: 14px;
}
.lcard .btn.block {
  height: 47px; margin-top: 6px; border-radius: 12px; border: 0;
  font-size: 14px; letter-spacing: 1px;
  background: linear-gradient(135deg, #17875f, #0d5a40);
  box-shadow: 0 10px 22px rgba(13, 90, 64, .24);
}
.lcard .btn.block:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #1b9368, #0a4d36);
  box-shadow: 0 13px 26px rgba(13, 90, 64, .3);
}

/* ---------- 侧边栏 ---------- */
.shell { grid-template-columns: 228px minmax(0, 1fr); }
.side {
  background: linear-gradient(178deg, #175640 0%, #0f4331 52%, #0b3426 100%);
  border-right: 0;
  color: #eaf4ee;
  padding: 24px 15px 20px;
  box-shadow: 5px 0 26px rgba(11, 52, 38, .09);
  z-index: 30;
}
.side::after {
  content: "";
  position: absolute; pointer-events: none;
  left: -30%; bottom: 12%; width: 160%; height: 240px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .05), transparent 72%);
}
.brand { padding: 0 10px 28px; position: relative; z-index: 1; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; font-size: 21px;
}
.bname { color: #fff; font-size: 16px; letter-spacing: .5px; }
.bname em { color: rgba(255, 255, 255, .52); font-size: 12.5px; }
.nav { position: relative; z-index: 1; gap: 5px; }
.nav a { height: 44px; color: rgba(255, 255, 255, .7); font-size: 14px; }
.nav a svg { opacity: .75; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.on {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  box-shadow: inset 3px 0 0 #62d3a3;
}
.nav a.on svg { opacity: 1; color: #a9ebcb; }
.nav::after {
  content: "把每一份报价，都做得清清楚楚。";
  display: block;
  margin: 24px 6px 0;
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .55);
  font-size: 11.5px; line-height: 1.7;
}
.side-foot {
  position: relative; z-index: 1;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 16px 10px 0;
}
.who { color: rgba(255, 255, 255, .88); font-size: 13px; }
.dot { background: #62d3a3; box-shadow: 0 0 0 3px rgba(98, 211, 163, .18); }
.linkbtn { color: rgba(255, 255, 255, .58); }
.linkbtn:hover { color: #fff; }

/* ---------- 顶栏 / 卡片 ---------- */
.topbar {
  padding: 22px 34px 18px;
  background: rgba(246, 248, 245, .88);
  border-bottom-color: #e6ebe5;
}
.topbar h1 { font-size: 23px; font-weight: 700; letter-spacing: -.4px; }
.sub { font-size: 12.5px; color: #7d8a80; margin-top: 4px; }
.top-actions .btn.primary { height: 40px; padding: 0 18px; box-shadow: 0 5px 14px rgba(18, 114, 83, .18); }
.view { padding-top: 26px; }

.card { border-color: #e6ebe5; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat {
  position: relative; overflow: hidden;
  padding: 18px 20px;
  border-color: #e6ebe5; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #127253, #57c797);
}
.stat:nth-child(2)::before { background: linear-gradient(90deg, #bd7c2c, #e9bb72); }
.stat:nth-child(3)::before { background: linear-gradient(90deg, #248b69, #86d6b2); }
.stat:nth-child(4)::before { background: linear-gradient(90deg, #4d6f9c, #9dbce0); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat .k { font-size: 11.5px; font-weight: 500; letter-spacing: .5px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 9px; letter-spacing: -.6px; }
.stat .v small { font-size: 12px; color: #8b968e; }
.stat.hi { background: linear-gradient(155deg, #edf8f1 0%, #fff 72%); border-color: #d6e9dc; }
.stat::after {
  content: ""; position: absolute; right: 16px; top: 16px;
  width: 28px; height: 28px; border-radius: 9px;
  background-color: rgba(18, 114, 83, .07);
  background-repeat: no-repeat; background-position: center; background-size: 17px 17px;
}
.stat:nth-child(1)::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23127253' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M7 3v4M17 3v4M3 10h18'/%3E%3C/svg%3E"); }
.stat:nth-child(2)::after { background-color: rgba(189, 124, 44, .08); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bd7c2c' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E"); }
.stat:nth-child(3)::after { background-color: rgba(36, 139, 105, .08); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23248b69' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E"); }
.stat:nth-child(4)::after { background-color: rgba(77, 111, 156, .08); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234d6f9c' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.4'/%3E%3Cpath d='M5 20c0-3.6 3.1-5.6 7-5.6s7 2 7 5.6'/%3E%3C/svg%3E"); }

/* ---------- 输入框 / 按钮 ---------- */
input[type=text], input[type=password], input[type=number], input[type=date],
input:not([type]), select, textarea {
  border-color: #dfe6df; background: #fff; border-radius: 10px; height: 42px;
  box-shadow: inset 0 1px 2px rgba(18, 48, 32, .025);
}
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(18, 114, 83, .11);
  border-color: var(--brand);
}
.btn { border-radius: 10px; font-size: 13.5px; }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #17875f, #0e5d43);
  box-shadow: 0 4px 12px rgba(14, 93, 67, .14);
}
.btn.primary:hover { background: linear-gradient(135deg, #1b9468, #0a5139); border-color: transparent; }
.chip { height: 34px; border-radius: 999px; }
.chip.on { background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 10px rgba(18, 114, 83, .2); }
.search input { height: 40px; border-radius: 999px; }

/* ---------- 列表 ---------- */
.list { border-color: #e6ebe5; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.lhead {
  height: 44px;
  background: #f4f8f4;
  color: #6c7b70;
  font-size: 11.5px; font-weight: 600; letter-spacing: .4px;
}
.lrow {
  min-height: 62px;
  transition: background .15s ease, box-shadow .15s ease;
}
.lrow:hover { background: #fbfdfb; box-shadow: inset 3px 0 0 var(--brand); }
.lrow .cust { font-size: 14.5px; font-weight: 600; }
.lrow .no { font-size: 12.5px; }
.lrow .amt { font-size: 15.5px; font-weight: 700; }
.lrow .sales { font-size: 12px; padding: 4px 10px; }
.pill { border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.att-badge.thumb { border-radius: 8px; }
.empty { padding: 52px 20px; }
.empty .ei {
  background: linear-gradient(150deg, #eef7f1, #f8faf7);
  border: 1px solid #e2eee6;
}
.empty .ei svg { stroke: #4a9d74; }
.empty b { font-size: 15px; }
.ctable .lhead, .ctable .crow { min-height: 64px; }
.crow:hover { background: #fbfdfb; box-shadow: inset 3px 0 0 var(--brand); }
.cname { font-size: 14.5px; font-weight: 600; }
.crow .c-owner { font-size: 11.5px; padding: 4px 10px; }
.urow { border-color: #e6ebe5; background: #fbfdfb; border-radius: 12px; }

/* ---------- 编辑页 ---------- */
.form-card, .att-card, .items-card, .dhead { border-color: #e6ebe5; border-radius: var(--radius); }
.form-card { padding: 22px 24px; box-shadow: var(--shadow-sm); }
.field > span { color: #5f6d64; font-weight: 500; }
.dhead { padding: 18px 22px; box-shadow: var(--shadow-sm); }
.dhead .dno strong { font-size: 19px; }
.seg { background: #eef2ed; padding: 3px; border-radius: 999px; }
.seg button { border-radius: 999px; height: 30px; }
.seg button.on { box-shadow: 0 2px 6px rgba(18, 48, 32, .1); }
.items-card { box-shadow: var(--shadow-sm); }
table.items th {
  height: 42px;
  background: #f4f8f4;
  color: #64736a;
  font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
}
table.items td { padding: 9px 9px; }
table.items input { border-color: #e2e8e2; background: #fcfdfc; }
table.items td.amt input {
  height: 46px; font-size: 16px; font-weight: 600;
  background: #f1f9f4; border-color: #cfe6d8;
}
table.items td.amt input:focus { background: #fff; border-color: var(--brand); }
table.items td.c-qty input { padding: 0 6px; text-align: center; }
table.items td.c-unit input { padding: 0 4px; text-align: center; }
table.items tr[data-tier] td.tier-cell { background: #f7fbf8; }
.items-foot { background: #f8faf8; padding: 12px 18px; }
.totals .tv { font-size: 24px; }
.addrow { font-weight: 600; }
.savebar { box-shadow: 0 -8px 26px rgba(18, 48, 32, .06); }
.att-card { box-shadow: var(--shadow-sm); position: relative; transition: border-color .15s, box-shadow .15s, background .15s; }
.att-card.drag-over {
  border-color: var(--brand);
  background: #f8fdf9;
  box-shadow: 0 0 0 3px rgba(18, 114, 83, .14);
}
.att-card.drag-over::after {
  content: "松开鼠标，文件就会自动上传";
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background: rgba(233, 245, 238, .94);
  border: 2px dashed var(--brand);
  color: var(--brand-dark);
  font-size: 15px; font-weight: 600; letter-spacing: .5px;
  pointer-events: none;
}
.att-empty {
  border: 1px dashed #d9e5dc;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  background: #fcfdfc;
}
.att-head b { font-size: 15px; }

/* ---------- 弹窗 / 查看面板 ---------- */
.modal { border-radius: 18px; box-shadow: 0 24px 70px rgba(10, 35, 22, .22); }
.qv-panel { border-radius: 18px; background: #eef1ed; box-shadow: 0 24px 70px rgba(10, 35, 22, .3); }
.qv-bar { padding: 14px 18px; }
.qv-title { font-size: 15.5px; }
.qv-bar .btn.primary { border-color: transparent; }
.att-panel { border-radius: var(--radius); box-shadow: var(--shadow-sm); border-color: #e6ebe5; }

/* ---------- 手机端跟随新风格 ---------- */
@media (max-width: 860px) {
  body { background: var(--bg); }
  .shell { grid-template-columns: 1fr; }
  .login-form { padding: 12vh 22px; align-items: start; }
  .lcard { max-width: 420px; }
  .lcard h1 { font-size: 27px; }
  .topbar { padding: 16px 16px 13px; background: rgba(246, 248, 245, .95); }
  .topbar h1 { font-size: 21px; }
  .view { padding: 16px 16px 0; }
  .stat { padding: 14px 15px; border-radius: 14px; }
  .stat .v { font-size: 21px; margin-top: 7px; }
  .list { background: transparent; border: 0; box-shadow: none; }
  .lrow, .crow {
    border-color: #e6ebe5; border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 14px;
  }
  .lrow:hover, .crow:hover { box-shadow: var(--shadow-sm); }
  .lrow .cust { font-size: 15px; }
  .search input { border-radius: 12px; height: 42px; }
  .form-card, .items-card, .att-card, .dhead { border-radius: 14px; }
  .form-card { padding: 16px; }
  .dhead { padding: 16px; }
  table.items td.amt input { height: 46px; font-size: 17px; }
  .savebar { border-radius: 0; }
  .qv-panel { border-radius: 0; }
  .la-list { margin-top: 34px; }
  .login-art h2 { font-size: 28px; }
}


/* ============================================================
   v18 · 利润展示 / 已成交快捷 / 科幻首页
   ============================================================ */

/* ---------- 列表：毛利 & 一键成交 ---------- */
.lrow .amt small.pf {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: #157a53;
  letter-spacing: 0;
  margin-top: 1px;
}
.lrow .amt small.pf.neg { color: var(--danger); }
.lhead .act, .lrow .act { text-align: right; }

.btn-won {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #cfe6d8;
  background: #f2fbf6;
  color: #0f6b47;
  font-size: 12px;
  transition: background .15s, color .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
}
.btn-won svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn-won:hover { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(20, 107, 70, .22); }
.btn-won.busy { opacity: .6; cursor: default; }
.won-check { font-size: 11.5px; color: #9aa8a0; white-space: nowrap; }

/* ---------- 编辑页：成本 / 毛利 / 毛利率 ---------- */
.items-sum { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.isum { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; padding-right: 16px; border-right: 1px dashed #dfe7e1; }
.isum span { font-size: 10.5px; color: var(--muted); letter-spacing: .4px; }
.isum b { font-size: 14.5px; font-variant-numeric: tabular-nums; color: var(--ink2); font-weight: 600; }
.isum b.pos { color: #0f7a56; }
.isum b.neg { color: var(--danger); }

/* 合计区：多个数量档时逐行列「数量 × 单价 = 金额」 */
.totals { flex-direction: column; align-items: flex-end; gap: 4px; }
.tot-main { display: flex; align-items: baseline; gap: 8px; }
.tot-lines { display: grid; grid-template-columns: auto auto auto auto auto auto; column-gap: 6px; row-gap: 2px; align-items: baseline; justify-content: end; max-width: 460px; }
/* 每一档拆成 6 个格子放进同一个网格，这样各档的数字能上下对齐 */
.tot-lines .tl { display: contents; }
.tot-lines[hidden] { display: none; }
.tot-lines .tl-n { color: var(--ink2); font-weight: 600; font-size: 12px; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tot-lines .tl-q { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tot-lines .tl-x, .tot-lines .tl-eq { color: #b7c1ba; font-size: 11px; }
.tot-lines .tl-p { color: var(--ink2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tot-lines .tl-a { color: var(--ink); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }

@media (max-width: 640px) {
  .tot-lines { column-gap: 5px; max-width: 100%; }
  .tot-lines .tl-n { max-width: 5.5em; }
  .tot-lines .tl-q, .tot-lines .tl-p { font-size: 11.5px; }
  .tot-lines .tl-a { font-size: 12px; }
}
table.items .row-profit { display: block; font-style: normal; font-size: 10.5px; color: #12805a; margin-top: 2px; }
table.items .row-profit.neg { color: var(--danger); }

@media (max-width: 860px) {
  .items-sum { width: 100%; gap: 10px; justify-content: space-between; margin-left: 0; margin-top: 6px; }
  .isum { padding-right: 10px; }
  .items-foot .totals { width: 100%; justify-content: flex-end; }
  table.items td.c-sup input { height: 46px; font-size: 16px; }
}

/* ---------- 首页 · 浅色科技风 ---------- */
body.home-mode { background: #eef3f1; }
body.home-mode .main {
  background:
    radial-gradient(900px 520px at 80% -10%, rgba(16, 168, 148, .13), transparent 62%),
    radial-gradient(760px 460px at 0% 106%, rgba(72, 120, 240, .10), transparent 62%),
    linear-gradient(180deg, #fbfdfc, #eef4f2 62%, #e8f1ee);
  min-height: 100dvh;
}
body.home-mode .view { max-width: 1620px; padding: 20px 34px 44px; }
body.home-mode .topbar {
  background: rgba(252, 254, 253, .86);
  border-bottom-color: rgba(18, 130, 116, .12);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
body.home-mode .topbar h1 { color: #0d2b26; letter-spacing: 1px; font-size: 19px; }
body.home-mode .topbar h1::before { content: "◈ "; color: #0fae97; }
body.home-mode .sub { color: #5b7a73; }
body.home-mode .tabbar { background: rgba(252, 254, 253, .96); border-top-color: rgba(18, 130, 116, .12); }
body.home-mode .tabbar a { color: #7b9590; }
body.home-mode .tabbar a.on { color: #0b8f7c; }

.hud {
  --hud-cyan: #0fae97;
  --hud-blue: #3b7bfa;
  --hud-amber: #c17d12;
  position: relative;
  border-radius: 20px;
  padding: 26px 26px 22px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa 88%);
  border: 1px solid rgba(18, 130, 116, .14);
  box-shadow: 0 20px 54px rgba(19, 66, 58, .10), 0 2px 6px rgba(19, 66, 58, .05);
  overflow: hidden;
  overflow: clip;
  color: #24413b;
}
.hud::before {
  content: "";
  position: absolute; inset: 9px;
  border: 1px solid rgba(18, 130, 116, .09);
  border-radius: 14px;
  pointer-events: none;
}
.hud-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(18, 130, 116, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 130, 116, .07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 12%, transparent 74%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 12%, transparent 74%);
  animation: hudGrid 26s linear infinite;
  opacity: .55;
  pointer-events: none;
}
@keyframes hudGrid { to { background-position: 0 46px, 46px 0; } }
.hud-scan {
  position: absolute; left: 0; right: 0; top: -180px; height: 180px;
  background: linear-gradient(180deg, transparent, rgba(16, 168, 148, .07), transparent);
  animation: hudScan 8s linear infinite;
  pointer-events: none;
}
@keyframes hudScan { to { top: 115%; } }

.hud-boot {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 40px 4px;
  color: #0b8f7c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; letter-spacing: 1.4px;
}
.hud-spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(18, 130, 116, .18); border-top-color: #0fae97;
  animation: hudSpin .9s linear infinite;
}
@keyframes hudSpin { to { transform: rotate(360deg); } }

.hud-head {
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 20px;
}
.hud-kicker {
  display: flex; align-items: center; gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px; letter-spacing: 2.2px;
  color: #0b8f7c;
}
.hud-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #0fae97;
  box-shadow: 0 0 0 4px rgba(16, 168, 148, .16);
  animation: hudPulse 1.9s ease-in-out infinite;
}
@keyframes hudPulse {
  50% { box-shadow: 0 0 0 9px rgba(16, 168, 148, 0); opacity: .55; }
}
.hud-head h2 {
  font-size: 24px; font-weight: 600; margin: 9px 0 5px;
  color: #0d2b26; letter-spacing: .6px;
  text-shadow: none;
}
.hud-head p { font-size: 12px; color: #6b8981; }
.hud-badges { display: flex; gap: 10px; flex: none; }
.hud-badge {
  min-width: 88px; padding: 10px 14px; border-radius: 12px;
  background: #f1faf7;
  border: 1px solid rgba(18, 130, 116, .16);
}
.hud-badge span { display: block; font-size: 10.5px; letter-spacing: 1px; color: #6b8981; }
.hud-badge b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px; color: #0b8f7c;
}
.hud-badge i { font-style: normal; font-size: 11px; }

.hud-kpis { position: relative; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 12px; }
.hk {
  position: relative; overflow: hidden;
  padding: 16px 18px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e4eeea;
  box-shadow: 0 2px 8px rgba(19, 66, 58, .05);
}
.hk::before {
  content: "";
  position: absolute; left: 0; top: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--hud-cyan), transparent 72%);
  opacity: .55;
}
.hk-main {
  background: linear-gradient(150deg, #eafaf5, #f9fdfc);
  border-color: rgba(16, 168, 148, .3);
}
.hk-k { font-size: 11.5px; color: #648279; letter-spacing: .8px; }
.hk-v {
  display: flex; align-items: baseline; gap: 3px;
  margin: 8px 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hk-v i { font-style: normal; font-size: 13px; color: #6b8981; }
.hk-v b {
  font-size: 26px; font-weight: 600; color: #10332c; letter-spacing: -.5px;
  text-shadow: none;
}
.hk-main .hk-v b { font-size: 32px; color: #0a8f7a; }
.hk-v i.hk-unit { font-size: 13px; }
.hk-sub { font-size: 11.5px; color: #6b8981; }
.hk-sub .pos, .hk-sub b.pos { color: #0b8a5f; }
.hk-sub .neg, .hk-sub b.neg { color: var(--danger); }
.hk-spark { position: absolute; right: 10px; bottom: 8px; width: 46%; height: 46px; opacity: .7; pointer-events: none; }
.hk-spark polyline { fill: none; stroke: var(--hud-cyan); stroke-width: 1.6; filter: none; }

.hud-row { display: grid; grid-template-columns: 1.9fr 1fr; gap: 12px; margin-top: 12px; }
.hp {
  border-radius: 14px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #e4eeea;
  box-shadow: 0 2px 8px rgba(19, 66, 58, .05);
}
.hp-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.hp-h b { font-size: 13px; color: #10332c; letter-spacing: .6px; }
.hp-h span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px; letter-spacing: 2px; color: #9ab3ac;
}
.hp-h a { font-size: 11.5px; color: #0b8f7c; }
.hp-h a span { letter-spacing: 0; font-size: 12px; }

.trend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 140px; }
.tb {
  --h: 0%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 6px; height: 100%;
}
.tb-bar {
  width: 100%; max-width: 34px; height: 100%;
  display: flex; align-items: flex-end;
  border-radius: 6px;
  background: #f7fbfa;
  overflow: hidden;
}
.tb-bar i {
  display: block; width: 100%; height: var(--h);
  border-radius: 6px;
  background: linear-gradient(180deg, #16c3a9, #5f93f5);
  box-shadow: none;
  transition: height .75s cubic-bezier(.2, .9, .3, 1);
}
.tb:hover .tb-bar i { filter: brightness(1.06); }
.tb-d {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px; color: #8aa5a0;
}

.hp-gauge { display: flex; flex-direction: column; }
.gauge { position: relative; flex: 1; display: grid; place-items: center; min-height: 150px; }
.gauge svg { width: 150px; height: 150px; }
.g-track { fill: none; stroke: #e3ede9; stroke-width: 9; }
.g-bar {
  fill: none; stroke: url(#gg); stroke-width: 9; stroke-linecap: round;
  filter: none;
  transition: stroke-dashoffset 1.05s cubic-bezier(.2, .9, .3, 1);
}
.gauge-txt { position: absolute; text-align: center; }
.gauge-txt b {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px; letter-spacing: -.5px; color: #10332c;
}
.gauge-txt i { font-style: normal; font-size: 12px; color: #0b8f7c; }
.gauge-txt span { font-size: 10.5px; letter-spacing: 1px; color: #8aa5a0; }
.gauge-foot { text-align: center; font-size: 11.5px; color: #6b8981; }
.gauge-foot b { color: #0a8f7a; }

.hp-recent { margin-top: 12px; }
.hfeed { display: grid; }
.hf-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 68px 84px 140px;
  align-items: center; gap: 12px;
  padding: 10px 8px;
  border-top: 1px solid #eef3f1;
  border-radius: 8px;
  transition: background .15s, padding .15s;
}
.hf-row:hover { background: #f3faf8; padding-left: 14px; padding-right: 14px; }
.hf-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; color: #0b8f7c;
}
.hf-cust { font-size: 13px; color: #173a32; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-cust em { font-style: normal; font-size: 10.5px; color: #8aa5a0; margin-left: 8px; }
.hf-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; color: #8aa5a0;
}
.hf-amt {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; color: #10332c;
}
.hf-amt em { display: block; font-style: normal; font-size: 10.5px; color: #0b8a5f; }
.hf-amt em.neg { color: var(--danger); }
.hf-st { text-align: right; }
.hf-empty { padding: 26px; text-align: center; font-size: 12.5px; color: #8aa5a0; }

.hud-foot { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.hud-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: #ffffff;
  background: linear-gradient(135deg, #14bda4, #0a9c8b);
  box-shadow: 0 6px 16px rgba(16, 168, 148, .24);
  transition: transform .15s, box-shadow .15s;
}
.hud-cta span { font-size: 16px; line-height: 1; }
.hud-cta.ghost {
  background: #ffffff;
  border: 1px solid #d9e8e3;
  color: #0b7d6d; box-shadow: none;
}
.hud-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(16, 168, 148, .26); }
.hud-cta.ghost:hover { border-color: #b6dbd2; box-shadow: 0 4px 14px rgba(19, 66, 58, .08); }

@media (max-width: 860px) {
  body.home-mode .view { padding: 14px 14px 34px; }
  body.home-mode .topbar { padding: 14px 16px 12px; }
  body.home-mode .topbar h1 { font-size: 17px; }
  .hud { padding: 18px 15px 16px; border-radius: 16px; }
  .hud::before { inset: 6px; }
  .hud-head { flex-direction: column; gap: 12px; }
  .hud-head h2 { font-size: 20px; }
  .hud-head-r { width: 100%; align-items: stretch; }
  .hud-head-r .mon-pick select { width: 100%; }
  .hud-badges { width: 100%; }
  .hud-badge { flex: 1; }
  .hud-kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
  .hk-main { grid-column: 1 / -1; }
  .hk { padding: 13px 14px 12px; }
  .hk-v b { font-size: 21px; }
  .hk-main .hk-v b { font-size: 27px; }
  .hk-spark { opacity: .4; }
  .hud-row { grid-template-columns: 1fr; }
  .trend { height: 120px; gap: 7px; }
  .hf-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "cust amt" "no st";
    row-gap: 4px;
    padding: 11px 6px;
  }
  .hf-cust { grid-area: cust; }
  .hf-no { grid-area: no; }
  .hf-date { display: none; }
  .hf-st { grid-area: st; justify-self: start; }
  .hf-amt { grid-area: amt; }
  .hud-foot .hud-cta { flex: 1 1 calc(50% - 5px); justify-content: center; padding: 0 12px; }
  .hud-foot .hud-cta:last-child { flex: 1 0 100%; }
}

/* 首页细节校正 */
.tb-bar { background: #f7fbfa; }
.hk:last-child .hk-v b { color: #b8791a; text-shadow: none; }
@media (max-width: 860px) {
  .hud-kpis .hk:last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .stat-pf .v small { display: block; margin-left: 0; }
}

/* v21 · 设计稿（CDR/CMX/AI/EPS）附件 */
.att-thumb.att-file.design-thumb {
  background: #fdf7ea;
  color: #a5711b;
  border: 1px solid #f0e3c6;
  font-size: 10px;
  letter-spacing: .3px;
}

/* v30 · 设计稿预览图（用户自己配的封面图） */
.att-thumb.has-cover { position: relative; }
.att-thumb .cover-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 86, 55, .74);
  color: #fff;
  font-size: 8.5px;
  line-height: 1.55;
  text-align: center;
  letter-spacing: .3px;
  pointer-events: none;
}
.att-cover-btn {
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 11.5px;
  cursor: pointer;
  text-align: left;
}
.att-cover-btn:hover { text-decoration: underline; }
/* 附件量出的展开尺寸：一键填到规格 */
.att-dim {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  color: var(--brand);
  font-size: 11.5px;
  line-height: 1.5;
  cursor: pointer;
  text-align: left;
}
.att-dim:hover { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.att-dim.dim-wait {
  border-color: transparent;
  background: none;
  color: var(--muted, #888);
  cursor: default;
}
/* 只是估出来的尺寸：弱化成灰，别让人当成实测 */
.att-dim.ref {
  border-color: #d8d8d8;
  background: #f5f5f5;
  color: #7a7a7a;
}
.pv-cover-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .2);
  font-size: 10.5px;
  font-weight: 400;
  vertical-align: middle;
}
.pv-cover-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-height: 100%;
}
.pv-cover-note {
  margin: 0;
  max-width: 560px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .72);
}

/* v31 · 复制上一单：单号栏多了一个按钮，窄屏收一下字距，别把「查看报价表」挤成两行 */
@media (max-width: 430px) {
  .savebar { gap: 8px; }
  .savebar .btn { padding-left: 6px; padding-right: 6px; font-size: 12.5px; }
}

/* Workspace styles are screen-only; the customer print layout is separate. */
@media screen {
  :root {
    --bg: #f3f6f7; --ink: #18272d; --ink2: #35454e; --muted: #52636b;
    --line: #dce4e7; --brand: #126b52; --brand-dark: #0d513f;
    --brand-soft: #e9f5ef; --radius: 8px; --shadow-sm: 0 1px 2px #17252b0c;
  }
  body, body.home-mode, body.home-mode .main { background: var(--bg); }
  .main, .tb-left, .view { min-width: 0; }
  .side { background: #17312e; box-shadow: none; }
  .side::after, .nav::after, body.home-mode .topbar h1::before { content: none; }
  .brand { border-bottom: 1px solid #ffffff24; padding-bottom: 19px; margin-bottom: 18px; }
  .brand .logo { background: #21765e; border-radius: 8px; }
  .nav a { border-radius: 7px; color: #d2e1de; }
  .nav a.on { background: #2b4945; box-shadow: inset 3px 0 #80d4b6; }
  .topbar, body.home-mode .topbar { background: #fff; border-bottom-color: var(--line); backdrop-filter: none; }
  .topbar h1, body.home-mode .topbar h1 { color: var(--ink); font-size: 22px; letter-spacing: 0; }
  .sub { color: var(--muted); }
  .btn { border-radius: 7px; }
  .btn.primary, .lcard .btn.block { background: var(--brand); box-shadow: none; }
  .btn.primary:hover, .lcard .btn.block:hover { background: var(--brand-dark); box-shadow: none; transform: none; }
  :is(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid #168064; outline-offset: 2px; }
  .side :is(a, button):focus-visible { outline-color: #98e5cc; }
  .login-art { background: #173d35; }
  .login-art::before, .login-art::after { content: none; }
  .login-form { background: #f8fafb; }
  .lcard h1 { letter-spacing: 0; }
  .lcard #lUser, .lcard #lPass { height: 46px; border-radius: 7px; }
  .card, .stat, .list, .form-card, .dhead, .items-card, .att-card, .att-panel { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
  .stat::after { content: none; }
  .stat:hover { transform: none; box-shadow: var(--shadow-sm); }
  .stat.hi { background: #eef7f2; border-color: #d1e5da; }
  .stat .v { letter-spacing: 0; overflow-wrap: anywhere; }
  .stat .v small { color: var(--muted); }
  .toolbar { gap: 12px; }
  .chip { border-radius: 7px; }
  .chip.on { background: var(--brand-soft); color: var(--brand-dark); border-color: #b9d9cb; box-shadow: none; font-weight: 650; }
  .lhead, .items-card table.items th { background: #edf2f4; color: #42545e; letter-spacing: 0; }
  .lrow:hover, .crow:hover { background: #f3f8f6; }
  .urow { background: #f8fafb; border-color: var(--line); border-radius: 8px; }
  .field > span { color: var(--ink2); font-weight: 600; }
  .seg { background: #edf1f3; border-radius: 8px; }
  .seg button { border-radius: 6px; }
  .items-card table.items td.amt input { background: #eef8f3; border-color: #badbca; }
  .items-card table.items td.c-sup input { background: #fff8ec; border-color: #ead4ab; }
  .items-foot { background: #f7f9fa; }
  .quote-dates { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 130px); gap: 14px; margin-top: 14px; }
  .quote-dates .field, .quote-dates input { min-width: 0; max-width: 100%; }
  .savebar { background: #fff; border-top-color: var(--line); box-shadow: 0 -4px 16px #17252b0d; }
  .savebar #btnDup { color: var(--brand-dark); }
  .att-empty { background: #f8fafb; border-color: #bdcdd3; }
  .att-cover-btn { min-height: 28px; }
  .modal, .qv-panel { border-radius: 8px; }
  .modal .mfoot { border-top: 1px solid var(--line); }
  .qv-body { background: #e9eef1; }
  .pv-bar { background: #17292d; }
  .pv-actions, .qv-actions { min-width: 0; flex-wrap: wrap; }
  .hud { padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .hud::before, .hud-bg, .hud-scan, .hud-live, .hk-spark { display: none; }
  .hud-head { margin-bottom: 18px; gap: 14px; }
  .hud-head h2 { font-size: 23px; letter-spacing: 0; color: var(--ink); }
  .hud-head p, .hud-kicker, .hp-h > span { color: var(--muted); letter-spacing: 0; }
  .hud-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hk, .hp, .hud-badge { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); min-width: 0; }
  .hk-main { background: #eaf6ef; border-color: #c8dfd2; }
  .hk-k, .hk-sub, .hud-badge span { color: var(--muted); }
  .hk-v { flex-wrap: wrap; overflow-wrap: anywhere; }
  .hk-v b, .hk-main .hk-v b { font-size: 25px; letter-spacing: 0; text-shadow: none; }
  .hud-row { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .hf-row { border-radius: 6px; }
  .hud-cta { border-radius: 7px; background: var(--brand); box-shadow: none; }
  .hud-cta.ghost { background: #fff; border-color: var(--line); color: var(--brand-dark); }
}
@media screen and (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar h1, body.home-mode .topbar h1 { font-size: 20px; }
  .top-actions > .btn { min-height: 42px; }
  .tabbar { border-top-color: var(--line); background: #fff; }
  .tabbar a.on { color: var(--brand-dark); }
  .tabbar a.on svg { background: var(--brand-soft); border-radius: 7px; }
  .list { border: 0; box-shadow: none; }
  .lrow, .crow { border-radius: 8px; }
  .savebar { gap: 6px; }
  .savebar .btn { min-width: 0; white-space: nowrap; padding-inline: 4px; }
  .qv-panel { border-radius: 0; }
  .hud-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud-kpis > .hk:first-child, .hud-kpis > .hk:last-child { grid-column: auto; }
  .hud-row { grid-template-columns: minmax(0, 1fr); }
  .hk-v b, .hk-main .hk-v b { font-size: 20px; }
  .hud-foot .hud-cta { min-height: 44px; }
  .lcard #lUser, .lcard #lPass, .field :is(input, select, textarea), .items-card table.items input { font-size: 16px; }
}
@media screen and (max-width: 420px) {
  .hud-head { flex-wrap: wrap; }
  .hud-badges { width: 100%; }
  .hud-badge { flex: 1; }
  .savebar .btn { font-size: 12px; }
  .dhead { flex-direction: column; align-items: stretch; }
  .dhead .dno { flex-wrap: wrap; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .field, .field :is(input, select, textarea) { min-width: 0; }
  .field :is(input, select, textarea) { max-width: 100%; }
  .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .seg button { padding-inline: 2px; min-width: 0; }
  .att-head { flex-wrap: wrap; }
  .att-head > div:first-child { min-width: 0; }
}
@media screen and (prefers-reduced-motion: reduce) {
  .shell *, .login *, .modal *, .qv-panel *, .pv-body * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.trial-results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; margin: 12px 0; padding: 12px; background: var(--bg); border-radius: 8px; }
.trial-results dd { margin: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#trialNote:empty { display: none; }
#trialNote.trial-loss { color: var(--danger); font-weight: 650; }
#trialAmount[aria-invalid=true] { border-color: var(--danger); }

.quote-pick { appearance: none; border: 0; background: transparent; text-align: left; padding: 4px 0; min-width: 0; cursor: pointer; }
.lrow .quote-pick:hover, .lrow.editing .quote-pick { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.lrow.editing { background: var(--brand-soft); box-shadow: inset 3px 0 var(--brand); }
#quoteSide { display: none; }
.inline-quote { min-width: 0; padding: 12px; background: var(--bg); scroll-margin-top: 78px; }
.inline-quote .items-foot { flex-wrap: wrap; gap: 8px; }
.inline-quote .items-sum { width: 100%; }
.inline-quote .totals { flex-wrap: wrap; }
.inline-quote .savebar { position: static; padding: 10px 0 0; background: transparent; box-shadow: none; }
@media screen and (min-width: 1150px) {
  .main:has(.quote-workspace) { height: 100dvh; display: flex; flex-direction: column; padding-bottom: 14px; }
  .main:has(.quote-workspace) .topbar { flex: none; }
  .view:has(.quote-workspace) { max-width: none; min-height: 0; flex: 1; display: flex; flex-direction: column; }
  .view:has(.quote-workspace) > :not(.quote-workspace) { flex: none; }
  .quote-workspace { flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(300px, 36%) minmax(0, 1fr); gap: 16px; }
  .quote-workspace #listBox, #quoteSide { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
  #quoteSide { display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
  #quoteSide:has(.inline-quote) .quote-side-empty { display: none; }
  .quote-side-empty { min-height: 100%; padding: 24px 18px; display: grid; align-content: center; justify-items: center; gap: 14px; text-align: center; color: var(--muted); }
  .quote-idle-label { color: var(--brand-dark); font-size: 13px; }
  .quote-idle-text { max-width: 24em; min-height: 3.3em; display: grid; align-items: center; color: var(--ink); font-size: 19px; line-height: 1.65; font-weight: 600; }
  .quote-workspace .lhead, .quote-workspace .lrow { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 10px; padding: 8px 12px; }
  .quote-workspace .lhead { display: none; }
  .quote-workspace .lrow { height: auto; min-height: 74px; grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: 'cust cust amt att' 'no sales st act'; }
  .quote-workspace .no { grid-area: no; }
  .quote-workspace .cust { grid-area: cust; }
  .quote-workspace .amt { grid-area: amt; }
  .quote-workspace .st { grid-area: st; }
  .quote-workspace .attcol { grid-area: att; }
  .quote-workspace .act { grid-area: act; }
  /* 业务员归属：桌面工作区里放在单号后面，带「业务员」前缀，一眼看出单是谁的 */
  .quote-workspace .lrow .sales { grid-area: sales; display: inline-block; justify-self: start; align-self: center; font-size: 12px; padding: 2px 9px; }
  .quote-workspace .lrow .sales::before { content: '业务员 '; color: var(--muted); font-weight: 400; }
  .quote-workspace .lrow .date { display: none; }
  .inline-quote .grid2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inline-quote .dhead { flex-wrap: wrap; }
  .inline-quote .savebar { position: sticky; bottom: 0; background: var(--bg); padding-bottom: 8px; }
}
@media screen and (max-width: 1149px) {
  .quote-workspace .inline-quote { border-block: 1px solid var(--line); }
}
/* 701–1149（平板 / 窄窗口）：八列表格放不下会把客户名挤没，改成卡片式，业务员也一并显示 */
@media screen and (min-width: 701px) and (max-width: 1149px) {
  .lhead { display: none; }
  .list { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .lrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "cust cust amt" "no sales st" "att att act";
    gap: 4px 10px;
    height: auto;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }
  .lrow:last-child { border-bottom: 1px solid var(--line); }
  .lrow .cust { grid-area: cust; white-space: normal; }
  .lrow .amt { grid-area: amt; }
  .lrow .no { grid-area: no; font-size: 12.5px; color: var(--muted); }
  .lrow .sales { grid-area: sales; justify-self: start; align-self: center; font-size: 12px; padding: 2px 9px; }
  .lrow .st { grid-area: st; justify-self: end; }
  .lrow .attcol { grid-area: att; justify-self: start; text-align: left; margin-top: 2px; }
  .lrow .act { grid-area: act; justify-self: end; margin-top: 2px; }
  .lrow .date { display: none; }
}
@media screen and (max-width: 1149px) {
  .lrow .sales::before { content: '业务员 '; color: var(--muted); font-weight: 400; }
}

.c-craft button[data-process-pick] { margin-top: 5px; width: 100%; height: 30px; font-size: 12.5px; }
.craft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.craft-card { padding: 18px 20px; margin: 0; }
.craft-head h2 { margin: 0 0 4px; font-size: 17px; }
.craft-head p { margin: 0 0 14px; font-size: 13px; line-height: 1.6; }
.craft-card .process-options { max-height: none; overflow: visible; gap: 8px; }

/* 材质管理：清单上方的搜索行 */
.mat-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.mat-tools .search { flex: 1 1 240px; max-width: 360px; }
.mat-count { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

@media (max-width: 860px) {
  .mat-tools { flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .mat-tools .search { flex: 1 1 100%; max-width: none; }
  .mat-count { font-size: 12px; }
}
.craft-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13.5px; overflow-wrap: anywhere; }
/* 「选择」弹窗里的搜索框 + 被筛掉的行要真的藏起来 */
.pick-search { margin-bottom: 10px; }
.pick-search .search { max-width: none; }
.process-options > label[hidden] { display: none; }

.craft-chip em { font-style: normal; font-size: 11px; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 1px 7px; }
.craft-del { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #f2f5f3; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.craft-del:hover { background: #fdeceb; color: #b8352a; }
.craft-add { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.craft-add input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 860px) {
  .craft-grid { grid-template-columns: 1fr; gap: 12px; }
  .craft-card { padding: 16px; }
}
.process-section { margin: 12px 0; padding: 12px 0; border-top: 1px solid var(--line); }
.process-section h4 { margin: 0 0 8px; }
.process-options { display: flex; flex-wrap: wrap; gap: 8px; max-height: 240px; overflow: auto; }
.process-options > label, .process-options > span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; }
.process-section form { display: flex; gap: 8px; margin-top: 8px; }
.process-section form input { flex: 1; min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 6px; }
@media (min-width: 861px) {
  table.items:has([data-process-pick]) { min-width: 1040px; }
}



/* ---------- 基础设置：工艺管理 / 材质管理 页签 ---------- */
.base-tabs { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.base-tabs a { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink2); font-size: 13.5px; text-decoration: none; }
.base-tabs a:hover { border-color: var(--brand); color: var(--brand-dark); }
.base-tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }

/* 侧栏「基础设置」小类：点标题这行就能收起 / 展开。
   标题这行跟别的菜单项一样大（44 高、14 号字、同一个图标尺寸），
   只有下面的子项往里缩进一格，用来表示从属关系。 */
.nav-group { display: grid; gap: 3px; }
.nav-gt {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 44px;
  margin: 0; padding: 0 10px 0 12px;
  border: 0; border-radius: 7px; background: none; cursor: pointer;
  color: #d2e1de; font: inherit; font-size: 14px;
  text-align: left; transition: background .15s ease, color .15s ease;
}
.nav-gt:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-gt:hover svg { opacity: .95; }
.nav-gt .gt-t { flex: 1 1 auto; }
.nav-gt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.nav-gt .chev { width: 14px; height: 14px; opacity: .6; transition: transform .18s ease, opacity .15s ease; }
.nav-gt:hover .chev { opacity: .95; }
.nav-group.on .nav-gt { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-group[data-open="0"] .nav-gt .chev { transform: rotate(-90deg); }
.nav-group[data-open="0"] .nav-sub { display: none; }
.nav-sub { display: grid; gap: 3px; }
.nav-group a { height: 40px; padding-left: 34px; font-size: 14px; border-radius: 7px; }
@media (max-width: 860px) {
  .nav-gt { height: 44px; font-size: 14px; border-radius: 7px; }
  .nav-gt .chev { width: 16px; height: 16px; }
  .nav-group a { height: 42px; font-size: 14px; border-radius: 7px; }
}

/* 报价明细的材质下拉 */
table.items select { height: 44px; width: 100%; border: 1px solid #e2e8e2; background: #fcfdfc; border-radius: 8px; padding: 0 8px; font-size: 14.5px; color: var(--ink); }
table.items select:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(20, 107, 70, .08); outline: none; }
@media (max-width: 860px) {
  table.items td select { height: 42px; font-size: 15px; }
  .c-craft button[data-process-pick] { margin-top: 6px; height: 34px; font-size: 13.5px; }
  .base-tabs { margin-bottom: 12px; }
}

/* 材质选择：点「选择」弹出可搜索的材质列表 */
.c-mat input[readonly] { cursor: pointer; }
.c-mat button[data-mat-pick] { margin-top: 5px; width: 100%; height: 30px; font-size: 12.5px; }
.mat-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.mat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: auto; text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 13.5px; cursor: pointer; }
.mat-row:hover { border-color: #c8d6cc; background: #f7fbf9; }
.mat-row.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.mat-row .rk { font-size: 11.5px; color: #8b9a90; font-weight: 400; }
.mat-row[hidden] { display: none; }
.mat-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.mat-foot .muted { font-size: 12.5px; }

/* 选择器里的「✎ 手填一个…」：清单里没有的写法也能写进去 */
.mat-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.mat-custom[hidden] { display: none; }
.mat-custom input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--ink);
}
.mat-custom input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 107, 70, .08); }
.mat-custom .btn { flex: none; height: 40px; padding: 0 16px; }
@media (max-width: 720px) { .c-mat button[data-mat-pick] { margin-top: 6px; height: 34px; font-size: 13.5px; } }

/* 品名选择：点「选择」弹出可搜索的品类列表，选中后自动带出材质 / 印刷 / 表面处理 / 后工 */
.c-name button[data-cat-pick] { margin-top: 5px; width: 100%; height: 30px; font-size: 12.5px; }
@media (max-width: 720px) { .c-name button[data-cat-pick] { margin-top: 6px; height: 34px; font-size: 13.5px; } }

/* ---------- 基础设置 · 品类管理 ---------- */
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; }
.cat-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.cat-name { font-size: 15px; color: var(--ink); }
.cat-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.cat-acts .btn.danger { color: #b4453b; border-color: #eccfcb; }
.cat-acts .btn.danger:hover { background: #fdf1ef; border-color: #e0b3ad; }
.cat-fields { display: flex; flex-direction: column; gap: 6px; }
.cat-field { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.75; }
.cat-k { flex: 0 0 60px; color: var(--muted); }
.cat-v { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.cat-v .pchip { font-size: 11.5px; line-height: 1.6; padding: 1px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap; }
.cat-none { font-style: normal; color: #a9b4ad; }
.catg { margin-bottom: 15px; }
.catg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; font-size: 13.5px; }
.catg-head .muted { font-size: 12px; }
.catg-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 138px; overflow: auto; padding: 1px; }
.catg-chip { height: auto; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; color: var(--ink2); cursor: pointer; }
.catg-chip:hover { border-color: #c8d6cc; background: #f7fbf9; }
.catg-chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
@media (max-width: 720px) {
  .cat-item { padding: 11px 12px; }
  .cat-field { flex-direction: column; gap: 2px; }
  .cat-k { flex: none; }
  .catg-chips { max-height: 180px; }
}

/* ---------- 吉祥物 ---------- */
.la-head { display: flex; align-items: center; gap: 22px; }
.la-mascot {
  flex: 0 0 auto; width: 176px; height: 176px; border-radius: 32px;
  background: #fff; padding: 6px; box-sizing: border-box;
  box-shadow: 0 24px 48px rgba(2, 26, 17, .35);
}
.la-mascot img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 26px; mix-blend-mode: multiply; }
.la-head-txt { min-width: 0; }
@media (max-width: 1240px) { .la-mascot { width: 116px; height: 116px; border-radius: 26px; } }
@media (min-width: 861px) and (max-height: 780px) { .la-mascot { width: 100px; height: 100px; border-radius: 22px; } }

.empty .ei.mascot { width: 92px; height: 92px; background: none; border: 0; border-radius: 0; margin-bottom: 2px; }
.empty .ei.mascot img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.qidle-mascot { width: 210px; height: 210px; max-width: 100%; object-fit: contain; mix-blend-mode: multiply; }
@media (max-width: 860px) { .qidle-mascot { width: 148px; height: 148px; } }
.lm-mascot { display: none; width: 46px; height: 46px; border-radius: 13px; object-fit: contain; mix-blend-mode: multiply; flex: 0 0 auto; }
@media (max-width: 860px) { .lm-brand .logo { display: none; } .lm-mascot { display: block; } }
/* 公司 logo（图标） */
.blogo { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(0, 0, 0, .22); }
.sheet .sh-co-row { display: flex; align-items: center; gap: 10px; }
.sheet .sh-logo { width: 40px; height: 40px; object-fit: contain; display: block; flex: 0 0 auto; }
@media print { .sheet .sh-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* 印刷栏：和材质一样是「点选择→搜索」的输入框 */
.c-print input[readonly] { cursor: pointer; }
.c-print button[data-print-pick] { margin-top: 5px; width: 100%; height: 30px; font-size: 12.5px; }
@media (max-width: 720px) {
  .c-print input { cursor: pointer; }
  .c-print button[data-print-pick] { margin-top: 6px; height: 34px; font-size: 13.5px; }
}

/* 印刷可以多选：明细里用小标签列出来，自动换行，不挤成一行 */
.print-view { display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-start; min-height: 38px; height: auto; padding: 5px 6px;
  border: 1px solid #d9e2dd; border-radius: 8px; background: #fff; cursor: pointer; }
.print-view:focus-visible { outline: none; border-color: #1f7a54; box-shadow: 0 0 0 3px rgba(31, 122, 84, .12); }
.print-view .pchip { font-size: 11.5px; line-height: 1.55; padding: 1px 6px; border-radius: 6px; white-space: nowrap;
  background: #e9f4ee; border: 1px solid #cde5d7; color: #1f6b47; }
.print-view .pv-empty { color: #9aa8a1; font-size: 13px; }
@media (max-width: 720px) { .print-view { min-height: 42px; } .print-view .pchip { font-size: 12.5px; } }

/* 生产中：新的状态点、生产按钮、上传核对图 */
.pill.producing { background: #fdf2e2; color: #a2610c; }
.btn-won.prod { background: #fff6e8; border-color: #f0d7b0; color: #a2610c; }
.btn-won.prod:hover { background: #b26a0e; border-color: #b26a0e; color: #fff; box-shadow: 0 4px 12px rgba(178, 106, 14, .22); }
.lrow .act { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

.prod-note { margin: 0 0 10px; line-height: 1.65; font-size: 13px; }
.proof-drop { border: 1.5px dashed #cddcd4; border-radius: 12px; padding: 16px 14px; text-align: center; cursor: pointer;
  background: #fbfdfc; transition: border-color .15s, background .15s; }
.proof-drop:hover, .proof-drop:focus-visible, .proof-drop.over { border-color: #1f7a54; background: #f2fbf6; outline: none; }
.proof-drop b { display: block; font-size: 13.5px; color: #0f6b47; }
.proof-drop span { display: block; margin-top: 4px; font-size: 12px; color: #8b9a93; }
.proof-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.proof-item { display: flex; align-items: center; gap: 10px; border: 1px solid #e3ece7; border-radius: 10px; padding: 8px; background: #fff; }
.proof-thumb { width: 54px; height: 54px; border-radius: 8px; overflow: hidden; background: #f2f5f3; display: flex;
  align-items: center; justify-content: center; flex: none; font-size: 11px; color: #7d8c85; }
.proof-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proof-meta { min-width: 0; flex: 1; }
.proof-meta b { display: block; font-size: 13px; font-weight: 500; color: #22302a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proof-meta small { color: #8b9a93; font-size: 11.5px; }
.proof-del { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #f6efef; color: #9a6a6a;
  font-size: 15px; cursor: pointer; line-height: 1; }
.proof-del:hover { background: #f0dede; color: #8d4f4f; }
.prod-hint { margin-top: 8px; font-size: 12.5px; }
@media (max-width: 720px) {
  .lrow .act { justify-content: flex-start; }
  .proof-drop { padding: 14px 12px; }
}

/* 品类关联：选择弹窗里「只列这个品类配好的」提示 + 折叠的其余选项 */
.pick-scope { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; }
.pick-more { flex: 0 0 100%; width: 100%; margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 8px; }
.pick-more > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 4px 0; list-style: none; user-select: none; }
.pick-more > summary::-webkit-details-marker { display: none; }
.pick-more > summary::before { content: "▸ "; }
.pick-more[open] > summary::before { content: "▾ "; }
.pick-more > summary:hover { color: var(--brand); }
.mat-list .pick-more { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.mat-list .pick-more > summary { flex: 0 0 auto; }

/* 附件分两栏：客户文件 / 生产核对文件 */
.att-group { display: flex; flex-direction: column; gap: 10px; }
.att-group + .att-group { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.att-group-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.att-group-head b { font-size: 13.5px; }
.att-group-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11.5px; font-weight: 600; }
.att-group[data-att-group="proof"] .att-group-count { background: #fdf3e6; color: #96631f; }
.att-group-head .muted { font-size: 12px; }
.att-group-list { display: flex; flex-direction: column; gap: 10px; }
.att-group-list .att-empty { padding: 12px; }
.inline-quote .att-head { flex-wrap: wrap; }
.inline-quote .att-head > div:first-child { flex: 1 1 100%; }
.inline-quote .att-item { flex-wrap: wrap; }
.inline-quote .att-meta { flex: 1 1 140px; }

/* ---------- 首页右栏：该跟进了 / 客户排行 / 本月小结 ---------- */
.hud-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.hud-main { min-width: 0; }
.hud-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; position: sticky; top: 14px; }

.hr-card {
  background: #fff;
  border: 1px solid rgba(18, 130, 116, .13);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 2px 8px rgba(19, 66, 58, .05);
  min-width: 0;
}
.hr-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.hr-h b { font-size: 13px; color: #10332c; letter-spacing: .6px; }
.hr-h span { font-size: 9.5px; letter-spacing: 1.2px; color: #a3bab4; flex: none; }

.hr-list { display: flex; flex-direction: column; gap: 6px; }
.hr-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px; border-radius: 10px;
  background: #f6fbf9; border: 1px solid transparent;
  text-decoration: none;
  transition: background .16s, border-color .16s, transform .16s;
}
.hr-item:hover { background: #edf8f4; border-color: #cbe8e0; transform: translateX(2px); }
.hr-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hr-no { font-size: 10.5px; color: #86a09a; letter-spacing: .2px; }
.hr-days { font-size: 9.5px; color: #0b8f7c; background: rgba(15, 174, 151, .11); padding: 1px 6px; border-radius: 999px; flex: none; }
.hr-days.warn { color: #b45309; background: rgba(217, 119, 6, .14); }
.hr-item-bot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hr-cust { font-size: 12.5px; font-weight: 600; color: #10332c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-amt { font-size: 12px; color: #0b8f7c; font-variant-numeric: tabular-nums; flex: none; }
.hr-empty { font-size: 12px; color: #a3bab4; padding: 12px 4px; text-align: center; }
.hr-more { display: block; margin-top: 9px; font-size: 11.5px; color: #0b8f7c; text-align: right; text-decoration: none; }
.hr-more:hover { text-decoration: underline; }

.hr-rank { display: flex; flex-direction: column; gap: 10px; }
.hr-rank-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  grid-template-areas: "i n v" "i b b";
  align-items: center;
  gap: 3px 8px;
}
.hr-rank-i {
  grid-area: i; width: 18px; height: 18px; border-radius: 6px;
  display: grid; place-items: center;
  font-style: normal; font-size: 10.5px; font-weight: 700;
  color: #7b9590; background: #eff5f3;
}
.hr-rank-i.top { color: #fff; background: linear-gradient(135deg, #14bda4, #5f93f5); }
.hr-rank-n { grid-area: n; font-size: 12.5px; color: #10332c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-rank-v { grid-area: v; font-size: 12px; color: #10332c; font-variant-numeric: tabular-nums; }
.hr-rank-bar { grid-area: b; display: block; height: 4px; border-radius: 999px; background: #edf3f1; position: relative; overflow: hidden; }
.hr-rank-bar::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--w, 0%); border-radius: 999px;
  background: linear-gradient(90deg, #14bda4, #5f93f5);
}

.hr-files { display: flex; flex-direction: column; gap: 6px; }
.hr-file {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 10px;
  background: #f6fbf9; text-decoration: none;
  transition: background .16s, transform .16s;
}
.hr-file:hover { background: #edf8f4; transform: translateX(2px); }
.hr-file-ext {
  flex: none; width: 36px; height: 24px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; letter-spacing: .3px;
  color: #0b8f7c; background: rgba(15, 174, 151, .13);
}
.hr-file-ext.proof { color: #b45309; background: rgba(217, 119, 6, .16); }
.hr-file-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hr-file-name { font-size: 12px; color: #10332c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-file-sub { font-size: 10px; color: #93aca6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hr-mini { display: flex; flex-direction: column; gap: 9px; }
.hr-mini > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: #6b8981; }
.hr-mini b { font-size: 14px; color: #10332c; font-variant-numeric: tabular-nums; }
.hr-mini b.neg { color: #dc2626; }

@media (max-width: 1500px) {
  .hud-grid { grid-template-columns: minmax(0, 1fr); }
  .hud-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; position: static; }
}
@media (max-width: 980px) {
  .hud-rail { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 右侧「就地编辑」面板：12 列的明细表放不下，改成三列卡片式，一行都看全 ---------- */
@media (min-width: 1150px) {
  .inline-quote .items-scroll { overflow: visible; }
  .inline-quote table.items { min-width: 0; display: block; }
  .inline-quote table.items thead { display: none; }
  .inline-quote table.items tbody { display: block; }
  .inline-quote table.items tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px 10px;
    padding: 14px 12px 12px;
    border-bottom: 1px solid var(--line2);
  }
  .inline-quote table.items tr:last-child { border-bottom: 0; }
  /* grid-area: auto 很重要：列表页的 .amt 带 grid-area: amt，会把金额甩到隐藏的第 5 列 */
  .inline-quote table.items td { display: block; padding: 0 !important; border: 0; min-width: 0; grid-area: auto; }
  .inline-quote table.items td::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .inline-quote table.items td input { border: 1px solid var(--line); background: #fff; height: 40px; font-size: 14px; }
  .inline-quote table.items td.amt input { height: 44px; font-size: 16px; background: #f7fbf8; }
  .inline-quote table.items td.c-sup input { height: 42px; font-size: 14px; }
  .inline-quote table.items td.c-name { grid-column: span 2; }
  .inline-quote table.items td.c-spec { grid-column: span 1; }
  .inline-quote table.items td.amt { text-align: left; font-size: 14px; font-weight: 600; color: var(--ink); align-self: end; }
  .inline-quote table.items td.del {
    grid-column: 1 / -1;
    width: auto;
    display: flex; gap: 6px; justify-content: flex-end;
    padding-top: 2px !important;
  }
  .inline-quote table.items td.del .row-act { width: auto; height: 28px; margin: 0; padding: 0 9px; font-size: 12px; }
  .inline-quote table.items td.del::before { display: none; }
  .inline-quote table.items tr[data-tier] td.tier-cell { display: none; }
  .inline-quote table.items tr[data-tier] { background: #fbfdfb; }
  .inline-quote table.items tr[data-tier] td.c-qty::before { content: "数量 · 同款"; color: var(--brand); }
  .inline-quote .items-tip { font-size: 11.5px; line-height: 1.6; }
}

/* ---------- 报价编辑页右侧信息栏：客户名片 / 本单小结 / 这个客户的最近报价 ---------- */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.edit-main { min-width: 0; }
.edit-rail { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.er-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.er-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.er-h b { font-size: 13px; color: var(--ink); letter-spacing: .4px; }
.er-h span { font-size: 9.5px; letter-spacing: 1.1px; color: var(--muted); flex: none; }
.er-name {
  font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.er-rows { display: flex; flex-direction: column; gap: 8px; }
.er-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.er-rows b {
  font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums;
  text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%;
}
.er-rows b.neg { color: var(--danger); }
.er-rows .er-total { border-top: 1px dashed var(--line); padding-top: 9px; margin-top: 2px; }
.er-rows .er-total span { font-size: 12.5px; color: var(--ink2); }
.er-rows .er-total b { font-size: 19px; font-weight: 800; color: var(--brand-dark); }

.er-list { display: flex; flex-direction: column; gap: 6px; }
.er-his {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 10px; border-radius: 10px; background: #f7faf9;
  text-decoration: none;
  transition: background .16s, transform .16s;
}
.er-his:hover { background: #eef6f3; transform: translateX(2px); }
.er-his-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.er-his-no { font-size: 10.5px; color: var(--muted); }
.er-his-st {
  font-size: 10px; color: var(--brand-dark); background: var(--brand-soft);
  padding: 1px 6px; border-radius: 999px; flex: none;
}
.er-his-bot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.er-his-amt { font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.er-empty { font-size: 12px; color: var(--muted); padding: 10px 4px; text-align: center; }

@media (max-width: 1699px) {
  .edit-grid { grid-template-columns: minmax(0, 1fr); }
  .edit-rail { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 1000px) {
  .edit-rail { grid-template-columns: minmax(0, 1fr); }
}

/* ================= 侧栏底部：动态头像（2026-12-02） ================= */
.side-foot { gap: 10px; }
.who-card {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  padding: 5px 9px 5px 5px;
  margin: -5px 0 -5px -5px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.who-card:hover { background: rgba(255, 255, 255, .075); border-color: rgba(255, 255, 255, .1); }
.who-card:active { transform: scale(.982); }
.who-card:focus-visible { outline: none; border-color: rgba(98, 211, 163, .55); box-shadow: 0 0 0 3px rgba(98, 211, 163, .16); }

.avatar { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }

/* 外圈光弧：慢慢转 */
.av-ring {
  position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(98, 211, 163, 0) 0deg,
    rgba(98, 211, 163, .95) 62deg,
    rgba(79, 209, 197, .95) 128deg,
    rgba(98, 211, 163, 0) 196deg,
    rgba(98, 211, 163, 0) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
  animation: avSpin 4.6s linear infinite;
}
@keyframes avSpin { to { transform: rotate(360deg); } }

/* 头像本体：名字第一个字 */
.av-face {
  position: relative; z-index: 1;
  width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; letter-spacing: .5px; line-height: 1;
  color: #eafff7;
  background: linear-gradient(150deg, #26a67d 0%, #12805a 55%, #0e6a4b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 8px rgba(0, 0, 0, .28);
  transition: box-shadow .25s ease;
}
.who-card:hover .av-face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), 0 0 0 3px rgba(98, 211, 163, .18), 0 4px 14px rgba(0, 0, 0, .3); }

/* 在线小绿点：会呼吸 */
.av-live {
  position: absolute; right: -1px; bottom: -1px; z-index: 2;
  width: 10px; height: 10px; border-radius: 50%;
  background: #62d3a3;
  border: 2px solid #0b3426;
  animation: avLive 2.6s ease-out infinite;
}
@keyframes avLive {
  0% { box-shadow: 0 0 0 0 rgba(98, 211, 163, .55); }
  68% { box-shadow: 0 0 0 7px rgba(98, 211, 163, 0); }
  100% { box-shadow: 0 0 0 0 rgba(98, 211, 163, 0); }
}

/* 换成自己的照片时：不再套那道转动的绿色光弧，改成一圈很细的白边，
   看起来才像「照片被框在圆里」，而不是绿色从边上漏出来 */
.avatar.has-img .av-ring { display: none; }
.avatar.has-img .av-face {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .16), 0 2px 8px rgba(0, 0, 0, .32);
}
.who-card:hover .avatar.has-img .av-face {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .26), 0 0 0 4px rgba(98, 211, 163, .16), 0 4px 14px rgba(0, 0, 0, .34);
}
.avatar.has-img .av-img { display: block; }
/* 右下角那个会呼吸的在线小绿点，贴在照片上也像「漏绿」——有照片时就一起收掉 */
.avatar.has-img .av-live { display: none; }

.who-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.who-name { font-size: 13px; color: rgba(255, 255, 255, .93); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { font-size: 10.5px; letter-spacing: .4px; color: rgba(255, 255, 255, .45); }

@media (prefers-reduced-motion: reduce) {
  .av-ring, .av-live { animation: none; }
}

/* ================= 客户管理：编号列（2026-12-02） ================= */
.ctable .lhead, .ctable .crow { grid-template-columns: 72px minmax(0, 1fr) 84px 128px 76px; }
.ctable.admin .lhead, .ctable.admin .crow { grid-template-columns: 72px minmax(0, 1fr) 76px 78px 122px 76px; }
.crow .c-code { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.cust-code-line { margin: 0 0 10px; font-size: 12.5px; }
.cust-code-line b { color: var(--brand-dark); letter-spacing: .3px; }

@media (max-width: 860px) {
  /* 手机上不占一列，编号收进隐藏，别把卡片挤坏 */
  .ctable .c-code { display: none; }
  .ctable .lhead, .ctable .crow { grid-template-columns: minmax(0, 1fr) auto; }
  .ctable.admin .lhead, .ctable.admin .crow { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ================= 头像：自定义图片（2026-12-02） ================= */
.av-face { position: relative; overflow: hidden; }
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.av-dialog { display: flex; align-items: flex-start; gap: 16px; }
.av-big {
  flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  font-size: 34px; font-weight: 700; color: #eafff7;
  background: linear-gradient(150deg, #26a67d 0%, #12805a 55%, #0e6a4b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 14px rgba(19, 66, 58, .16);
}
.av-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-dialog-txt { min-width: 0; }
.av-dialog-txt p { margin: 0; line-height: 1.7; }
.av-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 520px) {
  .av-dialog { flex-direction: column; align-items: center; text-align: center; }
  .av-actions { justify-content: center; }
}

/* ================= 报价编辑：撤回 / 重做（2026-12-02） ================= */
.qh-acts { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.qh-acts .btn { flex: 0 0 auto; }
.qh-acts .btn svg { width: 14px; height: 14px; }
.btn:disabled,
.btn[disabled] {
  opacity: .38;
  cursor: not-allowed;
  pointer-events: none;
}
.inline-quote .qh-acts { gap: 4px; }

@media (max-width: 860px) {
  /* 手机上按钮多，撤回/重做只留图标 */
  .qh-acts .lbl { display: none; }
  .qh-acts .btn { flex: 0 0 auto; width: 42px; padding: 0; }
  .qh-acts .btn svg { width: 17px; height: 17px; }
}

/* ---------- 头像裁剪：可拖动 / 可缩放（2026-12-02） ---------- */
.av-crop {
  position: relative; flex: none;
  width: 170px; height: 170px; border-radius: 50%;
  overflow: hidden;
  background-color: #eef4f1;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  cursor: grab; touch-action: none; user-select: none;
}
.av-crop.dragging { cursor: grabbing; }
.av-crop img {
  position: absolute; left: 0; top: 0;
  max-width: none; max-height: none;
  pointer-events: none;
  object-fit: fill;
}
.av-crop-hint { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; padding: 0 18px; pointer-events: none; }
.av-zoom { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.av-zoom[hidden] { display: none; }
.av-zoom input[type='range'] { flex: 1; min-width: 0; accent-color: var(--brand); }
.av-dialog-txt strong { color: var(--ink2); font-weight: 600; }

/* ---------- 材质栏也改成多选（2026-12-02） ---------- */
.c-mat .print-view { min-height: 46px; align-content: flex-start; }
.c-mat .print-view .pv-empty { font-size: 12.5px; }
.inline-quote .c-mat .print-view { min-height: 40px; }

/* ================= 客户 / 联系人：输入框里带一个小箭头（2026-12-03） ================= */
/* 原来是浏览器原生的 datalist 下拉，箭头丑、和这套界面不搭；换成自己的箭头 + 可搜索弹窗 */
.field-pick { position: relative; }
.field-pick input { padding-right: 36px; }
.fp-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: #8aa09a; cursor: pointer;
  transition: background .15s, color .15s;
}
.fp-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fp-btn:hover { background: rgba(20, 107, 70, .09); color: var(--brand-dark); }
.fp-btn:active { transform: translateY(-50%) scale(.94); }
.fp-btn[hidden] { display: none; }
.fp-btn:focus-visible { outline: 2px solid #168064; outline-offset: 1px; }

/* 客户选择弹窗里的一行：名字 + 联系人/地址 */
.pick-cust { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.pick-cust-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.pick-cust-main b { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.pick-cust-main em { font-style: normal; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-cust.on .pick-cust-main b { color: var(--brand-dark); }

/* 输入框不要再套「外描边 + 内发光」两层绿圈 */
:is(input, select, textarea):focus-visible { outline: none; }

/* ================= 管理员：代码库 / 可视化数据库（2026-12-03） ================= */
.nav-cap {
  padding: 12px 12px 4px;
  font-size: 10.5px; letter-spacing: 1.8px;
  color: rgba(210, 225, 222, .42);
}

.adm { display: grid; grid-template-columns: 282px minmax(0, 1fr); gap: 14px; align-items: start; }
.adm-side { padding: 14px; position: sticky; top: 14px; }
.adm-side-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.adm-side-h b { font-size: 13.5px; color: var(--ink); }
.adm-side-h span { font-size: 11.5px; }
.adm-search { max-width: none; margin-bottom: 10px; }
.adm-list { display: grid; gap: 3px; max-height: calc(100dvh - 300px); overflow: auto; }
.adm-empty { font-size: 12.5px; }
.adm-tip { margin-top: 10px; font-size: 11px; line-height: 1.6; }
.adm-load { padding: 26px 6px; font-size: 12.5px; color: var(--muted); text-align: center; }
.adm-load.err { color: var(--danger); }

/* 代码库 */
.code-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; text-align: left;
  color: var(--ink2);
}
.code-item:hover { background: #f4f8f5; border-color: var(--line2); }
.code-item.on { background: var(--brand-soft); border-color: #cfe4d8; color: var(--brand-dark); }
.code-ext {
  flex: none; min-width: 30px; padding: 2px 4px;
  border-radius: 4px; background: #eef3ef; color: #70857a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px; text-align: center; letter-spacing: .3px;
}
.code-item.on .code-ext { background: #d8ebe0; color: var(--brand-dark); }
.code-name { flex: 1 1 auto; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-size { flex: none; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.code-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
}
.code-title { min-width: 0; }
.code-title b { display: block; font-size: 13.5px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-title span { display: block; margin-top: 3px; font-size: 11.5px; }
.code-acts { display: flex; gap: 6px; flex: none; }
.code-scroll {
  display: flex; overflow: auto;
  max-height: calc(100dvh - 262px); min-height: 240px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 0 0 var(--radius) var(--radius);
}
.code-gutter, .code-pre {
  margin: 0; padding: 12px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 21px;
  tab-size: 2; -moz-tab-size: 2;
}
.code-gutter {
  flex: none; padding-left: 14px; padding-right: 10px;
  text-align: right; color: #b4c1b9;
  background: #f5f9f6; border-right: 1px solid var(--line2);
  user-select: none; position: sticky; left: 0; z-index: 1;
}
.code-pre { flex: 1 1 auto; padding-right: 18px; min-width: 0; color: #26332c; }
.code-pre code { font: inherit; }
.tk-kw { color: #0f6b46; font-weight: 600; }
.tk-str { color: #a1521e; }
.tk-cmt { color: #93a29a; font-style: italic; }
.tk-num { color: #2f5f9e; }

/* 数据库 */
.db-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 8px 9px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; text-align: left;
}
.db-item:hover { background: #f4f8f5; border-color: var(--line2); }
.db-item.on { background: var(--brand-soft); border-color: #cfe4d8; }
.db-tname {
  flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--ink2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.db-item.on .db-tname { color: var(--brand-dark); }
.db-trows { flex: none; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.db-head { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 8px; }
.db-title { min-width: 0; }
.db-title b { display: block; font-size: 13.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.db-title span { display: block; margin-top: 3px; font-size: 11.5px; }
.db-tools { display: flex; align-items: center; gap: 6px; width: 100%; flex-wrap: nowrap; }
.db-tools .search { flex: 1 1 auto; width: auto; min-width: 120px; }
.db-tools select { flex: none; width: auto; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 8px; font-size: 12.5px; }
.db-tools .btn { flex: none; }

.db-cols { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 14px 10px; }
.db-col {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 3px 7px; border-radius: 6px;
  background: #f5f8f5; border: 1px solid var(--line2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px; color: var(--ink2);
}
.db-col i { font-style: normal; color: #9aac9f; font-size: 9.5px; }
.db-col.pk { background: #fdf6e8; border-color: #f0e2c4; color: #8a621f; }
.db-col.pk i { color: #b08a45; }
.db-note { padding: 0 14px 8px; font-size: 11px; }

.db-grid-wrap {
  overflow: auto; margin: 0 14px 10px;
  max-height: calc(100dvh - 430px); min-height: 180px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
table.db-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.db-grid th {
  position: sticky; top: 0; z-index: 1;
  padding: 8px 10px; text-align: left; white-space: nowrap;
  background: #f4f8f5; border-bottom: 1px solid var(--line);
  color: #52665b; font-weight: 600; font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
table.db-grid th.sortable { cursor: pointer; user-select: none; }
table.db-grid th.sortable:hover { color: var(--brand-dark); background: #eef5f0; }
table.db-grid th.on { color: var(--brand-dark); }
table.db-grid td {
  padding: 7px 10px; border-bottom: 1px solid var(--line2);
  white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink2);
}
table.db-grid tbody tr:hover td { background: #f8fbf9; }
table.db-grid td.null { color: #b9c4bd; font-style: italic; }
table.db-grid td.db-empty { text-align: center; color: var(--muted); padding: 26px; }

.db-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 12px; font-size: 11.5px; flex-wrap: wrap; }
.db-pager { display: inline-flex; gap: 6px; }

.db-qcard { margin: 0 14px 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.db-qcard summary { cursor: pointer; font-size: 12.5px; color: var(--brand-dark); font-weight: 600; }
.db-qcard p { margin: 8px 0; font-size: 11.5px; }
.db-qcard textarea {
  width: 100%; min-height: 84px; resize: vertical;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6; background: #fcfdfc;
}
.db-qfoot { display: flex; justify-content: flex-end; margin: 8px 0; }
.db-qmeta { font-size: 11.5px; margin: 4px 0 6px; }
.db-qerr { color: var(--danger); font-size: 12.5px; padding: 8px 0; }
.db-qcard .db-grid-wrap { margin: 6px 0 0; max-height: 320px; }

.cell-full {
  margin: 0; max-height: 58vh; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.65; color: var(--ink2);
}
.sys-links { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .adm { grid-template-columns: minmax(0, 1fr); }
  .adm-side { position: static; padding: 12px; }
  .adm-list { display: flex; gap: 6px; overflow-x: auto; max-height: none; padding: 2px 2px 4px; }
  .code-item, .db-item {
    flex: none; width: auto; white-space: nowrap;
    background: #f6f9f7; border-color: var(--line2);
  }
  .code-size, .db-trows { display: none; }
  .code-scroll { max-height: 52vh; min-height: 180px; }
  .code-gutter, .code-pre { font-size: 11.5px; line-height: 19px; }
  .db-head { padding: 10px 12px 6px; }
  .db-tools { width: 100%; }
  .db-tools .search { flex: 1 1 auto; width: auto; min-width: 80px; }
  .db-tools select { padding: 0 6px; }
  .db-grid-wrap { margin: 0 10px 8px; max-height: 56vh; }
  .db-foot, .db-qcard { margin-left: 10px; margin-right: 10px; }
  .db-cols { padding: 0 12px 8px; }
  table.db-grid td { max-width: 220px; }
}

/* ================= 管理员：运行状态（2026-12-03） ================= */
.st { display: grid; gap: 12px; }

.st-hero { padding: 16px 18px; display: grid; gap: 14px; }
.st-hero-top { display: flex; align-items: center; gap: 14px; }
.st-beat { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.st-core {
  position: relative; z-index: 1;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
.st-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--brand); opacity: .25;
  animation: stPulse 2.6s ease-out infinite;
}
@keyframes stPulse {
  0% { transform: scale(.45); opacity: .3; }
  70% { transform: scale(1); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}
.st-hero.warn .st-core { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.st-hero.warn .st-ring { background: var(--amber); }
.st-hero.down .st-core { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.st-hero.down .st-ring { background: var(--danger); }

.st-hero-t { min-width: 0; flex: 1 1 auto; }
.st-hero-t b { display: block; font-size: 17px; letter-spacing: .2px; }
.st-hero-t p { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.st-hero.warn .st-hero-t b { color: var(--amber); }
.st-hero.down .st-hero-t b { color: var(--danger); }

.st-badge {
  flex: none; padding: 4px 10px; border-radius: 99px;
  background: #f5f8f5; border: 1px solid var(--line2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px; color: var(--muted);
}

.st-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.st-kpi {
  padding: 9px 11px; border-radius: 11px;
  background: #f8faf8; border: 1px solid var(--line2);
}
.st-kpi span { display: block; font-size: 11px; color: var(--muted); }
.st-kpi b { display: block; margin-top: 1px; font-size: 15px; font-variant-numeric: tabular-nums; }

.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.st-mod {
  display: flex; flex-direction: column; gap: 7px;
  padding: 13px 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.st-mod header { display: flex; align-items: center; gap: 7px; }
.st-mod header b { font-size: 13.5px; }
.st-mod header em {
  margin-left: auto; flex: none;
  padding: 1px 7px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-style: normal; font-size: 10.5px;
}
.st-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.st-mod.warn .st-dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.st-mod.warn header em { background: var(--amber-soft); color: var(--amber); }
.st-mod.down .st-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.st-mod.down header em { background: var(--danger-soft); color: var(--danger); }

.st-desc { font-size: 11.5px; color: var(--muted); }
.st-ms { display: grid; gap: 0; }
.st-ms li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 4px 0; border-bottom: 1px dashed var(--line2);
  font-size: 12.5px;
}
.st-ms li:last-child { border-bottom: 0; }
.st-ms li span { flex: none; color: var(--muted); }
.st-ms li b { font-weight: 500; text-align: right; word-break: break-word; }
.st-mod footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 3px; font-size: 11px; color: var(--muted);
}
.st-lat {
  flex: none; padding: 1px 6px; border-radius: 5px;
  background: #f3f7f4; font-variant-numeric: tabular-nums;
}
.st-note {
  padding: 6px 8px; border-radius: 8px;
  background: var(--amber-soft); color: #8a5f21; font-size: 11.5px; line-height: 1.5;
}
.st-mod.down .st-note { background: var(--danger-soft); color: #8f3535; }

.st-errors { padding: 14px; }
.st-err-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.st-err-h b { font-size: 13.5px; }
.st-errs { display: grid; gap: 6px; }
.st-errs li {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 7px 9px; border-radius: 9px;
  background: #fdf7f6; border: 1px solid #f4e4e2;
  font-size: 12.5px;
}
.st-err-t { flex: none; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.st-err-p { flex: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: #8f3535; }
.st-err-m { flex: 1 1 200px; min-width: 0; color: var(--ink2); word-break: break-word; }
.st-noerr { font-size: 12.5px; padding: 6px 0 2px; }
.st-err-foot { margin-top: 10px; font-size: 11px; }

.st-fail { padding: 22px; display: grid; gap: 6px; }
.st-fail b { font-size: 14px; color: var(--danger); }
.st-fail p { font-size: 12.5px; }

.st-switch {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--ink2); cursor: pointer; user-select: none;
}
.st-switch input { width: 14px; height: 14px; accent-color: var(--brand); }

/* 数据库下载 */
.db-dl {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 0 14px 10px;
}
.db-dl .muted { font-size: 11px; }

@media (max-width: 900px) {
  .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-hero-top { flex-wrap: wrap; }
  .st-badge { display: none; }
  .st-grid { grid-template-columns: minmax(0, 1fr); }
  .st-error, .st-errors { padding: 12px; }
  .db-dl { padding: 0 12px 8px; }
}

@media (max-width: 560px) {
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-hero .st-switch span { display: none; }
  .st-hero { padding: 14px; }
  .st-hero-t b { font-size: 15.5px; }
}

/* ================= 管理员：登录记录 / IP 锁定 ================= */
.lg { display: grid; gap: 12px; }
.lg > * { min-width: 0; }
.lg-top { padding: 14px; display: grid; gap: 12px; }
.lg-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lg-warn { color: var(--amber); }

.lg-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.lg-form .field { margin: 0; width: 200px; }
.lg-form .btn { height: 36px; }
.lg-me { font-size: 11.5px; padding-bottom: 8px; }
.lg-me b { font-weight: 500; color: var(--ink2); }

.lg-blocks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.lg-blocks > b { font-size: 12px; color: var(--ink2); }
.lg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 4px 3px 9px; border-radius: 99px;
  background: var(--danger-soft); border: 1px solid #f2dedb;
  color: #8f3535; font-size: 11.5px;
}
.lg-chip i { font-style: normal; color: #a8625c; }
.lg-chip button {
  width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: rgba(178, 65, 65, .12); color: #8f3535;
  line-height: 1; font-size: 13px;
}
.lg-chip button:hover { background: var(--danger); color: #fff; }

.lg-table-card { padding: 14px; }
.lg-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.lg-h b { font-size: 13.5px; }
.lg-h span { font-size: 11.5px; }
.lg-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table.lg-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.lg-table th {
  position: sticky; top: 0; z-index: 1;
  padding: 8px 10px; text-align: left; white-space: nowrap;
  background: #f4f8f5; border-bottom: 1px solid var(--line);
  color: #52665b; font-size: 11.5px; font-weight: 600;
}
table.lg-table td { padding: 9px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap; vertical-align: middle; }
table.lg-table tr:last-child td { border-bottom: 0; }
table.lg-table tr.fail td { background: #fdf9f8; }
.lg-time { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lg-who b { font-weight: 500; }
.lg-who span { margin-left: 6px; color: var(--muted); font-size: 11px; }
.lg-ok { color: var(--brand-dark); font-size: 11.5px; }
.lg-no { color: var(--danger); font-size: 11.5px; }
.lg-ipcell { display: inline-flex; align-items: center; gap: 8px; }
.lg-ipcell em {
  font-style: normal; padding: 0 6px; border-radius: 4px;
  font-size: 10.5px; background: var(--danger-soft); color: var(--danger);
}
.lg-table .lg-res { white-space: nowrap; }
.lg-why { margin-left: 7px; font-style: normal; font-size: 11px; color: var(--muted); }
.lg-lock {
  padding: 1px 8px; border-radius: 99px;
  border: 1px solid var(--line); background: #f6f9f7;
  font-size: 11px; color: var(--ink2);
}
.lg-lock:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.lg-loc { max-width: 420px; }
.lg-loc-t { display: inline-block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.lg-map { margin-left: 7px; font-size: 10.5px; color: var(--brand); border-bottom: 1px dashed currentColor; }
.lg-quick { display: inline-flex; gap: 4px; margin-left: 7px; vertical-align: middle; }
.lg-q {
  padding: 0 6px; border-radius: 5px;
  border: 1px solid var(--line); background: #f6f9f7;
  font-size: 10px; line-height: 16px; color: var(--ink2);
}
.lg-q:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.lg-q-no:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.lg-dev { color: var(--ink2); font-size: 11.5px; }
.lg-empty { text-align: center; color: var(--muted); padding: 26px; }
.lg-tip { margin-top: 10px; font-size: 11px; }
.lg-swipe { display: none; margin-top: 8px; font-size: 11px; }

@media (max-width: 900px) {
  .lg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-form .field { width: calc(50% - 5px); }
  .lg-form .btn { flex: 1 1 100%; }
  .lg-me { flex: 1 1 100%; padding-bottom: 0; }
  table.lg-table { min-width: 640px; }
  .lg-swipe { display: block; }
  .lg-loc { max-width: 260px; }
  .lg-loc-t { max-width: 150px; }
}

/* ================= 管理员：地区限制（2026-12-03） ================= */
.lg-geo { padding: 14px; display: grid; gap: 11px; }
.lg-geo-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lg-geo-h b { font-size: 13.5px; }
.lg-geo-state { font-size: 11.5px; color: var(--muted); }
.lg-geo-on { color: var(--brand-dark); font-weight: 500; }
.lg-geo-off { color: var(--muted); }
.lg-geo-sw { margin-left: auto; }
.lg-geo-tip { font-size: 11.5px; line-height: 1.55; }

.lg-geo-opts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lg-geo-unk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); flex: none; }
.lg-geo-unk select {
  height: 28px; padding: 0 22px 0 8px; border-radius: 8px;
  border: 1px solid var(--line2); background: #fbfdfc; font-size: 12px; color: var(--ink);
}
.lg-geo-picks { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.lg-geo-picks .muted { font-size: 11px; }
.lg-pick {
  padding: 1px 7px; border-radius: 99px;
  border: 1px dashed var(--line); background: #f9fcfa;
  font-size: 11px; color: var(--ink2);
}
.lg-pick:hover { border-style: solid; border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }

.lg-geo-rules { display: grid; gap: 7px; padding: 10px 11px; border-radius: 11px; background: #f8faf8; border: 1px solid var(--line2); }
.lg-geo-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lg-geo-k { flex: none; font-size: 11.5px; color: var(--ink2); min-width: 44px; }
.lg-geo-hint { font-size: 10.5px; margin-right: 3px; }
.lg-chip-allow { background: var(--brand-soft); border-color: #d5ece5; color: var(--brand-dark); }
.lg-chip-allow i { color: #5f8b7e; }
.lg-chip-allow button { background: rgba(20, 150, 120, .1); color: var(--brand-dark); }
.lg-chip-deny { background: var(--danger-soft); border-color: #f2dedb; color: #8f3535; }

.lg-geo-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-geo-form select,
.lg-geo-form input {
  height: 32px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line2); background: #fff; font-size: 12.5px; color: var(--ink);
}
.lg-geo-form select { flex: 0 0 auto; width: 96px; min-width: 0; }
.lg-geo-form input { flex: 1 1 170px; min-width: 0; }
.lg-geo-form .btn { height: 32px; flex: none; }

@media (max-width: 900px) {
  .lg-geo { padding: 12px; }
  .lg-geo-sw { margin-left: 0; }
  .lg-geo-form input { flex: 1 1 100%; }
  .lg-geo-form .btn { flex: 1 1 auto; }
}

/* ================= 管理员：精确位置（GPS 半径） ================= */
.lg-gps-pos { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 11.5px; }
.lg-gps-pos b { font-weight: 500; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink2); }
.lg-gps-pos .muted { font-size: 11px; }
.lg-gps-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.lg-gps-f { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.lg-gps-f input,
.lg-gps-f select {
  height: 32px; padding: 0 9px; border-radius: 9px;
  border: 1px solid var(--line2); background: #fff; font-size: 12.5px; color: var(--ink);
}
.lg-gps-f input[id='gpsLabel'] { width: 120px; }
.lg-gps-f select { width: 138px; }
.lg-gps-num { display: inline-flex; align-items: center; gap: 5px; }
.lg-gps-num input { width: 84px; }
.lg-gps-num i { font-style: normal; font-size: 11.5px; color: var(--muted); }

.lg-gps-tag {
  margin-left: 7px; padding: 0 6px; border-radius: 5px;
  background: #eef7f3; color: var(--brand-dark);
  font-size: 10.5px; font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .lg-gps-row { gap: 8px; }
  .lg-gps-f { flex: 1 1 130px; }
  .lg-gps-f input[id='gpsLabel'], .lg-gps-f select { width: 100%; }
  .lg-gps-num { width: 100%; }
  .lg-gps-num input { flex: 1 1 auto; width: auto; }
  .lg-gps-row .btn { flex: 1 1 auto; }
}

/* ================= 首页周期切换（2026-12-03） ================= */
.per { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.per .mon-pick select { height: 34px; background-color: #f7fbf9; }
.per-seg { background: #eaf3ef; padding: 3px; }
.per-seg button { height: 28px; padding: 0 13px; font-size: 12.5px; color: #4d6a60; }
.per-seg button:hover { color: var(--brand-dark); }
.per-seg button.on {
  background: #fff; color: var(--brand-dark); font-weight: 600;
  box-shadow: 0 1px 3px rgba(18, 48, 32, .12);
}
.hud.is-busy { opacity: .55; transition: opacity .12s ease; }

@media (max-width: 860px) {
  .per { width: 100%; gap: 8px; justify-content: stretch; }
  .per-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .per-seg button { padding: 0 4px; }
  .per .mon-pick { width: 100%; }
  .per .mon-pick select { width: 100%; }
}

/* ================= 装箱计算（2026-12-04） ================= */
.pk { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.pk > * { min-width: 0; }
.pk-form { padding: 15px; display: grid; gap: 13px; }
.pk-seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.pk-seg button { height: 32px; }
.pk-mode-tip { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.pk-sec h4 { font-size: 12px; color: #52665b; letter-spacing: .3px; margin: 0 0 7px; font-weight: 600; }
.pk-dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pk-dims + .pk-dims { margin-top: 8px; }
.pk-dims.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pk-dims .field { margin: 0; }
.pk-dims .field input { height: 34px; font-size: 13px; }
.pk-dims .field span { font-size: 11px; }
.pk-adv summary { cursor: pointer; font-size: 12px; color: var(--ink2); }
.pk-adv[open] summary { margin-bottom: 8px; }
.pk-adv .pk-dims .field span { font-size: 10.5px; }

.pk-hist { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 9px; }
.pk-hist-t { font-size: 11px; color: var(--muted); }
.pk-chip {
  padding: 2px 9px; border-radius: 99px;
  border: 1px solid var(--line); background: #f7fbf9;
  font-size: 11px; color: var(--ink2); font-variant-numeric: tabular-nums;
}
.pk-chip:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }

.pk-out { padding: 15px; min-height: 300px; }
.pk-hint { padding: 46px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.pk-hint.bad { color: var(--danger); line-height: 1.6; }

.pk-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pk-big {
  padding: 11px 13px; border-radius: 12px;
  background: #f6faf8; border: 1px solid var(--line2);
}
.pk-big span { display: block; font-size: 11px; color: var(--muted); }
.pk-big b { font-size: 24px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.pk-big i { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 5px; }
.pk-big em { display: block; margin-top: 2px; font-style: normal; font-size: 11px; color: var(--muted); }

.pk-list { margin-top: 13px; display: grid; gap: 0; }
.pk-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--line2); font-size: 12.5px;
}
.pk-list li:last-child { border-bottom: 0; }
.pk-list span { flex: none; color: var(--muted); }
.pk-list b { font-weight: 500; text-align: right; word-break: break-word; }

.pk-cont-wrap { margin-top: 12px; border: 1px solid var(--line2); border-radius: 11px; overflow: hidden; }
.pk-cont-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 12px; background: #f8fbf9; }
.pk-cont-h b { font-size: 12.5px; }
.pk-cont-h span { font-size: 10.5px; color: var(--muted); }
table.pk-cont { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.pk-cont th, table.pk-cont td { padding: 7px 12px; text-align: left; white-space: nowrap; }
table.pk-cont th { font-size: 11px; color: #52665b; font-weight: 600; border-bottom: 1px solid var(--line2); }
table.pk-cont td { border-bottom: 1px solid #f2f5f3; font-variant-numeric: tabular-nums; }
table.pk-cont tr:last-child td { border-bottom: 0; }

.pk-notes { margin-top: 10px; display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.pk-notes li::before { content: '· '; }
.pk-how { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line2); font-size: 11px; line-height: 1.7; color: var(--muted); }

@media (max-width: 900px) {
  .pk { grid-template-columns: minmax(0, 1fr); }
  .pk-big b { font-size: 21px; }
}
@media (max-width: 560px) {
  .pk-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-big:last-child { grid-column: 1 / -1; }
  .pk-form, .pk-out { padding: 13px; }
  .pk-cont-h { flex-wrap: wrap; }
  table.pk-cont { min-width: 0; }
}

/* ============================ 客户报价页（分享） ============================ */
.ctable .lhead, .ctable .crow { grid-template-columns: 72px minmax(0, 1fr) 84px 128px 108px; }
.ctable.admin .lhead, .ctable.admin .crow { grid-template-columns: 72px minmax(0, 1fr) 76px 78px 122px 108px; }
.crow .rowacts .btn.sm { padding: 4px 9px; font-size: 12px; }
@media (max-width: 860px) {
  .ctable .lhead, .ctable .crow { grid-template-columns: minmax(0, 1fr) auto; }
  .ctable.admin .lhead, .ctable.admin .crow { grid-template-columns: minmax(0, 1fr) auto; }
  .crow .rowacts .btn.sm { padding: 5px 10px; }
}

.cust-ok {
  display: inline-block;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

.share-modal { max-width: 560px; }
.share-cust { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.share-cust .muted { font-weight: 400; font-size: 12px; }
.share-state {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f7f4;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.share-state .dot { width: 7px; height: 7px; border-radius: 50%; background: #b6c1ba; flex: none; }
.share-state.on { background: var(--brand-soft); }
.share-state.on .dot { background: var(--brand); box-shadow: 0 0 0 3px rgba(20, 107, 70, .14); }
.share-state b { font-size: 13px; }
.share-state.off b { color: var(--muted); }

.share-url { display: flex; gap: 8px; margin-bottom: 10px; }
.share-url input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfb;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink2);
}
.share-url input:focus { outline: none; border-color: var(--brand); background: #fff; }
.share-url .btn { flex: none; }

.share-tip { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; }
.share-tip b { color: var(--ink); }
.share-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.share-actions .btn { font-size: 12.5px; }
.share-loading { padding: 26px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* 客户方多业务员：每人一条独立链接 */
.share-people {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.sp-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.sp-title .muted { font-weight: 400; font-size: 11.5px; }
.sp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfb;
  margin-bottom: 6px;
}
.sp-main { flex: 1; min-width: 0; }
.sp-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-name .muted { font-weight: 400; font-size: 12px; }
.sp-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.sp-meta b { color: var(--brand-dark); }
.sp-acts { display: flex; gap: 5px; flex: none; }
.sp-acts .btn.sm { padding: 4px 8px; font-size: 12px; }
.sp-tip { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin: 8px 0 0; }
.sp-tip b { color: var(--ink); }
.sp-warn {
  font-size: 11.5px;
  line-height: 1.7;
  color: #8a5a12;
  background: #fdf6e7;
  border-radius: 7px;
  padding: 7px 9px;
  margin: 8px 0 0;
}
@media (max-width: 560px) {
  .sp-row { flex-wrap: wrap; }
  .sp-acts { width: 100%; justify-content: flex-end; }
  .sp-acts .btn.sm { padding: 5px 11px; }
}

/* 草稿是否给客户看 */
.share-draft {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f6f8f6;
}
.sd-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
.sd-switch input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
  margin: 0;
}
.share-draft .muted { font-size: 11.5px; line-height: 1.5; }

/* ============================ 客户查看记录 ============================ */
.vs-form select {
  width: 132px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink);
  flex: none;
}
.vs-card { padding-bottom: 12px; }
.vs-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.vs-bar input {
  flex: 1;
  min-width: 170px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfb;
  font-size: 13px;
  color: var(--ink);
}
.vs-bar input:focus { outline: none; border-color: var(--brand); background: #fff; }
.vs-bar select {
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink);
  max-width: 190px;
}
.vs-head, .vs-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1.15fr) 148px minmax(0, 1fr) 168px;
  gap: 10px;
  align-items: center;
}
.vs-head {
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 12px 7px;
  border-bottom: 1px solid var(--line);
}
.vs-row {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f3f0;
  font-size: 12.5px;
}
.vs-row:last-child { border-bottom: none; }
.vs-row:hover { background: #fafbf9; }
.vs-row.is-deny { background: #fdf5f4; }
.vs-time { color: var(--ink2); line-height: 1.35; }
.vs-time b { font-weight: 600; font-variant-numeric: tabular-nums; }
.vs-time i {
  display: inline-block;
  margin-left: 4px;
  font-style: normal;
  font-size: 10.5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 4px;
  padding: 0 4px;
}
.vs-cust { min-width: 0; line-height: 1.35; }
.vs-cust b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-cust span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-act { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vs-a {
  font-size: 11px;
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}
.vs-a-open { background: #eef2ee; color: #5d6b62; }
.vs-a-view { background: #eef4fb; color: #38618c; }
.vs-a-accept { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.vs-a-deny { background: #fdecea; color: #a13a30; font-weight: 600; }
.vs-no { font-style: normal; font-size: 11.5px; color: var(--ink2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.vs-ip { min-width: 0; line-height: 1.35; }
.vs-ip .mono { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-ip span + span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-op { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.vs-op .btn.sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 8px; }
.vs-locked {
  font-size: 11px;
  color: #a13a30;
  background: #fdecea;
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}
.vs-empty { padding: 30px 12px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; }
@media (max-width: 860px) {
  .vs-form select { width: 100%; height: 36px; }
  .vs-form .btn.primary { width: 100%; }
  .vs-bar input { min-width: 0; flex: 1 1 100%; }
  .vs-bar select { flex: 1 1 auto; max-width: none; }
  .vs-head { display: none; }
  .vs-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "time act" "cust cust" "ip op";
    gap: 5px 8px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
  }
  .vs-row .vs-time { grid-area: time; }
  .vs-row .vs-cust { grid-area: cust; }
  .vs-row .vs-act { grid-area: act; justify-content: flex-end; }
  .vs-row .vs-ip { grid-area: ip; }
  .vs-row .vs-op { grid-area: op; }
  .vs-ip .mono, .vs-ip span + span { white-space: normal; word-break: break-all; }
}
