:root {
  --bg: #f4f2ee; --panel: #ffffff; --ink: #1d2522; --muted: #6d7671; --faint: #a4aca8; --line: #e6e2db; --line2: #f0ede8;
  --accent: #1f5a48; --accent-2: #2a7560; --accent-soft: #e5efea; --gold: #b5884a; --gold-soft: #f6eedf;
  --warn: #9a5b06; --warn-soft: #fcf1de; --danger: #b8402f; --danger-soft: #fbe8e4; --info: #2d5d80; --info-soft: #e5eef6;
  --vip: #7650a8; --vip-soft: #f1eaf9;
  --s-pre: #4f7fb0; --s-deposit: #3f8f5f; --s-contract: #c08a2e; --s-production: #8061b0; --s-aftersale: #c0564b;
  --side: #17231f; --side-2: #1e302a;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(30, 40, 35, .04), 0 2px 8px rgba(30, 40, 35, .04);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
body { overflow: hidden; }
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); cursor: pointer; text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: .01em; }
h2 { font-size: 22px; } h3 { font-size: 15.5px; } h4 { font-size: 14px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; } .ink { color: var(--ink); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.row { display: flex; align-items: center; gap: 8px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.ico { flex: none; display: inline-block; vertical-align: middle; }
::selection { background: #cfe3da; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5d0c7; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-sm); padding: 6px 14px; min-height: 34px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 5px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.03); transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: #c9d8d1; color: var(--accent); background: #fbfcfb; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #276a55, var(--accent)); border-color: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(31, 90, 72, .25); }
.btn.primary:hover { background: linear-gradient(180deg, #2e7a63, var(--accent-2)); color: #fff; }
.btn.danger { color: var(--danger); } .btn.danger:hover { border-color: #e8b9b0; background: var(--danger-soft); }
.btn.sm { padding: 2px 10px; min-height: 26px; font-size: 12.5px; border-radius: 7px; }
.btn.link { border: 0; background: none; padding: 2px 4px; color: var(--accent); box-shadow: none; min-height: 0; }
.btn.link:hover { text-decoration: underline; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; background: #ece9e3; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 7px; padding: 4px 9px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; }
.seg button.on { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; height: 100%; }
.side { background: linear-gradient(180deg, var(--side-2), var(--side) 60%); color: #c9d8d1; display: flex; flex-direction: column; padding: 18px 12px 12px; gap: 2px; overflow-y: auto; }
.brand { display: flex; flex-direction: column; gap: 10px; padding: 6px 10px 22px; }
.brand small { font-size: 11px; color: #8faea2; letter-spacing: .12em; padding-left: 3px; }
.logo-img { display: block; width: 100%; max-width: 156px; height: auto; }
.logo-img.lg { max-width: 220px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #d1a868, var(--gold)); color: #1b2a24; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); letter-spacing: 0; }
.logo.lg { width: 48px; height: 48px; font-size: 24px; border-radius: 14px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: #b8cbc3; position: relative; transition: background .15s, color .15s; }
.nav .ico { opacity: .85; }
.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav.on .ico { opacity: 1; color: #e2c48f; }
.nav .badge { margin-left: auto; }
.nav-sep { font-size: 11px; color: #6f8d82; padding: 16px 12px 6px; letter-spacing: .1em; }
.side .me { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8faea2; }
.side .me b { color: #fff; font-size: 13.5px; display: block; font-weight: 600; }
.me-act { display: flex; gap: 6px; margin-top: 10px; }
.me-act a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: #b8cbc3; background: rgba(255,255,255,.06); border-radius: 8px; padding: 5px 0; font-size: 12px; }
.me-act a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #3b7d68, #285e4d); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: none; font-size: 14px; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.main { overflow-y: auto; height: 100%; }
.page { padding: 26px 32px 64px; display: flex; flex-direction: column; gap: 18px; max-width: 1600px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 40px; }
.page-head h2 { margin-right: 8px; }
.page-head.hero { align-items: flex-end; padding-bottom: 4px; }
.page-head.hero h2 { font-size: 26px; }
.hero-date { font-size: 12.5px; color: var(--gold); font-weight: 600; letter-spacing: .06em; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; box-shadow: var(--shadow); }
.card > .head { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1250px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* tables */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: middle; }
.tbl th { background: #faf8f5; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; position: sticky; top: 0; z-index: 1; letter-spacing: .02em; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #f7faf8; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.wrap-text { white-space: pre-wrap; max-width: 360px; }
.empty { color: var(--faint); padding: 22px; text-align: center; font-size: 13px; }

/* chips & badges */
.tag { display: inline-flex; align-items: center; font-size: 12px; border-radius: 999px; padding: 0 9px; line-height: 22px; white-space: nowrap; background: var(--line2); color: #4b5550; font-weight: 500; }
.tag.green { background: var(--accent-soft); color: var(--accent); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); } .tag.info { background: var(--info-soft); color: var(--info); }
.tag.vip { background: var(--vip-soft); color: var(--vip); } .tag.gold { background: var(--gold-soft); color: #8a6224; } .tag.gray { background: #efede9; color: var(--muted); }
.tag[class*="stage-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: currentColor; }
.tag.stage-pre { background: #e9f0f8; color: var(--s-pre); } .tag.stage-deposit { background: #e6f3eb; color: var(--s-deposit); } .tag.stage-contract { background: #f8f0e0; color: #9a6b1c; }
.tag.stage-production { background: #f0ebf8; color: var(--s-production); } .tag.stage-aftersale { background: #f9e9e7; color: var(--s-aftersale); }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; font-size: 11px; line-height: 18px; text-align: center; background: var(--danger); color: #fff; font-weight: 600; }
.badge.gray { background: #a3b1ab; }

/* forms */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.form .wide { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld > label { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; font-weight: 500; }
.fld .gate { color: var(--warn); font-size: 11px; }
.fld .focus-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: inline-block; }
.inp { border: 1px solid #ddd8cf; border-radius: var(--radius-sm); padding: 7px 11px; min-height: 36px; background: #fff; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.inp:hover { border-color: #c9c3b8; }
.inp:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(42, 117, 96, .14); }
select.inp { appearance: none; -webkit-appearance: none; padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d7671' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
textarea.inp { min-height: 72px; resize: vertical; }
.ro { padding: 7px 0; min-height: 34px; white-space: pre-wrap; word-break: break-all; }
.ro.empty-val { color: #c3c9c5; }
.chk-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chk { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px; user-select: none; transition: all .15s; }
.chk:hover { border-color: #c9d8d1; }
.chk.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.search { width: 260px; padding-left: 34px !important; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23a4aca8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 11px center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab .badge { margin-left: 4px; background: #a3b1ab; }
.page-head .tabs { border: 0 !important; background: #ece9e3; border-radius: 10px; padding: 3px; gap: 2px; }
.page-head .tab { border: 0; margin: 0; border-radius: 8px; padding: 5px 14px; }
.page-head .tab.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* stage stepper */
.stepper { display: flex; gap: 6px; align-items: stretch; }
.step { flex: 1; padding: 9px 12px 9px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; position: relative; font-size: 13px; color: var(--muted); overflow: hidden; }
.step::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.step.done { color: var(--accent); background: #f4f8f6; }
.step.done::after { background: #b9d4c8; }
.step.cur { background: linear-gradient(180deg, #276a55, var(--accent)); border-color: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(31, 90, 72, .25); }
.step small { display: block; font-size: 11px; opacity: .85; font-weight: 400; }

/* order page */
.order-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.order-head .title { font-size: 24px; font-weight: 650; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.focus-card { border: 1px solid #b8d2c6; box-shadow: 0 0 0 3px rgba(42, 117, 96, .08), var(--shadow); }
.focus-card .head h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: 2px; }
.section-card.collapsed .form { display: none; }
.section-title { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.notice { border-radius: 10px; padding: 10px 14px; font-size: 13px; white-space: pre-wrap; border: 1px solid transparent; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: #f1dcb6; }
.notice.info { background: var(--info-soft); color: var(--info); border-color: #cfdeeb; }
.notice.danger { background: var(--danger-soft); color: var(--danger); border-color: #f0c8c0; }
.notice.ok { background: var(--accent-soft); color: var(--accent); border-color: #c8ddd3; }

/* workbench */
.todo { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.todo:last-child { border-bottom: 0; }
.todo .due { min-width: 92px; text-align: right; font-size: 12px; }
.due { display: inline-block; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.due.over { color: var(--danger); background: var(--danger-soft); font-weight: 600; } .due.soon { color: var(--warn); background: var(--warn-soft); font-weight: 600; } .due.ok { color: var(--muted); }
/* urgency of a 待办 row: yellow within 72 hours, red when overdue */
.todo.lv-soon, .todo.lv-over { margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-left: 4px solid; border-radius: 6px; }
.todo.lv-soon { background: var(--warn-soft); border-left-color: #e0a43a; } .todo.lv-over { background: var(--danger-soft); border-left-color: var(--danger); }
.todo.lv-soon + .todo, .todo.lv-over + .todo { margin-top: 2px; }
.tbl tr.lv-soon > td { background: var(--warn-soft); } .tbl tr.lv-over > td { background: var(--danger-soft); }
.tbl tr.lv-soon > td:first-child { box-shadow: inset 4px 0 #e0a43a; } .tbl tr.lv-over > td:first-child { box-shadow: inset 4px 0 var(--danger); }
.due-legend { display: inline-flex; gap: 10px; font-size: 12px; color: var(--muted); align-items: center; }
.due-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.due-legend .y { background: #e0a43a; } .due-legend .r { background: var(--danger); }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat { --c: var(--accent); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; cursor: pointer; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c); }
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--c); opacity: .07; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30, 40, 35, .08); }
.stat-l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .n { font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--c); font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .sts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.stat .sts .tag { background: #f5f3ef; font-size: 11.5px; line-height: 20px; }
.st-pre { --c: var(--s-pre); } .st-deposit { --c: var(--s-deposit); } .st-contract { --c: var(--s-contract); } .st-production { --c: var(--s-production); } .st-aftersale { --c: var(--s-aftersale); }
.rem { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 13px; align-items: baseline; }
.rem:last-child { border-bottom: 0; }

/* attachments */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.att { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .15s; }
.att:hover { box-shadow: 0 6px 18px rgba(30, 40, 35, .08); }
.att .meta a { white-space: nowrap; }
.att .meta .att-final { color: #8a6224; align-self: flex-start; }
.att.final { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.att .thumb { height: 116px; background: #f3f1ed center/cover no-repeat; cursor: zoom-in; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.att .meta { padding: 7px 9px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.att .meta .att-src { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att .meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.drop { border: 1.5px dashed #d5d0c7; border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; background: #fbfaf8; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* modal */
.mask { position: fixed; inset: 0; background: rgba(18, 26, 23, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 40px 16px; overflow-y: auto; animation: fade .15s ease-out; }
.modal { background: var(--panel); border-radius: 16px; width: 640px; max-width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.22); display: flex; flex-direction: column; animation: pop .18s ease-out; }
.modal.wide { width: 1000px; } .modal.xwide { width: 1200px; }
.modal > .mh { padding: 16px 22px; border-bottom: 1px solid var(--line2); display: flex; align-items: center; gap: 8px; }
.modal > .mh h3 { font-size: 16.5px; }
.modal > .mb { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal > .mf { padding: 12px 22px; border-top: 1px solid var(--line2); display: flex; gap: 8px; justify-content: flex-end; background: #fcfbf9; border-radius: 0 0 16px 16px; }
.x { margin-left: auto; cursor: pointer; font-size: 20px; color: var(--muted); border: 0; background: none; width: 32px; height: 32px; border-radius: 8px; }
.x:hover { background: var(--line2); color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* image gallery viewer */
.viewer { position: fixed; inset: 0; background: rgba(10, 14, 12, .92); z-index: 85; display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: fade .15s ease-out; user-select: none; }
.viewer img { max-width: 90vw; max-height: calc(100vh - 150px); border-radius: 6px; box-shadow: 0 10px 50px rgba(0,0,0,.5); cursor: default; }
.vw-x, .vw-nav { position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.vw-x:hover, .vw-nav:hover { background: rgba(255,255,255,.22); }
.vw-x { top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; font-size: 18px; }
.vw-nav { top: 50%; margin-top: -28px; width: 48px; height: 56px; border-radius: 12px; font-size: 34px; line-height: 1; }
.vw-nav.prev { left: 18px; } .vw-nav.next { right: 18px; }
.vw-bar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 92vw; cursor: default; }
.vw-count { color: #e6ece9; font-size: 13px; background: rgba(255,255,255,.1); padding: 2px 12px; border-radius: 999px; }
.vw-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 2px; }
.vw-thumb { width: 56px; height: 42px; border-radius: 6px; background: #333 center/cover no-repeat; cursor: pointer; opacity: .5; flex: none; outline: 2px solid transparent; transition: opacity .15s; }
.vw-thumb:hover { opacity: .85; }
.vw-thumb.on { opacity: 1; outline-color: #e2c48f; }

/* toast */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1d2c26; color: #fff; border-radius: 10px; padding: 11px 16px; max-width: 420px; white-space: pre-wrap; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 13px; animation: pop .2s ease-out; border-left: 3px solid #e2c48f; }
.toast.error { background: #a83a2b; border-left-color: #ffd2c8; }
.toasts { align-items: flex-end; }
.ntc { width: 380px; display: flex; gap: 12px; align-items: flex-start; background: #1d2c26; color: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 14px 36px rgba(15, 25, 20, .28); border: 1px solid rgba(226, 196, 143, .45); cursor: pointer; animation: ntcIn .35s cubic-bezier(.2,.9,.3,1.1); position: relative; }
@keyframes ntcIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.ntc-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #e2c48f; color: #1d2c26; }
.ntc.upload .ntc-ic, .ntc.done .ntc-ic { background: #6f9a62; color: #fff; }
.ntc-b { flex: 1; min-width: 0; }
.ntc-k { font-size: 12px; letter-spacing: .12em; color: #e2c48f; margin-bottom: 4px; }
.ntc-t { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ntc-role { font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; color: #fff; }
.ntc-type { font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.14); }
.ntc-task { font-size: 14px; margin-top: 4px; color: #fff; }
.ntc-m { font-size: 12.5px; color: #b9cdc4; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntc-x { position: absolute; top: 10px; right: 10px; color: rgba(255,255,255,.4); }
.ntc:hover .ntc-x { color: #fff; }
@media (max-width: 820px) { .ntc { width: calc(100vw - 36px); } }

/* login */
.login { height: 100%; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 10% 0%, #2c5e4e 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #5a4626 0%, transparent 55%), #15221d; }
.login .box { background: #fff; border-radius: 18px; padding: 32px 32px 28px; width: 380px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login h1 { font-size: 22px; letter-spacing: .08em; }
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 6px; }
.login .box .btn.primary { min-height: 42px; font-size: 15px; letter-spacing: .2em; }

/* sku */
.sku-img { width: 48px; height: 48px; border-radius: 8px; background: #f0ede8 center/cover no-repeat; flex: none; cursor: zoom-in; }
.sku-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.sku-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.sku-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(30, 40, 35, .1); }
.sku-cover { aspect-ratio: 4 / 3; background: #f0ede8; position: relative; overflow: hidden; cursor: zoom-in; display: flex; align-items: center; justify-content: center; color: #c9c3b8; }
.sku-cover.none { cursor: pointer; }
.sku-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.sku-card:hover .sku-cover img { transform: scale(1.05); }
.sku-zoom { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; background: rgba(20, 28, 25, .62); color: #fff; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.sku-status { position: absolute; left: 8px; top: 8px; background: rgba(255,255,255,.92); color: var(--muted); font-size: 11.5px; padding: 1px 8px; border-radius: 999px; }
.sku-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sku-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }
.sku-cat { color: var(--gold); font-weight: 600; }
.sku-name { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.sku-sub { font-size: 12px; color: var(--muted); min-height: 18px; }
.sku-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.sku-price { font-size: 17px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.sku-price small { font-size: 11px; font-weight: 400; color: var(--muted); }
.sku-quote { font-size: 11.5px; color: var(--muted); }
.sku-detail { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }
.gallery { display: flex; flex-direction: column; gap: 8px; }
.g-main { aspect-ratio: 4 / 3; border-radius: 12px; background: #f0ede8; overflow: hidden; position: relative; cursor: zoom-in; display: flex; align-items: center; justify-content: center; color: #b9b2a6; }
.g-main.none { cursor: default; }
.g-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.g-thumb { width: 64px; height: 48px; border-radius: 8px; background: #eee center/cover no-repeat; cursor: pointer; outline: 2px solid transparent; outline-offset: 1px; opacity: .75; }
.g-thumb.on { outline-color: var(--accent); opacity: 1; }
.pkg-card { display: flex; gap: 14px; }
.pkg-card .poster { width: 120px; height: 160px; border-radius: 10px; background: #f0ede8 center/cover no-repeat; flex: none; }
.best td { background: var(--accent-soft) !important; }
.lock::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; background: currentColor; opacity: .7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat; }

/* login: one-click test accounts */
.login { flex-wrap: wrap; gap: 28px; overflow-y: auto; padding: 28px; align-content: center; }
.demo-box { background: rgba(255,255,255,.97); border-radius: 18px; padding: 24px 26px; width: 780px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 12px; }
.demo-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 12px; transition: all .15s; background: #fff; }
.demo-card:hover { border-color: #a9cbbd; background: #f6faf8; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30, 40, 35, .08); }
.demo-card ul, ul.perm { margin: 8px 0 0; padding-left: 16px; color: var(--muted); line-height: 1.65; }

/* inline explanations (设置 → 我的账号 can turn them off) */
.help { display: flex; gap: 10px; align-items: flex-start; background: linear-gradient(90deg, #f3f7f4, #f8f6f1); border: 1px solid #e0e9e3; color: #45605a; border-radius: 10px; padding: 10px 14px; font-size: 12.5px; line-height: 1.65; }
.help-i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.card > .help { margin-bottom: 4px; }

/* AI 管家 */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 12px 18px 12px 14px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 14px;
  background: linear-gradient(135deg, #2a7560, #1a4a3c); box-shadow: 0 10px 28px rgba(26, 74, 60, .35), inset 0 1px 0 rgba(255,255,255,.15); transition: transform .15s, box-shadow .15s; }
.ai-fab .ico { color: #f1d49c; }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(26, 74, 60, .42); }
.ai-fab.on { opacity: 0; pointer-events: none; }
.ai-panel { position: fixed; right: 22px; bottom: 22px; z-index: 61; width: 420px; height: min(680px, calc(100vh - 44px)); background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(20, 30, 26, .28), 0 0 0 1px rgba(0,0,0,.04); display: flex; flex-direction: column; overflow: hidden; animation: pop .2s ease-out; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; background: linear-gradient(135deg, #22604d, #183f34); color: #fff; }
.ai-head .small { color: #a9c7bb; font-size: 11.5px; }
.ai-avatar { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #d9b276, #b5884a); color: #1b2a24; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ai-icon-btn { border: 0; background: rgba(255,255,255,.1); color: #fff; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ai-icon-btn:hover { background: rgba(255,255,255,.2); }
.ai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f7f5f1; }
.ai-msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.ai-msg.bot { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; align-self: flex-start; }
.ai-msg.me { background: var(--accent); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.ai-msg.err { background: var(--danger-soft); color: var(--danger); align-self: stretch; max-width: none; font-size: 12.5px; }
.ai-msg code { background: var(--line2); padding: 0 4px; border-radius: 4px; font-size: 12px; }
.ai-msg a { font-weight: 600; }
.ai-welcome { display: flex; flex-direction: column; gap: 12px; }
.ai-sugs { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ai-sug { background: #fff; border: 1px solid #d9e6df; color: var(--accent); border-radius: 12px; padding: 6px 12px; cursor: pointer; font-size: 12.5px; transition: all .15s; }
.ai-sug:hover { background: var(--accent-soft); border-color: #b8d2c6; }
.ai-card { align-self: stretch; background: #fff; border: 1px solid #ecd9b6; border-left: 3px solid var(--gold); border-radius: 12px; padding: 10px 13px; font-size: 13px; }
.ai-card-t { font-size: 11.5px; font-weight: 600; color: var(--gold); margin-bottom: 3px; letter-spacing: .04em; }
.ai-card.done { border-color: #c8ddd3; border-left-color: var(--accent); } .ai-card.done .ai-card-t { color: var(--accent); }
.ai-card.failed { border-color: #f0c8c0; border-left-color: var(--danger); } .ai-card.failed .ai-card-t { color: var(--danger); }
.ai-card.cancelled, .ai-card.skipped { opacity: .6; border-left-color: var(--faint); } .ai-card.cancelled .ai-card-t, .ai-card.skipped .ai-card-t { color: var(--muted); }
.ai-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; padding: 2px 4px; }
.ai-dots { display: inline-flex; gap: 3px; }
.ai-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: blink 1s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.ai-input { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line2); background: #fff; }
.ai-input textarea { flex: 1; border: 1px solid #ddd8cf; border-radius: 12px; padding: 9px 12px; resize: none; max-height: 120px; min-height: 40px; field-sizing: content; font-size: 13.5px; line-height: 1.5; }
.ai-input textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(42, 117, 96, .14); }
.ai-send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ai-send:disabled { background: #c9d3ce; cursor: default; }
.ai-send.stop { background: #8a3a2e; } .ai-send.stop i { width: 12px; height: 12px; background: #fff; border-radius: 2px; }

/* phones and narrow windows (web version) */
@media (max-width: 820px) {
  body { overflow: auto; }
  .login { height: auto; min-height: 100%; padding: 16px; gap: 16px; }
  .login .box { width: 100%; padding: 22px; }
  .demo-box { padding: 16px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100%; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; gap: 4px; overflow: visible; }
  .side .brand { width: 100%; padding-bottom: 8px; }
  .side .nav-sep { display: none; }
  .side .nav { padding: 6px 10px; }
  .nav.on::before { display: none; }
  .side .me { margin: 0; width: 100%; padding: 8px 4px 0; }
  .main { height: auto; overflow: visible; min-width: 0; }
  .page { padding: 14px 12px 40px; }
  .page-head.hero h2 { font-size: 21px; }
  .search { width: 100% !important; }
  .tbl-wrap, .card { overflow-x: auto; }
  .grid, .grid2, .grid3, .cards { grid-template-columns: 1fr !important; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 10px 8px; } .stat .n { font-size: 22px; }
  .stat .sts { display: none; }
  .page-head h2 { font-size: 18px; }
  .page-head .btn { padding: 5px 9px; }
  .mask { padding: 0; }
  .modal { width: 100% !important; max-width: 100% !important; max-height: 100%; border-radius: 0; }
  .modal > .mf { border-radius: 0; }
  .form { grid-template-columns: 1fr !important; }
  .stepper { overflow-x: auto; }
  .step { min-width: 96px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { white-space: nowrap; }
  .sku-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sku-body { padding: 8px 10px 10px; }
  .sku-detail { grid-template-columns: 1fr; }
  .vw-nav { width: 38px; height: 46px; font-size: 26px; }
  .vw-nav.prev { left: 6px; } .vw-nav.next { right: 6px; }
  .ai-fab { right: 14px; bottom: 14px; padding: 11px 15px 11px 12px; }
  .ai-panel { inset: 0; width: auto; height: auto; border-radius: 0; }
}

/* long forms: header and buttons stay put, the form scrolls inside the white panel */
.modal { max-height: calc(100vh - 80px); }
.modal > .mb { overflow-y: auto; min-height: 0; }
/* the body scrolls; its parts keep their height (a table with its own scroll box would otherwise be squashed to a thin line) */
.modal > .mb > * { flex-shrink: 0; }
@media (max-width: 820px) { .modal { max-height: 100vh; } }

/* 客户订单: stage bar — one step per stage, coloured, with the order count; the selected step is filled */
.pipe { display: flex; gap: 0; margin: 4px 0 2px; filter: drop-shadow(0 1px 2px rgba(30, 40, 35, .06)); }
.pipe-step { --c: var(--accent); flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center; gap: 8px; padding: 14px 14px 14px 30px; cursor: pointer;
  background: #fff; color: var(--ink); border-top: 3px solid var(--c); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); margin-left: -10px; transition: background .15s; }
.pipe-step:first-child { margin-left: 0; padding-left: 16px; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); border-radius: 10px 0 0 10px; }
.pipe-step.all { --c: var(--ink); flex: 0 0 120px; }
.pipe-step.st-pre { --c: var(--s-pre); } .pipe-step.st-deposit { --c: var(--s-deposit); } .pipe-step.st-contract { --c: var(--s-contract); } .pipe-step.st-production { --c: var(--s-production); } .pipe-step.st-aftersale { --c: var(--s-aftersale); }
.pipe-step:hover { background: #f7f5f1; }
.pipe-step .pipe-n { width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pipe-step .pipe-l { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-step b { margin-left: auto; padding-right: 10px; font-size: 22px; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; }
.pipe-step.on { background: var(--c); color: #fff; }
.pipe-step.on b { color: #fff; } .pipe-step.on .pipe-n { background: #fff; color: var(--c); }
.tbl tr[class*="row-"] > td:first-child { box-shadow: inset 3px 0 var(--c, transparent); }
.tbl tr.row-pre { --c: var(--s-pre); } .tbl tr.row-deposit { --c: var(--s-deposit); } .tbl tr.row-contract { --c: var(--s-contract); } .tbl tr.row-production { --c: var(--s-production); } .tbl tr.row-aftersale { --c: var(--s-aftersale); }
@media (max-width: 820px) {
  .pipe { overflow-x: auto; padding-bottom: 4px; }
  .pipe-step { flex: 0 0 auto; padding: 10px 10px 10px 26px; } .pipe-step.all { flex-basis: auto; }
  .pipe-step b { font-size: 17px; }
}

/* AI 管家: files sent with a message */
.ai-panel.over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.ai-files, .ai-pending { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-files { margin-bottom: 6px; }
.ai-pending { padding: 8px 12px 0; border-top: 1px solid var(--line2); }
.ai-file { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.18); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-pending .ai-file { background: var(--accent-soft); color: var(--accent); }
.ai-pending .ai-file.wait { opacity: .6; }
.ai-pending .ai-file a { margin-left: 2px; font-weight: 700; cursor: pointer; }
.ai-input .attach { align-self: flex-end; margin-bottom: 4px; }
.ai-pending + .ai-input { border-top: 0; }
.ai-input .ai-icon-btn.attach { color: var(--muted); background: transparent; } .ai-input .ai-icon-btn.attach:hover { color: var(--accent); background: var(--accent-soft); }
.section-card.current { border-color: #b8d2c6; box-shadow: 0 0 0 3px rgba(42, 117, 96, .08), var(--shadow); }

/* 补单 progress: 下单 → 出货 → 送货 → 安装 */
.as-steps { display: flex; gap: 3px; }
.as-steps span { font-size: 11.5px; padding: 2px 6px; border-radius: 6px; background: #f1eee9; color: var(--faint); white-space: nowrap; }
.as-steps span.done { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.as-steps span i { font-style: normal; font-weight: 400; margin-left: 3px; }
.form-sep { font-weight: 600; color: var(--accent); border-bottom: 1px solid var(--line2); padding: 8px 0 4px; margin-top: 4px; }

.split-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 10px; border-radius: 10px;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }

/* 客户增长 */
.growth-card > .head { flex-wrap: wrap; }
.growth-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.growth-kpi > div { border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 10px 14px; background: #fbfaf8; }
.growth-kpi .n { font-size: 26px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }
.growth-kpi .n small { font-size: 13px; font-weight: 500; color: var(--muted); }
.growth-chart { position: relative; width: 100%; height: 240px; }
.growth-chart svg { width: 100%; height: 100%; display: block; }
.growth-chart .gl { stroke: var(--line2); stroke-width: 1; }
.growth-chart .al { font-size: 12px; fill: var(--muted); }
.growth-chart .al.ink { fill: var(--ink); font-weight: 600; }
.growth-chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.growth-chart .dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.growth-chart .ch { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.growth-tip { position: absolute; transform: translate(-50%, calc(-100% - 14px)); background: #1d2522; color: #fff; font-size: 12px; line-height: 1.5; padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.growth-tip b { font-weight: 600; }
@media (max-width: 800px) { .growth-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .growth-chart { height: 220px; } }

/* 工厂管理 */
.fac-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 14px; }
.fac-sum > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 16px; min-width: 120px; display: flex; flex-direction: column; }
.fac-sum > div b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--accent); }
.fac-sum > div.bad b { color: var(--danger); } .fac-sum > div.bad { border-color: #f0c9c4; background: var(--danger-soft); }
.fac-tbl tbody tr { cursor: pointer; } .fac-tbl tbody tr:hover > td { background: #faf8f4; }
.fac-tbl tr.off > td { opacity: .55; }
.fac-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .fac-cats .tag { line-height: 19px; font-size: 11.5px; padding: 0 7px; }
.fac-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fac-note { background: var(--warn-soft); border: 1px solid #f1dcb6; border-radius: 10px; padding: 10px 14px; font-size: 13px; white-space: pre-wrap; }
.fac-note b { display: block; color: var(--warn); margin-bottom: 4px; }
@media (max-width: 760px) { .fac-head { grid-template-columns: 1fr; } .fac-sum > div { min-width: calc(50% - 5px); } }

/* 全部资料 Excel */
.xio-pv { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.xio-pv h4 { margin: 14px 0 6px; font-size: 13.5px; }
.xio-sum { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.xio-sum > div { border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; min-width: 96px; display: flex; flex-direction: column; background: #fff; }
.xio-sum > div b { font-size: 20px; color: var(--accent); font-variant-numeric: tabular-nums; }
.xio-sum > div.bad b { color: var(--danger); }
.xio-ch { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.xio-f { display: inline-block; margin-right: 14px; }

/* 免密登录: compact list when there are many accounts */
.demo-groups { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.demo-group { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: start; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.demo-group:last-child { border-bottom: 0; padding-bottom: 0; }
.demo-role { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; padding-top: 4px; }
.demo-names { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all .15s; font-family: inherit; color: inherit; }
.demo-chip:hover { border-color: #a9cbbd; background: #f6faf8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30, 40, 35, .08); }
@media (max-width: 820px) { .demo-group { grid-template-columns: 1fr; gap: 6px; } }

/* 扫码上传 */
.scan { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.scan-qr .qr { width: 240px; height: 240px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; display: flex; align-items: center; justify-content: center; }
.scan-qr .qr svg { width: 100%; height: 100%; display: block; }
.scan-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.scan-side .fld { display: flex; flex-direction: column; gap: 4px; }
.scan-url { word-break: break-all; user-select: all; background: var(--line2); border-radius: 8px; padding: 6px 8px; }
@media (max-width: 720px) { .scan { grid-template-columns: 1fr; justify-items: center; } .scan-side { width: 100%; } }
/* 实时通知: a todo someone just sent me */
.ntc.incoming { border: 1.5px solid #e2c48f; box-shadow: 0 14px 36px rgba(15, 25, 20, .32), 0 0 0 4px rgba(226, 196, 143, .18); }
.ntc.incoming .ntc-ic { animation: ntcRing .9s ease-in-out 2; }
@keyframes ntcRing { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-16deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
/* 确认收款 dialog */
.pay-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; background: var(--panel, #fff); }
.pay-row.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 90, 72, .1); }
.pay-row.ok { opacity: .72; }
.pay-vch { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pay-th { width: 64px; height: 48px; border-radius: 8px; background: #eef1ee center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); border: 1px solid var(--line); cursor: zoom-in; }

/* 工作台 · 现在要做 */
.wb-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.wb-chip { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.wb-chip span { font-size: 12.5px; color: var(--muted); }
.wb-chip b { font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); }
.wb-chip.main { background: var(--accent); border-color: var(--accent); } .wb-chip.main span { color: rgba(255,255,255,.8); } .wb-chip.main b { color: #fff; }
.wb-chip.over b { color: var(--danger); } .wb-chip.soon b { color: var(--warn); }
.wb-chip.over:not(.zero) { background: var(--danger-soft); border-color: #efc6bd; } .wb-chip.soon:not(.zero) { background: var(--warn-soft); border-color: #f1dcb6; }
.wb-chip.zero b { color: var(--faint); }
.now-card { border-top: 3px solid var(--accent); }
.now-g { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; letter-spacing: .04em; }
.now-g.over { color: var(--danger); } .now-g.soon { color: var(--warn); }
.now-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line2); border-left: 4px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.now-item.lv-over { background: var(--danger-soft); border-left-color: var(--danger); } .now-item.lv-soon { background: var(--warn-soft); border-left-color: #e0a43a; }
.now-item.lv-ok { border-left-color: var(--accent-2); }
.now-t { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.now-t .due { font-size: 12px; }
.now-o { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; }
.now-how { margin-top: 6px; font-size: 13px; color: var(--accent); display: flex; gap: 5px; align-items: flex-start; }
.now-how .ic, .now-how svg { flex: none; margin-top: 3px; }
.now-note { margin-top: 4px; font-size: 13px; color: var(--ink); background: rgba(255,255,255,.6); border-radius: 6px; padding: 3px 8px; display: inline-block; }
.now-act { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 108px; }
.now-act .btn { justify-content: center; }
.now-empty { padding: 6px 2px 2px; } .now-empty-t { font-size: 15px; font-weight: 600; color: var(--accent); display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.now-empty ul { margin: 6px 0 0 18px; padding: 0; font-size: 13px; color: var(--muted); }
.wb-sec { font-weight: 600; font-size: 14px; margin: 4px 0 -4px; }
@media (max-width: 700px) { .now-item { flex-direction: column; } .now-act { flex-direction: row; flex-wrap: wrap; min-width: 0; } }
.my-todos { border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; background: #fff; padding: 10px 14px; box-shadow: var(--shadow); }
.my-todos-h { font-weight: 600; color: var(--accent); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.my-todo { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; border-left: 4px solid var(--accent-2); margin-top: 6px; background: var(--bg); }
.my-todo.lv-over { background: var(--danger-soft); border-left-color: var(--danger); } .my-todo.lv-soon { background: var(--warn-soft); border-left-color: #e0a43a; }
.my-todo .due { font-size: 12px; margin-left: 6px; }

/* 业绩 / 目标 */
.perf-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 22px; }
.perf-t { display: flex; flex-direction: column; gap: 5px; }
.perf-bar { height: 8px; border-radius: 999px; background: var(--line2); overflow: hidden; }
.perf-bar i { display: block; height: 100%; border-radius: 999px; background: var(--gold); transition: width .3s; }
.perf-bar.full i { background: var(--accent); }
.perf-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.perf-kpi > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; }
.perf-kpi .n { font-size: 22px; font-weight: 600; margin-top: 2px; }
.perf-kpi .n small { font-size: 13px; font-weight: 400; color: var(--muted); }
.perf-total { font-size: 26px; font-weight: 600; color: var(--accent); }
.tgt-grid input.inp { width: 96px; padding: 3px 6px; text-align: right; }
.pur-due.overdue { color: var(--danger); font-weight: 600; } .pur-due.soon { color: var(--warn); font-weight: 600; }
.seg-pick { display: inline-flex; gap: 6px; align-items: center; min-height: 34px; }
.seg-pick .btn.sm { min-width: 56px; }
/* 0.7.6 上传区：点击选择或把文件拖到这里 */
.dropzone { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1.5px dashed #cfc8bc; border-radius: 10px; padding: 16px 14px; color: var(--muted); background: #fbfaf8; cursor: pointer; text-align: left; transition: border-color .12s, background .12s, color .12s; user-select: none; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); outline: none; }
.dropzone.over { border-color: var(--accent); border-style: solid; background: var(--accent-soft); color: var(--accent); }
.dropzone.busy { cursor: progress; opacity: .75; }
.dropzone.disabled { cursor: not-allowed; opacity: .5; }
.dropzone .dz-main { font-size: 14px; font-weight: 600; color: inherit; }
.dropzone .dz-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dropzone.small { display: inline-flex; padding: 6px 10px; gap: 6px; border-radius: 8px; min-height: 56px; }
.dropzone.small .dz-main { font-size: 12.5px; font-weight: 500; }
/* 0.7.6 推进到「X」：还缺 N 项 */
.next-needs { background: #fdf3ec; border: 1px solid #f3d9c6; border-radius: 10px; padding: 10px 14px 6px; font-size: 13.5px; color: var(--ink); }
.next-needs.ok { background: var(--accent-soft); border-color: #c8ddd3; padding-bottom: 10px; }
.next-needs .nn-h { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #b5532a; margin-bottom: 4px; }
.next-needs.ok .nn-h { color: var(--accent); margin-bottom: 0; }
.next-needs .nn-note { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.next-needs .nn-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(181, 83, 42, .12); }
.next-needs .nn-row:first-of-type { border-top: 0; }
.next-needs .nn-dot { color: #c9875f; width: 14px; flex: none; }
.next-needs .nn-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.next-needs .nn-go { color: #2f6fb0; white-space: nowrap; cursor: pointer; flex: none; margin-left: 10px; }
.next-needs .nn-sub .nn-go { margin-left: 6px; }
.next-needs .nn-sep { font-size: 12px; color: var(--muted); margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(181, 83, 42, .25); }
.next-needs .nn-row.todo { border-top: 0; padding: 3px 0; color: var(--muted); }
.next-needs.compact { padding: 8px 12px 4px; }
.fld.flash { animation: fldflash 1.6s ease-out; border-radius: 8px; }
@keyframes fldflash { 0%, 40% { box-shadow: 0 0 0 3px rgba(47, 111, 176, .35); background: #eef4fb; } 100% { box-shadow: 0 0 0 0 transparent; background: transparent; } }
/* 0.7.8 生产订单: 各品类进度 */
.prod-sum { margin: 4px 0 12px; border: 1px solid var(--line, #e6e1d8); border-radius: 10px; padding: 10px 14px; background: var(--card-soft, #faf8f4); }
.prod-sum-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.prod-sum-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--line, #e6e1d8); }
.prod-sum-row:first-of-type { border-top: 0; }
.prod-sum-cat { min-width: 64px; font-weight: 600; }
@media (max-width: 600px) { .prod-sum-head .muted { display: none; } }

/* 0.7.9: 生产订单 — 「送货安装」 under 「各品类进度」 */
.section-card .sub-head { font-weight: 600; font-size: 14px; margin: 14px 0 2px; color: var(--ink); }

/* 0.7.13 手机 AI 管家 (/ai): the chat fills the screen; bigger text and buttons for fingers */
body.m-ai { background: #f7f5f1; -webkit-text-size-adjust: 100%; }
.ai-panel.full { position: fixed; inset: 0; width: auto; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; animation: none; }
.ai-panel.full .ai-head { padding: calc(12px + env(safe-area-inset-top)) 12px 12px 14px; }
.ai-panel.full .ai-head b { font-size: 17px; }
.ai-panel.full .ai-head .small { font-size: 12.5px; }
.ai-panel.full .ai-icon-btn { width: auto; min-width: 40px; height: 40px; padding: 0 10px; gap: 4px; font-size: 13px; }
.ai-panel.full .ai-body { padding: 14px 12px; gap: 12px; }
.ai-panel.full .ai-msg { font-size: 16px; max-width: 92%; padding: 10px 14px; }
.ai-panel.full .ai-sug { font-size: 15px; padding: 10px 14px; }
.ai-panel.full .ai-card { font-size: 15.5px; padding: 12px 14px; }
.ai-panel.full .ai-card .btn.sm { font-size: 16px; padding: 11px 20px; border-radius: 12px; }
.ai-panel.full .ai-input { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
.ai-panel.full .ai-input textarea { font-size: 16px; min-height: 48px; max-height: 160px; padding: 12px 14px; border-radius: 14px; }
.ai-panel.full .ai-send { width: 48px; height: 48px; border-radius: 14px; }
.ai-panel.full .ai-input .ai-icon-btn.attach { width: 48px; height: 48px; margin-bottom: 0; background: var(--accent-soft); color: var(--accent); border-radius: 14px; }
.ai-panel.full .ai-file { font-size: 13px; }
.m-tipwrap { flex: none; padding: 8px 10px 0; }
.m-tipwrap:empty { display: none; }
.m-tip { display: flex; align-items: center; gap: 10px; background: #fff8ea; border: 1px solid #ecd9b6; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.m-tip .ico { vertical-align: -2px; }
.m-tip-x { font-size: 22px; line-height: 1; color: var(--muted); padding: 0 4px; cursor: pointer; }
.m-login { min-height: 100vh; min-height: 100dvh; padding: calc(28px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-width: 480px; margin: 0 auto; }
.m-brand { display: flex; align-items: center; gap: 12px; margin: 10px 4px 6px; }
.m-brand img { width: 56px; height: 56px; border-radius: 14px; }
.m-brand b { font-size: 22px; }
.m-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.m-card label { font-size: 13px; color: var(--muted); }
.m-card .inp { font-size: 16px; height: 48px; }
.m-check { display: flex; align-items: center; gap: 8px; font-size: 14px !important; color: var(--ink) !important; margin: 6px 0; }
.m-check input { width: 20px; height: 20px; }
.m-big { height: 50px; font-size: 17px; margin-top: 4px; }
.m-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.m-chips .demo-chip { font-size: 14px; padding: 9px 12px; }
.m-loading { padding: 40vh 0 0; text-align: center; color: var(--muted); }
body.m-ai .toasts { top: calc(80px + env(safe-area-inset-top)); left: 10px; right: 10px; }
body.m-ai .toast { font-size: 15px; }

/* 0.7.14 合同上传后自动 AI 识别金额 */
.ai-read { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: #eef6f2; border: 1px solid #cfe4d9; font-size: 13.5px; line-height: 1.6; }
.ai-read > .ico { color: var(--accent); flex: none; }
.ai-read.waiting { background: #f4f6f8; border-color: #dfe4ea; }
.ai-read.waiting > .ico { animation: spin 1.6s linear infinite; }
.ai-read.failed { background: #fff6ec; border-color: #f0d9b5; }
.ai-read .btn { flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
