/* ============================================================
   唐大装饰 · 装修报价流程管理系统
   设计语言：暖纸张底色 + 深胡桃侧栏 + 陶土红主色
   ============================================================ */

:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --ink: #1B1A17;
  --ink-2: #4A463F;
  --muted: #837C71;
  --line: #E7E2D8;
  --line-strong: #D8D2C5;
  --brand: #A2542A;
  --brand-dark: #83421F;
  --brand-soft: #FBF0E7;
  --green: #2E7A5C;
  --green-soft: #E9F4EE;
  --red: #B93B2E;
  --red-soft: #FBEAE7;
  --amber: #A96B10;
  --amber-soft: #FCF2DE;
  --sidebar: #191817;
  --sidebar-2: #232120;
  --radius: 13px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 8px 24px -16px rgba(27, 26, 23, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: #F3D9C6; }

.num, .money, td.num, .kpi-value, .mono { font-variant-numeric: tabular-nums; }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; overflow: hidden; }

.sidebar {
  background: var(--sidebar);
  color: #D9D5CD;
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(145deg, #B86133, #8C4420);
  color: #fff; display: grid; place-items: center;
  font-size: 17px; font-weight: 700; letter-spacing: -1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-text b { display: block; font-size: 14px; color: #F5F2EC; font-weight: 600; letter-spacing: .3px; }
.brand-text span { display: block; font-size: 11px; color: #7C766B; letter-spacing: .5px; }

.nav { flex: 1; overflow-y: auto; margin-top: 4px; }
.nav-label {
  font-size: 10.5px; letter-spacing: 1.2px; color: #6A6459;
  padding: 14px 10px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 1px 0;
  border-radius: var(--radius-sm);
  color: #B3ADA2; font-size: 13.5px; cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: #EDE9E1; }
.nav-item.active { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: #C4713F;
}
.nav-item .ico { width: 17px; height: 17px; opacity: .85; flex: none; }
.nav-item .count {
  margin-left: auto; font-size: 11px; color: #8A8377;
  background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 20px;
}

.sidebar-foot { border-top: 1px solid rgba(255,255,255,.07); padding-top: 12px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-sm); }
.user-chip:hover { background: rgba(255,255,255,.05); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: #3A3632; color: #E4DFD5; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600;
}
.user-chip .u-name { font-size: 13px; color: #E9E5DD; line-height: 1.2; }
.user-chip .u-role { font-size: 10.5px; color: #7F796E; }
.logout { margin-left: auto; font-size: 11px; color: #8A8377; cursor: pointer; padding: 4px; }
.logout:hover { color: #D9A38A; }

.main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar {
  height: 62px; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; font-size: 15px; }
.crumb .sep { opacity: .45; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.page { flex: 1; overflow-y: auto; padding: 24px 26px 60px; }
.page-narrow { max-width: 1180px; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 35px; padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2);
  font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: all .14s;
}
.btn:hover { border-color: #C0B9AA; background: #FCFBF8; }
.btn:active { transform: translateY(.5px); }
.btn-primary {
  background: linear-gradient(180deg, #AE5A2E, #9C4D26);
  border-color: #8E4521; color: #fff;
  box-shadow: 0 1px 2px rgba(140,68,32,.25), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #B76133, #A05026); border-color: #83421F; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(0,0,0,.045); color: var(--ink); }
.btn-danger { color: var(--red); border-color: #EBC9C3; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: .2px; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.section-title {
  font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 26px 0 10px;
}
.section-title:first-child { margin-top: 0; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -.6px; margin-top: 6px; line-height: 1.15; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi-foot { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.kpi.accent { background: linear-gradient(160deg, #FFFDFA, #FBF1E7); border-color: #EFDDCC; }

/* 表格 */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: var(--radius) var(--radius); }
.table td { padding: 11px 14px; border-bottom: 1px solid #F0ECE4; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FCFBF8; }
.table .num { text-align: right; }
.table .center { text-align: center; }
.table-wrap { overflow-x: auto; }

/* 状态徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.gray { background: #F0EEE8; color: #6F6A60; }
.badge.blue { background: #E8F0F8; color: #2A6091; }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field label .req { color: var(--red); margin-left: 2px; }
.input, select.input, textarea.input {
  height: 35px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
textarea.input { height: auto; padding: 8px 11px; line-height: 1.5; resize: vertical; }
.input:focus { border-color: #C79A7B; box-shadow: 0 0 0 3px rgba(162,84,42,.11); }
.input::placeholder { color: #B6AFA2; }
.form-grid { display: grid; gap: 14px; }
.form-grid.c2 { grid-template-columns: 1fr 1fr; }
.form-grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.hint { font-size: 11.5px; color: var(--muted); }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(28, 26, 23, .42);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .16s ease;
}
.modal {
  background: var(--surface); border-radius: 16px;
  width: 520px; max-width: 100%; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 70px -20px rgba(20,18,15,.45);
  animation: popIn .18s cubic-bezier(.2,.9,.3,1);
}
.modal.wide { width: 880px; }
.modal.xwide { width: 1120px; }

/* 户型这种只填一两位数字的小输入框 */
.input.ln { width: 56px; text-align: center; padding: 0 6px; font-variant-numeric: tabular-nums; }
.modal-head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-close { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.modal-close:hover { background: #F2EFE9; color: var(--ink); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; gap: 9px; justify-content: flex-end; background: var(--surface-2);
  border-radius: 0 0 16px 16px;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985) } to { opacity: 1; transform: none } }

/* Toast */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
/* 全屏预览下的提示容器：挂进全屏元素内，保持与页面平时一致的居中位置 */
.toast-fs { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #232120; color: #F3EFE7; padding: 9px 16px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
  animation: slideDown .2s ease;
}
.toast.error { background: #8E2F22; }
.toast.ok { background: #23624A; }
.toast { display: flex; align-items: center; gap: 12px; }
.toast-act {
  border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 12.5px;
  padding: 4px 10px; border-radius: 7px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.toast-act:hover { background: rgba(255,255,255,.3); }

/* 列表行内删除 */
.row-del {
  width: 24px; height: 24px; border-radius: 6px; border: 0; background: transparent;
  color: #C9BEB2; font-size: 12px; cursor: pointer; line-height: 1; font-family: inherit;
}
.row-del:hover { background: var(--red-soft); color: var(--red); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: none } }

/* 空状态 */
.empty {
  text-align: center; padding: 56px 20px; color: var(--muted);
}
.empty .big { font-size: 30px; opacity: .25; margin-bottom: 10px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
  padding: 9px 15px; font-size: 13.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 550; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.login-left {
  background: linear-gradient(160deg, #23201D 0%, #2E2823 55%, #3A2C22 100%);
  color: #EDE7DC; padding: 54px 56px;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.login-left::after {
  content: ""; position: absolute; right: -120px; bottom: -140px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(196,113,63,.30), transparent 65%);
}
.login-left h1 { font-size: 34px; line-height: 1.3; letter-spacing: -.5px; margin: 0 0 16px; font-weight: 600; }
.login-left p.lead { color: #A79E90; font-size: 14px; max-width: 380px; margin: 0 0 40px; }
.login-points { display: flex; flex-direction: column; gap: 14px; margin-top: auto; position: relative; z-index: 1; }
.login-point { display: flex; gap: 12px; align-items: flex-start; }
.login-point .dot {
  width: 22px; height: 22px; border-radius: 6px; flex: none; margin-top: 1px;
  background: rgba(196,113,63,.18); color: #D08B5C; display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.login-point b { display: block; font-size: 13px; color: #E6DFD3; font-weight: 550; }
.login-point span { font-size: 12px; color: #918A7D; }

.login-right { display: grid; place-items: center; padding: 40px; }
.login-card { width: 356px; }
.login-card h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.3px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; height: 40px; margin-top: 6px; }
.demo-accounts { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 16px; }
.demo-accounts .t { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.demo-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 9px; border-radius: 7px; font-size: 12px; cursor: pointer;
  color: var(--ink-2);
}
.demo-row:hover { background: #F1EDE5; }
.demo-row .r { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }

/* ---------- 客户 / 项目 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { width: 280px; position: relative; }
.toolbar .search .input { padding-left: 33px; }
.toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.spacer { flex: 1; }

.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt8 { margin-top: 8px } .mt12 { margin-top: 12px } .mt16 { margin-top: 16px } .mt24 { margin-top: 24px }
.flex { display: flex; align-items: center; gap: 8px; }

/* 区域卡片 */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.room-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; cursor: pointer; transition: border-color .15s, transform .12s, box-shadow .15s;
  position: relative;
}
.room-card:hover { border-color: #CDBBA9; box-shadow: 0 6px 20px -12px rgba(90,60,35,.35); transform: translateY(-1px); }
.room-card .rc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.room-card .rc-name { font-size: 14.5px; font-weight: 600; }
.room-card .rc-type { font-size: 11px; color: var(--muted); background: #F3F0E9; padding: 1px 7px; border-radius: 20px; }
.room-card .rc-dim { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.room-card .rc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.room-card .m { background: var(--surface-2); border-radius: 8px; padding: 7px 8px; }
.room-card .m .k { font-size: 10.5px; color: var(--muted); }
.room-card .m .v { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 1px; }
.room-card .m .v small { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 1px; }
.room-card .rc-foot { margin-top: 10px; display: flex; gap: 6px; font-size: 11.5px; color: var(--muted); }
.room-card .del {
  position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity .15s;
  color: var(--muted); font-size: 13px; padding: 2px 5px; border-radius: 6px;
}
.room-card:hover .del { opacity: 1; }
.room-card .del:hover { background: var(--red-soft); color: var(--red); }
/* 还没量尺寸：虚线边 + 淡底，一眼看出哪些没量 */
.room-card.pending { border-style: dashed; border-color: #D9C9B4; background: #FCFAF6; }
.room-card.pending .rc-metrics .v { color: var(--muted); }

/* 量房表单：洞口行 */
.op-row { display: grid; grid-template-columns: 84px 96px 1fr 1fr 1fr 1fr 56px 26px; gap: 6px; align-items: center; margin-bottom: 6px; }
.op-row .input { height: 31px; font-size: 12.5px; padding: 0 7px; }
.op-head { font-size: 11px; color: var(--muted); }
.op-del { color: var(--muted); cursor: pointer; text-align: center; border-radius: 6px; padding: 3px; }
.op-del:hover { background: var(--red-soft); color: var(--red); }

/* 实时算量预览条 */
.live-metrics {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  background: #FBF7F1; border: 1px solid #EFE4D6; border-radius: 11px; padding: 12px;
}
.live-metrics .lm .k { font-size: 10.5px; color: #8B7459; }
.live-metrics .lm .v { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; color: #6B4426; }
.live-metrics .lm .v small { font-size: 10px; font-weight: 400; }

/* 报价表 */
.quote-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.quote-table th {
  position: sticky; top: 0; z-index: 2;
  background: #F3EFE7; color: #6B655A; font-weight: 500; font-size: 11.5px;
  padding: 9px 8px; border-bottom: 1px solid var(--line-strong); text-align: left; white-space: nowrap;
}
.quote-table td { padding: 7px 8px; border-bottom: 1px solid #F1EDE5; vertical-align: top; }
.quote-table tr.room-head td {
  background: #FBF7F1; font-weight: 600; color: #6B4426; font-size: 12.5px;
  padding: 9px 8px; border-top: 1px solid #EDE2D3;
}
.quote-table tr.room-head td .amt { float: right; color: #8A5A33; font-weight: 600; }
.quote-table tr.line:hover { background: #FDFCF9; }
.quote-table .qty-input, .quote-table .price-input {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 3px 5px; border-radius: 5px; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 12.5px;
}
.quote-table .qty-input:hover, .quote-table .price-input:hover { border-color: var(--line-strong); background: #fff; }
.quote-table .qty-input:focus, .quote-table .price-input:focus {
  outline: none; border-color: #C79A7B; background: #fff; box-shadow: 0 0 0 2px rgba(162,84,42,.1);
}
.quote-table .name { font-weight: 500; color: var(--ink); }
.quote-table .meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.quote-table .amt { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.quote-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-summary { display: flex; justify-content: flex-end; padding: 16px 18px; }
.qs-table { width: 340px; font-size: 13px; }
.qs-table td { padding: 5px 0; }
.qs-table td.k { color: var(--muted); }
.qs-table td.v { text-align: right; font-variant-numeric: tabular-nums; }
.qs-table tr.total td { border-top: 1px solid var(--line-strong); padding-top: 10px; font-size: 17px; font-weight: 650; color: var(--brand-dark); }
.qs-table tr.total td.v { font-size: 22px; }
.qs-cn { text-align: right; font-size: 12px; color: var(--muted); padding-right: 18px; }

/* 打印 */
#print-root { display: none; }
@media print {
  body { background: #fff; }
  .app, #toast-root, #modal-root { display: none !important; }
  #print-root { display: block !important; padding: 0; }
  @page { size: A4 portrait; margin: 14mm 12mm; }
}
.print-doc { font-size: 11px; color: #000; font-family: var(--font); }
.print-doc h1 { font-size: 20px; text-align: center; margin: 0 0 4px; letter-spacing: 2px; }
.print-doc .p-sub { text-align: center; font-size: 10px; color: #555; margin-bottom: 12px; }
.print-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; font-size: 10.5px; margin-bottom: 10px; border-top: 1px solid #333; border-bottom: 1px solid #333; padding: 6px 0; }
.print-table { width: 100%; border-collapse: collapse; font-size: 9.5px; }
.print-table th, .print-table td { border: 1px solid #999; padding: 3px 4px; }
.print-table th { background: #EEE; font-weight: 600; }
.print-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.print-table tr.grp td { background: #F7F7F7; font-weight: 600; }
.print-sum { margin-top: 8px; font-size: 10.5px; }
.print-sum table { width: 100%; }
.print-sum td { padding: 2px 0; }
.print-sum td.n { text-align: right; font-variant-numeric: tabular-nums; }
.print-sum tr.big td { font-weight: 700; font-size: 12px; border-top: 1px solid #333; padding-top: 5px; }
.print-foot { margin-top: 10px; font-size: 9px; color: #555; line-height: 1.6; border-top: 1px dashed #999; padding-top: 6px; }

/* 响应式：小屏 */
@media (max-width: 1100px) {
  .app { grid-template-columns: 64px 1fr; }
  .brand-text, .nav-item span:not(.count), .nav-label, .user-chip .u-name, .user-chip .u-role { display: none; }
  .nav-item { justify-content: center; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .form-grid.c4 { grid-template-columns: 1fr 1fr; }
}

/* ============ P2：甘特图 / 照片 / 增项行编辑 ============ */
.tabs { overflow-x: auto; }
.tab { white-space: nowrap; }

.gantt { overflow-x: auto; padding-bottom: 4px; }
.gantt-inner { position: relative; }
.gantt-head { display: flex; height: 34px; border-bottom: 1px solid var(--line); }
.gantt-row { display: flex; height: 38px; border-bottom: 1px solid #F4F1EA; align-items: center; }
.gantt-row:last-child { border-bottom: none; }
.gantt-label {
  width: 190px; flex: none; padding: 0 12px; font-size: 12px;
  border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; position: sticky; left: 0; background: #fff; z-index: 3;
}
.gantt-head .gantt-label {
  background: #FBF9F5; font-weight: 600; height: 100%; display: flex; align-items: center;
}
.gantt-track { position: relative; height: 100%; flex: none; }
.gantt-bar {
  position: absolute; top: 9px; height: 20px; border-radius: 5px; font-size: 10px;
  color: #fff; display: flex; align-items: center; padding: 0 6px;
  overflow: hidden; white-space: nowrap; opacity: .95;
}
.gantt-tick {
  position: absolute; top: 0; height: 34px; border-left: 1px dashed #E7E2D8;
  font-size: 10px; color: var(--muted); padding-left: 4px; line-height: 34px;
}
.gantt-now { position: absolute; top: 0; bottom: 0; width: 1.5px; background: #B93B2E; opacity: .45; z-index: 2; }
.gantt-head .gantt-now { height: 34px; bottom: auto; }
.row-overdue { background: #FEF7F5; }

.ph-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ph {
  width: 72px; height: 72px; border-radius: 9px; overflow: hidden; position: relative;
  border: 1px solid var(--line); display: block; flex: none;
}
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-del {
  position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center;
  font-size: 12px; cursor: pointer; line-height: 1;
}
.ph-add {
  width: 72px; height: 72px; border: 1px dashed var(--line-strong); border-radius: 9px;
  display: grid; place-items: center; color: var(--muted); font-size: 22px;
  cursor: pointer; background: var(--surface-2);
}
.ph-add:hover { border-color: #C79A7B; color: var(--brand); }

.le-row { border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 8px; background: var(--surface-2); }
.le-main { display: flex; gap: 8px; }
.le-main .le-name { flex: 1; }
.le-price { display: flex; gap: 10px; align-items: flex-end; margin-top: 8px; }
.le-price label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--muted); width: 82px; }
.le-price .input { height: 30px; font-size: 12px; padding: 0 7px; }
.le-amt { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.le-amt b { color: var(--brand-dark); font-variant-numeric: tabular-nums; }

/* ============ P3：PDF 选材说明书阅读器 ============ */
.pdf-shell { display: flex; flex-direction: column; height: calc(100vh - 62px - 48px); gap: 10px; }
.pdf-toolbar {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; flex-wrap: wrap;
}
.pdf-title { font-weight: 600; font-size: 13.5px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-pager { display: flex; align-items: center; gap: 6px; }
.pdf-zoom { display: flex; align-items: center; gap: 6px; border-left: 1px solid var(--line); padding-left: 10px; }
.pdf-tools { display: flex; gap: 2px; border-left: 1px solid var(--line); padding-left: 8px; }
.tool {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 7px;
  border-radius: 7px; border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 10px; font-family: inherit;
}
.tool svg { width: 16px; height: 16px; }
.tool:hover { background: #F4F0E9; color: var(--ink); }
.tool.on { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px #EBD3BF; }
.pdf-body { flex: 1; display: flex; gap: 10px; min-height: 0; }
.pdf-side {
  width: 48px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 6px; display: flex; flex-direction: column; gap: 4px; flex: none;
}
.pdf-thumb {
  height: 34px; border-radius: 6px; display: grid; place-items: center; font-size: 11px;
  color: var(--muted); cursor: pointer; background: #F7F4EE; flex: none;
}
.pdf-thumb:hover { background: #EFE9DF; }
.pdf-thumb.on { background: var(--brand); color: #fff; }
.pdf-stage {
  flex: 1; overflow: auto; background: #E9E4DB; border-radius: 11px;
  display: flex; justify-content: center; align-items: flex-start; padding: 18px;
}
.pdf-page-wrap { position: relative; background: #fff; box-shadow: 0 4px 26px -8px rgba(0, 0, 0, .3); }
#canvas { display: block; }
.pdf-overlay { position: absolute; inset: 0; touch-action: none; }
.pdf-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pdf-divs { position: absolute; inset: 0; pointer-events: none; }
.pdf-obj { position: absolute; pointer-events: auto; cursor: pointer; }
.pdf-mosaic { background: rgba(38, 36, 33, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pdf-text {
  background: rgba(255, 255, 255, .93); padding: 2px 6px; border-radius: 4px;
  white-space: nowrap; font-weight: 600; line-height: 1.35; box-shadow: 0 1px 5px rgba(0, 0, 0, .14);
}
.pdf-stamp {
  border: 2px solid; padding: 1px 8px; border-radius: 4px; font-weight: 700;
  transform: rotate(-8deg); background: rgba(255, 255, 255, .55); letter-spacing: 2px;
}
.pdf-text-input { position: absolute; transform: translateY(-4px); z-index: 5; }
.pdf-text-input input {
  height: 28px; border: 1px solid var(--brand); border-radius: 5px; padding: 0 7px;
  font-size: 13px; outline: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .16); min-width: 170px;
}
.pdf-shot-mask { position: absolute; border: 1.5px dashed #C0392B; background: rgba(192, 57, 43, .08); z-index: 6; pointer-events: none; }
.pdf-status { display: flex; align-items: center; font-size: 11.5px; color: var(--muted); padding: 0 4px; }
#save.dirty { background: #A96B10; border-color: #8E5A0C; }

/* ============ 业主端分享 ============ */
.modal-sm { width: 430px; max-width: calc(100vw - 32px); }
.share-box { padding: 4px 2px 2px; }
.share-qr {
  display: flex; justify-content: center; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; width: fit-content; margin: 0 auto;
}
.share-tip { text-align: center; font-size: 11.5px; color: var(--muted); margin: 9px 0 12px; }
.share-url {
  width: 100%; height: 34px; font-size: 11.5px; font-family: var(--mono);
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 9px; cursor: text;
}
.share-meta {
  display: flex; justify-content: space-between; gap: 8px; font-size: 11px;
  color: var(--muted); margin-top: 8px; flex-wrap: wrap;
}
.share-meta b { color: var(--ink-2); font-weight: 600; }
.share-warn {
  margin-top: 10px; font-size: 11.5px; line-height: 1.65; color: var(--amber);
  background: var(--amber-soft); border-radius: 8px; padding: 8px 10px;
}
.share-note {
  margin-top: 10px; font-size: 11.5px; line-height: 1.75; color: var(--muted);
  background: var(--surface-2); border-radius: 8px; padding: 9px 11px;
}
.share-note b { color: var(--ink-2); }

/* ============ 师傅端：我的任务 ============ */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  height: 31px; padding: 0 13px; border-radius: 17px; display: inline-flex; align-items: center;
  gap: 5px; font-size: 12.5px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); cursor: pointer; user-select: none;
}
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip b { font-weight: 600; opacity: .8; }

.mt-ph {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.mt-ph-r { text-align: right; flex: none; }
.mt-ph-r a { color: var(--brand); text-decoration: none; }

.mt-row {
  display: flex; gap: 14px; justify-content: space-between; align-items: flex-start;
  padding: 13px 16px; border-bottom: 1px solid #F4F1EA;
}
.mt-row:last-child { border-bottom: none; }
.mt-row-l { min-width: 0; flex: 1; }
.mt-name { font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.mt-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.mt-row-r { text-align: right; flex: none; }
.mt-reject {
  margin-top: 7px; font-size: 12px; line-height: 1.6; color: var(--red);
  background: var(--red-soft); border-radius: 7px; padding: 6px 9px;
}

/* ============ 可打印正式文书（合同 / 结算单） ============ */
.doc { font-size: 10.5px; line-height: 1.85; }
.doc h1 { font-size: 22px; letter-spacing: 6px; margin-bottom: 2px; }
.doc .p-sub { margin-bottom: 14px; }
.doc-party { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.doc-party td { border: 1px solid #666; padding: 7px 9px; vertical-align: top; line-height: 1.9; }
.doc-h { font-weight: 700; font-size: 11.5px; margin: 12px 0 4px; letter-spacing: .5px; }
.doc-p { margin: 3px 0; text-indent: 0; text-align: justify; }
.doc-kv { width: 100%; border-collapse: collapse; margin: 2px 0 6px; }
.doc-kv td { border: 1px solid #999; padding: 4px 7px; vertical-align: top; }
.doc-kv td.k { width: 82px; background: #F4F4F4; font-weight: 600; white-space: nowrap; }
.doc-sign { width: 100%; border-collapse: collapse; margin-top: 22px; }
.doc-sign td { vertical-align: top; padding: 8px 10px; line-height: 2; }
.print-meta tr td { padding: 1px 0; }

/* 结算弹窗预览 */
.settle-preview {
  margin-top: 14px; padding: 12px 14px; background: var(--surface-2);
  border-radius: 10px; font-size: 12.5px;
}
.settle-preview > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-2); }
.settle-preview b { font-variant-numeric: tabular-nums; }
.settle-preview .big { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.settle-preview .big span { font-weight: 600; }
.settle-preview .big b { font-size: 18px; color: var(--brand); }

/* 看板 */
.rep-bar { display: flex; align-items: flex-end; gap: 10px; height: 132px; padding: 0 2px; }
.rep-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.rep-stack { width: 100%; max-width: 46px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.rep-seg { width: 100%; border-radius: 3px 3px 0 0; min-height: 2px; }
.rep-x { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.rep-v { font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rep-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.rep-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.aging-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 12.5px; }
.aging-row .bar { height: 8px; border-radius: 4px; background: var(--brand); opacity: .75; }

/* ============ 手写签名板 ============ */
.sign-pad { width: 100%; }
.sign-wrap {
  position: relative; border: 1px dashed var(--line-strong); border-radius: 11px;
  background: #fff; overflow: hidden;
}
.sign-canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }
.sign-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 15px; color: #C6BFB2; pointer-events: none; letter-spacing: 2px;
}
.sign-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px;
}
.sign-img { max-height: 52px; max-width: 190px; display: block; }
.sign-card { display: flex; align-items: center; gap: 10px; }
.sign-card .sign-img {
  border: 1px solid var(--line); border-radius: 7px; padding: 2px 5px; background: #fff;
}
.doc-sign-img { display: block; max-height: 58px; max-width: 210px; margin: 4px 0 2px; }

/* ============ 报价行 → 说明书锚点 ============ */
.pdf-anchors {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #FBF7F0; border: 1px solid #EDE3D6; border-radius: 10px;
  padding: 7px 11px; font-size: 12px;
}
.anch-label { color: var(--muted); flex: none; font-size: 11.5px; }
.anch-list { display: flex; gap: 6px; flex-wrap: wrap; }
.anch-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 9px;
  background: #fff; border: 1px solid #DFC7AE; border-radius: 14px;
  color: var(--brand-dark); font-size: 11.5px; line-height: 1.7;
}
.anch-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.anch-chip.on em { color: rgba(255, 255, 255, .8); }
.anch-chip em { font-style: normal; color: var(--muted); font-size: 10.5px; }
.anch-chip i {
  cursor: pointer; font-style: normal; width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .06); font-size: 10px;
}
.anch-chip i:hover { background: var(--red); color: #fff; }
.anch-chip.on i { background: rgba(255, 255, 255, .22); }
.anch-empty { color: var(--muted); font-size: 11.5px; }
.anch-total { margin-left: auto; color: var(--muted); font-size: 11px; }

@keyframes anchFlash {
  0% { box-shadow: 0 0 0 0 rgba(176, 84, 40, .55); }
  100% { box-shadow: 0 0 0 14px rgba(176, 84, 40, 0); }
}
.pdf-page-wrap.flash { animation: anchFlash 1.1s ease-out 2; }

/* 锚点选择弹窗 */
.anch-pick {
  margin-top: 7px; max-height: 232px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 9px; padding: 6px;
  background: var(--surface-2);
}
.anch-cat {
  font-size: 10.5px; color: var(--muted); padding: 5px 7px 3px; letter-spacing: .5px;
}
.anch-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 7px;
  font-size: 12.5px; cursor: pointer; color: var(--ink-2);
}
.anch-item:hover { background: #fff; }
.anch-item.on { background: var(--brand); color: #fff; }
.anch-item em { margin-left: auto; font-style: normal; font-size: 10.5px; opacity: .65; }

/* 锚点总览 */
.anch-count {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 10.5px;
}
.anch-group { margin-bottom: 12px; }
.anch-group:last-child { margin-bottom: 0; }
.anch-group-t {
  font-size: 12px; font-weight: 600; margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline;
}
.anch-line {
  display: flex; align-items: center; gap: 9px; padding: 4px 6px; font-size: 12px;
  border-radius: 6px;
}
.anch-line:hover { background: var(--surface-2); }
.anch-p {
  flex: none; min-width: 34px; text-align: center; padding: 1px 6px; border-radius: 5px;
  background: #fff; border: 1px solid var(--line-strong); color: var(--brand-dark);
  text-decoration: none; font-size: 11px; font-variant-numeric: tabular-nums;
}
.anch-p:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.anch-n { color: var(--ink); }
.anch-x {
  margin-left: auto; cursor: pointer; color: #C9C2B5; font-style: normal; font-size: 11px;
  padding: 0 3px;
}
.anch-x:hover { color: var(--red); }
.hint-line {
  margin-top: 12px; font-size: 12px; line-height: 1.8; color: var(--muted);
  background: var(--surface-2); border-radius: 9px; padding: 10px 13px;
}
.hint-line b { color: var(--brand-dark); }

/* 报价行里的页码 */
.anch-link {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 3px;
  padding: 0 6px; height: 18px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 10.5px; text-decoration: none; white-space: nowrap;
  border: 1px solid #EBD3BF;
}
.anch-link:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.anch-link svg { width: 10px; height: 10px; }
.anch-link.more { background: #F1EEE7; border-color: var(--line); color: var(--muted); }
.anch-row { display: flex; gap: 5px; flex-wrap: wrap; }


/* ============ 项目分类与施工条件 ============ */
.ptags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.ptag {
  font-size: 11px; padding: 2px 9px; border-radius: 20px;
  background: #F3F0E9; color: var(--ink-2); border: 1px solid transparent;
}
.ptag.brand { background: var(--brand-soft); color: var(--brand-dark); border-color: #EBD3BF; }
.ptag.warn { background: var(--amber-soft); color: var(--amber); }
.ptype {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand-dark); font-family: var(--font-sans, inherit);
}
.conds { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.cond {
  display: flex; gap: 8px; align-items: baseline; font-size: 12px; line-height: 1.7;
  padding: 6px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2);
}
.cond b { flex: none; font-size: 11px; padding: 0 6px; border-radius: 5px; background: rgba(0,0,0,.05); }
.cond.warn { background: var(--amber-soft); color: #7A4A08; }
.cond.warn b { background: rgba(169,107,16,.14); color: var(--amber); }
.cond.danger { background: var(--red-soft); color: #8B2B22; }
.cond.danger b { background: rgba(185,59,46,.14); color: var(--red); }
.cond.info b { color: var(--muted); }

.chk-line {
  display: flex; align-items: center; gap: 7px; height: 35px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}

/* ============ 异形区域块编辑器 ============ */
.shape-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.shape-top .tiny { margin-right: auto; }
.shape-body { display: grid; grid-template-columns: 1fr 300px; gap: 12px; align-items: start; }
.shape-list { min-width: 0; }
.sh-row {
  display: grid; grid-template-columns: 70px 1fr 1fr 1fr 1fr 68px 24px;
  gap: 6px; align-items: center; margin-bottom: 6px;
}
.sh-row .input { height: 30px; font-size: 12px; padding: 0 6px; }
.sh-quick { display: flex; gap: 4px; }
.sh-quick span {
  flex: 1; text-align: center; font-size: 10.5px; color: var(--muted);
  background: var(--surface-2); border-radius: 5px; padding: 4px 0; cursor: pointer;
}
.sh-quick span:hover { background: var(--brand-soft); color: var(--brand-dark); }
.sh-del { color: var(--muted); cursor: pointer; text-align: center; border-radius: 5px; padding: 3px 0; }
.sh-del:hover { background: var(--red-soft); color: var(--red); }
.shape-view {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; text-align: center;
}
.shape-view svg { width: 100%; height: 200px; display: block; }
.op-blank { height: 31px; }

/* ============ 项目档案 ============ */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.fcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.fcard-head { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px 10px; }
.fcard-ico {
  width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none;
}
.fcard-body { padding: 0 10px; flex: 1; }
.fitem {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-top: 1px solid #F1EDE5;
}
.fthumb {
  width: 40px; height: 32px; border-radius: 6px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none;
  border: 1px solid var(--line);
}
.fthumb img { width: 100%; height: 100%; object-fit: cover; }
.fthumb .fext { font-size: 9px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.fmeta { flex: 1; min-width: 0; }
.fname {
  font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fops { display: flex; gap: 4px; flex: none; }
.fops .btn { padding: 2px 7px; height: 24px; font-size: 11.5px; }
.fempty { padding: 16px 6px; font-size: 12px; color: var(--muted); text-align: center; }
.fcard-foot { padding: 9px 12px 12px; }
.fcard-foot .btn { width: 100%; justify-content: center; }

/* ============ 洞口与构件卡片 ============ */
.op-card {
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  margin-bottom: 9px; overflow: hidden;
}
.op-card-head {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px;
  background: var(--surface-2); border-bottom: 1px solid #F1EDE5;
}
.op-card-head .input { height: 30px; font-size: 12.5px; }
.op-summary { font-family: var(--mono); font-size: 11.5px; }
.op-card-body { display: grid; grid-template-columns: 1fr 250px; gap: 14px; padding: 12px; }
.op-card.folded .op-card-body { display: none; }
.op-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px 10px; }
.op-fields .opf { display: flex; flex-direction: column; min-width: 0; }
.op-fields .opf > label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.op-fields .opf.span2 { grid-column: span 2; }
.op-fields .opf.span4 { grid-column: 1 / -1; }
.op-fields .input { height: 32px; font-size: 12.5px; }
.opfhint { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.op-2sel, .op-3sel, .op-4sel { display: grid; gap: 6px; }
.op-2sel { grid-template-columns: 100px 1fr; }
.op-3sel { grid-template-columns: repeat(3, 1fr); }
.op-4sel { grid-template-columns: repeat(4, 1fr); }
.op-diagram {
  background: var(--surface-2); border-radius: 9px; padding: 8px;
  display: flex; align-items: center;
}
.op-diagram svg { width: 100%; height: auto; display: block; }

/* 异形区域说明 */
.shape-help {
  border: 1px solid #E8DFD0; background: #FCFAF5; border-radius: 10px;
  padding: 9px 12px; margin-bottom: 12px;
}
.shape-help summary { font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; outline: none; }
.shape-help-body { padding-top: 10px; }
.shape-help-cols { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: center; }
.shape-help-svg { width: 100%; height: auto; background: var(--surface); border-radius: 8px; border: 1px solid var(--line); }
.shape-help-table { margin-top: 10px; font-size: 12px; }
.shape-help-table th { font-size: 11px; color: var(--muted); font-weight: 500; }
.shape-help-table td { padding: 5px 8px; vertical-align: top; }
.sh-head {
  display: grid; grid-template-columns: 70px 1fr 1fr 1fr 1fr 68px 24px;
  gap: 6px; font-size: 10.5px; color: var(--muted); padding: 0 0 4px;
}
.sh-head span:nth-child(6), .sh-head span:nth-child(7) { }

/* ============ 项目档案·增强（多图/预览/截取/排序/备注） ============ */
.file-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.fitem { align-items: flex-start; flex-wrap: wrap; }
.fops { flex-wrap: wrap; justify-content: flex-end; max-width: 165px; }
.fops .btn { font-size: 11px; padding: 2px 6px; }
.fnote {
  font-size: 11.5px; color: var(--ink-2); margin-top: 3px; cursor: text;
  border-radius: 4px; padding: 1px 4px; margin-left: -4px;
  border: 1px dashed transparent; white-space: normal; line-height: 1.4;
}
.fnote:hover { border-color: var(--line); background: var(--surface-2); }
.fitem .fmeta { min-width: 130px; }
.move-btn { font-weight: 700; }
.move-btn:disabled { opacity: .35; cursor: not-allowed; }
.fitem.dragging { opacity: .4; }
.fitem.dragover { box-shadow: inset 0 2px 0 var(--brand); }
.fitem.flash { animation: fflash .9s ease; }
@keyframes fflash { 0%,100% { background: transparent; } 30% { background: rgba(196,138,60,.18); } }

/* 多文件上传列表 */
.up-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px solid var(--line); }
.up-row:first-child { border-top: none; }
.up-thumb {
  width: 34px; height: 30px; border-radius: 6px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; flex: none;
  font-size: 9px; font-weight: 700; color: var(--ink-2); overflow: hidden;
}
.up-meta { flex: 1; min-width: 0; }
.up-meta .input { height: 28px; font-size: 12px; margin-bottom: 2px; }

/* 大图预览 */
.lightbox { display: flex; align-items: center; justify-content: center; min-height: 300px; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.lightbox img { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: 6px; }

/* 裁剪 */
.crop-wrap {
  position: relative; display: inline-block; max-width: 100%; overflow: hidden;
  background: #2A2825; border-radius: 10px; line-height: 0;
}
.crop-wrap img { display: block; max-width: 100%; max-height: 62vh; user-select: none; -webkit-user-drag: none; }
.crop-sel {
  position: absolute; display: none; border: 2px solid #E8A33D;
  background: rgba(232,163,61,.18); pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.42);
}

/* ============ 项目档案·PDF 预览 ============ */
.fthumb-pdf {
  font-size: 9px; font-weight: 800; letter-spacing: .03em;
  color: #fff; background: #C0392B; border-radius: 4px; padding: 3px 4px;
}
.pdfpv { display: flex; flex-direction: column; gap: 8px; }
.pdfpv-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pdfpv-bar .btn { height: 28px; min-width: 28px; padding: 2px 8px; }
.pdfpv-page { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.pdfpv-page .input { width: 56px; height: 28px; text-align: center; padding: 0 4px; }
.pdfpv-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.pdfpv-zoom { min-width: 46px; text-align: center; font-size: 12px; }
.pdfpv-stage {
  background: #33302C; border-radius: 10px; padding: 16px;
  min-height: 340px; max-height: 66vh; overflow: auto; display: flex; justify-content: center;
}
.pdfpv-stage canvas { background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); border-radius: 3px; }
.pdfpv-tip { text-align: center; }

/* ============ 可移动/可缩放选区框 ============ */
.sel-box {
  position: absolute; box-sizing: border-box; z-index: 5;
  border: 2px solid #E8A33D; background: rgba(232,163,61,.14);
  cursor: move; display: none;
}
.sel-box .sel-h {
  position: absolute; width: 10px; height: 10px; background: #fff;
  border: 2px solid #E8A33D; border-radius: 2px; z-index: 6;
}
.sel-box .sel-h[data-h="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.sel-box .sel-h[data-h="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.sel-box .sel-h[data-h="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.sel-box .sel-h[data-h="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.sel-box .sel-h[data-h="n"] { left: 50%; top: -6px; margin-left: -5px; cursor: ns-resize; }
.sel-box .sel-h[data-h="s"] { left: 50%; bottom: -6px; margin-left: -5px; cursor: ns-resize; }
.sel-box .sel-h[data-h="w"] { top: 50%; left: -6px; margin-top: -5px; cursor: ew-resize; }
.sel-box .sel-h[data-h="e"] { top: 50%; right: -6px; margin-top: -5px; cursor: ew-resize; }
.sel-box .sel-size {
  position: absolute; left: 0; top: -22px; background: #E8A33D; color: #2A2015;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}

/* PDF 预览 canvas 容器（选区相对它定位） */
.pdfpv-canvas-wrap { position: relative; display: inline-block; line-height: 0; }

/* 全景图阶段 */
.phase-badge { margin-left: 6px; font-size: 10px; padding: 1px 6px; vertical-align: middle; }
.phase-strip { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 2px 4px; border-top: 1px solid var(--line); }
.phase-chip {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  border: 1px dashed var(--line); color: var(--muted);
}
.phase-chip.on { border-style: solid; border-color: #3E6E8E; color: #3E6E8E; background: rgba(62,110,142,.08); }

/* ============ 可移动/可缩放浮窗 ============ */
.fw-mask { position: fixed; inset: 0; background: rgba(20,18,16,.5); z-index: 1000; }
.fw {
  position: absolute; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 60px rgba(0,0,0,.4);
  display: flex; flex-direction: column; overflow: hidden; min-width: 360px; min-height: 260px;
}
.fw-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px 9px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); cursor: move; user-select: none;
}
.fw-title { flex: 1; min-width: 0; }
.fw-title h3 { margin: 0; font-size: 14px; color: var(--ink); font-weight: 650; }
.fw-title .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fw-tools { display: flex; align-items: center; gap: 4px; }
.fw-max, .fw-close {
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; border: none; background: transparent;
}
.fw-max { font-size: 15px; }
.fw-max:hover, .fw-close:hover { background: var(--line); color: var(--ink); }
.fw-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.fw-foot {
  border-top: 1px solid var(--line); padding: 8px 12px; display: flex; align-items: center; gap: 8px;
}
.fw-rs { position: absolute; z-index: 3; }
.fw-rs[data-rs="n"] { top: 0; left: 10px; right: 10px; height: 5px; cursor: ns-resize; }
.fw-rs[data-rs="s"] { bottom: 0; left: 10px; right: 10px; height: 6px; cursor: ns-resize; }
.fw-rs[data-rs="w"] { left: 0; top: 10px; bottom: 10px; width: 5px; cursor: ew-resize; }
.fw-rs[data-rs="e"] { right: 0; top: 10px; bottom: 10px; width: 6px; cursor: ew-resize; }
.fw-rs[data-rs="nw"] { top: 0; left: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.fw-rs[data-rs="ne"] { top: 0; right: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.fw-rs[data-rs="sw"] { bottom: 0; left: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.fw-rs[data-rs="se"] { bottom: 0; right: 0; width: 16px; height: 16px; cursor: nwse-resize; }

/* 截图去向预览 */
.shot-preview { display: flex; justify-content: center; background: var(--surface-2); border-radius: 8px; padding: 10px; }
.shot-preview img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 4px; }

/* ============ 全景图预览 ============ */
.pano-pv { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pano-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
.pano-bar .btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pano-stage {
  flex: 1; min-height: 280px; background: #2A2825; border-radius: 10px;
  padding: 14px; display: flex; align-items: center; justify-content: center; overflow: auto;
}
.pano-wrap { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.pano-wrap img { border-radius: 4px; }
.pano-wrap canvas { border-radius: 4px; touch-action: none; }
.phase-chip { cursor: pointer; user-select: none; }
.phase-chip:hover { border-color: var(--brand); }
.phase-chip.sel { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ============ 浮窗全屏 ============ */
.fw-full { font-size: 16px; }
.fw:fullscreen { width: 100vw !important; height: 100vh !important; border-radius: 0; }
.fw:fullscreen .fw-body { background: #1E1C1A; }
/* 全屏时预览区撑满，图片按比例放大充满窗框（小图不再缩在角落） */
.fw:fullscreen .fw-body { flex: 1; min-height: 0; }
.fw:fullscreen .lightbox { flex: 1; min-height: 0; }
.fw:fullscreen .lightbox img,
.fw:fullscreen .pano-pv { height: 100%; }
.fw:fullscreen .lightbox img {
  max-width: 100%; max-height: 100%; width: 100%; height: 100%;
  object-fit: contain; border-radius: 0;
}
.fw:fullscreen .pano-pv .pano-stage { flex: 1; min-height: 0; height: 100%; }
.fw:fullscreen .pdfpv-stage { flex: 1; min-height: 0; }
/* 缩放图片：放大后可抓取平移 */
.zoomable img.zoom-img { transition: transform .05s linear; max-height: 66vh; }
.zoomable img.zoom-img:active { cursor: grabbing; }

/* ============ 浮动截图按钮（可拖动/开关） ============ */
.float-shot {
  position: absolute; right: 16px; bottom: 16px; z-index: 8;
  display: flex; align-items: center; gap: 4px; cursor: move;
  background: rgba(30,28,26,.82); border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px; padding: 3px 4px; backdrop-filter: blur(4px);
}
.float-shot .fs-toggle, .float-shot .fs-shot {
  border: none; border-radius: 18px; cursor: pointer; font-size: 12px; height: 28px;
}
.float-shot .fs-toggle { width: 28px; background: transparent; color: #fff; }
.float-shot .fs-toggle.off { opacity: .6; }
.float-shot .fs-shot { background: var(--brand); color: #fff; padding: 0 14px; font-weight: 600; }
.float-shot .fs-shot:hover { filter: brightness(1.08); }
.lightbox { position: relative; }
/* 截图模式：光标变十字，明确此时是"拖框"而不是"拖动看图" */
.lightbox.shot-mode,
.lightbox.shot-mode img.zoom-img,
.lightbox.shot-mode img.zoom-img:active { cursor: crosshair; }
.pano-stage { position: relative; }

/* ============ 截图标注 ============ */
.anno { display: flex; flex-direction: column; gap: 8px; }
.anno-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.anno-bar .btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.anno-lb { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.anno-lb input[type=range] { width: 74px; }
.anno-wval { font-size: 11px; min-width: 16px; }
.anno-head-box { display: inline-flex; align-items: center; gap: 4px; }
.anno-colors { display: inline-flex; gap: 4px; }
.anno-color {
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(0,0,0,.2);
}
.anno-color.on { border-color: var(--ink); transform: scale(1.12); }
.anno-stage {
  background: #2A2825; border-radius: 8px; padding: 8px;
  display: flex; align-items: center; justify-content: center; min-height: 200px;
}
.anno-stage canvas { max-width: 100%; max-height: 58vh; touch-action: none; cursor: crosshair; background: #fff; }
