/* 建房工作台 · 主样式 */
:root {
  --navy: #1F3864;
  --navy-2: #2E5395;
  --gold: #C9A34E;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --line: #E3E8F0;
  --text: #26303E;
  --muted: #7A8598;
  --green: #1E8E5A;
  --red: #C0392B;
  --amber: #B7791F;
  --shadow: 0 1px 3px rgba(31,56,100,.08), 0 4px 14px rgba(31,56,100,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  display: flex; flex-direction: column;
}

/* ===== 顶栏 ===== */
.topbar {
  background: linear-gradient(135deg, var(--navy) 0%, #16294d 100%);
  color: #fff; padding: 10px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--gold); color: var(--navy);
  font-size: 22px; font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.title-wrap h1 { font-size: 17px; letter-spacing: 1px; }
.subtitle { font-size: 12px; color: #B9C4D8; display: block; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.countdown { display: flex; align-items: baseline; gap: 6px; background: rgba(255,255,255,.10); padding: 6px 14px; border-radius: 8px; }
.cd-label { font-size: 12px; color: #C7D2E5; }
.cd-num { font-size: 24px; font-weight: 800; color: #FFD98A; font-variant-numeric: tabular-nums; }
.cd-unit { font-size: 12px; color: #C7D2E5; }
.phase-badge { font-size: 12.5px; background: var(--gold); color: #16294d; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.data-actions { display: flex; gap: 6px; }
.btn-ghost {
  background: rgba(255,255,255,.12); color: #E8EDF5; border: 1px solid rgba(255,255,255,.25);
  padding: 5px 12px; border-radius: 6px; font-size: 12.5px; cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-ghost.danger:hover { background: var(--red); border-color: var(--red); }

/* ===== 布局 ===== */
.layout { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 200px; background: #fff; border-right: 1px solid var(--line);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; color: #4A5568;
  text-decoration: none; font-size: 14px; cursor: pointer; position: relative;
}
.nav-item:hover { background: #EEF2F9; }
.nav-item.active { background: var(--navy); color: #fff; font-weight: 600; }
.nav-ico { font-size: 15px; width: 20px; text-align: center; }
.nav-dot {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  min-width: 18px; height: 18px; border-radius: 999px; background: var(--red);
  color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; padding: 0 5px;
}
.content { flex: 1; overflow-y: auto; padding: 22px 26px 60px; }

/* ===== 页脚/提示 ===== */
.pagefoot {
  background: #EDF1F7; border-top: 1px solid var(--line);
  padding: 7px 22px; font-size: 12px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: rgba(31,56,100,.94); color: #fff; padding: 10px 22px; border-radius: 8px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 通用组件 ===== */
.view-title { font-size: 20px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.view-desc { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card h3 { font-size: 15.5px; color: var(--navy); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 .tag { font-size: 11px; font-weight: 400; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-card {
  background: linear-gradient(160deg, #fff, #F7F9FD); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-card .s-label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.stat-card .s-num { font-size: 26px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-card .s-num small { font-size: 13px; font-weight: 400; color: var(--muted); }
.stat-card .s-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-card.warn .s-num { color: var(--amber); }
.stat-card.good .s-num { color: var(--green); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  background: #EDF2FA; color: var(--navy); text-align: left;
  padding: 9px 10px; border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap;
}
.tbl td { padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; }
.tbl tr:nth-child(even) td { background: #FAFBFD; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { background: #F0F4FB; font-weight: 700; }

.btn-primary {
  background: var(--navy); color: #fff; border: none;
  padding: 8px 18px; border-radius: 7px; font-size: 13.5px; cursor: pointer; font-weight: 600;
}
.btn-primary:hover { background: var(--navy-2); }
.btn-sm {
  background: #EDF2FA; color: var(--navy); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-sm:hover { background: #DDE7F5; }
.btn-sm.danger { color: var(--red); }
.btn-sm.danger:hover { background: #FBE9E7; }

input.inp, select.inp, textarea.inp {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text); width: 100%;
}
input.inp:focus, select.inp:focus, textarea.inp:focus { outline: 2px solid #B9CCE8; border-color: var(--navy-2); }

.badge { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.badge.b-done { background: #E3F4EC; color: var(--green); }
.badge.b-doing { background: #FBF0DC; color: var(--amber); }
.badge.b-todo { background: #EDF0F4; color: var(--muted); }
.badge.b-block { background: #FBE9E7; color: var(--red); }
.badge.b-key { background: #E8ECF7; color: var(--navy); }

/* ===== 时间线 ===== */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid #C4CEDC;
}
.tl-item.done::before { background: var(--green); border-color: #B7E2CC; }
.tl-item.doing::before { background: var(--gold); border-color: #F0DCAE; box-shadow: 0 0 0 4px rgba(201,163,78,.18); }
.tl-item.block::before { background: var(--red); border-color: #F2C4BE; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-title { font-size: 14px; font-weight: 700; }
.tl-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }

/* ===== 审批步骤条 ===== */
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.step {
  flex: 1; min-width: 96px; background: #F6F8FC; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 8px; text-align: center; position: relative;
}
.step .s-no { font-size: 11px; color: var(--muted); }
.step .s-name { font-size: 12.5px; font-weight: 700; margin-top: 3px; color: #4A5568; }
.step.done { background: #E9F6EF; border-color: #BFE4CF; }
.step.done .s-name { color: var(--green); }
.step.doing { background: #FCF5E6; border-color: #EBD9AC; box-shadow: 0 0 0 3px rgba(201,163,78,.15); }
.step.doing .s-name { color: var(--amber); }

/* ===== 任务清单 ===== */
.task-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px;
  border-bottom: 1px dashed var(--line);
}
.task-item:last-child { border-bottom: none; }
.task-item input[type=checkbox] { width: 17px; height: 17px; margin-top: 2px; cursor: pointer; accent-color: var(--navy); }
.task-item.done .t-title { text-decoration: line-through; color: var(--muted); }
.t-title { font-size: 13.5px; line-height: 1.5; flex: 1; }
.t-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.t-del { color: #C4CCD8; cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 6px; }
.t-del:hover { color: var(--red); }

/* ===== 进度条 ===== */
.pbar { height: 9px; background: #E8EDF4; border-radius: 999px; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-2), var(--green)); border-radius: 999px; transition: width .4s; }
.prow { display: flex; justify-content: space-between; font-size: 12.5px; margin: 8px 0 4px; color: var(--muted); }

/* ===== 方案卡 ===== */
.plan-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.plan-card .pc-head { padding: 12px 16px; font-weight: 700; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-card.primary .pc-head { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.plan-card.backup .pc-head { background: linear-gradient(135deg, #5A6B85, #7A8AA5); }
.pc-body { padding: 14px 16px; font-size: 13.5px; line-height: 1.8; background: #fff; }
.pc-body b { color: var(--navy); }

/* ===== 提示块 ===== */
.note { border-left: 4px solid var(--gold); background: #FCF8EF; padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.8; color: #5B4A1E; margin-top: 10px; }
.note.red { border-color: var(--red); background: #FDF0EE; color: #7A2E24; }
.note.green { border-color: var(--green); background: #EFF8F2; color: #1D5C3E; }

/* ===== 户型图 ===== */
.floor-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.floor-tab { padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.floor-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.floor-svg-wrap { background: #F7F9FD; border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.floor-svg-wrap svg { max-width: 100%; height: auto; }
.svg-room { fill: #EAF0F9; stroke: var(--navy-2); stroke-width: 1.4; }
.svg-room.wet { fill: #DDEDE4; }
.svg-room.stair { fill: #F3ECDD; }
.svg-label { font-size: 13px; fill: var(--navy); font-weight: 700; font-family: "Microsoft YaHei", sans-serif; }
.svg-sub { font-size: 10.5px; fill: #7A8598; font-family: "Microsoft YaHei", sans-serif; }

/* ===== 模态框 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(15,25,45,.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: #fff; border-radius: 12px; width: min(420px, 92vw); padding: 20px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.modal-title { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.modal-body { font-size: 13.5px; line-height: 1.8; color: #4A5568; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ===== 联系人卡 ===== */
.contact-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.contact-card:last-child { border-bottom: none; }
.c-ava { width: 38px; height: 38px; border-radius: 50%; background: #E8ECF7; color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.c-name { font-weight: 700; font-size: 14px; }
.c-role { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.c-tel { font-size: 13px; color: var(--navy-2); font-variant-numeric: tabular-nums; }

/* ===== 空状态 ===== */
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0; }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav-item { white-space: nowrap; padding: 8px 12px; }
  .nav-ico { display: none; }
  .content { padding: 14px 12px 40px; }
  .title-wrap h1 { font-size: 15px; }
}
