/* 海亚报价 · 表格化工作台。颜色令牌见 theme.css。 */
* { box-sizing:border-box }
html,body { height:100% }
body {
  margin:0; background:var(--color-background-secondary); color:var(--color-text-primary);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei","Helvetica Neue",sans-serif;
  -webkit-font-smoothing:antialiased; font-synthesis:none;
}
button,input,select { font:inherit }
button { cursor:pointer }
button:focus-visible,select:focus-visible { outline:2px solid var(--color-accent); outline-offset:2px }

/* 整页固定高度，只有表格自己滚动 */
.workspace { height:100vh; height:100dvh; display:flex; flex-direction:column; overflow:hidden }

/* ---------- 顶栏 ---------- */
.appbar {
  flex:0 0 44px; display:flex; align-items:center; justify-content:space-between; padding:0 16px;
  background:var(--color-background-secondary); border-bottom:1px solid var(--color-border-tertiary);
}
.identity { display:flex; align-items:center; gap:8px }
.logo { color:var(--color-accent); display:grid; place-items:center }
.identity strong { display:block; font-size:15px; font-weight:650; letter-spacing:-.2px }
.identity small { display:block; font-size:10px; color:var(--color-text-tertiary) }
.appbar-actions { display:flex; align-items:center; gap:9px }
.local-badge { padding:2px 9px; border-radius:999px; background:var(--color-accent-soft); color:var(--color-accent); font-size:11px; font-weight:600 }
.role-label { font-size:12px; color:var(--color-text-secondary); margin-right:-3px }

.button {
  display:inline-flex; align-items:center; justify-content:center; gap:5px; height:28px; padding:0 11px;
  border:1px solid var(--color-border-tertiary); border-radius:var(--radius-md); background:var(--color-background-primary);
  color:var(--color-text-primary); font-size:12px; font-weight:600; white-space:nowrap;
}
.button:hover { background:var(--color-background-tertiary); border-color:var(--color-border-secondary) }
.button:disabled { opacity:.45; cursor:not-allowed }
.button[hidden] { display:none }
.button.primary,.button.add { background:var(--color-accent); border-color:transparent; color:var(--color-background-primary) }
.button.primary:hover,.button.add:hover { background:var(--color-accent-hover) }

/* ---------- 报价信息条（原两张卡片压成一行） ---------- */
.quote-bar {
  flex:0 0 auto; display:flex; align-items:center; gap:14px 18px; flex-wrap:wrap;
  padding:8px 16px; background:var(--color-background-primary); border-bottom:1px solid var(--color-border-tertiary);
}
.quote-id { min-width:0 }
.quote-id h1 { margin:0; font-size:15px; font-weight:650; letter-spacing:-.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:420px }
.quote-id p { margin:2px 0 0; font-size:11px; color:var(--color-text-tertiary); white-space:nowrap }
.kicker { font-family:"SF Mono",Menlo,Consolas,monospace; font-size:10.5px; color:var(--color-text-secondary); margin-right:8px }
.quote-switch { display:flex; align-items:center; gap:6px }
#quoteSelectButton { max-width:260px }
.quote-right { margin-left:auto; display:flex; align-items:center; gap:14px }
.status-control { display:flex; align-items:center; gap:7px; white-space:nowrap; color:var(--color-text-secondary); font-size:11px }
#quoteStatusButton { min-width:82px; font-weight:600; border-color:var(--color-border-secondary) }
#quoteStatusButton[data-status="核价中"] { background:var(--color-accent-soft); color:var(--color-accent-hover) }
#quoteStatusButton[data-status="已报价"] { background:var(--color-success-soft); color:var(--color-success) }
.summary-price { text-align:right; line-height:1.1 }
.summary-price span { display:block; font-size:10px; color:var(--color-text-tertiary) }
.summary-price strong { display:block; font-size:20px; font-weight:680; letter-spacing:-.5px; font-variant-numeric:tabular-nums }

/* ---------- 工作表区域 ---------- */
.sheets { flex:1; min-height:0; display:flex; flex-direction:column; background:var(--color-background-primary) }
.sheet { display:none; flex:1; min-height:0; overflow:auto }
.sheet.active { display:block }
#detailSheet.active { display:flex; flex-direction:column; overflow:hidden }

.sheet-toolbar { flex:0 0 40px; display:flex; align-items:center; gap:8px; padding:0 12px; border-bottom:1px solid var(--color-border-tertiary) }
.sheet-toolbar input,.sheet-toolbar select { height:28px; padding:0 8px; border:1px solid var(--color-border-tertiary); border-radius:var(--radius-md); background:var(--color-background-primary); font-size:12px; color:var(--color-text-primary) }
.sheet-toolbar input { width:200px }
/* 搜索框：复刻备料项目 public/index.html 的 .search-wrapper */
.search-wrapper { width:260px; height:34px; border-radius:17px; background:var(--color-background-tertiary); border:2.5px solid transparent; display:flex; align-items:center; padding:0 10px; transition:border-color .18s ease,background .18s ease; cursor:text }
.search-wrapper:focus-within { border-color:var(--color-text-primary); background:var(--color-background-tertiary) }
.search-wrapper .search-icon { width:16px; height:16px; flex:0 0 auto; margin-right:7px; color:var(--color-text-secondary); display:flex; align-items:center; justify-content:center }
.search-wrapper .search-icon svg { width:15px; height:15px; display:block; fill:none; stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round }
.sheet-toolbar .search-wrapper .search-input { flex:1; min-width:0; width:auto; height:100%; border:none; border-radius:0; outline:none; background:transparent; box-shadow:none; font-family:inherit; font-size:13px; font-weight:500; color:var(--color-text-primary); padding:0; caret-color:var(--color-text-primary) }
.search-wrapper .search-input[type="search"] { appearance:none; -webkit-appearance:none }
.search-wrapper .search-input[type="search"]::-webkit-search-decoration,
.search-wrapper .search-input[type="search"]::-webkit-search-cancel-button,
.search-wrapper .search-input[type="search"]::-webkit-search-results-button,
.search-wrapper .search-input[type="search"]::-webkit-search-results-decoration { display:none; -webkit-appearance:none }
.search-wrapper .search-input::placeholder { color:var(--color-text-secondary) }
.search-wrapper .clear-btn { width:18px; height:18px; border-radius:50%; border:none; background:var(--color-background-tertiary); color:var(--color-background-primary); flex:0 0 auto; display:none; align-items:center; justify-content:center; margin-left:6px; padding:0; cursor:pointer }
.search-wrapper .clear-btn.show { display:flex }
.search-wrapper .clear-btn svg { width:10px; height:10px; display:block; fill:none; stroke:currentColor; stroke-width:3; stroke-linecap:round; stroke-linejoin:round }
.search-hit { display:inline; border-radius:3px; padding:0 1px; background:var(--color-warning-soft); color:inherit; font-weight:700 }
.sheet-toolbar input:not(.search-input):focus { outline:none; border-color:var(--color-accent); box-shadow:0 0 0 3px var(--color-accent-soft) }
.toolbar-separator { width:1px; height:18px; background:var(--color-border-tertiary) }
.toolbar-spacer { flex:1 }
.group-nav { display:flex; align-items:center; gap:2px; min-width:0 }
.group-label { font-size:11px; color:var(--color-text-tertiary); margin-right:4px }
.group-jump { border:0; background:transparent; padding:4px 8px; border-radius:6px; font-size:11.5px; color:var(--color-text-secondary) }
.group-jump:hover,.group-jump.active { background:var(--color-accent-soft); color:var(--color-accent) }

/* 工具栏统一成搜索框那一套：30px 高、胶囊形、#f1f2f3 灰底、聚焦蓝描边（方案 B：整体收紧） */
.sheet-toolbar { flex:0 0 46px; gap:10px; padding:0 16px }
.sheet-toolbar .search-wrapper { width:240px; height:30px; border-radius:15px; border-width:2px }
.sheet-toolbar .search-wrapper .search-input { font-size:12.5px }
.sheet-toolbar .toolbar-separator { height:20px; margin:0 2px }
.sheet-toolbar .dd-btn { height:30px; border-radius:15px; background:var(--color-background-tertiary); border:2px solid transparent; padding:0 12px 0 14px; font-size:12.5px; font-weight:500; gap:10px; transition:border-color .18s ease,background .18s ease }
.sheet-toolbar .dd-btn:hover { background:var(--color-background-tertiary); border-color:transparent }
.sheet-toolbar .dd-btn:focus-visible,.sheet-toolbar .dd-btn[aria-expanded="true"] { border-color:var(--color-accent); background:var(--color-background-tertiary); box-shadow:none }
.sheet-toolbar .dd-chevron { color:var(--color-text-secondary) }
.sheet-toolbar .group-label { display:none }
.sheet-toolbar > .toolbar-spacer { display:none }
.sheet-toolbar .group-nav { flex:1 1 auto; min-width:0; position:relative; isolation:isolate; height:30px; padding:3px; gap:2px; border-radius:15px; background:var(--color-background-tertiary) }
.sheet-toolbar .group-jump { position:relative; z-index:2; min-width:max-content; height:24px; padding:0 12px; text-align:center; border-radius:12px; background:transparent; font-size:12px; font-weight:500; color:var(--color-text-primary); white-space:nowrap; transition:color .2s }
.sheet-toolbar .group-jump:hover { background:transparent; color:var(--color-text-primary) }
.sheet-toolbar .group-jump.active { background:transparent; color:var(--color-accent); font-weight:600; box-shadow:none }
/* 分组切换的“进度条”：浅蓝填充随表格横向滚动推进，白色滑块滑到当前所在分组 */
.seg-fill { position:absolute; z-index:0; left:3px; top:3px; bottom:3px; width:0; border-radius:12px; pointer-events:none;
  background:linear-gradient(90deg,var(--color-accent-soft),var(--color-focus-ring)); transition:width .14s linear }
.seg-thumb { position:absolute; z-index:1; left:0; top:3px; height:24px; width:0; border-radius:12px; pointer-events:none; background:var(--color-background-primary);
  box-shadow:0 1px 3px rgba(0,0,0,.12),0 0 0 .5px rgba(0,0,0,.04); transition:transform .34s cubic-bezier(.3,.8,.25,1),width .34s cubic-bezier(.3,.8,.25,1) }
.seg-thumb.no-anim { transition:none }
@media (prefers-reduced-motion:reduce) { .seg-thumb,.seg-fill { transition:none } }
/* 液态玻璃分组切换（克制版，参照 macOS 分段控件）：中性半透明底槽 + 白色玻璃滑块，发丝边线与轻阴影，无彩色渐变；只改外观，定位逻辑不变 */
.sheet-toolbar .group-nav { background:rgba(118,118,128,.10);
  -webkit-backdrop-filter:blur(20px) saturate(180%); backdrop-filter:blur(20px) saturate(180%);
  box-shadow:inset 0 0 0 .5px rgba(0,0,0,.05),inset 0 .5px 0 rgba(255,255,255,.6) }
.seg-fill { background:rgba(118,118,128,.07); box-shadow:none }
.seg-thumb { background:rgba(255,255,255,.94);
  -webkit-backdrop-filter:blur(12px) saturate(180%); backdrop-filter:blur(12px) saturate(180%);
  box-shadow:inset 0 .5px 0 rgba(255,255,255,1),0 0 0 .5px rgba(0,0,0,.06),0 3px 8px rgba(0,0,0,.08),0 1px 1.5px rgba(0,0,0,.05);
  transition:transform .38s cubic-bezier(.32,.72,0,1),width .38s cubic-bezier(.32,.72,0,1),scale .2s cubic-bezier(.32,.72,0,1) }
