* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== 浅色 · Stripe 精修（老板默认） ===== */
:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --card2: #f4f6f9;
  --lift: #ffffff;
  --text: #16192b;
  --text2: #626a7a;
  --muted: #99a1b0;
  --line: #e6e9ef;
  --line-strong: #d4d9e2;
  --accent: #5e6ad2;
  --accent-hover: #4f5ac0;
  --accent-bg: #eeeffb;
  --green: #17794a;
  --green-bg: #e2f5ec;
  --amber: #97590a;
  --amber-bg: #fcefd6;
  --red: #b3093c;
  --red-bg: #ffe9f1;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(22,25,43,.05);
  --shadow-lift: 0 2px 8px rgba(22,25,43,.07);
}

/* ===== 黑金奢华 · 动态（老板切换 · 默认） ===== */
body.boss-dark {
  --bg: #0a090c;
  --card: #151318;
  --card2: #1d1a20;
  --lift: #232028;
  --text: #f6f3ea;
  --text2: #a49c8a;
  --muted: #6d6555;
  --line: #2a2620;
  --line-strong: #3d3628;
  --accent: #d9b45a;
  --accent-hover: #ecca78;
  --accent-bg: #241d13;
  --green: #56c483;
  --green-bg: #16281d;
  --amber: #e6b043;
  --amber-bg: #2a2113;
  --red: #f2748f;
  --red-bg: #2c1620;
  --gold-grad: linear-gradient(115deg, #a9822f 0%, #e6c877 22%, #f6ecc0 40%, #d9b45a 60%, #b8912f 82%, #f0dc9a 100%);
  --glow-gold: 0 0 0 1px rgba(217,180,90,.22), 0 6px 28px rgba(217,180,90,.14);
  --shadow: none;
  --shadow-lift: 0 6px 28px rgba(0,0,0,.5);
}

/* ===== 工人 · 工业黑金 ===== */
body.worker {
  --bg: #141519;
  --card: #1e2026;
  --card2: #262932;
  --lift: #262932;
  --text: #f2f2f2;
  --text2: #a5a49e;
  --muted: #6e6d68;
  --line: #33353d;
  --line-strong: #44464f;
  --accent: #EF9F27;
  --accent-hover: #ffb54a;
  --accent-bg: #3a3122;
  --green: #37c896;
  --green-bg: #1e3a30;
  --amber: #EF9F27;
  --amber-bg: #3a3122;
  --red: #ff6b6b;
  --red-bg: #402226;
  --radius: 12px;
  --radius-lg: 14px;
  --shadow: none;
  --shadow-lift: none;
}

body {
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  letter-spacing: -0.05px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
#topbar {
  display: flex; justify-content: space-between; align-items: center;
  height: 56px; padding: 0 20px; background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 4px 9px; border-radius: 6px; letter-spacing: .3px; font-size: 13px;
}
body.worker .logo { color: #141519; }
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.2px; }
.brand-name small { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
select {
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.icon-btn {
  position: relative; background: none; border: none; color: var(--text2); cursor: pointer;
  display: flex; padding: 6px; border-radius: 6px; transition: background .12s, color .12s;
}
.icon-btn:hover { color: var(--text); background: var(--card2); }
.bell-count {
  position: absolute; top: -2px; right: -3px; background: var(--red); color: #fff;
  font-size: 10px; border-radius: 999px; padding: 1px 5px; font-weight: 600; line-height: 1.3;
}
body.boss-dark .bell-count, body.worker .bell-count { color: #fff; }
.notif-panel {
  position: fixed; top: 60px; right: 16px; width: 340px; max-height: 60vh; overflow-y: auto;
  background: var(--lift); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.16); z-index: 100; padding: 6px;
}
.notif-item { padding: 9px 11px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notif-item:last-child { border-bottom: none; }
.notif-item .time { color: var(--muted); font-size: 11px; }

/* ---------- 布局 ---------- */
#shell { display: flex; min-height: calc(100vh - 56px); }
#sidebar {
  width: 220px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line); padding: 12px 10px;
}
body.worker #sidebar { display: none; }
body:not(.worker) #tabs { display: none; }
#content { flex: 1; min-width: 0; }

.snav {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 11px; border: none; background: none; border-radius: 7px;
  color: var(--text2); font-size: 13.5px; font-weight: 500; cursor: pointer;
  font-family: inherit; text-align: left; margin-bottom: 1px; letter-spacing: -0.1px;
  transition: background .12s, color .12s;
}
.snav svg { flex-shrink: 0; opacity: .85; }
.snav:hover { background: var(--card2); color: var(--text); }
.snav.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.snav.active svg { opacity: 1; }
.snav-section { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 14px 11px 6px; }

nav#tabs { display: flex; gap: 6px; padding: 14px 20px 0; flex-wrap: wrap; }
.tab {
  padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text2); cursor: pointer; font-size: 16px; font-family: inherit;
}
.tab.active { background: var(--accent); color: #141519; border-color: var(--accent); font-weight: 600; }

main#view { padding: 22px; max-width: 1180px; }
body.worker main#view { max-width: 760px; margin: 0 auto; padding: 18px 22px 60px; }

/* ---------- 通用 ---------- */
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.g23 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@media (max-width: 940px){ .g23 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow);
}
.card h3 { font-size: 13.5px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.2px; }
.card h3 .spacer { flex: 1; }
.card h3 .sub { font-weight: 400; }

/* KPI 条 — Linear 精工：大号负字距数字 + 迷你走势 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 13px 15px; box-shadow: var(--shadow); transition: border-color .14s, box-shadow .14s; }
.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.kpi .label { font-size: 11px; color: var(--text2); display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.9px; line-height: 1.05; }
.kpi .value small { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.kpi .delta { font-size: 11px; font-weight: 600; letter-spacing: 0; }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi .spark { display: flex; align-items: flex-end; gap: 2px; height: 22px; margin-top: 9px; }
.kpi .spark i { flex: 1; background: var(--accent); border-radius: 1px; opacity: .28; min-height: 2px; }
.kpi .spark i.on { opacity: 1; }
.kpi.alert { border-color: var(--red); }
.kpi.alert .value { color: var(--red); }
.kpi.alert .spark i { background: var(--red); }

.stat { background: var(--card2); border-radius: 8px; padding: 13px 14px; }
.stat .label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.6px; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: 0; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 5px; white-space: nowrap; letter-spacing: 0;
}
.b-red { background: var(--red-bg); color: var(--red); }
.b-green { background: var(--green-bg); color: var(--green); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-blue { background: var(--accent-bg); color: var(--accent); }
.b-gray { background: var(--card2); color: var(--text2); border: 1px solid var(--line); }

/* 密集表格 */
table.dense { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.dense th { text-align: left; color: var(--text2); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.dense td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.dense tr:last-child td { border-bottom: none; }
table.dense tbody tr { transition: background .1s; }
table.dense tbody tr:hover { background: var(--card2); }
table.dense .num { text-align: right; }
table.dense .main { font-weight: 500; letter-spacing: -0.1px; }
table.dense .sub { font-size: 12px; color: var(--text2); font-weight: 400; letter-spacing: 0; }

/* 周历 · 高级日卡 */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { position: relative; text-align: center; padding: 12px 4px 10px; border-radius: 12px; cursor: pointer; border: 1px solid var(--line); background: var(--card2); transition: transform .2s cubic-bezier(.2,.7,.3,1), border-color .18s, box-shadow .22s, background .18s; overflow: hidden; }
.day:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.day .dow { display: block; font-size: 11px; color: var(--text2); font-weight: 500; letter-spacing: .04em; }
.day .dnum { display: block; font-size: 20px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; color: var(--text); line-height: 1.1; }
.day .devt { display: flex; gap: 3px; justify-content: center; margin-top: 7px; height: 6px; }
.day .devt i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .5; }
.day .devt i.warn { background: var(--red); opacity: 1; }
.day .devt i.idle { background: var(--muted); opacity: .35; }
.day.today { border-color: var(--accent); }
.day.sel { border-color: transparent; background: var(--accent); }
.day.sel .dow, .day.sel .dnum { color: #fff; }
.day.sel .devt i { background: rgba(255,255,255,.75); opacity: .85; }
body.worker .day.sel .dow, body.worker .day.sel .dnum { color: #141519; }

.row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .sub { font-size: 12px; color: var(--text2); }

.avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; background: var(--accent-bg); color: var(--accent); }

.bar { background: var(--line); border-radius: 999px; height: 6px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; background: var(--accent); transition: width .35s ease; }
.bar.ok > div { background: #22a06b; }
.bar.warn > div { background: #e0a027; }
.bar.danger > div { background: var(--red); }

button.btn { padding: 8px 14px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); cursor: pointer; font-size: 13px; font-family: inherit; font-weight: 500; transition: background .12s, border-color .12s; }
button.btn:hover { background: var(--card2); border-color: var(--muted); }
button.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
button.btn.primary:hover { background: var(--accent-hover); }
body.worker button.btn.primary { color: #141519; }
button.btn:active { transform: scale(.98); }
button.btn:disabled { opacity: .45; cursor: default; }

/* 工人端组件 */
body.worker button.btn { padding: 12px 18px; font-size: 15px; border-radius: 10px; }
body.worker .card { padding: 18px; }
.task-card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.task-card.done { border-left-color: var(--green); opacity: .78; }
.task-card.urgent { border-left-color: var(--red); }
.task-card h4 { font-size: 17px; margin-bottom: 4px; letter-spacing: -0.2px; }
.task-card .meta { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.task-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.task-actions .btn { flex: 1; min-width: 120px; }
.checklist { margin: 10px 0; }
.checklist label { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 14px; cursor: pointer; border-bottom: 1px dashed var(--line); }
.checklist input { width: 18px; height: 18px; accent-color: var(--green); }
.xp-wrap { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; }
.xp-wrap .bar { flex: 1; height: 10px; }
.medal { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; margin: 3px 5px 3px 0; }
.medal.locked { opacity: .38; filter: grayscale(1); }

.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 5px; }
.zone { text-align: center; padding: 6px 2px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: var(--card2); border: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.zone.p100 { background: var(--green-bg); color: var(--green); border-color: transparent; }
.zone.p50 { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.zone .pct { display: block; font-size: 9.5px; font-weight: 400; letter-spacing: 0; }

.calc-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.calc-io label { font-size: 12px; color: var(--text2); display: block; margin-bottom: 4px; }
.calc-io input, .calc-io select { width: 100%; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 14px; font-family: inherit; font-variant-numeric: tabular-nums; }
.calc-io input:focus, .calc-io select:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
.calc-result { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.calc-result .stat { flex: 1; min-width: 140px; }
.price { color: var(--amber); }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 8px; font-size: 13.5px; font-weight: 500; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.28); max-width: 90vw; }
body.worker .toast { background: var(--accent); color: #141519; }
.hidden { display: none; }

.section-title { font-size: 11px; color: var(--muted); margin: 18px 0 9px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.lock { font-size: 11px; color: var(--muted); }
.mt { margin-top: 12px; }

.feed-item { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; align-items: flex-start; }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--muted); }
.feed-dot.red { background: var(--red); }
.feed-dot.amber { background: #e0a027; }
.feed-dot.green { background: #22a06b; }

/* ===================== 黑金动态层（仅 boss-dark） ===================== */
@keyframes sheen { from { background-position: 200% center; } to { background-position: -200% center; } }
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(217,180,90,.28), 0 0 14px rgba(217,180,90,.07); }
  50% { box-shadow: 0 0 0 1px rgba(217,180,90,.55), 0 0 26px rgba(217,180,90,.22); }
}
@keyframes riseIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* 流光金 logo */
body.boss-dark .logo { background: var(--gold-grad); background-size: 220% auto; color: #1a1509; animation: sheen 5s linear infinite; }
/* KPI 大数字 = 流光金渐变字 */
body.boss-dark .kpi .value { background: var(--gold-grad); background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 6.5s linear infinite; }
body.boss-dark .kpi .value small { -webkit-text-fill-color: var(--muted); color: var(--muted); }
body.boss-dark .kpi.alert .value { background: none; -webkit-text-fill-color: var(--red); color: var(--red); animation: none; }
body.boss-dark .kpi.alert { border-color: transparent; animation: glowPulse 2.6s ease-in-out infinite; }
body.boss-dark .kpi .spark i.on { background: var(--accent-hover); }
/* 进度条 = 流光金（状态条保留红/黄/绿） */
body.boss-dark .bar:not(.ok):not(.warn):not(.danger) > div { background: var(--gold-grad); background-size: 220% auto; animation: sheen 6.5s linear infinite; }
/* 侧栏选中金 */
body.boss-dark .snav.active { background: var(--accent-bg); color: var(--accent-hover); }
body.boss-dark .snav.active svg { color: var(--accent-hover); }
/* 日历高级金：今天描金光晕，选中流光金卡 */
body.boss-dark .day.today { box-shadow: var(--glow-gold); }
body.boss-dark .day.sel { background: var(--gold-grad); background-size: 220% auto; animation: sheen 5s linear infinite; box-shadow: var(--glow-gold); }
body.boss-dark .day.sel .dow, body.boss-dark .day.sel .dnum { color: #1a1509; }
body.boss-dark .day.sel .devt i { background: #4a3c12; opacity: .8; }
/* 卡片悬停微光 */
body.boss-dark .card:hover { border-color: var(--line-strong); }
body.boss-dark .kpi:hover { box-shadow: var(--glow-gold); border-color: transparent; }
/* logo badge 在金底上用深色 */
body.boss-dark .avatar { background: var(--accent-bg); color: var(--accent-hover); }

/* KPI 入场级联（动态感） */
.kpi { animation: riseIn .38s ease both; }
.kpi:nth-child(1){animation-delay:.02s}.kpi:nth-child(2){animation-delay:.06s}.kpi:nth-child(3){animation-delay:.10s}
.kpi:nth-child(4){animation-delay:.14s}.kpi:nth-child(5){animation-delay:.18s}.kpi:nth-child(6){animation-delay:.22s}

/* ===================== 图表 ===================== */
.donut { display: block; margin: 0 auto; }
.donut-num { font-size: 27px; font-weight: 700; fill: var(--text); letter-spacing: -1px; }
.donut-lbl { font-size: 9px; fill: var(--text2); text-transform: uppercase; letter-spacing: .08em; }
.donut-track { stroke: var(--line); }
.donut-arc { animation: donutDraw 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes donutDraw { from { stroke-dashoffset: 327; } }
.donut-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.dl-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dl-row .grow { flex: 1; color: var(--text2); }
.dl-row b { font-variant-numeric: tabular-nums; }

/* 项目时间线泳道 */
.tl-lane { display: flex; align-items: center; gap: 12px; padding: 9px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.tl-lane:last-child { border-bottom: none; }
.tl-lane:hover .tl-name { color: var(--accent); }
.tl-name { width: 128px; flex-shrink: 0; font-size: 13px; font-weight: 500; letter-spacing: -0.1px; }
.tl-name small { display: block; color: var(--text2); font-weight: 400; font-size: 11px; }
.tl-track { flex: 1; height: 24px; background: var(--card2); border-radius: 7px; position: relative; overflow: hidden; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--accent); min-width: 3px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.tl-cap { width: 78px; flex-shrink: 0; text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.tl-cap .p { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
body.boss-dark .tl-fill { background: var(--gold-grad); background-size: 220% auto; animation: sheen 6.5s linear infinite; }
body.boss-dark .tl-fill.ok { background: linear-gradient(90deg,#2f7d4f,#56c483); animation: none; }
body.boss-dark .tl-fill.danger { background: linear-gradient(90deg,#a33a52,#f2748f); animation: none; }
.tl-fill.ok { background: #22a06b; }
.tl-fill.danger { background: var(--red); }

/* 完成矩阵 · site map + 单元详情 */
.zone.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.flow-note { display: flex; align-items: center; gap: 8px; background: var(--card2); border-radius: 8px; padding: 9px 12px; font-size: 12px; color: var(--text2); margin-bottom: 12px; }
.flow-note b { color: var(--text); font-weight: 500; }
.unit-detail { margin-top: 6px; }
.ud-head { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 4px; }
.ud-head b { font-size: 15px; letter-spacing: -0.2px; }
.udrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.udrow:last-child { border-bottom: none; }
.udrow .grow { flex: 1; min-width: 0; }
.udphoto { width: 40px; height: 40px; border-radius: 8px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; border: 1px solid var(--line); }
.udrow.done .udphoto { background: var(--accent-bg); border-color: transparent; }
.udrow .btn { flex-shrink: 0; }
.udrow.done .name { font-weight: 500; }
.udrow .name { color: var(--text2); }
body.boss-dark .udrow.done .udphoto { box-shadow: 0 0 10px rgba(217,180,90,.18); }

/* 文档栏：site plan 缩略图 + BQ */
.docs-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.doc-tile { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 8px 8px; cursor: pointer; text-decoration: none; color: var(--text); transition: border-color .12s; }
.doc-tile:hover { border-color: var(--accent); }
.doc-thumb { width: 72px; height: 52px; border-radius: 6px; object-fit: cover; background: #fff; border: 1px solid var(--line); }
.doc-tile .dt-name { font-size: 12.5px; font-weight: 500; }
.doc-tile .dt-sub { font-size: 11px; color: var(--text2); }
.doc-tile.empty { border-style: dashed; color: var(--text2); }

/* item 用料 spec */
.udrow details { margin-top: 4px; }
.udrow summary { cursor: pointer; font-size: 11.5px; color: var(--accent); list-style: none; }
.udrow summary::before { content: "▸ "; }
.udrow details[open] summary::before { content: "▾ "; }
.spec-box { background: var(--card2); border-radius: 8px; padding: 8px 11px; margin-top: 6px; font-size: 12px; }
.spec-box .sp-line { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.spec-box .sp-line:last-child { border-bottom: none; }
.spec-box .sp-line b { font-variant-numeric: tabular-nums; font-weight: 500; }
.spec-tag { font-size: 10px; color: var(--amber); }

/* ---------- 数据来源标记：已核实(真上报) vs 估算(前端底图) ---------- */
.dbchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--text2); white-space: nowrap;
}
.dbchip > i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dbchip.on  { color: var(--green); border-color: var(--green); }
.dbchip.off { color: var(--red);   border-color: var(--red); }

.tag-ver, .tag-est {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  border: 1px solid transparent; white-space: nowrap;
}
.tag-ver { color: var(--green); background: var(--green-bg); border-color: var(--green); }
.tag-est { color: var(--muted); background: var(--card2);    border-color: var(--line); }

/* ---------- 工序规格卡 · BQ ---------- */
.spec-row { cursor: pointer; }
.spec-row:hover { background: var(--card2); }
.spec-row.sel { background: var(--accent-bg); }
.spec-row.sel td.main { font-weight: 600; color: var(--accent); }
table.dense tr.thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line);
}
table.dense tr.thead th.num { text-align: right; }

.spec-detail { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.bq-quote {
  background: var(--card2); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 9px 12px; margin-top: 6px;
  font-size: 12px; line-height: 1.65; color: var(--text2);
}
.empty-note { font-size: 11.5px; color: var(--muted); padding: 8px 2px; }

/* 图纸断面 = 权威（绿）；图纸 vs BQ 冲突 = 警告（琥珀） */
.dwg-quote {
  background: var(--green-bg); border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0; padding: 9px 12px; margin-top: 6px;
  font-size: 12px; line-height: 1.7; color: var(--text);
}
.conflict-note {
  background: var(--amber-bg); border: 1px solid var(--amber);
  border-radius: 8px; padding: 9px 12px; margin-top: 10px;
  font-size: 11.5px; line-height: 1.65; color: var(--text2);
}
.conflict-note b { color: var(--amber); display: block; margin-bottom: 3px; }

.photo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 6px; }
.photo-wall .ph { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; }
.photo-wall .ph img { width: 100%; height: 78px; object-fit: cover; display: block; }
.photo-wall .ph-cap { display: block; font-size: 10px; color: var(--muted); padding: 4px 6px; }

/* ---------- 户型 Type A / B（直接写在 block 名旁：B7(B)）---------- */
.ht { font-weight: 700; font-style: normal; }
.ht-A { color: #4a90d9; }   /* 蓝 = Type A */
.ht-B { color: var(--amber); }  /* 金 = Type B（有 Louvres）*/
.type-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 0 8px; font-size: 11.5px; color: var(--text2); }
.type-legend .tl-item { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 进度收款卡 ---------- */
.claim-hero { display:flex; gap:14px; align-items:stretch; flex-wrap:wrap; margin:4px 0 10px; }
.claim-big { flex:1 1 220px; }
.claim-big .label { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.claim-big .val { font-size:30px; font-weight:800; letter-spacing:-.5px; font-variant-numeric:tabular-nums; line-height:1.15; }
.claim-big .val.green { color:var(--green); }
.claim-side { display:flex; flex-direction:column; gap:8px; justify-content:center; min-width:150px; }
.claim-side .ci { display:flex; justify-content:space-between; gap:12px; font-size:12.5px; border-bottom:1px dashed var(--line); padding-bottom:5px; }
.claim-side .ci .label { color:var(--text2); }
.claim-side .ci b { font-variant-numeric:tabular-nums; }
.claim-bar { height:9px; border-radius:99px; background:var(--card2); overflow:hidden; margin-bottom:6px; }
.claim-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,#b8862f,#f6ecc0,#d9b45a); }
body:not(.boss-dark) .claim-fill { background:var(--green); }

/* 「Section图」小链接：PROGRESS BY ITEM 每行工序名旁边 */
.seclink {
  font-size: 10.5px; color: var(--accent); cursor: pointer; white-space: nowrap;
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; margin-left: 6px;
}
.seclink:hover { border-color: var(--accent); background: var(--accent-bg); }

/* zone 格子左上角小绿点 = 这格有真上报记录，不是估算 */
.zone { position: relative; }
.zone > .ver-dot {
  position: absolute; top: 5px; left: 5px; display: block;
  width: 5px; height: 5px; border-radius: 50%; background: var(--green);
}
.udrow.verified .udphoto { color: var(--green); }

/* ---------- 登录闸 ---------- */
.login-wrap { display:flex; align-items:center; justify-content:center; min-height:80vh; width:100%; }
.login-card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:32px 28px; width:min(360px,92vw); box-shadow:var(--shadow-lift); text-align:center; }
.login-logo { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px;
  border-radius:10px; background:var(--accent); color:#fff; font-weight:800; letter-spacing:-.5px; margin-bottom:10px; }
.login-card h2 { margin:0 0 2px; font-size:19px; }
.login-card input { width:100%; margin-top:10px; padding:10px 12px; font-size:14px;
  border:1px solid var(--line-strong); border-radius:8px; background:var(--card2); color:var(--text); }
.login-card .lg-btn { width:100%; margin-top:12px; padding:10px; font-size:14px; }
.login-err { background:var(--red-bg); color:var(--red); border:1px solid var(--red);
  border-radius:6px; padding:7px 10px; font-size:12px; margin-top:10px; }

/* ---------- 现场事件时间线 ---------- */
.ev-day { margin-bottom: 8px; }
.ev-date { font-size: 11px; font-weight: 600; color: var(--text2); padding: 3px 0; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ev-item { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 12.5px; }
.ev-ic { font-size: 15px; line-height: 1.2; flex: none; }

/* ---------- Defect 手尾 ---------- */
.df-form { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.df-form select, .df-form input {
  font-size: 12.5px; padding: 6px 9px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--card2); color: var(--text);
}
.df-form input { min-width: 150px; }
.tag-src-mc   { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.tag-src-self { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.zone > .def-flag { position: absolute; top: 3px; left: 4px; font-size: 10px; font-style: normal; }

/* 两步工序：Bracket + 装门 两个小按钮 */
.stepcol { display: flex; flex-direction: column; gap: 5px; flex: none; }
.stepcol .stepbtn { font-size: 11px; padding: 5px 9px; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .kpi, body.boss-dark .logo, body.boss-dark .kpi .value, body.boss-dark .bar > div,
  body.boss-dark .day.sel, body.boss-dark .kpi.alert, .donut-arc, .tl-fill, body.boss-dark .tl-fill { animation: none !important; }
}
