/* 简洁风格：系统字体（国内外都能正常加载），一个主色，状态用颜色区分 */
[hidden] { display: none !important; }
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #627080;
  --line: #dde3e9;
  --accent: #0d5c7d;
  --accent-soft: #e3eff4;
  --ok: #2e7d4f;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --bad: #b3362d;
  --bad-soft: #fdecea;
  --radius: 8px;
  --font: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; line-height: 1.3; }
h2 { font-size: 1.1rem; margin: 2rem 0 .75rem; }
.card h2:first-child { margin-top: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.main { padding-block: 24px 64px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.bad { color: var(--bad); }
.c { text-align: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 顶栏 */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a:hover { text-decoration: none; color: var(--ink); }
.me { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.me form { margin: 0; }

/* 通用 */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; color: var(--muted); }
.crumb { margin: 0 0 12px; font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.narrow { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid transparent; }
.flash-ok { background: #e8f5ec; color: var(--ok); border-color: #c6e6d0; }
.flash-error { background: var(--bad-soft); color: var(--bad); border-color: #f5c9c4; }
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: #f2dcb3; }
.alert-inline { color: var(--warn); font-size: .82rem; }
.alert-inline::before { content: "⚠ "; }
.badge-warn { background: var(--warn-soft); color: var(--warn); font-size: .78rem; padding: 1px 8px; border-radius: 99px; }

/* 按钮与表单 */
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; line-height: 1.4; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linkbtn.danger { color: var(--bad); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: .85rem; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); width: 100%; min-width: 0;
}
input.mono { font-family: var(--mono); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; border: 0; padding: 0; margin: 0; }
.check { display: flex; gap: 8px; align-items: center; }
fieldset.projects-pick { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
fieldset.projects-pick legend { font-size: .85rem; color: var(--muted); padding: 0 4px; }
.danger-zone { border-color: #f0c8c3; }

/* 筛选与表格 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; flex: 0 1 auto; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; background: #f8fafb; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .c { text-align: center; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: #f8fafb; }
tr.archived td { opacity: .55; }
.fname { word-break: break-all; }
.actions { display: flex; gap: 12px; align-items: center; }
.actions form { margin: 0; }

/* 状态颜色 */
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--c-soft); color: var(--c); }
.st0 { --c: #6b5aa8; --c-soft: #efecf8; }
.st1 { --c: #4f6fa8; --c-soft: #e8eef8; }
.st2 { --c: #2f7f95; --c-soft: #e3f1f5; }
.st3 { --c: #8a6a12; --c-soft: #f7f0dc; }
.st4 { --c: #0d5c7d; --c-soft: #dcecf3; }
.st5 { --c: #2a7a63; --c-soft: #e0f2ec; }
.st6 { --c: #a8521f; --c-soft: #fbebdf; }
.st7 { --c: #2e7d4f; --c-soft: #e3f3e8; }
.mode { font-size: .78rem; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.mode-air { border-color: #c9d6ea; color: #4f6fa8; }

/* 进度条 */
.stepper { list-style: none; margin: 8px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(84px, 1fr)); overflow-x: auto; }
.stepper li { position: relative; text-align: center; }
.stepper li::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.cur::before { background: var(--accent); }
.stepper a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); padding: 0 4px; }
.stepper a:hover { text-decoration: none; }
.stepper .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-weight: 600; font-size: .85rem; }
.stepper .done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper .cur .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper .cur .lbl { color: var(--ink); font-weight: 700; }
.stepper .lbl { font-size: .82rem; line-height: 1.3; }
.stepper .date { font-size: .75rem; }

/* 货件详情 */
.current-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.eyebrow { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.big { font-size: 1.35rem; font-weight: 700; }
.countdown { text-align: right; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 20px; margin: 0; }
.kv > div { min-width: 0; }
.kv dt { font-size: .8rem; color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; white-space: pre-wrap; }
details.update summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.update[open] summary { margin-bottom: 14px; }
.stages { display: grid; gap: 10px; }
.stage-card { margin: 0; scroll-margin-top: 72px; }
.stage-card-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.stage-card.pending { display: flex; justify-content: space-between; padding: 10px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.stage-card:target { outline: 2px solid var(--accent); }
.items { white-space: pre-wrap; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 4px 0 18px 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.tl-del { margin: 0 0 0 auto; }
.note { margin: 6px 0; white-space: pre-wrap; }
.upload { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }

/* 总览 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi .n { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.kpi.warn { background: var(--warn-soft); border-color: #f2dcb3; }
.kpi.warn .n { color: var(--warn); }
.pipeline { display: grid; grid-template-columns: repeat(8, minmax(80px, 1fr)); gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
.pipe { display: flex; flex-direction: column; align-items: center; color: var(--ink); text-align: center; }
.pipe:hover { text-decoration: none; }
.pipe .bar { height: 80px; width: 36px; display: flex; align-items: flex-end; background: #f1f4f6; border-radius: 4px; overflow: hidden; }
.pipe .fill { width: 100%; background: var(--c); min-height: 0; }
.pipe .n { font-weight: 700; font-size: 1.1rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pipe .l { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two > section { min-width: 0; }
.list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list li { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.matrix th.c { font-size: .75rem; white-space: nowrap; }
.cnt { display: inline-block; min-width: 26px; padding: 1px 6px; border-radius: 99px; background: var(--c-soft); color: var(--c); font-weight: 700; }
.cnt:hover { text-decoration: none; }

/* 登录 */
.login { max-width: 380px; margin: 10vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }

@media (max-width: 760px) {
  .two { grid-template-columns: 1fr; }
  .topbar-inner { gap: 8px 16px; padding-block: 8px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .countdown { text-align: left; }
  .stepper { grid-template-columns: repeat(8, 84px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- 阶段简笔画与动画 ---------- */
.art { color: var(--c); width: 100%; max-width: 180px; height: auto; display: block; overflow: hidden; }
.art .fillbg { fill: var(--surface); }
.art .a-tick { stroke-dasharray: 20; animation: tick 3.6s ease-in-out infinite; }
.art .a-road { stroke-dasharray: 14 10; animation: road .6s linear infinite; }
.art .a-bump { animation: bump .35s ease-in-out infinite alternate; }
.art .a-spin { animation: spin .6s linear infinite; }
.art .a-speed { animation: speed .8s ease-out infinite; }
.art .a-slide { animation: slide 3s ease-out infinite; }
.art .a-clock { animation: spin 4s linear infinite; }
.art .a-bob { animation: bob 2.4s ease-in-out infinite alternate; }
.art .a-wave { animation: wave 2s linear infinite; }
.art .a-wave.slow { animation-duration: 3.4s; }
.art .a-smoke { animation: smoke 2s ease-out infinite; }
.art .a-cloud { animation: cloud 4s linear infinite; }
.art .a-cloud.late { animation-duration: 5.5s; animation-delay: -2.5s; }
.art .a-float { animation: float 2s ease-in-out infinite alternate; }
.art .a-drop { animation: drop 3.2s ease-out infinite; }
.art .a-shadow { animation: shadow 3.2s ease-out infinite; }
.art .a-scan { animation: scan 4s ease-in-out infinite; }
.art .a-pop { animation: pop .6s ease-out .1s both; }
.art .a-check { stroke-dasharray: 40; animation: check .7s ease-out .6s both; }

@keyframes tick { 0%, 12% { stroke-dashoffset: 20; } 28%, 86% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 20; } }
@keyframes road { to { stroke-dashoffset: 24; } }
@keyframes bump { to { transform: translateY(-1.5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes speed { 0% { opacity: 0; transform: translateX(10px); } 40% { opacity: .7; } 100% { opacity: 0; transform: translateX(-12px); } }
@keyframes slide { 0% { opacity: 0; transform: translateX(-70px); } 15% { opacity: 1; } 45%, 85% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(0); } }
@keyframes bob { from { transform: rotate(-2.5deg) translateY(0); } to { transform: rotate(2.5deg) translateY(2px); } }
@keyframes wave { to { transform: translateX(-40px); } }
@keyframes smoke { 0% { opacity: .6; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(-8px, -16px); } }
@keyframes cloud { from { transform: translateX(170px); } to { transform: translateX(-50px); } }
@keyframes float { to { transform: translateY(-5px); } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-34px); } 25% { opacity: 1; transform: translateY(0); } 33% { transform: translateY(-7px); } 41%, 88% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(0); } }
@keyframes shadow { 0% { transform: scale(.3); } 25%, 88% { transform: scale(1); } 100% { transform: scale(.3); } }
@keyframes scan { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(-36px, 6px); } 60% { transform: translate(-20px, 30px); } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes check { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .art * { animation: none !important; } }

.current-body { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: start; }
.current-body > div { min-width: 0; }
.stage-help { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.guide .card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.guide .art { max-width: 150px; margin: 0 auto 4px; }
.guide h3 { margin: 0; font-size: 1rem; }
.guide p { margin: 0; color: var(--muted); font-size: .9rem; }
.guide .tip { font-size: .82rem; }
@media (max-width: 760px) { .current-body { grid-template-columns: 1fr; } .current-body .art { max-width: 150px; } }
.guide .row { flex-wrap: nowrap; gap: 8px; } .guide .row .art { max-width: 48%; margin: 0; }

/* ---------- 快速维护 ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .88rem; }
.chip b { font-variant-numeric: tabular-nums; color: var(--c, var(--muted)); }
.chip:hover { text-decoration: none; border-color: var(--muted); }
.chip.on { border-color: var(--c, var(--accent)); background: var(--c-soft, var(--accent-soft)); font-weight: 600; }
.chip.warn { --c: var(--warn); --c-soft: var(--warn-soft); }
.table.board td { vertical-align: middle; }
.table .cb { width: 36px; text-align: center; }
.table .right { text-align: right; }
.table .right .btn { margin-right: 8px; }
.small-btn { padding: 5px 12px; font-size: .85rem; }
.quick-form { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.quick-form .field { flex: 1; min-width: 140px; }
.quick-form .field > span { font-size: .75rem; }
.quick-form input, .quick-form select { padding: 5px 8px; }
tr.expand > td { background: #f8fafb; padding: 16px 20px; }
.expand-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.batch { margin-top: 20px; }
.narrow-field { max-width: 320px; }
.selbar { position: sticky; bottom: 12px; margin: 12px auto 0; max-width: 420px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 10px 12px 10px 18px; border-radius: 99px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
@media (max-width: 760px) { .quick-form { flex-wrap: wrap; } }

/* ---------- 私人物品与仓库 ---------- */
.private { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 4px; background: #f3eefb; color: #5b3f94; white-space: nowrap; margin-right: 4px; }
.flash-private { background: #f3eefb; color: #5b3f94; border-color: #ddd0f2; }
fieldset.visibility { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
fieldset.visibility legend { font-size: .85rem; color: var(--muted); padding: 0 4px; }
.viewer-pick { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 0 24px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 16px; }
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.wh-card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.wh-card h3 { margin: 0; font-size: 1rem; }
.wh-card.inactive { opacity: .55; }
.wh-stock { display: flex; gap: 14px; font-size: .88rem; }
.wh-stock b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.wh-meta { font-size: .85rem; color: var(--muted); }

/* ---------- 进度条与提货 ---------- */
.bars { display: grid; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.pbar { --bar: var(--accent); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pbar.pick { --bar: #2e7d4f; }
.pbar.time { --bar: #0d5c7d; }
.pbar.late { --bar: var(--bad); }
.pbar-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; }
.pbar-label { font-weight: 600; }
.pbar-track { height: 8px; background: #e7ecf0; border-radius: 99px; overflow: hidden; }
.pbar-fill { height: 100%; background: var(--bar); border-radius: 99px; transition: width .4s ease; }
.pbar.big .pbar-track { height: 12px; }
.pbar.big .pbar-head { font-size: .95rem; }
.pbar.mini { margin-top: 6px; max-width: 160px; }
.pbar.mini .pbar-track { height: 5px; }
.pbar.mini .pbar-head { font-size: .75rem; color: var(--muted); }
.pbar.mini .pbar-label { font-weight: 500; }
.bar-in-list .pbar.mini { max-width: none; }
.status-cell { min-width: 130px; }
.flash-archived { background: #eef1f4; color: var(--muted); border-color: var(--line); }
.tablewrap.flat { border: 0; margin-top: 12px; }
.inline-form { display: inline; margin: 0; }
#pickup .card > .pbar { margin-bottom: 4px; }

/* ---------- 全程进度（渐变、分段） ---------- */
.journey { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.j-track { position: relative; height: 12px; border-radius: 99px; overflow: hidden; background: #e7ecf0; }
.j-grad { position: absolute; inset: 0; background: linear-gradient(90deg, #8b78d8 0%, #6a7fd6 10%, #3f8fd0 20%, #1f9fb5 60%, #22a37a 90%, #17804f 100%); }
.j-rest { position: absolute; top: 0; bottom: 0; right: 0; background: #e7ecf0; transition: left .5s ease; }
.j-tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--surface); }
.journey.late .j-rest { box-shadow: inset 3px 0 0 var(--bad); }
.j-segs { display: flex; gap: 8px; }
.j-seg { min-width: 0; display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); padding-top: 2px; }
.j-seg b { color: var(--ink); font-weight: 600; font-size: .82rem; }
.j-seg b .muted { font-weight: 400; font-size: .75rem; }
.j-seg.todo b { color: var(--muted); }
.j-seg.active span { color: var(--ink); }
.journey.mini { margin-top: 6px; max-width: 160px; }
.journey.mini .j-track { height: 6px; }
.journey.mini .j-tick { width: 1px; }
@media (max-width: 600px) { .j-segs { flex-direction: column; gap: 4px; } .j-seg { flex: none !important; } }
.pbar.pick .pbar-fill { background: linear-gradient(90deg, #7cc79a, #22a37a); }
.j-seg b { white-space: nowrap; }