.group-nav:has(.group-jump:active) .seg-thumb { scale:.97 }
.sheet-toolbar .group-jump { color:#475467; font-weight:500; letter-spacing:.2px }
.sheet-toolbar .group-jump:hover:not(.active) { color:#1d2939 }
.sheet-toolbar .group-jump.active { color:#101828; font-weight:600 }
/* 原生分段控件的比例：按内容定宽、五段等宽、底槽单色；滚动时滑块仍跟随当前分组 */
.sheet-toolbar .group-nav { flex:0 0 auto; display:grid; grid-auto-flow:column; grid-auto-columns:minmax(76px,1fr); gap:0 }
.sheet-toolbar .group-jump { flex:none!important; padding:0 14px }
/* 进度细线放在控件下方外侧，与玻璃滑块错开，避免重叠 */
.sheet-toolbar .seg-fill { display:block; top:auto; bottom:-5px; left:6px; height:2px; max-width:calc(100% - 12px); border-radius:1px; background:rgba(52,120,240,.5); box-shadow:none; transition:width .14s linear,opacity .2s }
.sheet-toolbar .seg-fill[data-empty="1"] { opacity:0 }
.sheet-toolbar .group-nav { user-select:none; -webkit-user-select:none; touch-action:pan-y }
.sheet-toolbar .group-jump.active { cursor:grab }
.sheet-toolbar .group-nav.seg-dragging,.sheet-toolbar .group-nav.seg-dragging * { cursor:grabbing!important }
.seg-thumb.dragging { scale:1.04 1.1; box-shadow:inset 0 .5px 0 rgba(255,255,255,1),0 0 0 .5px rgba(0,0,0,.07),0 6px 16px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.06) }
.sheet-toolbar #addRowButton { height:30px; padding:0 15px; border-radius:15px; font-size:12.5px; font-weight:600 }

/* 编辑栏 */
.formula-bar { flex:0 0 30px; display:flex; align-items:stretch; border-bottom:1px solid var(--color-border-secondary); font-size:12px }
.cell-address { width:96px; display:flex; align-items:center; justify-content:center; border-right:1px solid var(--color-border-tertiary); font-family:"SF Mono",Menlo,Consolas,monospace; font-weight:600; font-size:11.5px }
/* 编辑栏左侧的当前格状态：可填写 / 公式 / 已锁 / 不适用 / 输入中 */
.cell-state { flex:0 0 auto; min-width:78px; display:flex; align-items:center; justify-content:center; gap:4px; padding:0 10px; border-right:1px solid var(--color-border-tertiary); font-size:11.5px; font-weight:600; white-space:nowrap; color:var(--color-text-tertiary) }
.cell-state svg { width:12px; height:12px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round }
.cell-state .fx-mark { font-style:italic; font-weight:700; font-family:Georgia,"Times New Roman",serif; font-size:12.5px; line-height:1 }
.cell-state[data-kind="editable"] { color:var(--color-text-primary) }
.cell-state[data-kind="editing"] { color:var(--color-accent); background:var(--color-accent-soft) }
.cell-state[data-kind="calculated"] { color:var(--cell-calculated-text) }
.cell-state[data-kind="locked"] { color:var(--cell-locked-text); background:var(--cell-locked) }
.cell-state[data-kind="na"] { color:var(--color-text-tertiary) }
.formula-input { flex:1; min-width:0; border:0; padding:0 10px; outline:none; background:var(--color-background-primary); font-size:12px; color:var(--color-text-primary) }
.formula-input:focus:not([readonly]) { box-shadow:inset 0 0 0 2px var(--sel) }
.formula-input[readonly] { color:var(--color-text-tertiary); cursor:default }
.formula-input.is-formula { color:var(--cell-calculated-text); font-family:"SF Mono",Menlo,Consolas,monospace; font-size:11.5px }


/* ---------- 网格 ---------- */
.grid-scroll { flex:1; min-height:0; overflow:auto; position:relative; background:var(--color-background-primary); outline:none }
.quote-grid { border-collapse:separate; border-spacing:0; table-layout:fixed; width:max-content; font-size:12px; user-select:none; -webkit-user-select:none }
.quote-grid th,.quote-grid td {
  height:26px; padding:0 6px; border-right:1px solid var(--grid-line); border-bottom:1px solid var(--grid-line);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:var(--color-background-primary); color:var(--color-text-primary);
}
.quote-grid thead { position:sticky; top:0; z-index:6 }
.quote-grid thead th { background:var(--column-head-label); color:var(--column-head-text); font-weight:600; text-align:center }
.quote-grid .h-group th { height:20px; font-size:10.5px; background:var(--column-head-group); color:var(--column-head-group-text); border-right-color:rgba(30,40,55,.08); border-bottom-color:var(--column-head-border) }
.quote-grid .h-letter th { height:calc(24px * var(--sheet-scale,1)); padding:0; font-size:10px; font-weight:500; background:var(--column-head-coordinate); color:var(--column-head-muted); cursor:default }
.quote-grid .h-label th { height:calc(42px * var(--sheet-scale,1)); padding:4px 5px; font-size:11px; cursor:default; white-space:normal; border-bottom:1px solid var(--column-head-border) }
/* 冻结表头保留 sticky，不能用 relative 覆盖其 left 偏移。 */
.quote-grid .h-label th:not(.sticky),.quote-grid .h-letter th:not(.sticky) { position:relative }
.head-coordinate { display:flex; align-items:center; justify-content:center; position:relative; height:100%; min-height:calc(24px * var(--sheet-scale,1)) }
.head-letter { position:relative; line-height:1 }
.head-menu { position:absolute; right:calc(5px * var(--sheet-scale,1)); top:50%; transform:translateY(-50%); display:flex; align-items:center; justify-content:center; width:calc(16px * var(--sheet-scale,1)); height:calc(20px * var(--sheet-scale,1)); padding:0; border:0; border-radius:3px; color:var(--color-accent); background:transparent; cursor:pointer; opacity:1 }
.head-menu svg { display:block; width:calc(12px * var(--sheet-scale,1)); height:calc(12px * var(--sheet-scale,1)); fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round }
.head-menu:hover,.head-menu:focus-visible { background:var(--color-background-tertiary); color:var(--color-accent); opacity:1 }
.col-resize { position:absolute; right:0; top:0; bottom:0; width:5px; cursor:col-resize; z-index:2 }
.col-resize:hover { background:transparent }
.quote-grid thead th.hl { background:var(--head-hl); color:var(--sel) }

/* 行号栏与冻结列 */
.quote-grid .gutter { position:sticky; left:0; z-index:3; width:40px; padding:0 4px; text-align:center; background:var(--grid-head); color:var(--grid-head-text); font-size:11px; font-weight:500; border-right:2px solid var(--gutter-divider) }
.quote-grid .rowhead { cursor:default; font-variant-numeric:tabular-nums }
.quote-grid .rowhead.hl { background:var(--head-hl); color:var(--sel); font-weight:500; box-shadow:inset -3px 0 0 var(--sel) }
.quote-grid thead .gutter { z-index:8 }
.quote-grid th.corner { cursor:pointer; font-size:9px; color:var(--color-border-secondary) }
.quote-grid thead th.corner { background:var(--column-head-coordinate); color:var(--column-head-muted); border-bottom:1px solid var(--column-head-border) }
.quote-grid .sticky { position:sticky; z-index:2 }
.quote-grid thead .sticky { z-index:7 }
.quote-grid .sticky-edge { border-right:2px solid var(--freeze-line) }
.quote-grid td.frozen-row-edge,.quote-grid th.frozen-row-edge { border-bottom:2px solid var(--freeze-line) }
/* 冻结边界：粗线从表头贯通到底；表格滚动后边界外侧淡入独立的渐变投影层（不占用单元格阴影，避免与选中框冲突） */
.grid-scroll-host { position:relative }
.freeze-shadow { position:absolute; z-index:6; pointer-events:none; opacity:0; transition:opacity .16s ease }
#freezeShadowX { width:10px; background:linear-gradient(90deg,var(--freeze-shadow),transparent) }
#freezeShadowY { height:10px; background:linear-gradient(180deg,var(--freeze-shadow),transparent) }
.grid-scroll.scrolled-x ~ #freezeShadowX,.grid-scroll.scrolled-y ~ #freezeShadowY { opacity:1 }

/* 默认字段配色独立于当前身份；权限仍由服务端和 canEdit 校验。 */
.quote-grid td { cursor:cell; background-image:var(--cell-data-image,none) }
.quote-grid td.editable { background-color:var(--cell-editable) }
.quote-grid td.calculated { background-color:var(--cell-calculated); color:var(--cell-calculated-text) }
.quote-grid td.locked { background-color:var(--cell-locked); color:var(--cell-locked-text) }
.quote-grid td.na { background-color:var(--color-na); --cell-data-image:repeating-linear-gradient(135deg,var(--color-na) 0 5px,var(--color-na-stripe) 5px 6px); color:transparent }
/* 单元格文字默认居中（数字同样居中，保留等宽数字便于对位） */
.quote-grid tbody td { text-align:center }
.quote-grid tbody .add-row td { text-align:left }
.quote-grid td.numeric { text-align:center; font-variant-numeric:tabular-nums }
.quote-grid td.name-cell { font-weight:600 }
.quote-grid td.warn { background-color:var(--color-warning-soft); color:var(--color-warning) }
.cell-warning { color:var(--color-warning); font-style:normal; margin-right:3px }
.quote-grid td.in-range { background-image:linear-gradient(var(--sel-fill),var(--sel-fill)),var(--cell-data-image,none) }
.quote-grid td.in-range.active { background-image:var(--cell-data-image,none) }


/* 分组行与插入行 */
.quote-grid .section-row th { height:24px; background:var(--section-row-bg); color:var(--section-row-text); font-size:11.5px; font-weight:650; text-align:left; overflow:visible; border-top:1px solid var(--section-row-border) }
.quote-grid .section-row.purchased th { background:var(--section-row-bg); color:var(--section-row-text) }
.quote-grid .section-row th.gutter { background:var(--grid-head) }
.quote-grid .section-label span { position:sticky; left:48px }
.quote-grid .add-row td { height:24px; background:var(--color-background-primary); overflow:visible }
.quote-grid .add-row th { height:24px }
.add-inline { position:sticky; left:48px; border:0; background:transparent; padding:2px 6px; border-radius:5px; font-size:11.5px; color:var(--color-accent) }
.add-inline:hover { background:var(--color-background-tertiary) }
.quote-grid td.empty { height:60px; text-align:center; color:var(--color-text-tertiary) }

/* 合计行：贴底常驻 */
.quote-grid tfoot { position:sticky; bottom:0; z-index:5 }
.quote-grid tfoot td,.quote-grid tfoot th { height:28px; background:var(--color-summary); border-top:1px solid var(--color-summary-border); border-bottom:0; overflow:visible }
.foot-sticky { position:sticky; left:48px; display:inline-flex; align-items:center; gap:6px; color:var(--color-text-secondary); font-size:11.5px }
.foot-sticky b { color:var(--color-text-primary); font-variant-numeric:tabular-nums }
.foot-sticky i { width:1px; height:12px; margin:0 8px; background:var(--color-border-secondary) }

/* 浮在单元格上的编辑框：空闲时透明并保持焦点，用来接键盘和输入法 */
.cell-editor {
  position:absolute; left:0; top:0; width:10px; height:26px; z-index:9; margin:0; padding:0 6px;
  border:0; outline:none; background:var(--color-background-primary); color:var(--color-text-primary); font-size:12px;
  opacity:0; pointer-events:none; caret-color:transparent;
}
.cell-editor.open { opacity:1; pointer-events:auto; caret-color:auto; box-shadow:inset 0 0 0 2px var(--sel) }

/* 机台格：可选列表的小箭头 */
.quote-grid td.has-list { padding-right:20px; position:relative }
.quote-grid td.has-list::after { content:""; position:absolute; right:7px; top:50%; width:5px; height:5px; margin-top:-4px; border-right:1.5px solid var(--color-text-tertiary); border-bottom:1.5px solid var(--color-text-tertiary); transform:rotate(45deg) }
.quote-grid td.has-list:hover::after { border-color:var(--color-text-primary) }

/* ---------- 行操作：行号边缘拖动、落点提示、右键菜单、确认框 ---------- */
.quote-grid .rowhead { position:sticky }

body.row-dragging-on,body.row-dragging-on * { cursor:grabbing !important; user-select:none }
.quote-grid tr.row-dragging td,.quote-grid tr.row-dragging th { opacity:.45 }
.quote-grid tr.row-drop-target td { background:var(--color-background-tertiary) }
.dd-item.danger .dd-text { color:var(--color-danger) }
.dd-item.danger.hot { background:var(--color-danger-soft) }
.button.danger { background:var(--color-danger); border-color:transparent; color:var(--color-background-primary) }
.button.danger:hover { background:var(--color-danger-hover) }
.confirm-mask { position:fixed; inset:0; z-index:80; display:grid; place-items:center; background:rgba(0,0,0,.18); animation:fadeIn .12s ease }
.confirm-box { width:min(380px,calc(100vw - 32px)); padding:18px 18px 14px; border-radius:var(--radius-lg); background:var(--color-background-primary); box-shadow:var(--shadow-popover) }
.confirm-box h3 { margin:0 0 10px; font-size:15px; font-weight:650 }
.confirm-box ul { margin:0; padding:8px 10px; list-style:none; border-radius:8px; background:var(--color-background-tertiary); font-size:12.5px; line-height:1.8; color:var(--color-text-secondary); max-height:200px; overflow:auto }
.confirm-box p { margin:10px 0 0; font-size:11.5px; color:var(--color-text-tertiary) }
.confirm-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px }
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

/* ---------- 自定义下拉框 ---------- */
.native-hidden { display:none !important }
.dd-btn {
  display:inline-flex; align-items:center; gap:8px; height:28px; min-width:0; max-width:100%; padding:0 9px 0 10px;
  border:1px solid var(--color-border-tertiary); border-radius:var(--radius-md); background:var(--color-background-primary);
  color:var(--color-text-primary); font-size:12px; text-align:left; cursor:pointer; transition:border-color .12s,box-shadow .12s;
}
.dd-btn:hover { border-color:var(--color-border-secondary) }
.dd-btn:focus-visible,.dd-btn[aria-expanded="true"] { outline:none; border-color:var(--color-accent); box-shadow:0 0 0 3px var(--color-accent-soft) }
.dd-btn:disabled { opacity:.55; cursor:default; background:var(--color-background-tertiary) }
.dd-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.dd-chevron { flex:none; color:var(--color-text-tertiary); transition:transform .15s }
.dd-btn[aria-expanded="true"] .dd-chevron { transform:rotate(180deg); color:var(--color-accent) }
.dd-menu {
  position:fixed; z-index:60; max-height:min(320px,60vh); max-width:min(480px,calc(100vw - 16px)); overflow-y:auto; padding:4px;
  background:var(--color-background-primary); border:1px solid var(--color-border-tertiary); border-radius:10px; box-shadow:var(--shadow-popover); font-size:12px;
}
.dd-item { display:flex; align-items:center; gap:6px; height:28px; padding:0 10px 0 4px; border-radius:6px; color:var(--color-text-primary); cursor:pointer; white-space:nowrap }
.dd-item.hot { background:var(--color-background-tertiary) }
.dd-item.selected { background:var(--color-accent-soft) }
.dd-item.selected .dd-text { font-weight:600; color:var(--color-accent) }
.dd-check { width:16px; flex:none; text-align:center; color:var(--color-accent); font-size:11px }
.dd-text { flex:1; overflow:hidden; text-overflow:ellipsis }
.dd-hint { margin-left:16px; color:var(--color-text-tertiary); font-variant-numeric:tabular-nums }
.dd-empty { padding:8px 12px; color:var(--color-text-tertiary) }

/* 状态栏 */
.grid-bottom { flex:0 0 24px; display:flex; align-items:center; gap:14px; padding:0 12px; border-top:1px solid var(--color-border-tertiary); background:var(--color-background-tertiary); font-size:11px; color:var(--color-text-tertiary) }
.legends { display:flex; align-items:center; white-space:nowrap }
.legend { display:inline-block; width:10px; height:10px; margin:0 4px 0 10px; border:1px solid var(--color-border-secondary); vertical-align:-1px }
.legend:first-child { margin-left:0 }
.legend.editable { background:var(--cell-editable) }
.legend.calculated { background:var(--cell-calculated) }
.legend.locked { background:var(--cell-locked) }
.legend.na { background:repeating-linear-gradient(135deg,var(--color-na) 0 2px,var(--color-na-stripe) 2px 3px) }
.selection-stats { color:var(--color-text-secondary); font-variant-numeric:tabular-nums }

/* 飞书式个人视图与协作控件 */
.sheet-tool { flex:none; min-height:28px; padding:0 9px; font-size:12px; white-space:nowrap }
#issuesButton.has-issues { color:var(--color-warning); background:var(--color-warning-soft) }
.sheet-popover { position:fixed; z-index:80; width:min(300px,calc(100vw - 16px)); padding:14px; background:var(--color-background-primary); border:1px solid var(--color-border-tertiary); border-radius:10px; box-shadow:0 12px 32px var(--color-shadow-tint); font-size:12px; color:var(--color-text-primary) }
#columnPanel { top:135px; right:150px; max-height:min(520px,70vh); overflow:auto }
.column-menu { width:250px }
.find-panel { top:133px; right:16px; width:335px }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:10px }
.panel-head strong { font-size:14px }
.panel-head button { border:0; background:transparent; font-size:20px; line-height:20px; color:var(--color-text-secondary); cursor:pointer }
.sheet-popover p { color:var(--color-text-secondary); line-height:1.5; margin:8px 0 }
.sheet-popover label { display:block; margin:10px 0; color:var(--color-text-secondary) }
.sheet-popover label>input[type=search],.sheet-popover label>input[type=text] { display:block; box-sizing:border-box; width:100%; height:30px; margin-top:5px; padding:0 9px; border:1px solid var(--color-border-tertiary); border-radius:6px; background:var(--color-background-primary); color:var(--color-text-primary) }
.panel-actions { display:flex; flex-direction:column; gap:3px }
.panel-actions.inline { flex-direction:row; flex-wrap:wrap }
.panel-actions button { border:0; background:var(--color-background-tertiary); border-radius:5px; padding:7px 9px; text-align:left; color:var(--color-text-primary); cursor:pointer }
.panel-actions button:hover { background:var(--color-background-tertiary) }
.column-choices { display:grid; grid-template-columns:1fr 1fr; gap:4px; max-height:360px; overflow:auto; margin:8px 0 12px }
.column-choices label { display:flex; align-items:center; gap:6px; margin:0; padding:4px 2px; white-space:nowrap; color:var(--color-text-primary) }
.column-choices span { overflow:hidden; text-overflow:ellipsis }
.cell-details-panel { position:fixed; z-index:75; top:0; right:0; bottom:0; width:min(340px,100vw); box-sizing:border-box; padding:18px; background:var(--color-background-primary); border-left:1px solid var(--color-border-tertiary); box-shadow:-10px 0 28px var(--color-shadow-tint); overflow-y:auto; font-size:12px }
.cell-details-panel h4 { font-size:12px; color:var(--color-text-secondary); margin:18px 0 8px }
.detail-entry { border-bottom:1px solid var(--color-border-tertiary); padding:8px 0 }
.detail-entry b { color:var(--color-text-primary) }
.detail-entry time { display:block; color:var(--color-text-tertiary); font-size:10px; margin-top:2px }
.detail-entry p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.5; margin:6px 0 0 }
.detail-empty { color:var(--color-text-tertiary) }
#commentForm { margin-top:20px; display:flex; flex-direction:column; gap:7px }
#commentForm textarea { box-sizing:border-box; width:100%; padding:8px; border:1px solid var(--color-border-tertiary); border-radius:6px; font:inherit; resize:vertical }
#commentForm button { align-self:flex-end }
[hidden] { display:none !important }

