:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e6e9f2;
  --line-2: #eef1f7;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-weak: #eef2ff;
  --danger: #dc2626;
  --danger-weak: #fef2f2;
  --ok: #16a34a;
  --ok-weak: #f0fdf4;
  --amber: #d97706;
  --amber-weak: #fffbeb;
  --sky: #0284c7;
  --sky-weak: #f0f9ff;
  --violet: #7c3aed;
  --violet-weak: #f5f3ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .05);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 28px rgba(15, 23, 42, .09);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); background: #fff; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
textarea { resize: vertical; min-height: 80px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* 按钮 */
button.primary, button.ok, button.ghost, .dlg-foot button, .dlg-body button:not(.step):not(.node):not(.ghost):not(.primary):not(.soft-btn):not(.link):not(.tg):not([class*="d-"]) {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 16px; font-size: 14px; font-weight: 500;
  transition: background .15s, border-color .15s, transform .05s;
}
button:active { transform: translateY(1px); }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79, 70, 229, .28); }
button.primary:hover { background: #4338ca; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.ghost { border-color: transparent; background: none; color: var(--muted); padding: 6px 8px; }
button.ghost:hover { background: var(--line-2); color: var(--text); }
button.link { border: none; background: none; color: var(--primary); font-size: 13px; padding: 4px 6px; font-weight: 500; }
button.link:hover { text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #7c3aed); box-shadow: 0 4px 12px rgba(79, 70, 229, .35); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, .05); } }
.me { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; color: var(--text-2); }
.me:hover { border-color: #cbd5e1; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #818cf8, #6366f1); }
.avatar.lg { width: 36px; height: 36px; font-size: 15px; }
.avatar.sm { width: 22px; height: 22px; font-size: 11px; background: linear-gradient(135deg, #94a3b8, #64748b); }

/* 主体 */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 24px 80px; }
.hero h2 { margin: 4px 0 16px; font-size: 22px; font-weight: 700; letter-spacing: .2px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stat {
  --c: var(--primary); --cw: var(--primary-weak);
  position: relative; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon label" "num num" "sub sub";
  align-items: center; column-gap: 10px; transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden;
}
button.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); opacity: 0; transition: opacity .15s; }
.stat.active { border-color: var(--c); }
.stat.active::after { opacity: 1; }
.stat-icon { grid-area: icon; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: var(--cw); }
.stat-label { grid-area: label; font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-num { grid-area: num; font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 10px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat-sub { grid-area: sub; font-size: 12px; color: var(--faint); margin-top: 4px; min-height: 18px; }
.stat-sub em { font-style: normal; color: var(--danger); font-weight: 600; }
.stat-sub em.blk { color: #b91c1c; }
.k-all { --c: var(--primary); --cw: var(--primary-weak); }
.k-buy { --c: var(--amber); --cw: var(--amber-weak); }
.k-ship { --c: var(--sky); --cw: var(--sky-weak); }
.k-label { --c: #0d9488; --cw: #f0fdfa; }
.k-ops { --c: var(--violet); --cw: var(--violet-weak); }
.k-done { --c: var(--ok); --cw: var(--ok-weak); }

/* 输入区 */
.composer { margin-top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px 10px; }
.composer:focus-within { border-color: #c7d2fe; box-shadow: var(--shadow), 0 0 0 4px rgba(99, 102, 241, .08); }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer textarea { border: none; box-shadow: none !important; padding: 7px 2px; min-height: 38px; height: 38px; resize: none; font-size: 16px; line-height: 1.5; background: transparent; }
.composer textarea::placeholder { color: var(--faint); }
.send { display: inline-flex; align-items: center; gap: 6px; height: 38px; flex: none; }
.composer-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.examples { display: flex; gap: 6px; flex-wrap: wrap; }
.ex { border: 1px solid var(--line); background: #f8fafc; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--text-2); }
.ex:hover { border-color: #c7d2fe; background: var(--primary-weak); color: var(--primary); }
.hint { font-size: 12px; color: var(--faint); }
.quick-preview { margin: 8px 0 0 48px; display: grid; gap: 4px; font-size: 13px; }
.quick-preview:empty { display: none; }
.quick-preview > div { padding: 6px 10px; border-radius: 8px; background: var(--primary-weak); color: #3730a3; }
.quick-preview > div.muted { background: #f1f5f9; color: var(--muted); }
.paste-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0 48px; }
.paste-imgs:empty { display: none; }
#dImgs { margin-left: 0; }
.paste-img { position: relative; }
.paste-img img { width: 68px; height: 68px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.paste-img button { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; padding: 0; font-size: 11px; border-radius: 50%; background: #0f172a; color: #fff; border: 2px solid #fff; }

/* 列表头 */
.list-head { display: flex; gap: 12px; align-items: center; margin: 28px 0 12px; }
.seg-tabs { display: inline-flex; background: #e8ebf3; padding: 3px; border-radius: 11px; flex: none; }
.seg-tabs button { border: none; background: none; padding: 6px 16px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.seg-tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; color: var(--faint); }
.search:focus-within { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.search input { border: none; box-shadow: none !important; padding: 9px 0; background: transparent; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--text-2); }
.chip:hover { border-color: #cbd5e1; }
.chip.active { border-color: var(--primary); color: #fff; background: var(--primary); }

/* 任务卡片 */
#list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); align-items: start; }
#list > .empty { grid-column: 1 / -1; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px 14px 22px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: #cbd5e1; }
.card.p3::before { background: var(--danger); }
.card.p2::before { background: #f59e0b; }
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); border-color: #dde2ee; }
.card.done { opacity: .72; }
.card.done::before { background: var(--ok); }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order { font-size: 18px; font-weight: 700; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 500; background: #f1f5f9; color: var(--text-2); }
.t-buy { background: var(--amber-weak); color: #b45309; }
.t-ship { background: var(--sky-weak); color: #0369a1; }
.t-ops { background: var(--violet-weak); color: #6d28d9; }
.t-red { background: var(--danger-weak); color: #b91c1c; }
.t-gray { background: #f1f5f9; color: var(--muted); }
.badge.soft { font-weight: 600; }
.prio-pick { width: auto; font-size: 12px; font-weight: 600; padding: 2px 22px 2px 9px; border-radius: 999px; border: none; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-repeat: no-repeat; background-position: right 7px center; background-size: 8px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.6'/%3E%3C/svg%3E"); }
.prio-pick.p3 { background-color: var(--danger-weak); color: var(--danger); }
.prio-pick.p2 { background-color: var(--amber-weak); color: #b45309; }
.prio-pick.p1 { background-color: #f1f5f9; color: var(--muted); }
.age { font-size: 12px; color: var(--faint); white-space: nowrap; }
.age.old { color: var(--danger); font-weight: 600; background: var(--danger-weak); padding: 2px 8px; border-radius: 999px; }
.age.ok { color: var(--ok); font-weight: 500; }
.card-text { margin: 8px 0 0; color: var(--text-2); font-size: 14px; }

/* 环节进度条 */
.tracker { display: flex; align-items: center; margin-top: 14px; flex-wrap: wrap; row-gap: 8px; }
.node { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; background: none; padding: 4px 10px 4px 4px; border-radius: 999px; text-align: left; transition: background .15s, border-color .15s; }
.node .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; border: 2px dashed #cbd5e1; color: transparent; background: #fff; }
.node-txt { display: flex; flex-direction: column; line-height: 1.25; }
.node-txt b { font-size: 13px; font-weight: 600; color: var(--text-2); }
.node-txt small { font-size: 11px; color: var(--faint); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.todo:hover { background: var(--primary-weak); border-color: #c7d2fe; }
.node.todo:hover .dot { border-style: solid; border-color: var(--primary-2); color: var(--primary-2); }
.node.todo:hover .dot::after { content: "✓"; }
.node.mine .dot { border: 2px solid var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.node.mine .node-txt small { color: var(--primary); font-weight: 600; }
.node.done .dot { border: none; background: var(--ok); color: #fff; }
.node.done .node-txt small { color: var(--ok); }
.node.blocked .dot { border: none; background: var(--danger); color: #fff; }
.node.blocked { background: var(--danger-weak); }
.node.blocked .node-txt b, .node.blocked .node-txt small { color: var(--danger); }
.node.skipped { opacity: .5; }
.line { width: 28px; height: 2px; background: #e2e8f0; border-radius: 2px; margin: 0 2px; flex: none; }
.line.done { background: #86efac; }

.last-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; }
.bubble { background: #f6f7fb; border-radius: 4px 12px 12px 12px; padding: 5px 10px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bubble b { font-weight: 600; margin-right: 6px; color: var(--text); }
.more { font-size: 12px; color: var(--faint); white-space: nowrap; }

/* 空状态 */
.empty { text-align: center; padding: 56px 16px 64px; background: var(--card); border: 1px dashed #d5dbe8; border-radius: 18px; }
.empty-art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #34d399, #16a34a); box-shadow: 0 10px 24px rgba(22, 163, 74, .28); }
.empty-art svg { width: 30px; height: 30px; stroke-width: 2.6; }
.empty h3 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0; color: var(--muted); font-size: 14px; }
.small-empty { padding: 36px 16px; }

/* 弹窗 */
dialog { border: none; border-radius: 18px; padding: 0; width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 24px 64px rgba(15, 23, 42, .25); }
dialog::backdrop { background: rgba(15, 23, 42, .4); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dlg-head h3 { margin: 0; font-size: 18px; flex: 1; }
.dlg-body { padding: 16px 20px; }
.dlg-body h4 { font-size: 14px; color: var(--text-2); }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; }
/* 紧急度选择：选中的那个填色（选择器写全，压过弹窗里按钮的默认白底） */
.dlg-body .seg button { color: var(--text-2); }
.dlg-body .seg button.on.p3 { background: var(--danger); border-color: var(--danger); color: #fff; }
.dlg-body .seg button.on.p2 { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.dlg-body .seg button.on.p1 { background: #64748b; border-color: #64748b; color: #fff; }
.issue-text { color: var(--text-2); }

/* 详情里的环节按钮 */
.detail-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step-wrap { display: inline-flex; align-items: center; gap: 2px; }
.step { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 7px 12px; border-radius: 10px; font-size: 14px; line-height: 1.3; border: 1px solid var(--line); background: #fff; min-width: 120px; }
.step small { font-size: 11px; color: var(--muted); }
.step.done { background: var(--ok-weak); border-color: #86efac; color: #166534; }
.step.done small { color: #15803d; }
.step.todo { border-style: dashed; border-color: #94a3b8; }
.step.todo:hover { border-color: var(--primary-2); background: var(--primary-weak); }
.step.todo.mine { border: 2px solid var(--primary); background: var(--primary-weak); color: var(--primary); }
.step.blocked { background: var(--danger-weak); border-color: #fca5a5; color: var(--danger); }
.step.blocked small { color: var(--danger); }
.step-picks { display: flex; gap: 16px; }
.step-picks label { display: flex; gap: 6px; align-items: center; color: var(--text); font-size: 14px; }
.step-picks input { width: auto; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.timeline li.event { color: var(--muted); font-size: 13px; }
.timeline .who { font-weight: 600; color: var(--text); }
.timeline .when { font-size: 12px; color: var(--faint); margin-left: 8px; }
.note-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.note-imgs img, .paste-img img { cursor: zoom-in; }
.note-imgs img { max-width: 200px; max-height: 200px; border-radius: 10px; border: 1px solid var(--line); display: block; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users td, table.users th { padding: 8px 4px; border-bottom: 1px solid var(--line-2); text-align: left; }
table.users th { color: var(--muted); font-weight: 500; font-size: 13px; }

/* 提示 */
#toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 12px; display: none; z-index: 99; font-size: 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); }

/* 登录页 */
.login { max-width: 380px; margin: 14vh auto; background: #fff; padding: 32px 28px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.login h2 { margin: 0 0 20px; }
.login input { margin-bottom: 12px; padding: 12px; }
.login button { width: 100%; padding: 12px; }

/* 手机 */
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat.k-all { grid-column: span 3; }
  .stat.k-done { display: none; }
}
@media (max-width: 600px) {
  .topbar-in { padding: 0 16px; height: 56px; }
  .brand-sub, .sync, #who { display: none; }
  .me { padding: 4px; }
  .wrap { padding: 16px 16px 60px; }
  .hero h2 { font-size: 19px; margin-bottom: 12px; }
  .stat-grid { gap: 8px; }
  .stat { padding: 12px; column-gap: 8px; }
  .stat-icon { width: 26px; height: 26px; border-radius: 7px; }
  .stat-icon svg { width: 15px; height: 15px; }
  .stat-num { font-size: 24px; margin-top: 6px; }
  .stat-label { font-size: 12px; }
  .composer { padding: 12px; }
  .composer .avatar.lg { display: none; }
  .quick-preview, .paste-imgs { margin-left: 0; }
  .hint { display: none; }
  .list-head { flex-direction: column; align-items: stretch; margin-top: 20px; }
  .seg-tabs { align-self: flex-start; }
  .card { padding: 14px 14px 12px 18px; }
  .line { width: 14px; }
}

/* 看大图 */
dialog.viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border-radius: 0; background: transparent; box-shadow: none; display: none; }
dialog.viewer[open] { display: grid; place-items: center; }
dialog.viewer::backdrop { background: rgba(10, 12, 20, .86); backdrop-filter: blur(4px); }
#viewerImg { max-width: 92vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff; cursor: zoom-out; }
.v-btn { position: fixed; border: none; background: rgba(255, 255, 255, .14); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; display: grid; place-items: center; }
.v-btn:hover { background: rgba(255, 255, 255, .26); }
.v-close { top: 20px; right: 20px; font-size: 18px; }
.v-prev, .v-next { top: 50%; transform: translateY(-50%); font-size: 30px; display: none; }
.v-prev { left: 20px; }
.v-next { right: 20px; }
dialog.viewer.multi .v-prev, dialog.viewer.multi .v-next { display: grid; }
.v-count { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; background: rgba(255, 255, 255, .14); padding: 4px 12px; border-radius: 999px; }
.v-count:empty { display: none; }

/* 页面风格的确认 / 输入弹窗 */
dialog.ask { width: min(440px, calc(100vw - 32px)); border-radius: 18px; }
dialog.ask form { padding: 22px 22px 18px; }
.ask-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ask-head h3 { margin: 0; font-size: 18px; }
.ask-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--primary); background: var(--primary-weak); }
.ask-icon.danger { color: var(--danger); background: var(--danger-weak); }
.ask-msg { margin: 8px 0 4px; color: var(--muted); font-size: 14px; }
.ask-field { display: block; margin-top: 14px; }
.ask-field span { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.ask-field input { padding: 11px 12px; font-size: 15px; }
.ask-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
.ask-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.ask-foot button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 18px; font-size: 14px; font-weight: 500; }
.ask-foot button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.danger-btn { background: var(--danger) !important; border-color: var(--danger) !important; color: #fff; box-shadow: 0 2px 8px rgba(220, 38, 38, .28); }

.bell { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; }
.bell:hover { background: #fef3c7; }
@media (max-width: 600px) { .bell { padding: 4px 8px; font-size: 12px; } }

/* 点环节后立刻给反馈 */
.node.busy { pointer-events: none; opacity: .75; }
.node.busy .dot { border: 2px solid #c7d2fe; border-top-color: var(--primary); color: transparent !important; animation: spin .7s linear infinite; }
.node.busy .dot::after { content: "" !important; }
@keyframes spin { to { transform: rotate(360deg); } }
.node.done .dot { animation: pop .25s ease-out; }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* 任务详情：内容区单独滚动，留言框固定在底部 */
dialog.detail { width: min(640px, calc(100vw - 24px)); overflow: hidden; }
dialog.detail[open] { display: flex; flex-direction: column; height: min(860px, calc(100vh - 40px)); }
dialog.detail .dlg-head { flex: none; gap: 8px; }
dialog.detail .dlg-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.head-action { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }
.head-action:hover { color: var(--danger); border-color: #fca5a5; background: var(--danger-weak); }
.note-bar { flex: none; border-top: 1px solid var(--line); background: #fbfcfe; padding: 12px 16px 14px; }
.note-bar .paste-imgs { margin: 0 0 8px; }
.note-row { display: flex; gap: 10px; align-items: flex-end; }
.note-row textarea { min-height: 44px; height: 44px; max-height: 160px; resize: none; padding: 11px 14px; border-radius: 12px; background: #fff; font-size: 15px; }
.note-row button { height: 44px; flex: none; padding: 0 20px; }
.note-row button:disabled { opacity: .7; }

/* 刚操作过的卡片闪一下 */
.card.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px rgba(22, 163, 74, .55), var(--shadow-hover); border-color: #86efac; } 100% { box-shadow: var(--shadow); } }

/* 左侧日历栏 */
.wrap.layout { max-width: 1400px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.topbar-in { max-width: 1400px; }
.side { position: sticky; top: 84px; display: grid; gap: 16px; }
.cal-card, .side-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 15px; }
.cal-nav { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 18px; line-height: 1; color: var(--muted); }
.cal-nav:hover { background: var(--line-2); color: var(--text); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-week span { font-size: 12px; color: var(--faint); padding-bottom: 4px; }
.cal-grid button { position: relative; aspect-ratio: 1; border: 1px solid transparent; background: none; border-radius: 10px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; padding: 0; }
.cal-grid button:hover { background: var(--line-2); }
.cal-grid button.future { color: #cbd5e1; }
.cal-grid button.today { border-color: var(--primary-2); color: var(--primary); font-weight: 700; }
.cal-grid button.has-open { background: #fff5f5; }
.cal-grid button.all-done { background: #f3fbf5; }
.cal-grid button.sel { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 10px rgba(79, 70, 229, .3); }
.cal-grid em { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #f87171; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 17px; border: 2px solid #fff; }
.cal-grid em.urg { background: var(--danger); }
.cal-grid i { position: absolute; bottom: 2px; right: 4px; font-size: 9px; font-style: normal; color: var(--ok); font-weight: 700; }
.cal-grid button.sel i { color: #fff; }
.cal-legend { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.cal-legend .link { margin-left: auto; font-size: 12px; }
.lg-red { width: 10px; height: 10px; border-radius: 50%; background: #f87171; display: inline-block; }
.lg-ok { width: 10px; height: 10px; border-radius: 3px; background: #dcfce7; border: 1px solid #86efac; display: inline-block; }
.side-card h4 { margin: 0 0 8px; font-size: 14px; color: var(--text-2); }
.old-row { width: 100%; display: flex; align-items: center; gap: 6px; border: none; background: none; padding: 8px 6px; border-radius: 8px; text-align: left; font-size: 13px; }
.old-row:hover { background: var(--line-2); }
.old-row + .old-row { border-top: 1px solid var(--line-2); }
.old-age { font-size: 12px; color: var(--danger); font-weight: 600; }
.day-chip { flex: none; border: 1px solid var(--primary); background: var(--primary-weak); color: var(--primary); border-radius: 11px; padding: 8px 12px; font-size: 13px; font-weight: 600; white-space: pre; }
.day-chip:hover { background: #e0e7ff; }
.main-col { min-width: 0; }
.main-col .hero h2 { margin-top: 4px; }

/* 中等宽度：日历放到上方，横向排 */
@media (max-width: 1180px) {
  .wrap.layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); order: 2; }
  .main-col { display: contents; }
  .main-col .hero { order: 1; }
  .main-col .composer { order: 3; }
  .main-col .list-head { order: 4; }
  .main-col .chips { order: 5; }
  .main-col #list { order: 6; }
  .cal-grid button { aspect-ratio: auto; height: 34px; }
}
@media (max-width: 700px) {
  .side { grid-template-columns: minmax(0, 1fr); order: 7; margin-top: 8px; }
  .side-card { display: none; }
}

/* 新建前的确认卡片 */
.qc { margin: 4px 0 0 48px; border: 1px solid #c7d2fe; background: #f8f9ff; border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; }
.qc-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.qc-head .muted { font-size: 12px; }
.qc-row { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.qc-row.other { font-size: 13px; color: var(--text-2); padding: 8px 12px; }
.qc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qc-order { font-size: 16px; }
.qc-text { color: var(--muted); font-size: 13px; }
.qc-top select { width: auto; padding: 5px 28px 5px 10px; font-size: 13px; }
.qc-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.qc-step { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); background: #f6f7fb; border-radius: 10px; padding: 4px 4px 4px 10px; }
.qc-step select { width: auto; padding: 4px 26px 4px 8px; font-size: 13px; border-radius: 8px; }
.qc-step.done { color: var(--ok); padding: 6px 10px; flex-direction: column; align-items: flex-start; gap: 0; background: var(--ok-weak); }
.qc-step.done small { font-size: 11px; }
.qc-arrow { color: var(--faint); }
.qc-foot { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 600px) { .qc { margin-left: 0; } }
/* 详情里环节旁边的处理人 */
.step-wrap { flex-direction: column; align-items: stretch; gap: 6px; }
.step-side { display: flex; align-items: center; gap: 4px; }
.assign-pick { width: auto; max-width: 150px; font-size: 12px; padding: 3px 24px 3px 8px; border-radius: 8px; }
/* 已解决的卡片更明显 */
.card.done { background: #fafbfc; opacity: .8; }
.card.done .order { color: var(--muted); }

/* 设置弹窗 */
dialog.settings { width: min(760px, calc(100vw - 24px)); }
.settings .dlg-body { padding: 20px 22px 24px; }
.me-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: linear-gradient(135deg, #eef2ff, #f5f3ff); border: 1px solid #e0e7ff; flex-wrap: wrap; }
.avatar.xl { width: 48px; height: 48px; font-size: 20px; }
.avatar.md { width: 38px; height: 38px; font-size: 15px; }
.me-info { display: flex; flex-direction: column; }
.me-info b { font-size: 17px; }
.me-info span { font-size: 13px; color: var(--muted); }
.soft-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.soft-btn:hover { border-color: #c7d2fe; color: var(--primary); }
.soft-btn.danger { color: var(--danger); }
.soft-btn.danger:hover { border-color: #fca5a5; background: var(--danger-weak); color: var(--danger); }
.small-btn { padding: 7px 14px !important; font-size: 13px !important; border-radius: 10px; }
.sec-head { display: flex; align-items: center; margin: 24px 0 12px; }
.sec-head h4 { margin: 0; font-size: 15px; color: var(--text); }
.sec-head .count { color: var(--faint); font-weight: 500; }
.add-card { border: 1px solid #c7d2fe; background: #f8f9ff; border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.add-grid label > span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.pw-row { display: flex; gap: 6px; }
.dept-pick { display: flex; gap: 6px; }
.dept-pick button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 0; font-size: 14px; font-weight: 500; color: var(--text-2); }
.dept-pick button.on.d-ops { background: var(--violet); border-color: var(--violet); color: #fff; }
.dept-pick button.on.d-buy { background: var(--amber); border-color: var(--amber); color: #fff; }
.dept-pick button.on.d-ship { background: var(--sky); border-color: var(--sky); color: #fff; }
.add-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.member-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.member { display: grid; grid-template-columns: auto minmax(0, 1fr) 130px 70px auto; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; }
.member + .member { border-top: 1px solid var(--line-2); }
.member:hover { background: #fafbfe; }
.member.off { opacity: .55; }
.m-info { display: flex; flex-direction: column; min-width: 0; }
.m-info b { font-size: 15px; }
.m-info span { font-size: 12px; color: var(--faint); }
.m-dept { width: 100%; font-size: 13px; padding: 6px 28px 6px 10px; border-radius: 999px; font-weight: 500; }
.m-dept.d-ops { background-color: var(--violet-weak); color: #6d28d9; border-color: #ddd6fe; }
.m-dept.d-buy { background-color: var(--amber-weak); color: #b45309; border-color: #fde68a; }
.m-dept.d-ship { background-color: var(--sky-weak); color: #0369a1; border-color: #bae6fd; }
.m-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; text-align: center; }
.m-status.on { background: var(--ok-weak); color: var(--ok); }
.m-status.off { background: #f1f5f9; color: var(--muted); }
.m-status.admin { background: var(--primary-weak); color: var(--primary); }
.m-actions { display: flex; gap: 6px; justify-content: flex-end; min-width: 150px; }
.avatar.d-ops { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.avatar.d-buy { background: linear-gradient(135deg, #fbbf24, #d97706); }
.avatar.d-ship { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.avatar.d-none { background: linear-gradient(135deg, #818cf8, #4f46e5); }
@media (max-width: 640px) {
  .add-grid { grid-template-columns: 1fr; }
  .member { grid-template-columns: auto minmax(0, 1fr) auto; }
  .m-dept { grid-column: 2; }
  .m-status { grid-column: 3; grid-row: 1; }
  .m-actions { grid-column: 1 / -1; justify-content: flex-start; min-width: 0; }
}

/* Shopline 订单信息 */
.t-ok { background: var(--ok-weak); color: #15803d; }
.shop-strip { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line-2); min-width: 0; }
.shop-strip img, .shop-strip .ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: #e2e8f0; border: 1px solid var(--line); }
.shop-strip.missing { color: #b45309; background: var(--amber-weak); border-color: #fde68a; font-size: 13px; }
.ss-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ss-main b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-meta { display: flex; align-items: center; gap: 6px; flex: none; font-size: 12px; }
.cc { font-size: 11px; font-weight: 700; color: var(--text-2); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.order-box:empty { display: none; }
.order-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcfe; }
.ob-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ob-items { display: grid; gap: 8px; }
.ob-item { display: flex; align-items: center; gap: 10px; }
.ob-item img, .ob-item .ph { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; cursor: zoom-in; background: #e2e8f0; }
.ob-item div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ob-item b { font-size: 13px; font-weight: 600; }
.ob-item small { font-size: 12px; color: var(--muted); }
.ob-item .qty { font-weight: 700; font-size: 14px; }
.ob-addr { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.ob-addr .muted { margin-right: 6px; }
.qc-check { display: block; margin-top: 6px; font-size: 12px; }
.qc-check.ok { color: var(--ok); }
.qc-check.bad { color: #b45309; font-weight: 600; }
@media (max-width: 600px) { .ss-meta .muted { display: none; } }

/* 详情：环节上下排列，每环下面有对话 */
#dSteps.detail-steps { display: grid; gap: 10px; }
.sblock { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fff; }
.sblock.done { background: #fbfefc; border-color: #d1fae5; }
.sblock.blocked { border-color: #fecaca; background: #fffafa; }
.sblock.flash-blk { animation: flash 1.6s ease-out; }
.sb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sb-head .step { min-width: 150px; }
.sb-thread { display: grid; gap: 8px; margin: 10px 0 2px; padding: 10px; background: #f8fafc; border-radius: 10px; max-height: 320px; overflow-y: auto; }
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg.mine { flex-direction: row-reverse; }
.msg .avatar.sm { margin-top: 2px; }
.msg.mine .avatar.sm { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.msg-body { max-width: 80%; }
.msg-meta { display: flex; gap: 6px; align-items: baseline; font-size: 12px; color: var(--faint); }
.msg.mine .msg-meta { justify-content: flex-end; }
.msg-meta b { color: var(--text-2); font-weight: 600; }
.msg-text { margin-top: 2px; background: #fff; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 6px 10px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.mine .msg-text { background: var(--primary-weak); border-color: #c7d2fe; border-radius: 12px 4px 12px 12px; }
.msg .note-imgs img { max-width: 160px; max-height: 160px; }
.sb-reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.sb-reply textarea { min-height: 38px; height: 38px; resize: none; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.sb-reply button { height: 38px; flex: none; }
.sblock .paste-imgs { margin: 8px 0 0; }
.t-msg { background: #fef3c7; color: #92400e; font-weight: 600; animation: pulse-msg 2s infinite; }
@keyframes pulse-msg { 50% { background: #fde68a; } }
/* 顶部消息中心 */
.inbox-wrap { position: relative; }
.inbox-btn { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.inbox-btn:hover { border-color: #c7d2fe; color: var(--primary); }
.inbox-btn em { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; border: 2px solid #fff; }
.inbox-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(15, 23, 42, .18); z-index: 30; overflow: hidden; }
.ip-head { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ip-list { max-height: 420px; overflow-y: auto; }
.ib-item { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; border: none; background: #fff; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.ib-item:hover { background: #f8fafc; }
.ib-item.unread { background: #f5f7ff; }
.ib-item.unread .ib-top::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); display: inline-block; margin-right: 6px; }
.ib-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ib-top { display: flex; align-items: center; gap: 3px; font-size: 13px; color: var(--muted); }
.ib-top b { color: var(--text); }
.ib-top small { color: var(--faint); }
.ib-text { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ip-empty { padding: 24px 16px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 600px) { .inbox-pop { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; } }

/* 详情：简洁版 */
.d-sec-head { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; }
.d-sec-head h4 { margin: 0; font-size: 14px; color: var(--text-2); }
.d-tracker { margin-top: 0; padding: 8px 10px; background: #f8fafc; border-radius: 12px; }
.d-adjust { margin-top: 8px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; }
.adj-row { display: flex; align-items: center; gap: 10px; }
.adj-row b { width: 40px; font-size: 13px; }
.adj-row .assign-pick { max-width: 200px; }
.adj-picks { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line-2); }
.timeline li.tl-msg { border-bottom: none; padding: 6px 0; }
.timeline li.event { text-align: center; border-bottom: none; padding: 4px 0; font-size: 12px; }
.timeline li.event .who { font-weight: 500; color: var(--muted); }
.msg-to { font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-weak); border-radius: 6px; padding: 0 6px; }
.target-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tg { display: inline-flex; align-items: baseline; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--text-2); }
.tg small { font-size: 11px; color: var(--faint); }
.tg.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.tg.on small { color: #e0e7ff; }
.d-adjust[hidden] { display: none; }

/* 同一行的卡片等高，留言条贴底对齐 */
#list { align-items: stretch; }
.card { display: flex; flex-direction: column; }
.card > .last-note { margin-top: auto; }
.card > .tracker { margin-bottom: 2px; }
.card:not(:has(.last-note)) > .tracker { margin-top: auto; padding-top: 14px; }

/* @ 提醒 */
.note-row { position: relative; }
.mention-pop { position: absolute; left: 0; bottom: calc(100% + 8px); width: 260px; max-height: 300px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); padding: 6px; z-index: 30; }
.mention-pop[hidden] { display: none; }
.mp-head { font-size: 12px; color: var(--muted); padding: 4px 8px 6px; }
.dlg-body .mp-item, .mp-item { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; box-shadow: none; border-radius: 10px; padding: 7px 8px; text-align: left; font-size: 14px; cursor: pointer; }
.mp-item small { color: var(--muted); margin-left: auto; font-size: 12px; }
.mp-item.on, .mp-item:hover { background: var(--primary-weak); }
.at { color: var(--primary); font-weight: 600; background: var(--primary-weak); border-radius: 6px; padding: 0 3px; }
.at.me { color: #fff; background: var(--primary); }
.msg.mine .at { color: inherit; background: rgba(255, 255, 255, .22); }
.ib-at { font-style: normal; font-size: 11px; font-weight: 600; color: #fff; background: var(--danger); border-radius: 6px; padding: 0 5px; margin-left: 6px; }

/* 客服岗位：青色 */
.k-cs { --c: #0d9488; --cw: #f0fdfa; }
.dept-pick button.on.d-cs { background: #0d9488; border-color: #0d9488; color: #fff; }
.m-dept.d-cs { background-color: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.avatar.d-cs { background: linear-gradient(135deg, #2dd4bf, #0d9488); }

/* 刚发出的留言：发送中半透明，失败标红 */
.tl-msg.sending .msg-body { opacity: .6; }
.tl-msg.failed .msg-text { border: 1px solid #fca5a5 !important; background: #fef2f2 !important; color: var(--danger) !important; }
.sending-note { font-size: 12px; color: var(--muted); text-align: right; margin: 2px 44px 0 0; }
.sending-note.err { color: var(--danger); }

/* 手机上统计卡：6 个排成两行三列，大小一致 */
@media (max-width: 860px) {
  .stat.k-all { grid-column: auto; }
  .stat.k-done { display: grid; }
}
@media (max-width: 600px) {
  .stat .stat-sub { font-size: 11px; }
}
.card-text .at { font-weight: 600; }
#quick { scrollbar-width: none; }
#quick::-webkit-scrollbar { display: none; }

/* 换筛选、还没拿到数据时，旧列表先变淡 */
#list { transition: opacity .12s; }
#list.stale { opacity: .45; pointer-events: none; }

/* 调整面板：环节先后 */
.adj-order { display: inline-flex; gap: 2px; margin-right: 4px; }
.dlg-body .adj-order .mv, .adj-order .mv { width: 26px; height: 26px; padding: 0; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--text-2); font-size: 13px; line-height: 1; cursor: pointer; box-shadow: none; }
.adj-order .mv:hover:not(:disabled) { border-color: #c7d2fe; color: var(--primary); }
.adj-order .mv:disabled { opacity: .3; cursor: default; }
.adj-row > b { white-space: nowrap; min-width: 64px; }

/* 环节拖动换顺序 */
#dSteps .node { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
#dSteps .node.dragging { position: relative; z-index: 2; background: #fff; border-color: var(--primary-2); box-shadow: 0 8px 20px rgba(79, 70, 229, .22); cursor: grabbing; transition: none; }
#dSteps.sorting .line { opacity: .3; }
#dSteps .node.drop-here { box-shadow: -3px 0 0 var(--primary); }
#dSteps.drop-end { box-shadow: inset -3px 0 0 var(--primary); }

.ib-turn { font-style: normal; font-size: 11px; font-weight: 600; color: #fff; background: var(--primary); border-radius: 6px; padding: 0 5px; margin-left: 6px; }

/* 卡片上的发货单号 */
.ship-nos { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; margin: 8px 0 2px; }
.copy-no { font-size: 12px; background: var(--ok-weak); color: #15803d; border: 1px solid #bbf7d0; border-radius: 6px; padding: 1px 6px; cursor: copy; }
.copy-no:hover { border-color: var(--ok); }
/* 成员改名 */
.m-rename { margin-left: 6px; font-size: 12px !important; padding: 0 4px !important; opacity: 0; }
.member:hover .m-rename { opacity: 1; }
@media (hover: none) { .m-rename { opacity: 1; } }
/* 手机：环节标题不挤成竖排 */
.d-sec-head h4, #dAdjustToggle { white-space: nowrap; flex: none; }
@media (max-width: 600px) { .hint-steps { display: none; } }
#dNote { scrollbar-width: none; }
#dNote::-webkit-scrollbar { display: none; }

/* 宽屏：内容铺开一些，两边少留空；任务卡片宽屏一排 3 张 */
.topbar-in, .wrap, .wrap.layout { max-width: 1680px; }
@media (min-width: 1181px) {
  .topbar-in { padding: 0 32px; }
  .wrap { padding-left: 32px; padding-right: 32px; }
}
#list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }

/* 「发给」选具体的人 */
.tg-pop { position: absolute; left: 0; bottom: calc(100% + 44px); width: 260px; max-height: 340px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); padding: 6px; z-index: 31; }
.tg-pop[hidden] { display: none; }
.tp-head { font-size: 12px; color: var(--muted); padding: 4px 8px 6px; }
.dlg-body .tp-item, .tp-item { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; box-shadow: none; border-radius: 10px; padding: 7px 8px; text-align: left; font-size: 14px; cursor: pointer; color: var(--text); }
.tp-item:hover { background: var(--line-2); }
.tp-item.on { background: var(--primary-weak); }
.tp-item small { color: var(--muted); font-size: 12px; }
.tp-item i { margin-left: auto; font-style: normal; color: var(--primary); font-weight: 700; }
.tp-more summary { font-size: 12px; color: var(--muted); padding: 6px 8px; cursor: pointer; }

/* 新建任务的紧急度：选中后要有底色（之前被弹窗按钮的通用白底盖掉，变成白字白底） */
#nPrio button { background: #fff; color: var(--text-2); }
#nPrio button.on.p3 { background: var(--danger); border-color: var(--danger); color: #fff; }
#nPrio button.on.p2 { background: #f59e0b; border-color: #f59e0b; color: #fff; }
#nPrio button.on.p1 { background: #64748b; border-color: #64748b; color: #fff; }

/* 中等宽度（小笔记本、浏览器没开满）：顶部按钮不换行，放不下的先藏起来 */
.inbox-btn, .me, #who, .me-name, .sync { white-space: nowrap; }
@media (max-width: 1100px) {
  .brand-sub, .topbar .sync { display: none; }
}
@media (max-width: 900px) {
  #who, .me-name { display: none; }
  .me { padding: 4px; }
}

/* 卡片：环节和最后一条留言放在底部，同一排卡片底部对齐 */
.card-foot { margin-top: auto; padding-top: 14px; }
.card-foot .tracker { margin-top: 0; flex-wrap: nowrap; overflow: hidden; }
/* 卡片上的环节紧凑一点，4 个也能一行放下 */
.card-foot .node { padding: 3px 6px 3px 2px; gap: 6px; flex: none; }
.card-foot .node .dot { width: 22px; height: 22px; font-size: 12px; }
.card-foot .node-txt b { font-size: 12.5px; }
.card-foot .node-txt small { font-size: 11px; max-width: 72px; }
.card-foot .line { width: 14px; margin: 0 1px; flex: 1 1 14px; max-width: 28px; min-width: 8px; }
/* 最后一条留言：头像 + 名字 + 多久前，下一行是内容 */
.card-foot .last-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.card-foot .last-note .avatar { margin-top: 1px; }
.ln-body { flex: 1; min-width: 0; }
.ln-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); line-height: 1.4; }
.ln-meta b { color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.ln-meta .more { color: var(--faint); }
.ln-text { margin-top: 2px; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 没有留言的卡片也留同样的位置，同一排卡片的环节就能对齐 */
.empty-note .ln-meta { color: #c3cad8; }
.avatar.ghost { background: var(--line-2) !important; box-shadow: none; }

/* @ 的人读没读 */
.seen { margin-top: 3px; font-size: 11.5px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }
.msg.mine .seen { justify-content: flex-end; }
.seen i { font-style: normal; color: #cbd5e1; }
.seen .rd { color: var(--ok); font-weight: 600; }
.seen .ur { color: var(--faint); }

/* Shopline 订单 ID：小字，点一下复制 */
.sl-id { margin: -2px 0 8px; line-height: 1; }
.copy-id { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--faint); font-family: ui-monospace, Menlo, monospace; cursor: copy; border-radius: 6px; padding: 2px 6px 2px 0; }
.copy-id i { font-style: normal; font-size: 11px; opacity: .6; }
.copy-id:hover { color: var(--primary); }
.copy-id:hover i { opacity: 1; }
.ob-head .copy-id { margin-left: 6px; padding-left: 6px; }

/* 在线演示版 */
.demo-tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: #92400e; background: #fef3c7; border: 1px solid #fde68a; border-radius: 6px; padding: 0 6px; vertical-align: 2px; }
.is-demo .mainnav a[href="/ship.html"], .is-demo .mainnav a[href="/track.html"] { display: none; }

/* 卡片每一块固定位置，同一排卡片上下对齐，中间不再空一大块 */
.sl-id { min-height: 18px; }
.shop-strip { min-height: 58px; box-sizing: border-box; }
.shop-strip.pending { color: var(--faint); }
.shop-strip.pending .ph { background: var(--line-2); border-color: var(--line-2); }
.shop-strip.pending small { font-size: 12.5px; }
.shop-strip.missing .ph { background: #fde68a; border-color: #fcd34d; }
.card-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.55; min-height: calc(1.55em * 2); }
.card-foot { padding-top: 10px; }