/* 常用工具和表格显示；定位规则与冻结表头分别处理。 */
.format-toolbar { flex:none; display:flex; align-items:center; gap:3px; min-height:40px; padding:3px 12px; border-bottom:1px solid var(--color-border-tertiary); background:var(--color-background-tertiary); overflow-x:auto; scrollbar-width:thin }
.tool-btn { flex:none; height:28px; padding:0 7px; border:0; border-radius:5px; background:transparent; color:var(--color-text-secondary); font:inherit; font-size:12px; white-space:nowrap; cursor:pointer }
.tool-btn.icon { min-width:26px; padding:0 6px; font-size:15px }
.tool-btn:hover { background:var(--color-background-tertiary); color:var(--color-text-primary) }
.tool-btn.on { background:var(--color-accent-soft); color:var(--color-accent) }
.tool-btn:disabled { opacity:.4; cursor:default }
.format-toolbar select { flex:none; height:27px; padding:0 5px; max-width:104px; border:1px solid transparent; border-radius:4px; font:inherit; font-size:12px; background:transparent; color:var(--color-text-secondary) }
.format-toolbar select:hover { border-color:var(--color-focus-ring) }
.tool-divider { flex:none; width:1px; height:20px; background:var(--color-background-tertiary); margin:0 5px }
.color-tool { position:relative; display:inline-flex; align-items:center; justify-content:center; flex:none; width:27px; height:27px; border-radius:4px; cursor:pointer; font-size:16px }
.color-tool input { position:absolute; left:4px; bottom:0; width:19px; height:6px; padding:0; border:0; background:transparent; cursor:pointer }
.color-tool input::-webkit-color-swatch-wrapper { padding:0 }
.color-tool input::-webkit-color-swatch { border:0 }
.cell-address { box-sizing:border-box; border:0; border-right:1px solid var(--color-border-tertiary); border-radius:0; background:var(--color-background-primary); outline:none; min-width:0; font:inherit; text-align:center }
.cell-address:focus { box-shadow:inset 0 0 0 2px var(--sel) }
.quote-grid { font-size:calc(12px * var(--sheet-scale,1)) }
.quote-grid tbody td,.quote-grid tbody .rowhead { height:calc(var(--row-height,26px) * var(--sheet-scale,1)); vertical-align:middle }
.quote-grid .h-letter th { font-size:calc(10px * var(--sheet-scale,1)) }
.quote-grid .h-label th { font-size:calc(11px * var(--sheet-scale,1)) }
.quote-grid td.frozen-row,.quote-grid th.frozen-row { position:sticky; z-index:4 }
.quote-grid td.frozen-intersection,.quote-grid th.frozen-intersection { z-index:5 }
.fill-handle { position:absolute; z-index:10; box-sizing:border-box; width:10px; height:10px; padding:0; background:var(--sel); border:2px solid var(--color-background-primary); border-radius:0; cursor:crosshair; box-shadow:none }
body.filling-on,body.filling-on * { cursor:crosshair!important; user-select:none!important }
.cell-photo { display:inline-block; max-width:28px; height:22px; object-fit:contain; vertical-align:middle; cursor:pointer; border-radius:3px }
.asset-count { margin-left:3px; font-size:9px; color:var(--color-text-tertiary) }
.rich-panel { width:310px; max-height:70vh; overflow:auto }
.rich-panel select { box-sizing:border-box; display:block; width:100%; height:30px; padding:0 8px; margin-top:5px; border:1px solid var(--color-focus-ring); border-radius:5px; background:var(--color-background-primary); color:var(--color-text-primary) }
.preset-row,.condition-row { display:flex; align-items:center; gap:6px; margin:5px 0; padding:6px; border-radius:5px; background:var(--color-background-tertiary) }
.preset-row button,.condition-row button { border:0; background:transparent; cursor:pointer; color:var(--color-text-secondary); font:inherit }
.preset-row button:first-child { flex:1; text-align:left; padding:4px }
.condition-row span { flex:1; font-size:11px; overflow-wrap:anywhere }
.condition-row i { flex:none; width:13px; height:13px; border:1px solid var(--color-focus-ring); border-radius:2px }
.rule-color input { vertical-align:middle; margin-left:10px; border:0; width:38px; height:23px }
.value-filter-head { display:flex; align-items:center; gap:5px; margin-top:12px; padding-bottom:5px; color:var(--color-text-secondary); font-size:11px }
.value-filter-head span { flex:1 }.value-filter-head button { border:0; padding:2px 3px; background:transparent; color:var(--color-accent); cursor:pointer; font-size:11px }
.value-filter-list { max-height:150px; overflow:auto; border:1px solid var(--color-border-tertiary); border-radius:5px; padding:4px }
.value-filter-list label { display:flex; align-items:center; gap:5px; margin:0; padding:4px 2px }
.value-filter-list span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.asset-card { margin:14px 0; padding:10px; border:1px solid var(--color-border-tertiary); border-radius:8px; display:flex; flex-direction:column; gap:7px }
.asset-card img { max-width:100%; max-height:210px; object-fit:contain; display:block; margin:auto }
.asset-card a { color:var(--color-accent); text-decoration:none; overflow-wrap:anywhere }
.asset-card small { color:var(--color-text-tertiary) }
.asset-file-icon { font-size:28px }
.asset-upload { display:block; text-align:center; border:1px dashed var(--color-accent); border-radius:6px; padding:12px; color:var(--color-accent); cursor:pointer }
.asset-upload input { display:block; width:100%; font-size:11px; margin-top:8px }
.grid-bottom #densitySelect { font:inherit; background:transparent; border:0; color:var(--color-text-tertiary); max-width:90px }
.zoom-btn { border:0; background:transparent; color:var(--color-text-secondary); font-size:15px; padding:0 4px; cursor:pointer }.grid-bottom { gap:8px }
.analysis-body { padding:0 24px 28px; overflow:auto }
.analysis-metrics { display:flex; gap:16px; margin-bottom:20px }.analysis-metrics article { flex:1; background:var(--color-background-tertiary); border:1px solid var(--color-border-tertiary); padding:18px; border-radius:10px }.analysis-metrics small { display:block; color:var(--color-text-tertiary) }.analysis-metrics strong { display:block; font-size:28px; margin-top:7px; color:var(--color-text-primary) }
.analysis-columns { display:grid; grid-template-columns:1fr 1.3fr; gap:20px }.chart-card { padding:20px; background:var(--color-background-primary); border:1px solid var(--color-focus-ring); border-radius:10px }.chart-card h3 { margin:0 0 18px; font-size:14px; color:var(--color-text-primary) }.stacked-cost { display:flex; height:32px; border-radius:6px; overflow:hidden; margin-bottom:22px }.chart-legend { display:flex; align-items:center; gap:8px; margin:12px 0; font-size:12px; color:var(--color-text-secondary) }.chart-legend i { width:10px; height:10px; border-radius:2px }.chart-legend span { flex:1 }.chart-legend small { width:50px; text-align:right; color:var(--color-text-tertiary) }
.cost-rank { display:flex; align-items:center; gap:10px; width:100%; border:0; padding:7px 0; background:transparent; font:inherit; font-size:12px; color:var(--color-text-secondary); cursor:pointer }.cost-rank:hover { background:var(--color-background-tertiary) }.cost-rank>span { width:110px; flex:none; text-align:left; white-space:nowrap; text-overflow:ellipsis; overflow:hidden }.cost-rank>i { flex:1; height:13px; background:var(--color-background-tertiary); border-radius:3px; overflow:hidden }.cost-rank em { display:block; height:100%; background:var(--color-chart-1) }.cost-rank b { width:52px; text-align:right; font-weight:500 }
@media(max-width:800px){.analysis-columns { grid-template-columns:1fr }.format-toolbar { padding:3px 8px }.analysis-body { padding:0 12px 18px }.analysis-metrics { gap:6px }.analysis-metrics article { padding:10px }.analysis-metrics strong { font-size:20px }}
@media print {
 @page { size:A3 landscape; margin:10mm }
 html,body,.workspace,.sheets,.sheet { height:auto!important; overflow:visible!important; min-height:0!important }
 .appbar,.quote-switch,.appbar-actions,.sheet-toolbar,.format-toolbar,.formula-bar,.sheet-tabs,.grid-bottom,.cell-editor,.fill-handle,.sheet-popover,.cell-details-panel,#toast { display:none!important }
 .sheet:not(.active) { display:none!important }.sheet.active { display:block!important }
 .grid-scroll { overflow:visible!important; height:auto!important }.quote-grid { width:100%!important; font-size:8px!important }
 .quote-grid th,.quote-grid td { position:static!important; left:auto!important; top:auto!important; white-space:normal!important; height:auto!important; padding:3px!important }
 .quote-grid thead { position:static!important; display:table-header-group!important }.quote-grid tfoot { position:static!important; display:table-footer-group!important }
 .head-menu,.col-resize,.add-row { display:none!important }.quote-grid td.active { box-shadow:none!important }.quote-grid tr { break-inside:avoid }.quote-bar { padding:0 0 12px!important }.quote-right { margin-left:auto }
}
@media(max-width:900px){.sheet-toolbar .sheet-tool { padding:0 6px }.find-panel { top:180px }}
@media(max-width:620px){#columnPanel { top:185px; right:8px }.find-panel { top:185px; right:8px }}

/* ---------- Mac 风格功能导航：应用层级，与明细表分开 ---------- */
.workspace-body { flex:1; min-height:0; display:flex; overflow:hidden }
.workspace-content { flex:1; min-width:0; min-height:0; display:flex; flex-direction:column }
.sheet-tabs { flex:0 0 166px; display:flex; flex-direction:column; gap:22px; padding:18px 10px; overflow-y:auto; background:linear-gradient(145deg,#f3f5f8,#edf0f4); border-right:1px solid var(--color-border-tertiary) }
.nav-group { display:flex; flex-direction:column; gap:4px }
.nav-group h2 { margin:0 0 5px; padding:0 10px; font-size:10px; font-weight:600; color:var(--color-text-tertiary); letter-spacing:.4px }
.sheet-tab { display:flex; align-items:center; gap:9px; width:100%; min-height:36px; border:0; border-radius:8px; background:transparent; padding:8px 10px; font-size:12px; color:var(--color-text-secondary); text-align:left; white-space:nowrap }
.sheet-tab:hover { background:rgba(36,48,66,.055) }
.sheet-tab.active { background:var(--color-accent-soft); color:var(--color-accent); font-weight:600; box-shadow:0 1px 2px rgba(36,48,66,.04) }
.nav-icon { flex:0 0 17px; width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round }
.nav-label { min-width:0 }
.nav-label small { display:block; margin-top:3px; color:var(--color-text-tertiary); font-size:10px; font-weight:400 }
.sheet-tab .nav-count { margin-left:auto; padding:1px 5px; border-radius:5px; background:rgba(36,48,66,.055); color:var(--color-text-secondary); font-size:10px; font-weight:500; font-variant-numeric:tabular-nums }
.nav-caption { margin-top:auto; padding:0 10px; font-size:10px; line-height:1.7; color:var(--color-text-tertiary) }
.workspace-status { flex:0 0 28px; display:flex; align-items:stretch; border-top:1px solid var(--color-border-tertiary); background:var(--color-background-secondary) }
.status-caption { align-self:center; padding-left:12px; color:var(--color-text-tertiary); font-size:10px }
.tab-spacer { flex:1 }
.autosave { display:flex; align-items:center; padding:0 12px; font-size:11px; background:var(--color-success-soft); color:var(--color-success); white-space:nowrap }
.autosave.saving { background:transparent; color:var(--color-text-secondary) }
.autosave.error { background:var(--color-danger-soft); color:var(--color-danger) }
.help-button { border:0; border-left:1px solid var(--color-border-tertiary); background:transparent; padding:0 12px; font-size:11.5px; color:var(--color-text-secondary) }
.help-button:hover { background:var(--color-background-tertiary) }
.help-panel { position:fixed; right:12px; bottom:40px; z-index:40; width:380px; padding:14px 16px; background:var(--color-background-primary); border-radius:var(--radius-lg); box-shadow:var(--shadow-popover); font-size:12px; color:var(--color-text-secondary) }
.help-panel h3 { margin:0 0 8px; font-size:13px; color:var(--color-text-primary) }
.help-panel dl { display:grid; grid-template-columns:auto 1fr; gap:5px 12px; margin:0 }
.help-panel dt { font-family:"SF Mono",Menlo,Consolas,monospace; font-size:11px; color:var(--color-text-primary); white-space:nowrap }
.help-panel dd { margin:0 }
.help-panel p { margin:10px 0 0; color:var(--color-text-tertiary); font-size:11px }

/* ---------- 其他工作表 ---------- */
.simple-head { padding:18px 24px 14px; border-bottom:1px solid var(--color-border-tertiary) }
.simple-head h2 { margin:0 0 4px; font-size:16px; font-weight:650 }
.simple-head p { margin:0; font-size:12px; color:var(--color-text-tertiary) }
.simple-table-wrap { padding:20px 24px; max-width:760px }
.simple-table,.summary-table { width:100%; border-collapse:collapse; font-size:12.5px }
.simple-table th,.summary-table th { text-align:left; padding:9px 12px; background:var(--column-head-label); color:var(--column-head-text); font-weight:600 }
.simple-table td,.summary-table td { padding:9px 12px; border-bottom:1px solid var(--color-border-tertiary) }
.simple-table td:last-child { color:var(--color-text-primary) }
.summary-layout { display:grid; grid-template-columns:minmax(560px,800px) 260px; gap:24px; padding:20px 24px }
.summary-table .right { text-align:right; font-variant-numeric:tabular-nums }
.summary-table input { width:88px; height:28px; box-sizing:border-box; padding:0 8px; border:0; border-radius:6px; background:var(--color-background-tertiary); color:var(--color-text-primary); text-align:center; font:inherit; font-size:13px; font-weight:600; font-variant-numeric:tabular-nums; transition:background-color .12s ease,box-shadow .12s ease; -moz-appearance:textfield; appearance:textfield }
.summary-table input::-webkit-outer-spin-button,.summary-table input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0 }
.summary-table input:hover:not(:disabled) { background:var(--color-accent-soft) }
.summary-table input:focus { outline:none; background:#fff; box-shadow:0 0 0 1.5px var(--color-accent),0 0 0 4px var(--color-accent-soft) }
.summary-table input:disabled { field-sizing:content; width:auto; min-width:1ch; padding:0 4px 0 0; text-align:left; background:transparent; color:var(--color-text-primary); cursor:default; -webkit-text-fill-color:var(--color-text-primary); opacity:1 }
.summary-table tfoot th { background:var(--color-summary); color:var(--color-text-primary); font-size:14px }
.summary-aside { height:fit-content; padding:16px; border:1px solid var(--color-border-tertiary); border-radius:var(--radius-lg); font-size:12px; line-height:1.65; color:var(--color-text-secondary) }
.summary-aside h3 { margin:0 0 8px; font-size:13px; color:var(--color-text-primary) }
.notice { margin-top:14px; padding:10px; border-left:3px solid var(--color-accent); background:var(--color-background-tertiary) }
.history-body { max-width:760px; padding:14px 24px }
.history-body h3 { font-size:13px; margin:6px 0 }
.history-item { padding:10px 0; border-bottom:1px solid var(--color-border-tertiary); font-size:12px; color:var(--color-text-secondary) }
.history-item time { display:block; margin-top:3px; font-size:10.5px; color:var(--color-text-tertiary) }

#toast { position:fixed; left:50%; bottom:46px; z-index:50; transform:translate(-50%,8px); opacity:0; pointer-events:none; padding:8px 16px; border-radius:999px; background:var(--color-text-primary); color:var(--color-background-primary); font-size:12px; box-shadow:var(--shadow-popover); transition:opacity .18s,transform .18s; max-width:80vw }
#toast.show { opacity:1; transform:translate(-50%,0) }

/* ---------- 窄屏 ---------- */
@media (max-width:1100px) {
  .quote-id h1 { max-width:300px }
}
@media (max-width:900px) {
  .identity small,.local-badge { display:none }
  .group-label { display:none }
  .sheet-toolbar .search-wrapper { width:220px }
  .summary-layout { grid-template-columns:minmax(0,1fr) }
  .help-button { display:none }
}
/* 格式工具栏并入后，搜索与分组这一行在中等宽度下收紧，再窄时折成两行 */

@media (max-width:1259px) and (min-width:621px) {
  .sheet-toolbar { flex-wrap:wrap; flex-basis:auto; padding:8px 12px 10px; row-gap:14px !important }
  .sheet-toolbar .sheet-actions { margin-left:auto }
}
@media (max-width:620px) {
  .workspace { height:auto; min-height:100dvh; overflow:visible }
  .appbar { padding:0 10px }
  .role-label { display:none }
  #roleSelectButton { max-width:120px }
  .quote-bar { padding:8px 10px; gap:8px }
  .quote-id h1 { max-width:none; white-space:normal; font-size:14px }
  .quote-right { margin-left:0; width:100%; justify-content:space-between; flex-wrap:wrap; gap:8px }
  .quote-switch { width:100%; flex-wrap:wrap }
  #quoteSelectButton { flex:1 1 0; min-width:0; max-width:none }
  .quote-id { width:100% }
  .quote-id p { white-space:normal }
  .sheet-toolbar { flex-basis:auto; flex-wrap:wrap; padding:8px 10px; gap:8px }
  .search-wrapper { flex:1; width:auto }
  .toolbar-separator,.toolbar-spacer { display:none }
  .sheet-toolbar .group-nav { flex:0 0 100%; overflow-x:auto; scrollbar-width:none }
  .sheet-toolbar .group-jump { flex:0 0 auto }
  .seg-fill { display:none }
  .sheet-toolbar .search-wrapper { flex:1; width:auto }
  .grid-scroll { flex:none; height:62dvh }
  .legends { display:none }
  .autosave { display:none }
  .sheet-tabs { overflow-x:auto }
  .summary-layout { display:block; padding:14px; overflow-x:auto }
  .summary-aside { margin-top:14px }
}

.sheet-input-dialog{border:1px solid var(--line);border-radius:12px;width:min(420px,90vw);padding:24px;color:var(--ink);box-shadow:0 20px 70px var(--color-shadow-tint)}.sheet-input-dialog::backdrop{background:var(--color-shadow-tint)}.sheet-input-dialog h3{margin:0 0 18px}.sheet-input-dialog label{display:block;font-size:13px;margin:14px 0}.sheet-input-dialog input{display:block;width:100%;margin-top:8px;padding:10px;border:1px solid var(--line);border-radius:6px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}

/* 报价工作优先：常用工具常驻，低频工具渐进展开。 */
.tool-btn,.button,.dd-btn{transition:background-color .12s ease,color .12s ease,box-shadow .12s ease;cursor:pointer}
.tool-btn:active:not(:disabled),.button:active:not(:disabled){box-shadow:inset 0 0 0 1px var(--color-focus-ring)}
.tool-btn:focus-visible,.button:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}
.format-toolbar{gap:5px;background:var(--color-background-primary);min-height:38px}
.alignment-buttons{display:flex;border-radius:6px;gap:2px;background:var(--color-background-tertiary);padding:2px}
.alignment-buttons [data-align]{font-size:0;width:26px;height:26px;position:relative}
.alignment-buttons [data-align]::after{content:'';display:block;width:15px;height:13px;background:linear-gradient(currentColor,currentColor) 0 0/15px 1.5px no-repeat,linear-gradient(currentColor,currentColor) 0 4px/10px 1.5px no-repeat,linear-gradient(currentColor,currentColor) 0 8px/15px 1.5px no-repeat,linear-gradient(currentColor,currentColor) 0 12px/10px 1.5px no-repeat}
.alignment-buttons [data-align=center]::after{background-position:center 0,center 4px,center 8px,center 12px}
.alignment-buttons [data-align=right]::after{background-position:right 0,right 4px,right 8px,right 12px}
.more-tools{margin-left:auto}.more-tool-group{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:8px 0 18px}.more-tools-panel small{color:var(--color-text-tertiary);font-size:11px}.more-tool-group select{display:inline-block;width:auto;margin:0}.more-tools-panel{animation:popover-in .12s ease-out}.sheet-popover:not([hidden]),.dd-menu:not([hidden]){animation:popover-in .12s ease-out}
.dd-item{height:32px;padding:0 10px;gap:9px;transition:background-color .1s ease}.dd-check{width:18px;color:var(--color-text-secondary);text-align:center}.dd-item.menu-section{border-top:1px solid var(--color-border-tertiary);margin-top:5px;padding-top:5px;height:38px;border-radius:0 0 6px 6px}.dd-menu{padding:6px;border:1px solid var(--color-focus-ring);box-shadow:0 8px 28px var(--color-shadow-tint)}.dd-hint{font-size:11px;color:var(--color-text-tertiary)}
@keyframes popover-in{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.basic-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:10px 20px}.basic-actions label{font-size:12px;display:flex;gap:6px;align-items:center}.rate-input{width:130px;padding:6px;border:1px solid var(--color-border-tertiary);border-radius:4px}.basic-dialog{border:1px solid var(--color-border-tertiary);border-radius:8px;width:min(850px,92vw);max-height:88vh;overflow:auto;padding:20px;color:var(--color-text-primary)}.basic-dialog::backdrop{background:var(--color-shadow-tint)}.basic-dialog p{font-size:13px;line-height:1.7}.basic-dialog .basic-actions{padding:12px 0}.basic-dialog input,.basic-dialog select{padding:6px;border:1px solid var(--color-border-tertiary);border-radius:4px}.import-mapping{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.import-mapping label{font-size:12px;display:flex;flex-direction:column;gap:5px}.import-mapping select{max-width:100%}.import-error{color:var(--color-danger)}.backup-row{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--color-focus-ring);padding:12px 0;gap:10px}.backup-row small{display:block;color:var(--color-text-tertiary);font-size:11px}@media(max-width:620px){.import-mapping{grid-template-columns:1fr}.backup-row{font-size:11px;overflow-wrap:anywhere}}

.permission-option{display:inline-flex;align-items:center;gap:6px;margin:8px 16px 8px 0;min-width:130px}.permission-option input{width:auto}#permissionFields fieldset{margin:12px 0;border:1px solid var(--color-border-tertiary);padding:12px}

.column-protection{border-bottom:1px solid var(--color-border-tertiary);padding:0 0 12px;margin-bottom:12px}.column-protection p{margin:6px 0;font-size:12px}.column-protection small{display:block;color:var(--color-text-secondary);line-height:1.5;margin-top:6px}

/* 字母与操作独立一行，字段名使用完整列宽。 */
.head-text{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;line-height:1.35}
.head-label{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.head-unit{font-size:calc(10px * var(--sheet-scale,1));font-weight:400;color:var(--column-head-muted)}
.head-lock{position:absolute;right:calc(100% + 3px * var(--sheet-scale,1));top:50%;transform:translateY(-50%);display:inline-flex;width:calc(12px * var(--sheet-scale,1));height:calc(13px * var(--sheet-scale,1));color:var(--color-text-tertiary)}
.head-lock svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
/* 锁放在字段名前，跟随文字 */
.head-label .head-lock{position:static;transform:none;vertical-align:calc(-1px * var(--sheet-scale,1));margin-right:calc(3px * var(--sheet-scale,1))}
/* 独立列筛选框 */
.filter-panel { width:min(280px,calc(100vw - 16px)); padding:12px; max-height:calc(100vh - 16px); overflow:auto; font-size:12px }
.filter-sort { display:flex; margin:2px 0 8px }
.filter-sort button { flex:1; height:30px; border:1px solid var(--color-border-tertiary); background:var(--color-background-primary); font:inherit; font-weight:600; color:var(--color-text-primary) }
.filter-sort button:first-child { border-radius:7px 0 0 7px }.filter-sort button:last-child { border-radius:0 7px 7px 0 }
.filter-sort button[aria-pressed=true] { border-color:var(--color-accent); background:var(--color-accent-soft); color:var(--color-accent) }
.filter-tabs { display:flex; border-bottom:1px solid var(--color-border-tertiary); margin-bottom:8px }
.filter-tabs button { flex:1; position:relative; border:0; height:30px; background:none; font:inherit; color:var(--color-text-primary) }
.filter-tabs button[aria-selected=true] { color:var(--color-accent); font-weight:600 }
.filter-tabs button[aria-selected=true]::after { content:''; position:absolute; bottom:-1px; left:25%; right:25%; height:3px; border-radius:3px 3px 0 0; background:var(--color-accent) }
#filterValueSearch,#filterConditionValue,.filter-panel select { box-sizing:border-box; width:100%; height:30px; padding:0 10px; border:1px solid var(--color-border-tertiary); border-radius:7px; font:inherit; background:var(--color-background-primary); color:var(--color-text-primary) }
.filter-panel input:focus,.filter-panel select:focus { outline:2px solid var(--color-focus-ring); outline-offset:1px }
.filter-panel .filter-value-row { display:flex; align-items:center; gap:8px; margin:0; padding:6px 4px; color:var(--color-text-primary); cursor:pointer }
.filter-value-row input { margin:0; width:14px; height:14px; accent-color:var(--color-text-primary); flex:none }
.filter-value-row span { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.filter-value-row small { color:var(--color-text-tertiary); font-size:11px; font-variant-numeric:tabular-nums }
.filter-value-row:hover { background:var(--color-background-tertiary); border-radius:5px }
.filter-all { margin-top:4px!important }
#filterValueList { max-height:180px; overflow:auto }
#filterConditionPane { padding-bottom:12px }
#filterConditionPane select { display:block; margin-top:8px }
#filterError { color:var(--color-danger); font-size:12px; min-height:16px; margin:6px 0 }
.filter-footer { border-top:1px solid var(--color-border-tertiary); padding-top:8px }.filter-footer p { font-size:11px; margin:2px 0 6px }
.filter-footer>div { display:flex; align-items:center; gap:6px; padding-top:2px }
.filter-footer button { border:1px solid var(--color-border-tertiary); border-radius:6px; background:var(--color-background-primary); font:inherit; padding:6px 12px; color:var(--color-text-primary) }
#filterClear { margin-right:auto; padding:6px 0; border:0; color:var(--color-text-secondary); font-size:12px }
#filterConfirm { background:var(--color-accent); border-color:var(--color-accent); color:var(--color-background-primary) }
.head-menu.filtered { background:var(--color-accent-soft); box-shadow:0 0 0 1px var(--color-focus-ring);border-radius:4px }

#filterError:empty { display:none }
.filter-panel .panel-head { margin-bottom:6px }
.filter-panel .panel-head strong { font-size:12px }
/* 条件分类菜单 */
.condition-picker { position:relative; margin:8px 0 }
#filterConditionButton { display:flex; align-items:center; justify-content:space-between; width:100%; height:30px; padding:0 9px; font:inherit; border:1px solid var(--color-border-tertiary); border-radius:6px; background:var(--color-background-primary); color:var(--color-text-primary); text-align:left }
#filterConditionButton::after { content:'⌄'; color:var(--color-text-tertiary) }
#filterConditionButton[aria-expanded=true] { border-color:var(--color-accent) }
#filterConditionMenu { position:absolute; top:34px; left:0; right:0; z-index:2; max-height:260px; overflow:auto; padding:4px; border:1px solid var(--color-border-tertiary); border-radius:7px; background:var(--color-background-primary); box-shadow:0 6px 18px var(--color-shadow-tint) }
#filterConditionMenu button { width:100%; display:flex; align-items:center; justify-content:space-between; padding:7px 9px; border:0; border-radius:4px; background:var(--color-background-primary); color:var(--color-text-primary); font:inherit; text-align:left }
#filterConditionMenu button:hover,#filterConditionMenu button:focus-visible { background:var(--color-background-tertiary); color:var(--color-text-primary) }
.condition-inputs { display:flex; align-items:center; gap:6px }
.condition-inputs input { min-width:0; flex:1 }
#filterConditionValueTo { box-sizing:border-box; width:100%; height:30px; padding:0 10px; border:1px solid var(--color-border-tertiary); border-radius:7px; font:inherit }
.filter-panel:has(#filterConditionMenu:not([hidden])) { overflow:visible }
#filterConditionMenu { max-height:200px }

/* 权限提示独立于字段底色。 */
.access-notice { padding:3px 8px; border-radius:4px; background:var(--color-background-tertiary); color:var(--color-text-secondary); font-size:11px; white-space:nowrap }
.access-notice[hidden] { display:none }

/* 原格式工具栏取消后，撤销/重做、冻结、视图、更多、菜单并入搜索与分组这一行右侧 */
.sheet-actions { display:flex; align-items:center; gap:2px; flex:none }
.sheet-actions .sheet-tool.icon { width:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; border:0; background:transparent; color:#667085; border-radius:6px }
.sheet-actions .sheet-tool.icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round }
.sheet-actions .sheet-tool.icon:hover:not(:disabled) { background:var(--color-background-tertiary); color:#344054 }
.sheet-actions .sheet-tool:disabled { opacity:.4; cursor:default }
.sheet-actions .sheet-tool.on { background:var(--color-accent-soft); color:var(--color-accent) }

/* 工具按钮：每个按钮都是独立灰色胶囊（同“全部零件”），彼此留间隔，不做共同底槽，避免与分组滑块混淆 */
.sheet-toolbar .button.sheet-tool:not(.icon) { height:30px; min-height:30px; padding:0 13px; border:2px solid transparent; border-radius:15px; background:var(--color-background-tertiary); color:#344054; font-size:12.5px; font-weight:500; box-shadow:none; transition:background-color .15s ease,border-color .15s ease,color .15s ease }
.sheet-toolbar .button.sheet-tool:not(.icon):hover:not(:disabled) { background:#e7eaef; border-color:transparent; color:#101828 }
.sheet-toolbar .button.sheet-tool:not(.icon)[aria-expanded="true"],.sheet-toolbar .button.sheet-tool:not(.icon):focus-visible { border-color:var(--color-accent); background:var(--color-background-tertiary); outline:none }
.sheet-toolbar .button.sheet-tool.on:not(.icon) { background:var(--color-accent-soft); color:var(--color-accent); font-weight:600 }
.sheet-toolbar .tool-count { margin-left:5px; min-width:16px; height:16px; padding:0 5px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; font-variant-numeric:tabular-nums; color:#667085; background:rgba(118,118,128,.14) }
.sheet-toolbar .has-issues .tool-count { color:#fff; background:var(--color-warning) }
.sheet-toolbar .sheet-actions { margin-left:auto; gap:6px }
.sheet-toolbar .action-gap { width:4px; flex:none }
.sheet-toolbar .dd-btn { flex:none; white-space:nowrap }
.sheet-toolbar .search-wrapper { width:200px; flex:0 1 200px; min-width:140px }
@media (max-width:1499px) {
  .sheet-toolbar { gap:6px; padding-left:12px; padding-right:12px }
  .sheet-toolbar .toolbar-separator { display:none }
  .sheet-toolbar .search-wrapper { width:170px; flex:0 1 170px; min-width:130px }
  .sheet-toolbar .sheet-actions { gap:5px }
}
.sheet-toolbar .group-nav { margin-left:10px }
@media (max-width:620px) { .sheet-toolbar .group-nav { margin-left:0 } }

/* 点击感：按下微缩、松手轻弹回；面板与菜单从按钮处轻弹出现 */
.sheet-toolbar .button,.sheet-toolbar .dd-btn,.formula-bar .button,.sheet-popover .panel-actions button,.sheet-popover .more-tool-group button { transition:transform .24s cubic-bezier(.34,1.56,.64,1),background-color .15s ease,border-color .15s ease,color .15s ease }
.sheet-popover .panel-actions button:active:not(:disabled),.sheet-popover .more-tool-group button:active:not(:disabled) { transform:scale(.97); transition-duration:.07s }
.dd-item:active { background:var(--color-accent-soft) }
@keyframes pop-in { from { opacity:0; transform:translateY(-6px) scale(.96) } to { opacity:1; transform:none } }
@keyframes slide-in-right { from { opacity:0; transform:translateX(18px) } to { opacity:1; transform:none } }
.sheet-popover:not([hidden]),.dd-menu:not([hidden]) { animation:pop-in .18s cubic-bezier(.2,.9,.3,1.15); transform-origin:top center }
.cell-details-panel:not([hidden]) { animation:slide-in-right .2s cubic-bezier(.2,.8,.3,1) }
@media (prefers-reduced-motion:reduce) {
  .sheet-popover:not([hidden]),.dd-menu:not([hidden]),.cell-details-panel:not([hidden]) { animation:none }
}


/* WPS 式按钮：平时无底色无阴影，悬停浅灰圆角底，按下/生效更深的灰；不浮起、不缩放、不回弹 */
.sheet-toolbar .button.sheet-tool:not(.icon),.formula-bar .button { height:30px; min-height:30px; padding:0 10px; border:0; border-radius:6px; background:transparent; color:#344054; font-size:12.5px; font-weight:500; box-shadow:none; transform:none; transition:background-color .12s ease,color .12s ease }
.sheet-toolbar .button.sheet-tool:not(.icon):hover:not(:disabled),.formula-bar .button:hover:not(:disabled) { background:#eceef1; color:#101828 }
.sheet-toolbar .button.sheet-tool:not(.icon):active:not(:disabled),.formula-bar .button:active:not(:disabled),
.sheet-toolbar .button.sheet-tool:not(.icon)[aria-expanded="true"] { background:#e2e5e9; color:#101828; outline:none }
.sheet-toolbar .button.sheet-tool.on:not(.icon) { background:#e2e5e9; color:#101828; font-weight:600 }
.sheet-toolbar .button.sheet-tool:not(.icon):focus-visible { outline:2px solid var(--color-accent); outline-offset:1px }
#issuesButton.has-issues { background:transparent }
#issuesButton.has-issues:hover { background:#eceef1 }
.sheet-actions .sheet-tool.icon { border-radius:6px }
.sheet-actions .sheet-tool.icon:hover:not(:disabled) { background:#eceef1; color:#344054 }
.sheet-actions .sheet-tool.icon:active:not(:disabled) { background:#e2e5e9; transform:none }
.sheet-toolbar .button,.sheet-toolbar .dd-btn,.formula-bar .button { transform:none!important }
.sheet-toolbar .button.add:hover:not(:disabled) { box-shadow:none }
.sheet-toolbar .sheet-actions { gap:2px }

/* 附件在当前报价页面预览与管理 */
.asset-thumbnail { border:0; background:var(--color-background-secondary); padding:8px; border-radius:6px; cursor:zoom-in }
.asset-thumbnail span { display:block; margin-top:6px; font-size:11px; color:var(--color-text-tertiary) }
.asset-name { overflow-wrap:anywhere }
.asset-actions { display:flex; align-items:center; gap:18px }
.asset-actions button { border:0; background:transparent; color:var(--color-text-danger,#c0392b); cursor:pointer; padding:4px }
.asset-upload.disabled { opacity:.55; cursor:default }
.image-preview { width:min(960px,92vw); max-width:92vw; max-height:92vh; padding:16px; border:1px solid var(--color-border-tertiary); border-radius:12px; background:var(--color-background-primary); color:var(--color-text-primary); box-shadow:0 16px 60px #0003 }
.image-preview::backdrop { background:#10182899 }
.image-preview .panel-head strong { overflow-wrap:anywhere; min-width:0 }
.image-preview .panel-head button { flex-shrink:0 }
.image-preview-stage { height:min(66vh,680px); display:flex; flex-direction:column; align-items:center; justify-content:center; background:var(--color-background-secondary); border-radius:6px; margin:12px 0; overflow:hidden }
.image-preview-stage img { max-width:100%; max-height:100%; object-fit:contain }
.image-preview-actions { display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap }
.image-preview-actions button { padding:6px 10px; border:1px solid var(--color-border-tertiary); border-radius:6px; background:var(--color-background-primary); color:inherit; cursor:pointer }
.image-preview-actions button:disabled { opacity:.4; cursor:default }
.image-preview-actions a { color:var(--color-accent); text-decoration:none }

/* 单元格标注 v2：符号放在格子左侧（不与下拉箭头、数字争位置），备注三角在右上角。
   浮层沿用 sheet-popover 外观，按钮沿用工具栏 WPS 式：平时透明，悬停浅灰，选中浅蓝。 */
.quote-grid td[data-r]:not(.sticky):not(.frozen-row){position:relative}
.quote-grid td.has-mark{padding-left:20px;padding-right:20px}
.cell-mark,.cell-note-mark{position:absolute;z-index:1;padding:0;margin:0;border:0;background:none;cursor:pointer;box-shadow:none;line-height:1}
.cell-mark{left:3px;top:calc(50% - 8px);width:16px;height:16px;display:grid;place-items:center;border-radius:4px;font-family:-apple-system,"Segoe UI Symbol",Arial,sans-serif;font-size:12px;font-weight:700}
.cell-mark:hover{background:rgba(255,255,255,.75);box-shadow:0 0 0 1px var(--color-border-tertiary)}
.cell-note-mark{right:0;top:0;width:0;height:0;border-top:8px solid #c98a1e;border-left:8px solid transparent}
.cell-note-mark:hover{border-top-color:#b86a0c}

/* 右键菜单顶部快捷条 */
.ann-quick{padding:4px 4px 8px;margin-bottom:4px;border-bottom:1px solid var(--color-border-tertiary)}
.ann-quick-row{display:flex;align-items:center;justify-content:space-between;gap:2px}
.ann-quick-row+.ann-quick-row{margin-top:6px;padding:0 5px;justify-content:space-between}
.ann-quick-sym{width:36px;height:30px;padding:0;border:0;border-radius:6px;background:transparent;display:grid;place-items:center;font-size:16px;font-weight:700;transition:background-color .12s ease}
.ann-quick-sym:hover{background:#eceef1}
.ann-quick-sym:active{background:#e2e5e9}
.ann-quick-sym[aria-pressed=true]{background:var(--color-accent-soft);box-shadow:inset 0 0 0 1px rgba(52,120,240,.35)}

/* 色点：菜单、浮层通用 */
.ann-dot{position:relative;flex:none;width:22px;height:22px;padding:0;border-radius:50%;border:1px solid rgba(16,24,40,.12);background:var(--swatch,#fff);cursor:pointer;transition:transform .12s ease,box-shadow .12s ease}
.ann-dot:hover{transform:scale(1.1)}
.ann-dot[aria-pressed=true],.ann-dot.on{box-shadow:0 0 0 2px var(--color-background-primary),0 0 0 4px var(--color-accent)}
.ann-dot[aria-pressed=true]::after{content:'';position:absolute;left:7px;top:4px;width:5px;height:9px;border:solid var(--color-text-primary);border-width:0 2px 2px 0;transform:rotate(45deg);opacity:.7}
.ann-dot-ink[aria-pressed=true]::after{border-color:#fff;opacity:1}
.ann-dot-none{background:linear-gradient(135deg,transparent 45%,#d0d5dd 45% 55%,transparent 55%),#fff}
.ann-dot-none[aria-pressed=true]::after{display:none}
.ann-dot-custom{display:block;background:conic-gradient(#ef4444,#f59e0b,#22c55e,#06b6d4,#3b82f6,#a855f7,#ef4444);overflow:hidden}
.ann-dot-custom.on{background:var(--swatch)}
.ann-dot-custom input{position:absolute;inset:-4px;width:calc(100% + 8px);height:calc(100% + 8px);opacity:0;cursor:pointer;border:0;padding:0}

/* 标注浮层 */
.annotation-panel{width:316px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;padding:12px;z-index:180}
.annotation-panel.above{transform-origin:bottom center}
.annotation-panel:focus{outline:none}
.ann-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 10px}
.ann-head strong{font-size:13px;font-weight:600;color:var(--color-text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ann-close{flex:none;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--color-text-tertiary);font-size:18px;line-height:22px}
.ann-close:hover{background:#eceef1;color:var(--color-text-primary)}
.ann-symbols{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;padding:3px;border-radius:9px;background:var(--color-background-tertiary)}
.ann-sym{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 0 5px;border:0;border-radius:7px;background:transparent;color:var(--color-text-secondary);transition:background-color .12s ease,box-shadow .12s ease}
.ann-sym:hover{background:rgba(255,255,255,.7)}
.ann-sym[aria-pressed=true]{background:#fff;box-shadow:0 1px 3px rgba(16,24,40,.12),0 0 0 1px rgba(16,24,40,.04);color:var(--color-text-primary)}
.ann-sym-icon{font-size:16px;font-weight:700;line-height:18px}
.ann-sym-name{font-size:11px;line-height:14px}
.ann-colors{margin:12px 2px 0}
.ann-color-row{display:flex;align-items:center;gap:8px}
.ann-color-row+.ann-color-row{margin-top:9px}
.ann-label{width:26px;flex:none;font-size:11px;color:var(--color-text-tertiary)}
.ann-note{margin-top:12px}
.ann-note textarea{display:block;width:100%;min-height:34px;max-height:150px;resize:none;padding:7px 9px;border:1px solid var(--color-border-tertiary);border-radius:8px;background:var(--color-background-secondary);color:var(--color-text-primary);font:inherit;font-size:12.5px;line-height:1.5;transition:border-color .12s ease,background-color .12s ease,box-shadow .12s ease}
.ann-note textarea:hover{border-color:var(--color-border-secondary)}
.ann-note textarea:focus{outline:0;background:var(--color-background-primary);border-color:var(--color-accent);box-shadow:0 0 0 3px var(--color-focus-ring)}
.ann-note-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:22px;margin-top:4px}
.ann-note-state{font-size:11px;color:var(--color-text-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ann-seg{display:inline-flex;flex:none;padding:2px;border-radius:7px;background:var(--color-background-tertiary)}
.ann-seg[hidden]{display:none}
.ann-seg button{padding:2px 8px;border:0;border-radius:5px;background:transparent;font-size:11px;color:var(--color-text-secondary)}
.ann-seg button[aria-pressed=true]{background:#fff;color:var(--color-text-primary);box-shadow:0 1px 2px rgba(16,24,40,.12)}
.ann-foot{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-top:8px;padding-top:10px;border-top:1px solid var(--color-border-tertiary)}
.ann-presets{display:flex;flex-wrap:wrap;gap:5px;min-width:0}
.ann-chip{display:inline-flex;align-items:center;border-radius:999px;background:var(--chip,var(--color-background-tertiary))}
.ann-chip button{display:inline-flex;align-items:center;gap:3px;height:24px;padding:0 9px;border:0;border-radius:999px;background:transparent;font-size:11.5px;color:var(--color-text-primary)}
.ann-chip button:hover{box-shadow:inset 0 0 0 1px rgba(16,24,40,.14)}
.ann-chip b{font-size:12px}
.ann-chip .ann-chip-x{padding:0 7px 0 0;margin-left:-5px;color:var(--color-text-tertiary)}
.ann-chip .ann-chip-x:hover{box-shadow:none;color:var(--color-danger)}
.ann-chip-add{height:24px;padding:0 8px;border:1px dashed var(--color-border-secondary);border-radius:999px;background:transparent;font-size:11.5px;color:var(--color-text-tertiary)}
.ann-chip-add:hover{border-color:var(--color-accent);color:var(--color-accent)}
.ann-clear{flex:none;height:24px;padding:0 8px;border:0;border-radius:6px;background:transparent;font-size:11.5px;color:var(--color-text-tertiary)}
.ann-clear:hover:not(:disabled){background:var(--color-danger-soft);color:var(--color-danger)}
.ann-clear:disabled{opacity:.4;cursor:default}

/* 只读摘要 */
.ann-readonly{font-size:12.5px}
.ann-badges{display:flex;flex-wrap:wrap;gap:6px}
.ann-badge{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:999px;background:var(--color-background-tertiary);color:var(--color-text-primary);font-size:12px}
.ann-badge i{width:10px;height:10px;border-radius:50%;border:1px solid rgba(16,24,40,.15)}
.ann-note-text{margin:10px 0 0!important;padding:8px 10px;border-radius:8px;background:var(--color-background-secondary);color:var(--color-text-primary)!important;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}
.ann-meta{display:block;margin-top:8px;font-size:11px;color:var(--color-text-tertiary)}
.ann-summary{margin:0 0 8px!important;color:var(--color-text-primary)!important}
.ann-empty{margin:4px 0!important;color:var(--color-text-tertiary)!important}
.ann-reason{margin:12px 0 0!important;padding-top:10px;border-top:1px solid var(--color-border-tertiary);font-size:11px;color:var(--color-text-tertiary)!important}

/* 查找标注 */
.annotation-browse{width:340px}
.annotation-browse .panel-head{margin-bottom:10px}
.annotation-browse .panel-head small{margin-left:6px;font-size:11px;font-weight:400;color:var(--color-text-tertiary)}
.annotation-browse .panel-head .ann-title{display:flex;align-items:baseline}
.ann-filter{display:flex;flex-wrap:wrap;gap:5px}
.ann-filter-chip{display:inline-flex;align-items:center;gap:4px;height:26px;padding:0 9px;border:0;border-radius:999px;background:var(--color-background-tertiary);color:var(--color-text-secondary);font-size:12px;transition:background-color .12s ease}
.ann-filter-chip:hover:not(:disabled){background:#e2e5e9}
.ann-filter-chip[aria-pressed=true]{background:var(--color-accent-soft);color:var(--color-accent);font-weight:600}
.ann-filter-chip:disabled{opacity:.4;cursor:default}
.ann-filter-chip small{font-size:10.5px;color:inherit;opacity:.7;font-variant-numeric:tabular-nums}
.ann-filter-chip i{width:10px;height:10px;border-radius:50%;border:1px solid rgba(16,24,40,.15)}
.annotation-browse .ann-only{display:flex!important;align-items:center;gap:6px;margin:10px 0 6px!important;font-size:12px;color:var(--color-text-secondary)}
.ann-only input{margin:0}
#annotationList{max-height:300px;overflow:auto;margin:0 -6px;padding:0 2px}
.ann-entry{display:flex;align-items:flex-start;gap:9px;width:100%;padding:8px 6px;border:0;border-radius:7px;background:transparent;text-align:left;color:var(--color-text-primary)}
.ann-entry:hover{background:#eceef1}
.ann-entry.here{background:var(--color-accent-soft)}
.ann-entry-mark{flex:none;width:22px;height:22px;display:grid;place-items:center;border-radius:6px;background:var(--color-background-tertiary);font-size:12px}
.ann-entry-note{width:0;height:0;border-top:7px solid #c98a1e;border-left:7px solid transparent}
.ann-entry-body{min-width:0;flex:1}
.ann-entry-title{display:block;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ann-entry-title small{margin-left:6px;font-size:11px;color:var(--color-text-tertiary)}
.ann-entry-note-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:2px;font-size:11.5px;line-height:1.45;color:var(--color-text-secondary);white-space:pre-wrap;overflow-wrap:anywhere}
.ann-nav{display:flex;justify-content:flex-end;gap:4px;margin-top:8px;padding-top:8px;border-top:1px solid var(--color-border-tertiary)}
.ann-nav button{height:26px;padding:0 10px;border:0;border-radius:6px;background:transparent;font-size:12px;color:var(--color-text-secondary)}
.ann-nav button:hover:not(:disabled){background:#eceef1;color:var(--color-text-primary)}
.ann-nav button:disabled{opacity:.4;cursor:default}

@media(max-width:620px){
 .annotation-panel,.annotation-browse{width:calc(100vw - 16px)}
 .ann-note textarea{font-size:16px}
 .ann-dot{width:26px;height:26px}
 .ann-dot[aria-pressed=true]::after{left:9px;top:5px}
 .cell-mark{width:18px;height:18px;top:calc(50% - 9px);font-size:13px}
 .quote-grid td.has-mark{padding-left:22px;padding-right:22px}
}
@media (prefers-reduced-motion:reduce){.ann-dot:hover{transform:none}}
.dd-menu.has-header{max-height:min(560px,calc(100vh - 16px))}

/* 阅读备注不进入输入框；长文本保留换行并在卡片内滚动。 */
.annotation-note-reader{width:360px;max-width:calc(100vw - 16px);user-select:text}
.note-reader-part{margin:-4px 0 10px;color:var(--color-text-secondary);font-size:12px}
.note-reader-content{max-height:min(380px,calc(100dvh - 160px));overflow:auto;overscroll-behavior:contain}
.note-reading-entry+.note-reading-entry{padding-top:12px;margin-top:12px;border-top:1px solid var(--color-border-tertiary)}
.note-entry-head{display:flex;align-items:baseline;gap:7px;margin-bottom:7px;flex-wrap:wrap;font-size:12px}
.note-entry-head small{color:var(--color-text-tertiary);font-size:11px}
.note-reading-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.65;color:var(--color-text-primary);user-select:text}
.note-reading-actions,.note-preview-foot{display:flex;align-items:center;gap:4px;margin-top:9px}
.note-reading-actions small,.note-preview-foot small{margin-right:auto;color:var(--color-text-tertiary);font-size:11px;overflow-wrap:anywhere}
.note-reading-actions button,.note-reader-nav button,.note-preview-foot button,.note-reader-add{border:0;border-radius:5px;background:transparent;color:var(--color-accent);padding:4px 7px;font:inherit;font-size:12px;flex:none}
.note-reading-actions button:hover,.note-reader-nav button:hover:not(:disabled),.note-preview-foot button:hover,.note-reader-add:hover{background:#eceef1}
.note-reader-nav{display:flex;align-items:center;gap:4px;margin-top:12px;border-top:1px solid var(--color-border-tertiary);padding-top:8px}
.note-reader-nav small{margin-right:auto;color:var(--color-text-tertiary);font-size:11px}
.note-reader-nav button:disabled{opacity:.4;cursor:default;color:var(--color-text-tertiary)}
.annotation-note-preview{width:320px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;z-index:190;user-select:text}
.note-preview-text{max-height:180px;overflow:auto;overscroll-behavior:contain}
.note-reader-add{margin-top:8px}
@media(max-width:620px){.annotation-note-reader,.annotation-note-preview{width:calc(100vw - 16px)}.note-reading-text{font-size:14px}.note-reading-actions button,.note-reader-nav button{min-height:32px}}

/* 撤销/重做移到工具行最左，与搜索之间用细竖线隔开（任何宽度都保留） */
.history-actions { display:flex; align-items:center; gap:2px; flex:none; margin-left:-6px }
.history-actions .sheet-tool.icon { width:30px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; border:0; background:transparent; color:#667085; border-radius:8px }
.history-actions .sheet-tool.icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round }
.history-actions .sheet-tool.icon:hover:not(:disabled) { background:var(--color-background-tertiary); color:#344054 }
.history-actions .sheet-tool:disabled { opacity:.4; cursor:default }
.history-divider { flex:none; width:1px; height:20px; margin:0 4px; background:var(--color-border-tertiary) }

/* ---- 工具行重排（编辑→导航→定位→筛选显示→输出→主操作） ---- */
.sheet-toolbar .history-divider { display:none }
.sheet-toolbar .tb-divider { flex:none; width:1px; height:20px; margin:0 2px; background:var(--color-border-tertiary) }
.sheet-toolbar .tb-group { display:flex; align-items:center; gap:6px; flex:none }
.sheet-toolbar > .toolbar-spacer.tb-push { display:block; flex:1 1 8px; min-width:8px }
.sheet-toolbar .sheet-actions { margin-left:0; gap:8px }
@media (max-width:1259px) and (min-width:621px) {
  .sheet-toolbar .sheet-actions { margin-left:auto }
  .sheet-toolbar .tb-divider-end { display:none }
}
@media (max-width:620px) {
  .sheet-toolbar .tb-divider,.sheet-toolbar > .toolbar-spacer.tb-push { display:none }
  .sheet-toolbar .tb-group { flex-wrap:wrap }
}

/* 分组切换移到右侧，紧挨插入行 */
.sheet-toolbar .sheet-actions { gap:10px }
.sheet-toolbar .sheet-actions .group-nav { flex:0 0 auto }
@media (max-width:620px) {
  .sheet-toolbar .sheet-actions { flex:0 0 100%; flex-wrap:wrap; margin-left:0 }
  .sheet-toolbar .sheet-actions .group-nav { flex:0 0 100% }
}
/* 分组切换自适应填满左侧按钮与插入行之间的空白 */
.sheet-toolbar > .toolbar-spacer.tb-push { display:none }
.sheet-toolbar .sheet-actions { flex:1 1 auto; min-width:0; margin-left:6px }
.sheet-toolbar .sheet-actions .group-nav { flex:1 1 auto; min-width:max-content; grid-auto-columns:minmax(76px,1fr) }
.sheet-toolbar .sheet-actions .group-jump { padding:0 10px }
@media (max-width:1259px) and (min-width:621px) {
  .sheet-toolbar .sheet-actions { flex:1 1 100%; margin-left:0 }
}

/* ---------- 报价管理（2026-10-13）：报价列表、客户报价单、版本对比、材料单价库 ---------- */
.basic-dialog .panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.basic-dialog .panel-head strong{font-size:15px}
.basic-dialog .panel-head button{border:0;background:transparent;font-size:20px;line-height:1;color:var(--color-text-tertiary);cursor:pointer;padding:2px 6px;border-radius:6px}
.basic-dialog .panel-head button:hover{background:var(--color-background-tertiary);color:var(--color-text-primary)}
.basic-dialog h3{font-size:13px;margin:18px 0 8px;color:var(--color-text-primary)}
.basic-dialog h3 small{font-weight:400;color:var(--color-text-tertiary);margin-left:8px}
.basic-dialog .dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.right{text-align:right}
.q-muted{color:var(--color-text-tertiary)}
.q-warn{display:inline-block;margin-left:6px;padding:0 6px;border-radius:8px;background:var(--color-warning-soft);color:var(--color-warning);font-size:11px;font-weight:600}
.q-empty{text-align:center;color:var(--color-text-tertiary);padding:28px 12px!important}

.quote-list-dialog{width:min(1080px,94vw)}
.quote-list-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.quote-list-tools input{flex:1 1 260px;min-width:200px;height:34px;padding:0 12px!important;border-radius:17px!important;border:2px solid transparent!important;background:var(--color-background-tertiary);font-size:13px}
.quote-list-tools input:focus{outline:none;border-color:var(--color-accent)!important;background:var(--color-background-primary)}
.quote-list-filter{display:flex;gap:4px;flex-wrap:wrap}
.quote-list-filter button{height:28px;padding:0 10px;border:0;border-radius:14px;background:transparent;color:var(--color-text-secondary);font-size:12px;cursor:pointer}
.quote-list-filter button small{margin-left:5px;color:var(--color-text-tertiary);font-variant-numeric:tabular-nums}
.quote-list-filter button:hover:not(:disabled){background:var(--color-background-tertiary)}
.quote-list-filter button[aria-pressed="true"]{background:var(--color-accent-soft);color:var(--color-accent);font-weight:600}
.quote-list-filter button[aria-pressed="true"] small{color:var(--color-accent)}
.quote-list-filter button:disabled{opacity:.45;cursor:default}
.quote-list-wrap{max-height:min(58vh,560px);overflow:auto;border:1px solid var(--color-border-tertiary);border-radius:var(--radius-md)}
.quote-list-wrap .simple-table th{position:sticky;top:0;z-index:1}
.quote-list-table td{vertical-align:middle;white-space:nowrap}
.quote-list-table tbody tr{cursor:pointer}
.quote-list-table tbody tr:hover td{background:var(--color-background-secondary)}
.quote-list-table tbody tr:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}
.quote-list-table tr.current td{background:var(--color-accent-soft)}
.quote-list-table tr.current td:first-child{box-shadow:inset 3px 0 0 var(--color-accent)}
.quote-list-table tr.is-archived td{color:var(--color-text-tertiary)}
.quote-list-table .q-code{font-family:"SF Mono",Menlo,Consolas,monospace;font-size:11.5px}
.quote-list-table .q-title{white-space:normal;min-width:140px;font-weight:600}
.quote-list-table .q-price{font-variant-numeric:tabular-nums;font-weight:600}
.quote-list-table .q-last small{display:block;color:var(--color-text-tertiary);font-size:11px}
.q-pill{display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:600;background:var(--color-background-tertiary);color:var(--color-text-secondary)}
.q-pill[data-status="核价中"]{background:var(--color-accent-soft);color:var(--color-accent-hover)}
.q-pill[data-status="已报价"]{background:var(--color-success-soft);color:var(--color-success)}
.q-pill.archived{background:transparent;border:1px dashed var(--color-border-secondary);color:var(--color-text-tertiary)}
.q-action{height:26px;padding:0 10px;border:1px solid var(--color-border-tertiary);border-radius:13px;background:var(--color-background-primary);color:var(--color-text-secondary);font-size:12px;cursor:pointer;white-space:nowrap}
.q-action:hover{border-color:var(--color-border-secondary);color:var(--color-text-primary)}
.q-action.danger:hover{border-color:var(--color-danger);color:var(--color-danger)}
.quote-list-foot{margin:10px 2px 0;font-size:12px!important;color:var(--color-text-tertiary)}

.customer-quote-dialog{width:min(640px,94vw)}
.cq-note{margin:0 0 12px}
.cq-warn{margin:0 0 12px;padding:8px 12px;border-radius:var(--radius-md);background:var(--color-warning-soft);color:var(--color-warning);font-size:12.5px}
.cq-warn.blocking{background:var(--color-danger-soft);color:var(--color-danger)}
.cq-mode{display:grid;grid-template-columns:1fr 1fr;gap:10px;border:0;padding:0;margin:0 0 14px}
.cq-mode legend{font-size:12px;color:var(--color-text-secondary);margin-bottom:6px}
.cq-mode label{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--color-border-tertiary);border-radius:var(--radius-md);cursor:pointer}
.cq-mode label:has(input:checked){border-color:var(--color-accent);background:var(--color-accent-soft)}
.cq-mode input{margin-top:3px}
.cq-mode strong{display:block;font-size:13px}
.cq-mode small{display:block;font-size:11.5px;color:var(--color-text-tertiary);line-height:1.5;margin-top:2px}
.cq-grid{display:grid;grid-template-columns:1fr 140px;gap:10px 12px}
.cq-grid label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:var(--color-text-secondary)}
.cq-grid .cq-wide{grid-column:1/-1}
.cq-grid input,.cq-grid textarea{font:inherit;font-size:13px;color:var(--color-text-primary);padding:7px 9px;border:1px solid var(--color-border-tertiary);border-radius:6px;resize:vertical}
.cq-grid input:focus,.cq-grid textarea:focus{outline:none;border-color:var(--color-accent);box-shadow:0 0 0 3px var(--color-accent-soft)}
.cq-remember{display:flex;gap:8px;align-items:center;margin-top:12px;font-size:12px;color:var(--color-text-secondary)}
.cq-remember[hidden]{display:none}
.cq-summary{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:center;margin-top:14px;padding:10px 12px;border-radius:var(--radius-md);background:var(--color-summary);border:1px solid var(--color-summary-border);font-size:12.5px}
.cq-summary strong{margin-left:auto;font-size:14px}

.compare-dialog{width:min(920px,94vw)}
.compare-pick{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px}
.compare-pick label{display:flex;align-items:center;gap:8px;color:var(--color-text-secondary);font-size:12px}
.compare-pick select{min-width:260px}
.cmp-hero{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:14px 0 4px;padding:14px 16px;border-radius:var(--radius-lg);background:var(--color-summary);border:1px solid var(--color-summary-border)}
.cmp-hero small{display:block;font-size:11px;color:var(--color-text-tertiary)}
.cmp-hero b{font-size:20px;font-variant-numeric:tabular-nums}
.cmp-arrow{color:var(--color-text-tertiary);font-size:18px}
.cmp-hero-delta{margin-left:auto;font-size:14px;font-weight:600}
.cmp-up{color:var(--color-warning)}
.cmp-down{color:var(--color-success)}
.cmp-same{color:var(--color-text-tertiary);font-weight:400}
.cmp-table td{font-variant-numeric:tabular-nums}
.cmp-table tr:not(.changed) td{color:var(--color-text-tertiary)}
.cmp-table tr.total td{font-weight:700;color:var(--color-text-primary);border-top:2px solid var(--color-border-secondary)}
.cmp-to{font-weight:600}
.cmp-items td{vertical-align:top;color:var(--color-text-primary)!important}
.cmp-items tr[data-cmp-item]{cursor:pointer}
.cmp-items tr[data-cmp-item]:hover td{background:var(--color-background-secondary)}
.cmp-items td small{display:block;color:var(--color-text-tertiary);font-size:11px;margin-top:2px}
.cmp-fields span{display:inline-block;margin:0 12px 3px 0}
.cmp-fields em{font-style:normal;color:var(--color-text-tertiary);margin-right:6px}
.cmp-sub{white-space:nowrap}
.cmp-tag{display:inline-block;width:18px;height:18px;line-height:18px;text-align:center;border-radius:4px;margin-right:6px;font-size:11px;font-weight:700;background:var(--color-accent-soft);color:var(--color-accent)}
.cmp-tag.add{background:var(--color-success-soft);color:var(--color-success)}
.cmp-tag.del{background:var(--color-danger-soft);color:var(--color-danger)}
.cmp-removed td{text-decoration:line-through;text-decoration-color:var(--color-border-secondary)}
.cmp-removed td:last-child{text-decoration:none}

.materials-wrap{max-width:1040px}
.material-search{width:260px;height:32px;padding:0 12px;margin-bottom:10px;border:2px solid transparent;border-radius:16px;background:var(--color-background-tertiary);font-size:12.5px}
.material-search:focus{outline:none;border-color:var(--color-accent);background:var(--color-background-primary)}
.material-table td{padding:5px 8px}
.material-table input{width:100%;min-width:70px;box-sizing:border-box;padding:5px 7px;border:1px solid transparent;border-radius:5px;background:transparent;font:inherit;font-size:12.5px;color:var(--color-text-primary)}
.material-table input:hover:not(:disabled){border-color:var(--color-border-tertiary)}
.material-table input:focus{outline:none;border-color:var(--color-accent);background:var(--color-background-primary);box-shadow:0 0 0 3px var(--color-accent-soft)}
.material-table input[type="number"]{text-align:right;font-variant-numeric:tabular-nums}
.material-table tr.conflict td{background:var(--color-warning-soft)}
.material-table .m-kg{white-space:nowrap;font-size:12px}
#materialHint{font-size:12px;color:var(--color-text-tertiary)}
#materialHint.dirty{color:var(--color-warning);font-weight:600}
@media(max-width:620px){.cq-mode,.cq-grid{grid-template-columns:1fr}.quote-list-table .q-last,.quote-list-table th:nth-child(8){display:none}#quoteListButton{flex:0 0 auto}}
.simple-table th.right,.simple-table td.right{text-align:right}
.material-table td:nth-child(6){white-space:nowrap;font-size:12px}
/* 材料单价页：本单材料价 + 材料库两段 */
.materials-scroll{padding-bottom:24px}
.material-section+.material-section{border-top:1px solid var(--color-border-tertiary);margin-top:4px}
.material-section-head{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;padding:16px 24px 0}
.material-section-head h3{margin:0;font-size:14px;font-weight:650}
.material-section-head h3 small{font-weight:400;color:var(--color-text-tertiary);margin-left:6px;font-size:12px}
.material-section-head span{font-size:12px}
.material-section .materials-wrap{padding-top:12px}
.material-section .basic-actions{padding:12px 24px 0}
.quote-material-table td{vertical-align:middle}
.quote-material-table input{max-width:140px;text-align:right;font-variant-numeric:tabular-nums;border-color:var(--color-border-tertiary)}
.quote-material-table input::placeholder{color:var(--color-text-tertiary);text-align:left}
.quote-material-table tr.overridden td{background:var(--color-accent-soft)}
.quote-material-table td b{font-variant-numeric:tabular-nums}
.quote-material-table td small{display:block;margin:2px 0 0}
.m-src{display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:600;white-space:nowrap}
.m-src.lib{background:var(--color-background-tertiary);color:var(--color-text-secondary)}
.m-src.quote{background:var(--color-accent);color:#fff}
.m-src.none{border:1px dashed var(--color-border-secondary);color:var(--color-text-tertiary);font-weight:400}
/* 材料单价合并表（全局价 + 本单价并排） */
.material-bar{padding:12px 24px 4px}
.material-bar .material-search{margin:0}
.material-only{font-size:12px!important;color:var(--color-text-secondary);gap:6px}
.material-bar .tb-gap{flex:1}
.material-status{display:flex;gap:16px;flex-wrap:wrap;padding:6px 24px 0;font-size:12px;color:var(--color-text-tertiary)}
.material-status #quoteMaterialsCode{color:var(--color-text-secondary);font-weight:600}
.material-status #materialHint.dirty{color:var(--color-warning);font-weight:600}
.merged-material-table{min-width:900px}
.merged-material-table th small{font-weight:400;color:var(--column-head-muted);margin-left:4px;font-size:11px}
.merged-material-table td{vertical-align:middle}
.merged-material-table input[type="number"]{max-width:130px;margin-left:auto;display:block;border-color:var(--color-border-tertiary)}
.merged-material-table input::placeholder{color:var(--color-text-tertiary);text-align:right;font-size:11.5px}
.merged-material-table [data-qm-price]{border-color:var(--color-accent-soft)!important;background:var(--color-background-primary)}
.merged-material-table tr.overridden [data-qm-price]{border-color:var(--color-accent)!important;font-weight:600}
.merged-material-table tr.lib-changed [data-lib-price]{background:var(--color-warning-soft);border-color:var(--color-warning)}
.merged-material-table tr.not-in-quote td{color:var(--color-text-tertiary)}
.merged-material-table tr.removed td{opacity:.45;text-decoration:line-through}
.merged-material-table tr.removed td.m-actions{opacity:1;text-decoration:none}
.merged-material-table tr.fresh td{background:var(--color-background-secondary)}
.merged-material-table td b{font-variant-numeric:tabular-nums;margin-right:6px}
.merged-material-table td small{display:block;margin-top:2px}
.merged-material-table .m-actions{white-space:nowrap;text-align:right}
.merged-material-table .m-actions .q-action+.q-action{margin-left:6px}
.m-src.library{background:var(--color-background-tertiary);color:var(--color-text-secondary)}
.m-src.none{border:1px dashed var(--color-border-secondary);color:var(--color-text-tertiary);font-weight:400}
#materialsSheet .materials-wrap{max-width:1240px}
.merged-material-table th{white-space:nowrap}
.merged-material-table th small{display:block;margin:1px 0 0;max-width:150px;overflow:hidden;text-overflow:ellipsis;margin-left:auto}
.merged-material-table td:nth-child(1){min-width:150px}
.merged-material-table td:nth-child(5){white-space:nowrap}
.merged-material-table td:nth-child(5) small{display:block}
.merged-material-table td:nth-child(5) .m-src{display:inline-block;vertical-align:1px}
.merged-material-table td:nth-child(7) input{min-width:140px}

/* 按内容宽度折行，侧栏不挤压表格工具。窄屏导航放在报价上方。 */
@media (min-width:1101px) and (max-width:1425px) {
 .sheet-toolbar { flex-wrap:wrap; flex-basis:auto; padding:8px 12px 10px; row-gap:14px!important }
 .sheet-toolbar .sheet-actions { flex:1 1 100%; margin-left:0 }
}
@media (max-width:1100px) {
 .workspace-body { flex-direction:column }
 .sheet-tabs { flex:0 0 auto; flex-direction:row; gap:16px; padding:8px 12px; border-right:0; border-bottom:1px solid var(--color-border-tertiary); overflow-x:auto; overflow-y:hidden }
 .nav-group { flex:0 0 auto; flex-direction:row; align-items:center; gap:4px }
 .nav-group + .nav-group { border-left:1px solid var(--color-border-secondary); padding-left:16px }
 .nav-group h2 { font-size:10px; margin:0; padding:0 5px 0 0; max-width:26px; white-space:normal; line-height:1.4 }
 .sheet-tab { width:auto; gap:6px; padding:7px 9px }
 .nav-icon { width:15px; height:15px; flex-basis:15px }
 .nav-caption { display:none }
}
@media (max-width:620px) {
 .workspace-body { overflow:visible; flex:none }
 .workspace-content { overflow:visible; flex:none }
 .sheet-tabs { gap:10px; padding:8px; min-height:62px }
 .nav-group + .nav-group { padding-left:10px }
 .sheet-tab { font-size:11px; padding:7px; gap:5px }
 .nav-icon { display:none }
 .workspace-status { min-height:28px }
}
@media print {
 .workspace-body,.workspace-content { display:block; overflow:visible }
 .workspace-status { display:none }
}

/* 标题右侧按钮：收起后保留展开入口。 */
.nav-toggle { width:28px; height:28px; padding:4px; display:grid; place-items:center; border:0; border-radius:6px; color:var(--color-text-secondary); background:transparent }
.nav-toggle:hover { background:rgba(36,48,66,.07) }
.nav-toggle svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round }
.nav-toggle[aria-expanded="false"] { color:var(--color-accent); background:var(--color-accent-soft) }
@media (min-width:1101px) {
 .nav-collapsed .sheet-tabs { flex-basis:54px; padding:18px 7px; gap:16px }
 .nav-collapsed .nav-label,.nav-collapsed .nav-count,.nav-collapsed .nav-group h2,.nav-collapsed .nav-caption { display:none }
 .nav-collapsed .sheet-tab { justify-content:center; padding:9px; gap:0 }
 .nav-collapsed .nav-group + .nav-group { padding-top:16px; border-top:1px solid var(--color-border-tertiary) }
}


.nav-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:5px; padding-left:10px; gap:6px }
.nav-heading h2 { margin:0; padding:0 }
.nav-toggle { flex:0 0 24px; width:24px; height:24px; padding:4px; border:1px solid var(--color-border-tertiary); background:rgba(255,255,255,.8); box-shadow:0 1px 2px rgba(36,48,66,.04) }
.nav-toggle svg { width:14px; height:14px; stroke-width:1.8 }
.nav-toggle[aria-expanded="false"] svg { transform:rotate(180deg) }
@media (min-width:1101px) {
 .nav-collapsed .nav-heading { padding:0; justify-content:center; grid-template-columns:0 24px }
}
@media (max-width:1100px) {
 .nav-heading { flex:0 0 auto; padding:0; margin:0 }
 .nav-heading h2 { padding:0 }
 .nav-collapsed .sheet-tabs { display:flex; min-height:40px; padding-top:8px; padding-bottom:8px }
 .nav-collapsed .sheet-tab,.nav-collapsed .nav-group + .nav-group,.nav-collapsed .nav-heading h2 { display:none }
}

/* 导航动效：固定行位置，宽度与文字同步过渡，支持中途反向切换。 */
.nav-toggle svg { transition:transform 240ms cubic-bezier(.22,1,.36,1) }
@media (min-width:1101px) {
 .sheet-tabs { overflow-x:hidden; transition:flex-basis 260ms cubic-bezier(.22,1,.36,1),padding 260ms cubic-bezier(.22,1,.36,1) }
 .nav-heading { display:grid; grid-template-columns:minmax(0,1fr) 24px; gap:0; transition:padding 260ms cubic-bezier(.22,1,.36,1) }
 .nav-heading h2 { overflow:hidden; white-space:nowrap }
 .nav-label,.nav-count,.nav-group h2,.nav-caption { opacity:1; transition:opacity 150ms ease,max-width 260ms cubic-bezier(.22,1,.36,1) }
 .nav-label { max-width:110px; overflow:hidden; white-space:nowrap }
 .nav-count { max-width:28px; overflow:hidden }
 .sheet-tab { transition:gap 260ms cubic-bezier(.22,1,.36,1),padding 260ms cubic-bezier(.22,1,.36,1),background-color 150ms ease }
 .nav-collapsed .nav-label,.nav-collapsed .nav-count,.nav-collapsed .nav-group h2,.nav-collapsed .nav-caption { display:block; opacity:0; pointer-events:none }
 .nav-collapsed .nav-label,.nav-collapsed .nav-count { max-width:0 }
 .nav-collapsed .nav-count { padding:0; margin:0 }
 .nav-collapsed .sheet-tab { justify-content:flex-start; padding:8px 11px; gap:0 }
 .nav-collapsed .nav-group + .nav-group { padding-top:0; border-top:0 }
 .nav-collapsed .sheet-tabs { gap:22px }
}
@media (prefers-reduced-motion:reduce) {
 .sheet-tabs,.sheet-tab,.nav-heading,.nav-label,.nav-count,.nav-group h2,.nav-caption,.nav-toggle svg { transition:none!important }
}

/* 收起时文字只淡出，不换行撑高或触发侧栏滚动条。 */
@media (min-width:1101px) {
 .sheet-tabs { overflow-x:hidden }
 .nav-group { flex-shrink:0 }
 .nav-group h2 { white-space:nowrap; overflow:hidden; height:14px; line-height:14px }
 .nav-heading { height:24px; flex-shrink:0 }
 .sheet-tab { flex-shrink:0; height:36px; min-height:36px }
 .nav-label,.nav-label small { white-space:nowrap }
 .nav-caption { flex-shrink:0; width:146px; height:34px; line-height:17px; white-space:nowrap }
}

/* 选区四边覆盖行列接缝的1px边框，保留其余格线。 */
.quote-grid td.sel-edge-left { --selection-left:linear-gradient(to right,var(--sel) 0 2px,transparent 2px) }
.quote-grid td.sel-edge-right { --selection-right:linear-gradient(to left,transparent 0 1px,var(--sel) 1px 3px,transparent 3px) }
.quote-grid td.in-range.sel-edge-left,.quote-grid td.in-range.sel-edge-right,
.quote-grid td.in-range.sel-edge-top,.quote-grid td.in-range.sel-edge-bottom {
 background-origin:border-box; background-clip:border-box;
 background-image:var(--selection-top,linear-gradient(transparent,transparent)),var(--selection-bottom,linear-gradient(transparent,transparent)),var(--selection-left,linear-gradient(transparent,transparent)),var(--selection-right,linear-gradient(transparent,transparent)),linear-gradient(var(--selection-left-fill,var(--sel-fill)),var(--selection-left-fill,var(--sel-fill))),var(--cell-data-image,none);
}
.quote-grid td.in-range.active { --selection-left-fill:transparent }
.quote-grid td.sel-continuation { border-bottom-color:transparent }
.quote-grid .rowhead.hl.sel-continuation {
 border-bottom-color:transparent; background-origin:border-box; background-clip:border-box;
 background-image:linear-gradient(to left,transparent 0 2px,var(--sel) 2px 5px,transparent 5px);
 box-shadow:inset -3px 0 0 var(--sel),inset 0 -1px 0 0 var(--grid-line);
}

.quote-grid td.sticky-edge.sel-edge-right { --selection-right:linear-gradient(to left,var(--sel) 0 2px,transparent 2px) }

.quote-grid td.sel-edge-top { --selection-top:linear-gradient(to bottom,var(--sel) 0 2px,transparent 2px) }
.quote-grid td.sel-edge-bottom { --selection-bottom:linear-gradient(to top,transparent 0 1px,var(--sel) 1px 3px,transparent 3px) }
.quote-grid td.frozen-row-edge.sel-edge-bottom { --selection-bottom:linear-gradient(to top,var(--sel) 0 2px,transparent 2px) }
.quote-grid td.sel-horizontal-continuation { border-right-color:transparent }

/* 行号选中线替代原绿色分隔线，不在其旁边叠画。 */
.quote-grid .rowhead.hl { border-right-color:var(--sel); box-shadow:none }
.quote-grid .rowhead.hl.sel-continuation {
 background-image:linear-gradient(to left,var(--sel) 0 2px,transparent 2px);
 box-shadow:inset 0 -1px 0 0 var(--grid-line);
}

/* 表头层次：字段名为主，分组其次，字母与单位辅助阅读。 */
.quote-grid .h-group th { height:calc(24px * var(--sheet-scale,1)); font-size:calc(12px * var(--sheet-scale,1)); font-weight:650; letter-spacing:.2px }
.quote-grid .h-letter th { font-size:calc(10.5px * var(--sheet-scale,1)); font-weight:500 }
.quote-grid .h-label th { height:calc(48px * var(--sheet-scale,1)); padding:5px 6px; font-size:calc(13px * var(--sheet-scale,1)); font-weight:650; border-bottom:2px solid var(--column-head-border) }
.quote-grid .head-label { line-height:1.3 }
.quote-grid .head-unit { font-size:calc(10.5px * var(--sheet-scale,1)); font-weight:400; line-height:1.2 }

/* 字母坐标也要清晰可辨，与字段名保持字号层级。 */
.quote-grid .h-letter th { font-size:calc(12px * var(--sheet-scale,1)); font-weight:650; color:var(--column-head-text) }
.quote-grid .head-letter { font-weight:650 }
.quote-grid .h-letter th.hl { color:var(--sel) }

/* 列设置：桌面三列紧凑排列，完整展示28列与恢复按钮。 */
#columnPanel { width:min(600px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); padding:14px 16px }
#columnPanel:not([hidden]) { display:flex; flex-direction:column }
#columnPanel .panel-head,#columnPanel > p,#columnPanel > button { flex-shrink:0 }
#columnPanel > p { margin:8px 0; font-size:12px }
#columnPanel .column-choices { grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px 10px; max-height:none; min-height:0; overflow:auto; margin:6px 0 12px }
#columnPanel .column-choices label { min-height:26px; padding:3px 2px; font-size:12px; gap:6px }
#columnPanel > button { align-self:flex-start }
@media (max-width:620px) {
 #columnPanel .column-choices { grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 6px }
 #columnPanel { padding:12px }
}

/* 列设置收紧留白，保持完整展示。 */
#columnPanel { width:min(500px,calc(100vw - 24px)); padding:12px 14px }
#columnPanel > p { margin:6px 0; font-size:11.5px }
#columnPanel .column-choices { gap:2px 8px; margin:4px 0 10px }
#columnPanel .column-choices label { min-height:24px; padding:2px 0; font-size:12px; gap:5px }
#columnPanel .column-choices input { margin:0; flex:0 0 auto }
@media (max-width:620px) { #columnPanel { padding:12px } }

/* 整表只读提示：只读身份 / 已报价冻结 / 已作废 */
.readonly-banner{display:flex;align-items:center;gap:8px;padding:6px 14px;background:var(--cell-locked);border-bottom:1px solid #e6dfd0;color:var(--cell-locked-text);font-size:12px;font-weight:600}
.readonly-banner::before{content:'';width:12px;height:12px;flex:none;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat}
.readonly-banner[hidden]{display:none}

/* 图例做成迷你单元格，和表里的格子长得一样 */
.legend{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:24px;height:16px;margin:0 5px 0 12px;border-radius:3px;font-style:normal;font-size:10px;font-weight:600;line-height:1;vertical-align:-3px;font-variant-numeric:tabular-nums}
.legend.editable{background:#fff;border:1px solid var(--color-border-secondary);color:var(--color-text-primary)}
.legend.calculated{background:var(--cell-calculated);border:1px solid var(--column-head-border);color:var(--cell-calculated-text);font-family:Georgia,"Times New Roman",serif;font-style:italic}
.legend.locked{background:var(--cell-locked);border:1px solid #ddd3bf;color:var(--cell-locked-text)}
.legend.locked::before{content:'';width:9px;height:10px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat}
.legend.na{background:repeating-linear-gradient(135deg,#fff 0 3px,#d8d2c4 3px 4.5px);border:1px solid var(--color-border-secondary)}

/* 成本分析：分类色 + 2px 间隔；零件排名按 材料/成型/人工/外购 堆叠 */
.stacked-cost{gap:2px;background:var(--color-background-primary)}
.stacked-cost span{min-width:2px}
.chart-legend i{width:10px;height:10px;border-radius:3px}
.rank-legend{display:flex;flex-wrap:wrap;gap:6px 14px;margin:-8px 0 12px;font-size:11.5px;color:var(--color-text-secondary)}
.rank-legend span{display:inline-flex;align-items:center;gap:5px}
.rank-legend i{width:9px;height:9px;border-radius:2px}
.cost-rank>i{background:transparent}
.cost-rank .rank-bar{display:flex;gap:2px;height:100%;min-width:3px}
.cost-rank .rank-bar em{display:block;height:100%;min-width:2px;background:none}
.cost-rank .rank-bar em:last-child{border-radius:0 3px 3px 0}
.cost-rank:hover .rank-bar{filter:brightness(1.06)}

/* 成本分析清爽版：白底卡片、圆润条形 */
.analysis-metrics article{background:var(--color-background-primary);border:1px solid var(--color-border-tertiary);box-shadow:0 1px 2px rgba(20,30,50,.04)}
.analysis-metrics small{font-size:12px}
.chart-card{border-color:var(--color-border-tertiary);box-shadow:0 1px 2px rgba(20,30,50,.04)}
.stacked-cost{height:20px;border-radius:10px;gap:3px}
.stacked-cost span:first-child{border-radius:10px 0 0 10px}.stacked-cost span:last-child{border-radius:0 10px 10px 0}
.chart-legend i,.rank-legend i{border-radius:50%}
.cost-rank>i{height:10px}
.cost-rank .rank-bar{gap:2px}
.cost-rank .rank-bar em:first-child{border-radius:5px 0 0 5px}.cost-rank .rank-bar em:last-child{border-radius:0 5px 5px 0}.cost-rank .rank-bar em:only-child{border-radius:5px}
.cost-rank:hover{background:var(--color-background-secondary);border-radius:6px}

/* 版本与记录 */
.h-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
.h-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;align-items:start;padding:20px 24px 32px;max-width:1200px}
.h-layout .history-body{max-width:none;padding:0}
.h-side{display:flex;flex-direction:column;gap:16px;position:sticky;top:12px}
.h-card{background:var(--color-background-primary);border:1px solid var(--color-border-tertiary);border-radius:10px;padding:16px 18px;box-shadow:0 1px 2px rgba(20,30,50,.04)}
.h-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.h-card-head h3{margin:0;font-size:14px;font-weight:650;color:var(--color-text-primary)}
.h-card-head small{font-size:12px;color:var(--color-text-tertiary)}
.h-filters{display:flex;gap:4px;flex-wrap:wrap}
.h-chip{display:inline-flex;align-items:center;gap:5px;height:26px;padding:0 10px;border:0;border-radius:13px;background:transparent;font:inherit;font-size:12px;color:var(--color-text-secondary);cursor:pointer}
.h-chip small{font-size:11px;color:var(--color-text-tertiary);font-variant-numeric:tabular-nums}
.h-chip:hover{background:var(--color-background-tertiary)}
.h-chip.active{background:var(--color-accent-soft);color:var(--color-accent);font-weight:600}.h-chip.active small{color:var(--color-accent)}
.h-hint{margin:0 0 6px;font-size:11.5px;color:var(--color-text-tertiary)}
.h-day{position:sticky;top:0;z-index:1;margin:14px 0 2px;padding:4px 0;background:var(--color-background-primary);font-size:12px;font-weight:650;color:var(--color-text-secondary)}
.h-day:first-child{margin-top:4px}
.h-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:10px;align-items:start;padding:9px 0;border-bottom:1px solid var(--color-border-tertiary)}
.h-row:last-child{border-bottom:0}
.h-icon{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:8px;background:var(--color-background-tertiary);color:var(--color-text-secondary)}
.h-icon svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.h-row[data-type="data"] .h-icon{background:#ebf2fe;color:#3478f0}
.h-row[data-type="status"] .h-icon{background:#fff3e6;color:#d9822b}
.h-row[data-type="note"] .h-icon{background:#f1ecfe;color:#7c5cf0}
.h-title{font-size:13px;color:var(--color-text-primary);line-height:1.45;overflow-wrap:anywhere}
.h-sub{margin-top:3px;font-size:12px;color:var(--color-text-secondary);line-height:1.5;overflow-wrap:anywhere}
.h-old{color:var(--color-text-tertiary);text-decoration:line-through;text-decoration-color:rgba(0,0,0,.25)}
.h-arrow{margin:0 6px;color:var(--color-text-tertiary)}
.h-new{color:var(--color-text-primary);font-weight:600}
.h-meta{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-size:12px;color:var(--color-text-secondary);white-space:nowrap}
.h-meta time{font-size:11px;color:var(--color-text-tertiary);font-variant-numeric:tabular-nums}
.h-empty{margin:4px 0;font-size:12.5px;line-height:1.6;color:var(--color-text-tertiary)}
.h-more{margin:12px auto 0;display:block}
.h-snap{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;padding:8px 0;border-top:1px solid var(--color-border-tertiary);font-size:12.5px}
.h-snap b{font-weight:650}.h-snap span{color:var(--color-text-secondary)}.h-snap time{grid-column:1/-1;font-size:11px;color:var(--color-text-tertiary)}
.h-notice{display:grid;grid-template-columns:1fr auto;gap:2px 8px;align-items:center;padding:8px 0;border-top:1px solid var(--color-border-tertiary);font-size:12.5px}
.h-who{font-weight:600;color:var(--color-text-primary)}
.h-kind{grid-row:2;font-size:11.5px;color:var(--color-text-tertiary)}
.h-notice time{grid-row:2;grid-column:2;font-size:11px;color:var(--color-text-tertiary);text-align:right}
.h-pill{justify-self:end;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:600}
.h-pill.wait{background:#fff3e6;color:#b4610e}.h-pill.ok{background:var(--color-success-soft);color:var(--color-success)}.h-pill.bad{background:var(--color-danger-soft);color:var(--color-danger)}
@media(max-width:900px){.h-layout{grid-template-columns:1fr;padding:14px}.h-side{position:static}}

/* 价格设置页（机台费率 / 材料单价）：白底卡片 + 柔和输入框 */
#ratesSheet,#materialsSheet{background:var(--color-background-secondary)}
#ratesSheet .simple-head,#materialsSheet .simple-head{background:var(--color-background-primary)}
#ratesSheet .simple-head p,#materialsSheet .simple-head p{max-width:760px;line-height:1.6}
#materialsSheet .simple-head b{color:var(--color-text-primary);font-weight:600}
.p-card{margin:20px 24px 32px;background:var(--color-background-primary);border:1px solid var(--color-border-tertiary);border-radius:12px;box-shadow:0 1px 2px rgba(20,30,50,.04);overflow:hidden}
#ratesSheet .p-card{max-width:820px}
#materialsSheet .p-card{max-width:1280px}
.p-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:14px 18px;border-bottom:1px solid var(--color-border-tertiary)}
.p-bar .tb-gap{flex:1}
.p-hint{font-size:12px;color:var(--color-text-tertiary)}
.p-card .simple-table-wrap{padding:0;max-width:none}
.p-card .simple-table th{background:var(--color-background-secondary);color:var(--color-text-secondary);font-size:12px;font-weight:600;padding:10px 18px;border-bottom:1px solid var(--color-border-tertiary)}
.p-card .simple-table td{padding:8px 18px}
.p-card .simple-table tbody tr:last-child td{border-bottom:0}
.p-card .simple-table tbody tr:hover td{background:var(--color-background-secondary)}
/* 统一的数字输入：浅灰圆角底，无边框，悬停浅蓝，聚焦蓝框 */
.rate-table input,.merged-material-table input[type="number"],.merged-material-table input[data-lib-note],.merged-material-table tr.fresh input{height:30px;box-sizing:border-box;padding:0 10px;border:0!important;border-radius:7px;background:var(--color-background-tertiary)!important;color:var(--color-text-primary);font:inherit;font-size:13px;font-variant-numeric:tabular-nums;transition:background-color .12s ease,box-shadow .12s ease;-moz-appearance:textfield;appearance:textfield}
.rate-table input::-webkit-outer-spin-button,.rate-table input::-webkit-inner-spin-button,.merged-material-table input::-webkit-outer-spin-button,.merged-material-table input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.rate-table input:hover:not(:disabled),.merged-material-table input:hover:not(:disabled){background:var(--color-accent-soft)!important}
.rate-table input:focus,.merged-material-table input:focus{outline:none;background:#fff!important;box-shadow:0 0 0 1.5px var(--color-accent),0 0 0 4px var(--color-accent-soft)}
.rate-table input:disabled,.merged-material-table input:disabled{background:transparent!important;color:var(--color-text-primary);-webkit-text-fill-color:var(--color-text-primary);opacity:1;cursor:default}
.rate-table input{width:130px;text-align:right;font-weight:600}
.rate-table .r-ton b{font-size:14px;font-weight:650;font-variant-numeric:tabular-nums}
.rate-table .r-ton span{margin-left:3px;font-size:12px;color:var(--color-text-tertiary)}
.rate-table .r-def{color:var(--color-text-secondary);font-variant-numeric:tabular-nums}
.r-diff{display:inline-block;padding:2px 9px;border-radius:10px;font-size:11.5px;font-weight:600;white-space:nowrap}
.r-diff.same{background:var(--color-background-tertiary);color:var(--color-text-tertiary);font-weight:500}
.r-diff.up{background:#fff1e8;color:#c2551a}
.r-diff.down{background:#e8f6f0;color:#1f8a5f}
.r-diff.none{border:1px dashed var(--color-border-secondary);color:var(--color-text-tertiary);font-weight:500}
.r-diff.new{background:var(--color-accent-soft);color:var(--color-accent)}
.rate-table tr.r-fresh td{background:#f7faff}
/* 材料单价 */
#materialsSheet .material-bar{padding:14px 18px;border-bottom:1px solid var(--color-border-tertiary)}
#materialsSheet .material-status{padding:10px 18px 0}
#materialsSheet .materials-wrap{padding:8px 0 0}
.merged-material-table input[type="number"]{width:120px;max-width:none;text-align:right;font-weight:600}
.merged-material-table input[data-lib-note]{width:100%;min-width:140px}
.merged-material-table input::placeholder{font-weight:400;color:var(--color-text-tertiary)}
.merged-material-table tr.overridden td{background:#f5f9ff}
.merged-material-table tr.overridden [data-qm-price]{background:var(--color-accent-soft)!important;color:var(--color-accent);box-shadow:inset 0 0 0 1.5px rgba(52,120,240,.35)}
.merged-material-table tr.lib-changed [data-lib-price]{background:var(--color-warning-soft)!important;box-shadow:inset 0 0 0 1.5px rgba(214,140,30,.45)}
.m-src{padding:1px 8px;font-size:11px}
.m-src.library{background:var(--color-background-tertiary);color:var(--color-text-secondary)}
.m-src.quote{background:var(--color-accent-soft);color:var(--color-accent)}
.merged-material-table .q-action{height:26px;border:0;background:transparent;color:var(--color-text-tertiary)}
.merged-material-table .q-action:hover{background:var(--color-background-tertiary);color:var(--color-text-primary)}
.merged-material-table .q-action.danger:hover{background:var(--color-danger-soft);color:var(--color-danger)}
@media(max-width:800px){.p-card{margin:12px}.p-bar .tb-gap{display:none}}

/* 价格设置页居中 */
#ratesSheet .p-card,#materialsSheet .p-card{margin-left:auto;margin-right:auto}
#ratesSheet .simple-head{padding-left:max(24px,calc((100% - 820px) / 2));padding-right:max(24px,calc((100% - 820px) / 2))}
#materialsSheet .simple-head{padding-left:max(24px,calc((100% - 1280px) / 2));padding-right:max(24px,calc((100% - 1280px) / 2))}
.rate-table th,.rate-table td,.rate-table th.right,.rate-table td.right{text-align:center}
.rate-table input{text-align:center}
.rate-table .r-ton b,.rate-table .r-ton span{font-size:13px;font-weight:500;color:var(--color-text-primary);font-variant-numeric:tabular-nums}
.rate-table .r-ton span{margin-left:2px}

/* ---------- 多人协作（2026-10-14）：占用提示条、编辑中标记、登录状态页、用户与权限 ---------- */
.collab-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:4px 16px;border-bottom:1px solid var(--color-border-tertiary);font-size:12.5px;color:var(--color-text-primary);background:var(--color-accent-soft)}
.collab-bar[hidden]{display:none}
.collab-bar[data-kind="locked"]{background:var(--color-warning-soft);color:var(--color-warning)}
.collab-bar[data-kind="offline"]{background:var(--color-danger-soft);color:var(--color-danger)}
.collab-bar::before{content:'';width:14px;height:14px;flex:none;background:currentColor;-webkit-mask:var(--collab-icon) center/contain no-repeat;mask:var(--collab-icon) center/contain no-repeat;--collab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 15-6.7L21 8M21 3v5h-5M21 12a9 9 0 0 1-15 6.7L3 16M3 21v-5h5'/%3E%3C/svg%3E")}
.collab-bar[data-kind="locked"]::before{--collab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E")}
.collab-bar[data-kind="offline"]::before{--collab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M2 2l20 20M8.5 16.4a5 5 0 0 1 7 0M5 12.9a10 10 0 0 1 5.2-2.8M19 12.9a10 10 0 0 0-2-1.5M2 9.3a15 15 0 0 1 4.2-2.7M22 9.3A15 15 0 0 0 11 5M12 20h.01'/%3E%3C/svg%3E")}
.collab-text{flex:1 1 260px;min-width:0;line-height:1.4}
.collab-text b{font-weight:650}
.collab-text small{display:inline-block;margin-left:8px;color:var(--color-text-tertiary);font-size:11.5px}
.collab-btn{height:22px;padding:0 8px;border:1px solid var(--color-border-secondary);border-radius:var(--radius-sm);background:var(--color-background-primary);color:var(--color-text-primary);font:inherit;font-size:12px;cursor:pointer;white-space:nowrap}
.collab-btn:hover:not(:disabled){background:var(--color-background-tertiary)}
.collab-btn:disabled{opacity:.5;cursor:not-allowed}
.collab-btn.primary{background:var(--color-accent);border-color:transparent;color:#fff}
.collab-btn.primary:hover:not(:disabled){background:var(--color-accent-hover)}
.collab-btn.danger{color:var(--color-danger);border-color:#f0c4c0}
.collab-btn.danger:hover{background:var(--color-danger-soft)}
.edit-lock-chip{display:inline-flex;align-items:center;gap:6px;padding:2px 3px 2px 9px;border-radius:999px;background:var(--color-success-soft);color:var(--color-success);font-size:11.5px;font-weight:600;white-space:nowrap}
.edit-lock-chip[hidden]{display:none}
.edit-lock-chip i{width:7px;height:7px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px rgba(47,111,74,.15)}
.edit-lock-chip button{height:20px;padding:0 8px;border:0;border-radius:999px;background:var(--color-background-primary);color:var(--color-text-secondary);font:inherit;font-weight:500;cursor:pointer}
.edit-lock-chip button:hover{color:var(--color-text-primary);background:#fff;box-shadow:0 0 0 1px var(--color-border-tertiary)}
.nav-count.nav-alert{background:var(--color-warning-soft);color:var(--color-warning);font-weight:650}
.nav-count[hidden]{display:none}
#usersSheet .simple-head{background:var(--color-background-primary)}
#usersSheet .simple-head p{max-width:760px;line-height:1.6}
.users-wrap{padding:16px 24px 28px;max-width:900px}
.users-bar{display:flex;align-items:center;gap:8px;margin-bottom:10px;font-size:12.5px;color:var(--color-text-secondary)}
.users-bar .tb-gap{flex:1}
.users-table td{vertical-align:middle}
.users-table td strong{font-weight:600}
.users-table small{display:block;color:var(--color-text-tertiary);font-size:11px;margin-top:2px}
.users-table small.users-you{display:inline;margin:0}
.users-table select{height:28px;min-width:118px;padding:0 6px;border:1px solid var(--color-border-secondary);border-radius:var(--radius-sm);background:var(--color-background-primary);font:inherit;font-size:12.5px}
.users-table tr.pending{background:#fffbf2}
.users-table tr.disabled td{color:var(--color-text-tertiary)}
.users-table .users-seen{font-size:12px;color:var(--color-text-secondary);white-space:nowrap}
.users-table .users-act{text-align:right;white-space:nowrap}
.users-table .users-act .button{height:28px;padding:0 12px;font-size:12px}
.users-self{font-size:11.5px;color:var(--color-text-tertiary)}
.users-empty{padding:18px 12px;text-align:center;color:var(--color-text-tertiary)}
.user-state{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11.5px;font-weight:600;white-space:nowrap}
.user-state.active{background:var(--color-success-soft);color:var(--color-success)}
.user-state.pending{background:var(--color-warning-soft);color:var(--color-warning)}
.user-state.disabled{background:var(--color-background-tertiary);color:var(--color-text-tertiary)}
.role-legend{display:grid;grid-template-columns:max-content 1fr;gap:6px 14px;margin:18px 0 0;padding:12px 14px;border-radius:var(--radius-md);background:var(--color-background-secondary);font-size:12px;line-height:1.55}
.role-legend dt{font-weight:650;color:var(--color-text-primary)}
.role-legend dd{margin:0;color:var(--color-text-secondary)}
.users-log-title{margin:22px 0 8px;font-size:13px;font-weight:650}
.users-log{margin:0;padding:0;list-style:none;font-size:12px;color:var(--color-text-secondary)}
.users-log li{padding:6px 0;border-bottom:1px solid var(--color-border-tertiary)}
.users-log li span{display:inline-block;min-width:96px;color:var(--color-text-tertiary);font-variant-numeric:tabular-nums}
.auth-gate{position:fixed;inset:0;z-index:2000;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--color-background-secondary)}
.auth-gate[hidden]{display:none}
body.auth-gated .workspace{visibility:hidden}
.auth-card{width:min(420px,100%);padding:30px 28px 24px;border:1px solid var(--color-border-tertiary);border-radius:var(--radius-lg);background:var(--color-background-primary);box-shadow:var(--shadow-popover);text-align:center}
.auth-card h2{margin:14px 0 8px;font-size:17px;font-weight:650;color:var(--color-text-primary)}
.auth-card p{margin:0;font-size:13px;line-height:1.7;color:var(--color-text-secondary)}
.auth-card small{display:block;margin-top:12px;padding:8px 10px;border-radius:var(--radius-sm);background:var(--color-background-tertiary);font-size:11.5px;color:var(--color-text-tertiary);word-break:break-all}
.auth-actions{margin-top:20px}
.auth-actions .button{min-width:120px;height:34px}
.auth-icon{width:44px;height:44px;margin:0 auto;border-radius:50%;background:var(--color-accent-soft);position:relative}
.auth-icon::after{content:'';position:absolute;inset:11px;background:var(--color-accent);-webkit-mask:var(--auth-icon) center/contain no-repeat;mask:var(--auth-icon) center/contain no-repeat;--auth-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E")}
.auth-gate[data-kind="pending"] .auth-icon,.auth-gate[data-kind="expired"] .auth-icon{background:var(--color-warning-soft)}
.auth-gate[data-kind="pending"] .auth-icon::after,.auth-gate[data-kind="expired"] .auth-icon::after{background:var(--color-warning)}
.auth-gate[data-kind="expired"] .auth-icon::after{--auth-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E")}
.auth-gate[data-kind="disabled"] .auth-icon,.auth-gate[data-kind="network"] .auth-icon,.auth-gate[data-kind="dingtalk"] .auth-icon,.auth-gate[data-kind="error"] .auth-icon{background:var(--color-danger-soft)}
.auth-gate[data-kind="disabled"] .auth-icon::after,.auth-gate[data-kind="network"] .auth-icon::after,.auth-gate[data-kind="dingtalk"] .auth-icon::after,.auth-gate[data-kind="error"] .auth-icon::after{background:var(--color-danger)}
.auth-gate[data-kind="network"] .auth-icon::after{--auth-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M2 2l20 20M8.5 16.4a5 5 0 0 1 7 0M5 12.9a10 10 0 0 1 5.2-2.8M19 12.9a10 10 0 0 0-2-1.5M2 9.3a15 15 0 0 1 4.2-2.7M22 9.3A15 15 0 0 0 11 5M12 20h.01'/%3E%3C/svg%3E")}
@media (max-width:620px){
 .collab-bar{padding:4px 10px}
 .collab-text small{display:block;margin:2px 0 0}
 .users-wrap{padding:12px 10px 24px}
 .users-table th:nth-child(4),.users-table td:nth-child(4){display:none}
 .users-table select{min-width:96px}
 .users-table .role-help{display:none}
 .users-table th,.users-table td{padding:8px 6px}
}

/* ---------- 权限分层（2026-10-14）：全局 / 本单标记、本单权限对话框 ---------- */
.scope-tag{display:inline-block;margin-left:4px;padding:1px 6px;border-radius:4px;background:var(--color-warning-soft);color:var(--color-warning);font-size:10.5px;font-weight:600;line-height:1.5;vertical-align:1px;white-space:nowrap}
.scope-tag.global{background:var(--color-accent-soft);color:var(--color-accent)}
.users-table .users-grants{font-size:12px;color:var(--color-text-secondary);max-width:180px}
.muted{color:var(--color-text-tertiary)}
.quote-access-dialog{width:min(820px,calc(100vw - 32px))}
.quote-access-dialog .qa-note{margin:0 0 12px;font-size:12.5px;line-height:1.6;color:var(--color-text-secondary)}
.qa-code{margin-left:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:500;color:var(--color-text-tertiary)}
.qa-wrap{max-height:min(56vh,520px);overflow:auto;border:1px solid var(--color-border-tertiary);border-radius:var(--radius-md)}
.qa-table th{position:sticky;top:0;z-index:1}
.qa-table td{vertical-align:middle}
.qa-table tr.granted td{background:#fffbf2}
.qa-table select{height:28px;padding:0 6px;border:1px solid var(--color-border-secondary);border-radius:var(--radius-sm);background:var(--color-background-primary);font:inherit;font-size:12.5px}
.qa-table .qa-fields{display:block;margin-top:3px;font-size:11px;color:var(--color-text-tertiary);line-height:1.5}
.qa-edit{margin-left:6px;height:24px;padding:0 8px;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--color-accent);font:inherit;font-size:12px;cursor:pointer}
.qa-edit:hover{background:var(--color-accent-soft)}
.qa-table tr.qa-pick td{background:var(--color-background-secondary);padding:10px 12px 12px}
.qa-table tr.qa-pick fieldset{display:flex;flex-wrap:wrap;gap:4px 14px;margin:0 0 8px;padding:8px 10px;border:1px solid var(--color-border-tertiary);border-radius:var(--radius-sm);background:var(--color-background-primary)}
.qa-table tr.qa-pick legend{padding:0 4px;font-size:12px;font-weight:600}
.qa-table tr.qa-pick .permission-option{font-size:12.5px}
.qa-pick-actions{display:flex;justify-content:flex-end;gap:8px}
.qa-pick-actions .button{height:28px;font-size:12px}
.qa-foot{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;font-size:12px;color:var(--color-text-secondary)}
.qa-foot span{flex:1 1 300px}
.qa-foot b{color:var(--color-text-primary);font-weight:600}
@media (max-width:620px){
 .users-table th:nth-child(4),.users-table td:nth-child(4){display:none}
 .qa-table th:nth-child(2),.qa-table td:nth-child(2){display:none}
}

/* ---------- 成本分析一屏自适应（2026-10-14）：桌面不出现上下滚动，按窗口高度压缩间距并决定排行条数 ---------- */
@media (min-width:801px){
 #analysisSheet.active{display:flex;flex-direction:column;overflow:hidden}
 #analysisSheet .simple-head{flex:none;padding:clamp(10px,1.8vh,18px) 24px clamp(8px,1.4vh,14px)}
 #analysisSheet .simple-head p{display:block}
 .analysis-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:clamp(10px,1.8vh,18px) 24px clamp(12px,2.2vh,24px)}
 .analysis-metrics{flex:none;gap:clamp(10px,1.2vw,16px);margin-bottom:clamp(10px,1.8vh,20px)}
 .analysis-metrics article{padding:clamp(8px,1.6vh,18px) clamp(12px,1.4vw,18px)}
 .analysis-metrics strong{font-size:clamp(20px,3.4vh,28px);margin-top:clamp(2px,.6vh,7px)}
 .analysis-columns{flex:1;min-height:0;grid-template-rows:minmax(0,1fr)}
 .chart-card{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:clamp(12px,2vh,20px)}
 .chart-card h3{flex:none;display:flex;align-items:baseline;gap:8px;margin:0 0 clamp(8px,1.6vh,18px)}
 .chart-card h3 small{font-size:11.5px;font-weight:400;color:var(--color-text-tertiary)}
 .stacked-cost{flex:none;margin-bottom:clamp(8px,1.8vh,22px)}
 .legend-list{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:flex-start}
 .legend-list .chart-legend{flex:0 1 34px;min-height:18px;margin:0}
 .rank-legend{flex:none}
 .rank-list{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .rank-list .cost-rank{flex:0 1 32px;min-height:22px;padding:0 4px}
}

/* 用户提供字体，仅用于顶栏姓名；原始字体保留在 Downloads。 */
@font-face{font-family:"Haiya ShiGuang";src:url("/HYShiGuangTiW.ttf") format("truetype");font-style:normal;font-weight:400;font-display:swap}
/* ---------- 顶栏身份（2026-10-14）：无头像，姓名 + 轻量全局身份标签 ---------- */
.user-chip{display:inline-flex;align-items:center;gap:8px;max-width:100%;height:32px;padding:0 8px;border:0;border-radius:6px;background:transparent;box-shadow:none;font:inherit;color:var(--color-text-primary);cursor:default}
.user-chip:disabled{opacity:1}
.user-chip.switchable{cursor:pointer}
.user-chip.switchable:hover{background:var(--color-background-tertiary)}
.user-chip.switchable:active,.user-chip.switchable[aria-expanded="true"]{background:var(--color-border-tertiary)}
.user-name{min-width:0;max-width:180px;overflow:hidden;text-overflow:ellipsis;font-family:"Haiya ShiGuang","PingFang SC","Microsoft YaHei",sans-serif;font-size:15px;font-weight:400;letter-spacing:.035em;color:var(--color-text-primary);white-space:nowrap}
.user-role{display:inline-flex;align-items:center;flex:none;height:20px;padding:0 6px;border:1px solid var(--color-border-tertiary);border-radius:4px;font-size:10px;font-weight:400;letter-spacing:0;line-height:1;white-space:nowrap;background:transparent;color:var(--color-text-secondary)}
.user-chip[data-role="none"] .user-role{color:var(--color-text-tertiary)}
.user-switch{display:none;flex:none;width:10px;height:10px;fill:none;stroke:var(--color-text-tertiary);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;margin-left:2px}
.user-chip.switchable .user-switch{display:block}
@media (prefers-reduced-motion:no-preference){.user-chip{transition:background-color 120ms ease}}
.new-quote-btn{display:inline-flex;align-items:center;gap:4px}
.new-quote-btn svg{width:10px;height:10px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;opacity:.7}
@media (max-width:620px){.user-name{max-width:96px}.user-chip{padding:0 6px;gap:6px}}

/* ---------- 保存方式（2026-10-14） ---------- */
.workspace-status{flex-basis:30px;align-items:center}
.save-mode{display:inline-flex;flex:none;align-items:center;white-space:nowrap;padding:2px;margin-right:8px;border:1px solid #e3e4e9;border-radius:9px;background:#f5f5f7}
.save-mode button{height:20px;min-width:62px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:#505055;font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:background-color .15s,color .15s,box-shadow .15s}
.save-mode button:hover{background:#ededf0}
.save-mode button[aria-pressed="true"]{background:#fff;color:var(--color-accent);box-shadow:0 1px 3px rgba(30,35,50,.12)}
.manual-save{display:inline-flex;align-items:center;gap:4px;margin-left:6px}
.manual-save[hidden]{display:none}
.manual-save .save-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:3px;color:var(--color-text-primary)}
.manual-save .save-btn svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}
.manual-save .save-btn:disabled{background:transparent;color:var(--color-text-tertiary);opacity:.5}
.save-count{position:absolute;right:-5px;top:-3px;min-width:15px;height:15px;padding:0 3px;border-radius:8px;background:var(--color-accent);color:#fff;font-size:9px;line-height:15px;text-align:center;font-variant-numeric:tabular-nums}
.save-count[hidden]{display:none}
#saveStatus.draft{gap:6px;color:var(--color-text-secondary);background:transparent;font-size:11px;font-weight:500;margin:0 4px;min-height:24px;padding:0 8px;font-variant-numeric:tabular-nums}
#saveStatus.draft::before{content:'';flex:none;width:6px;height:6px;border-radius:50%;background:#c48528}
.quote-grid td.is-draft{background-color:#fffaf0}
.quote-grid td.is-draft::before{content:'';position:absolute;left:5px;top:5px;width:4px;height:4px;border-radius:1px;background:#c48528;pointer-events:none}

/* 报价信息按内容区宽度排布，避免只有状态与价格被挤到第二行。 */
.workspace-content{container-type:inline-size;container-name:quote-workspace}
.quote-bar{display:grid;grid-template-columns:minmax(200px,1fr) minmax(280px,auto) auto;gap:8px 12px}
.quote-id h1{max-width:100%}
.quote-id p{overflow:hidden;text-overflow:ellipsis}
.quote-switch{min-width:0;flex-wrap:wrap}
.quote-switch>.button{flex:none}
.quote-switch #quoteSelectButton{flex:1 1 120px;min-width:120px;max-width:220px}
.quote-right{margin-left:0;min-width:0;justify-content:flex-end;gap:10px}
.summary-price{flex:none;white-space:nowrap}
@container quote-workspace (max-width:1150px){
 .quote-bar{grid-template-columns:minmax(0,1fr) auto}
 .quote-id{grid-column:1/-1}
 .quote-switch{grid-column:1}
 .quote-right{grid-column:2}
}
@container quote-workspace (max-width:800px){
 .quote-bar{grid-template-columns:minmax(0,1fr)}
 .quote-id,.quote-switch,.quote-right{grid-column:1;width:100%}
 .quote-right{justify-content:space-between;flex-wrap:wrap}
}
/* 使用实际内容宽度自然换行，草稿操作出现时也给插入行留出空间。 */
.sheet-toolbar{flex:0 0 auto;min-height:46px;flex-wrap:wrap;padding:7px 12px;row-gap:10px}
.sheet-toolbar .sheet-actions{flex:1 1 420px;min-width:min(420px,100%);margin-left:0}
.sheet-toolbar .sheet-actions .group-nav{min-width:0;grid-auto-columns:minmax(0,1fr)}
.sheet-toolbar .sheet-actions .group-jump{min-width:0;padding:0 6px}
.sheet-toolbar #addRowButton{flex:none}
.appbar-actions{min-width:0;flex-wrap:wrap;justify-content:flex-end}
@container quote-workspace (max-width:640px){
 .sheet-toolbar .tb-group{flex-wrap:wrap;min-width:0;max-width:100%}
 .sheet-toolbar .search-wrapper{width:min(240px,100%);min-width:0}
 .sheet-toolbar .sheet-actions{flex-wrap:wrap;justify-content:flex-end}
 .sheet-toolbar .sheet-actions .group-nav{flex:1 1 100%}
}
@media (max-width:620px){
 .workspace-status{flex-wrap:wrap;height:auto;flex-basis:auto;align-items:center;gap:2px;padding:3px 0}
 .workspace-status .status-caption{display:none}
 .workspace-status .tab-spacer{display:none}
 .workspace-status .save-mode{margin-left:8px;margin-right:auto}
 .workspace-status .autosave{display:flex;min-height:24px;padding:0 8px}
 .workspace-status .help-button{min-height:24px;padding:0 8px}
}

/* 项目 Logo，保留原 PNG 透明背景 */
.end-edit-actions{flex-wrap:wrap}
#endEditDialog p{max-width:420px;margin:12px 0 18px;font-size:13px;line-height:1.7;color:var(--color-text-secondary)}
.identity .logo { width:36px; height:36px; flex:0 0 36px; }
.identity .logo img { display:block; width:100%; height:100%; object-fit:contain; }

/* 报价导入导出：参考备料按钮，导入向下、导出向上。 */
.quote-switch>.transfer-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:30px;padding:0 11px;border:1px solid #c8dcff;border-radius:8px;background:#fff;color:var(--color-accent);font-size:12px;font-weight:600;white-space:nowrap}
.quote-switch>.transfer-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.quote-switch>.transfer-btn.export-btn{background:var(--color-accent-soft);border-color:#b8d2ff}
.quote-switch>.transfer-btn:hover:not(:disabled){background:#e0ecff;border-color:#a9c9ff}
.quote-switch>.transfer-btn:disabled{opacity:.5;cursor:not-allowed}

/* 底栏编辑占用替代工作台字样，保持底栏原高度。 */
.workspace-status>.edit-lock-chip{flex:none;margin-left:10px;height:24px;padding:2px 3px 2px 8px;gap:6px;font-size:11px}
.workspace-status>.edit-lock-chip i{width:6px;height:6px;box-shadow:0 0 0 3px rgba(47,111,74,.12)}
.workspace-status>.edit-lock-chip button{height:20px;padding:0 7px;font-size:11px}
@media(max-width:620px){.workspace-status>.edit-lock-chip{margin-right:auto}}

.cell-details-panel[data-scope="quote"]{display:flex;flex-direction:column;width:min(420px,100vw);overflow:hidden}
.cell-details-panel[data-scope="quote"][hidden]{display:none}
.cell-details-panel[data-scope="quote"]>.panel-head{flex:none}
.cell-details-panel[data-scope="quote"] #cellDetailsBody{flex:1;min-height:0;overflow-y:auto;padding-right:4px}
.cell-details-panel[data-scope="quote"] #commentForm{flex:none;margin-top:12px;padding-top:12px;border-top:1px solid var(--color-border-tertiary)}
.quote-details-summary{color:var(--color-text-secondary);line-height:1.5;overflow-wrap:anywhere}

/* 整单备注为蓝色卡片，系统操作记录为中性时间线。 */
.quote-notes-section{padding:12px;border:1px solid #d9e5f7;border-radius:10px;background:#f5f8fe;margin:14px 0 24px}
.cell-details-panel h4.quote-section-title{display:flex;align-items:center;gap:7px;margin:0 0 12px;font-size:13px;font-weight:650;color:var(--color-accent)}
.quote-section-title svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.quote-section-title>span{margin-left:auto;padding:1px 6px;border-radius:5px;background:#e5edfb;font-size:10px;font-weight:500;font-variant-numeric:tabular-nums}
.quote-note-card{padding:11px 12px;border:1px solid #e3eaf5;border-radius:7px;background:#fff}
.quote-note-card+.quote-note-card{margin-top:8px}
.quote-note-meta{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;font-size:11px}
.quote-note-meta time{margin-left:auto;color:var(--color-text-tertiary);font-size:10px}
.quote-note-card p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;margin:8px 0 0;color:var(--color-text-primary);font-size:12px}
.quote-notes-section .detail-empty{margin:4px 0;font-size:11px}
.quote-records-section{border-top:1px solid var(--color-border-tertiary);padding-top:18px}
.cell-details-panel .quote-records-section h4{color:var(--color-text-secondary)}
.quote-records-section .quote-section-title>span{background:var(--color-background-tertiary);color:var(--color-text-tertiary)}
.quote-record-list{padding-left:6px}
.quote-record-entry{position:relative;margin-left:3px;padding:0 0 17px 17px;border-left:1px solid var(--color-border-tertiary)}
.quote-record-entry::before{content:'';position:absolute;left:-3px;top:5px;width:5px;height:5px;border-radius:50%;background:#a9b2bf;box-shadow:0 0 0 3px #fff}
.quote-record-entry:last-child{padding-bottom:4px;border-left-color:transparent}
.quote-record-title{font-size:11.5px;color:var(--color-text-secondary);line-height:1.5}
.quote-record-change{margin-top:4px;font-size:11px;line-height:1.5;overflow-wrap:anywhere;color:var(--color-text-tertiary)}
.quote-record-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:5px;font-size:10px;color:var(--color-text-tertiary)}
.quote-record-meta time{font-variant-numeric:tabular-nums}

.quote-note-actions{display:flex;justify-content:flex-end;margin-top:8px}
.quote-note-actions button,.quote-note-undo button{border:0;background:transparent;font:inherit;font-size:11px;color:var(--color-accent);padding:3px 5px;border-radius:4px;cursor:pointer}
.quote-note-actions [data-quote-note-delete]{color:var(--color-text-tertiary)}
.quote-note-actions [data-quote-note-delete]:hover{color:var(--color-danger);background:var(--color-danger-soft)}
.quote-note-actions [data-quote-note-restore]:hover,.quote-note-undo button:hover{background:var(--color-accent-soft)}
.quote-note-undo{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;padding:7px 9px;border-radius:6px;background:#e9f0fc;font-size:11px;color:var(--color-text-secondary)}
.quote-deleted-notes{margin-top:12px;font-size:11px;color:var(--color-text-tertiary)}
.quote-deleted-notes summary{cursor:pointer;padding:4px 0}
.quote-deleted-notes .quote-note-card{margin-top:8px;background:#f7f8fa;border-color:var(--color-border-tertiary)}
.quote-deleted-notes .quote-note-card p{color:var(--color-text-tertiary)}
