:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #e3e6ea;
    --text: #1f2329;
    --text-2: #646a73;
    --text-3: #8f959e;
    --primary: #185fa5;
    --primary-2: #2f7fd0;
    --primary-soft: #e6f1fb;
    --green: #2e9e5b;
    --green-soft: #e7f5ec;
    --amber: #c8821a;
    --amber-soft: #fbf0db;
    --red: #d8504a;
    --red-soft: #fbe9e8;
    --purple: #6c4fc1;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(20,30,50,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Segoe UI, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
h1,h2,h3 { margin: 0; font-weight: 600; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; outline: none; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); }
.btn { border: 1px solid var(--border); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 8px; font-size: 13px; transition: .15s; }
.btn:hover { border-color: var(--primary-2); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 11px; font-size: 14px; margin-top: 6px; }
.btn-danger { color: var(--red); border-color: #f0c4c2; }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.link-btn { background: none; border: none; color: var(--text-3); font-size: 12px; text-decoration: underline; padding: 4px; }
.link-btn:hover { color: var(--primary); }

/* ===== 登录 ===== */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e9f1fb, #f5f6f8); position: relative; padding: 20px 16px 48px; }
/* 管局要求备案号挂在首页底部。登录页是 flex 居中的，页脚用绝对定位钉在最下面，
   上面的 padding-bottom 给它留位，窗口再矮也不会压到卡片。 */
.login-screen > .icp-bar { position: absolute; left: 0; right: 0; bottom: 14px; }
.icp-bar { font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.8; }
.icp-bar a { color: inherit; text-decoration: none; }
.icp-bar a:hover { color: var(--primary); text-decoration: underline; }
/* 登录后首页那条跟着内容滚到底，补一点边距和上面的栅格对齐 */
.home-view > .icp-bar { padding: 0 18px 18px; }
.login-card { width: 380px; background: var(--surface); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand-logo { width: 46px; height: 46px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.login-brand h1 { font-size: 19px; }
.login-brand p { margin: 2px 0 0; color: var(--text-3); font-size: 12px; }
.tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tab { flex: 1; border: none; background: transparent; padding: 8px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
.auth-form label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
.auth-form input { margin-top: 5px; }
.form-msg { color: var(--red); font-size: 12px; min-height: 16px; margin-bottom: 4px; }
.form-msg.ok { color: var(--green); }
.form-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin: 8px 0; cursor: pointer; }
.hint { font-size: 11px; color: var(--text-3); margin-top: 10px; }

/* ===== 主布局 ===== */
.main-screen { min-height: 100vh; display: flex; flex-direction: column; }
.app-header { height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.app-title { font-weight: 600; font-size: 15px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
/* 桌面端徽标：只有探测到本机看图程序才会亮（网页端一直是 hidden），
   用来回答"我开的到底是哪个入口、现在有没有网"。 */
.ds-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px 10px; white-space: nowrap; }
.ds-chip.hidden { display: none; }
.ds-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.ds-dot.on { background: #2e9e5b; }
.ds-dot.off { background: #d0453f; }
.user-menu { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.layout { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 248px; background: var(--surface); border-right: 1px solid var(--border); padding: 14px 10px; overflow-y: auto; }
.sidebar-title { font-size: 12px; color: var(--text-3); padding: 6px 8px; }
.project-list { display: flex; flex-direction: column; gap: 4px; }
.project-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.project-item:hover { background: var(--surface-2); }
.project-item.active { background: var(--primary-soft); border-color: #bcdcff; }
.project-item .pi-name { font-weight: 600; font-size: 13px; }
.project-item .pi-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.workspace { flex: 1; padding: 20px 24px; overflow-y: auto; }

.empty-state { text-align: center; color: var(--text-3); margin-top: 12vh; }
.empty-state .empty-icon { font-size: 52px; }
.empty-state h2 { font-size: 17px; color: var(--text-2); margin: 12px 0 6px; }

.project-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.project-header h2 { font-size: 20px; }
.project-meta { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.project-meta span { margin-right: 12px; }
.project-stat-chips { display: flex; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 20px; font-size: 12px; background: var(--surface-2); color: var(--text-2); }
.chip.open { background: var(--amber-soft); color: var(--amber); }
.chip.closed { background: var(--green-soft); color: var(--green); }
.chip.over { background: var(--red-soft); color: var(--red); }

/* ===== Tabs ===== */
.tabs-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-nav { border: none; background: transparent; padding: 10px 16px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tab-nav:hover { color: var(--primary); }
.tab-nav.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== 通用面板 ===== */
.panel-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.panel-bar .filters { display: flex; gap: 8px; align-items: center; }
.panel-bar select { width: auto; padding: 7px 10px; }
/* BIM 页那个排序下拉：标签小字贴左边，别抢方案表的宽度 */
.bim-sort-lb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #888; }
.bim-sort-lb select { font-size: 13px; color: var(--text); }

/* ===== 图模空间 ===== */
.draw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.draw-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: .15s; }
.draw-card:hover { box-shadow: var(--shadow); border-color: var(--primary-2); }
.draw-thumb { height: 130px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 34px; overflow: hidden; }
.draw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.draw-info { padding: 10px 12px; }
.draw-info .di-name { font-weight: 600; font-size: 13px; }
.draw-info .di-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* 批注查看器 */
.viewer-wrap { position: relative; background: #1f2329; border-radius: var(--radius); overflow: hidden; display: inline-block; max-width: 100%; }
.viewer-wrap img { display: block; max-width: 100%; max-height: 68vh; }
.viewer-pin { position: absolute; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.viewer-pin.closed { background: var(--green); }
.viewer-pin.open { background: var(--amber); }

/* ===== 问题列表 ===== */
.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 14px; cursor: pointer; transition: .15s; }
.issue-card:hover { box-shadow: var(--shadow); border-color: var(--primary-2); }
.issue-no { font-weight: 700; color: var(--primary); width: 42px; flex-shrink: 0; }
.issue-main { flex: 1; min-width: 0; }
.issue-title { font-weight: 600; font-size: 14px; }
.issue-sub { font-size: 12px; color: var(--text-3); margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.badge { padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.b-sev-critical { background: var(--red-soft); color: var(--red); }
.b-sev-major { background: var(--amber-soft); color: var(--amber); }
.b-sev-minor { background: var(--primary-soft); color: var(--primary); }
.b-sev-suggestion { background: var(--surface-2); color: var(--text-2); }
.b-st-pending { background: var(--amber-soft); color: var(--amber); }
.b-st-in_progress { background: var(--primary-soft); color: var(--primary); }
.b-st-review { background: #efe6fb; color: var(--purple); }
.b-st-closed { background: var(--green-soft); color: var(--green); }
.b-st-rejected { background: var(--red-soft); color: var(--red); }
.overdue { color: var(--red); font-weight: 600; }

/* ===== 问题详情：一条时间线 + 唯一一块「现在轮到你」操作卡 ===== */
.issue-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 12px; }
.issue-top h2 { margin: 0 0 6px; font-size: 18px; }
.issue-top-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-3); }
.issue-top-r { display: flex; gap: 6px; align-items: center; }
.tl-list { border-left: 2px solid var(--border); margin: 0 0 14px 6px; padding-left: 16px; }
.tl-row { position: relative; padding: 8px 0 10px; }
.tl-row::before { content: ''; position: absolute; left: -22px; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.tl-head b { color: var(--primary); }
.tl-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.tl-tag.t-create, .tl-tag.t-reply { background: #eef6ff; color: #1a5fb4; border-color: #cfe0f5; }
.tl-tag.t-pass { background: var(--green-soft); color: var(--green); border-color: #bfe3cd; }
.tl-tag.t-reject { background: var(--red-soft); color: var(--red); border-color: #f0c9c9; }
.tl-tag.t-status, .tl-tag.t-chat { background: transparent; color: var(--text-3); border-style: dashed; }
.tl-text { margin-top: 4px; white-space: pre-wrap; line-height: 1.6; word-break: break-word; }
.tl-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tl-img { max-width: 240px; max-height: 160px; object-fit: contain; }
.issue-img { max-width: 100%; border-radius: 8px; margin: 6px 6px 6px 0; border: 1px solid var(--border); }
.zl { cursor: zoom-in; }
/* 附图全屏看：盖在弹窗（z-index 2000）之上，看图页/合模的 1000 层也压得住 */
.img-viewer { position: fixed; inset: 0; z-index: 3000; background: rgba(8,10,14,.94); display: flex; align-items: center; justify-content: center; padding: 52px 14px 14px; }
.img-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: zoom-out; }
.iv-bar { position: absolute; top: 0; left: 0; right: 0; height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; color: #e8eaed; font-size: 13px; }
.iv-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-x { background: #2b3038; border: 1px solid #454b54; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: #e8eaed; flex: 0 0 auto; }
.now-card { border: 1px solid var(--primary); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; margin-bottom: 12px; }
.now-card.is-wait { border-style: dashed; border-color: var(--border); background: var(--surface-2); }
.now-head { font-size: 13px; margin-bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.now-head b { color: var(--primary); }
.now-ops { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.now-ops .btn { white-space: nowrap; }
.cmt-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; background: var(--surface); }
.cmt-box summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.cmt-box #cmtList { margin-top: 8px; max-height: 240px; overflow: auto; }
.cmt-box textarea { margin-top: 8px; width: 100%; }
.cmt-box .btn { margin-top: 6px; }
.comment { border-bottom: 1px solid var(--surface-2); padding: 10px 0; }
.comment .c-head { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.comment .c-body { line-height: 1.5; }

/* ===== 统计 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-card .sc-num { font-size: 26px; font-weight: 700; }
.stat-card .sc-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.chart-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.chart-block h3 { font-size: 14px; margin-bottom: 14px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12px; }
.bar-label { width: 90px; color: var(--text-2); text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; background: var(--surface-2); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--primary); transition: width .4s; }
.bar-val { width: 30px; color: var(--text-2); }

/* ===== 图档库 ===== */
.doc-table { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.doc-table th, .doc-table td { padding: 11px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--surface-2); }
.doc-table th { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.doc-table tr:last-child td { border-bottom: none; }

/* ===== 成员 ===== */
.member-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.member-row .m-name { font-weight: 600; }
.member-row .m-role { font-size: 12px; color: var(--text-3); margin-left: 8px; }

/* ===== Modal ===== */
.modal-root { position: fixed; inset: 0; background: rgba(20,28,40,.45); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal.wide { max-width: 880px; }
.modal h2 { font-size: 17px; margin-bottom: 16px; }
.modal .form-row { margin-bottom: 13px; }
.modal .form-row label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-3); cursor: pointer; }
.drop-zone:hover { border-color: var(--primary-2); color: var(--primary); }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #1f2329; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13px; z-index: 80; box-shadow: var(--shadow); }
/* 错误提示必须和成功同款里跳出来：app.js 里 20 多处 toast(msg, true) 以前被签名吞掉了 */
.toast.err { background: #b3261e; font-weight: 600; }

/* ===== CAD 矢量查看器（专业黑底风格） ===== */
.cad-modal-body { margin-top: 10px; }
.cad-container { width: 100%; height: 64vh; border: 1px solid #333; border-radius: 8px; overflow: hidden; position: relative; background: #1a1a1a; }

.cad-root { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; background: #1a1a1a; }

/* 工具栏 */
.cad-toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #2a2a2a 0%, #222222 100%);
  border-bottom: 1px solid #444;
  flex-shrink: 0; flex-wrap: wrap;
}
.cad-btn {
  cursor: pointer;
  border: 1px solid #444;
  background: #333;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  color: #ccc;
  transition: all 0.15s;
}
.cad-btn:hover { border-color: #666; color: #fff; background: #444; }
.cad-btn.active { background: #0066cc; border-color: #0088ff; color: #fff; }
.cad-separator { width: 1px; height: 20px; background: #444; margin: 0 4px; }
.cad-hint { font-size: 11px; color: #88ccff; margin-left: 8px; }
.cad-spacer { flex: 1; }

/* 模型 / 布局 空间切换标签 */
.cad-space-tabs {
  display: flex; align-items: center; gap: 2px;
  background: #111; border: 1px solid #444;
  border-radius: 4px; padding: 2px;
}
.cad-space-tag {
  cursor: pointer;
  padding: 3px 10px;
  font-size: 11px;
  color: #999;
  border-radius: 3px;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.cad-space-tag:hover { color: #fff; background: #333; }
.cad-space-tag.active {
  background: #0088ff;
  color: #fff;
  font-weight: 600;
}

/* 状态栏 */
.cad-statusbar {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px;
  background: #111;
  border-top: 1px solid #333;
  font-size: 11px;
  color: #888;
  flex-shrink: 0;
}
.cad-statusbar .cad-status-sep { color: #444; }
.cad-statusbar [data-role="coords"] { color: #00ff88; font-family: "Consolas", "Monaco", monospace; }
.cad-statusbar [data-role="zoom"] { color: #ffaa00; }
.cad-statusbar [data-role="status"] { color: #aaa; }

/* 画布区域 */
.cad-canvas-wrap { flex: 1; position: relative; min-height: 0; background: #1a1a1a; }
.cad-canvas-wrap canvas { display: block; width: 100%; height: 100%; }

/* 十字光标 */
.cad-crosshair {
  position: absolute;
  pointer-events: none;
  display: none;
  z-index: 3;
}

/* 加载遮罩 */
.cad-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(26,26,26,.95);
  z-index: 5;
  font-size: 13px;
  color: #aaa;
}
.cad-loading.hidden { display: none; }
.cad-spinner {
  width: 36px; height: 36px;
  border: 3px solid #333;
  border-top-color: #0088ff;
  border-radius: 50%;
  animation: cad-spin .8s linear infinite;
}
@keyframes cad-spin { to { transform: rotate(360deg); } }

/* 图层面板 */
.cad-layers {
  position: absolute; top: 44px; right: 10px;
  background: #222;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  padding: 10px;
  max-height: 46vh;
  overflow-y: auto;
  display: none;
  min-width: 180px;
  z-index: 6;
}
.cad-layers.show { display: block; }
.cad-layers .cl-title { font-weight: 600; font-size: 12px; color: #aaa; margin-bottom: 6px; }
.cad-layers .cl-actions { display: flex; gap: 6px; margin-bottom: 8px; }
.cad-layers .cl-btn {
  cursor: pointer; border: 1px solid #444; background: #333;
  border-radius: 4px; padding: 3px 8px; font-size: 11px; color: #aaa;
}
.cad-layers .cl-btn:hover { background: #444; color: #fff; }
.cad-layers .cl-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; padding: 3px 0;
  color: #ccc; white-space: nowrap;
}
.cad-layers .cl-item input { accent-color: #0088ff; }
.cad-layers .cl-empty { font-size: 12px; color: #666; padding: 6px 0; }
.cad-layers::-webkit-scrollbar { width: 6px; }
.cad-layers::-webkit-scrollbar-track { background: #1a1a1a; }
.cad-layers::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* 定位标记 */
.cad-locate-dot {
  position: absolute; transform: translate(-50%, -50%);
  background: rgba(255,68,68,.95);
  color: #fff; padding: 6px 14px; border-radius: 16px;
  font-size: 12px; font-weight: 600;
  box-shadow: 0 0 0 4px rgba(255,68,68,.3), 0 4px 16px rgba(0,0,0,.5);
  pointer-events: none;
  animation: cad-pulse 1.4s ease-in-out infinite;
  z-index: 7;
}
@keyframes cad-pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(255,68,68,.3), 0 4px 16px rgba(0,0,0,.5); }
  50% { box-shadow: 0 0 0 12px rgba(255,68,68,.05), 0 4px 16px rgba(0,0,0,.5); }
}

/* ---------- 移动端（手机 / 平板）：CAD 矢量查看器 ----------
   画布上的手势由 cad-viewer.js 接管（touch-action:none），这里只管按钮够大、
   工具栏不换行溢出、状态栏和图层面板在小屏上不挡图。 */
@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .cad-toolbar { gap: 6px; padding: 6px 8px; }
  .cad-btn { padding: 9px 12px; font-size: 14px; min-height: 40px; }
  .cad-btn-ico { font-size: 16px; }
  .cad-separator { display: none; }
  .cad-hint { font-size: 12px; width: 100%; margin: 2px 0 0; order: 9; }
  .cad-spacer { display: none; }
  .cad-space-tag { padding: 9px 12px; font-size: 13px; }
  .cad-statusbar { font-size: 12px; padding: 7px 10px; gap: 6px; }
  .cad-layers { top: auto; bottom: 46px; right: 8px; left: 8px; max-height: 44vh; min-width: 0; }
  .cad-layers .cl-item { padding: 7px 0; font-size: 14px; white-space: normal; }
  .cad-layers .cl-btn { padding: 8px 12px; font-size: 13px; }
  .canvasWrap, .cad-canvas-wrap { touch-action: none; }
}

/* 文字标签（支持中文）——工程自带 TTF（Noto 子集，SIL OFL，vendor/fonts/）渲染文字；
   黑晕改 4 向硬描边（密集区不糊块） */
@font-face {
  font-family: 'CADCJK';
  src: url('/fonts/chinese.ttf') format('truetype');
  font-display: swap;
}
.cad-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.cad-label {
  position: absolute; transform: translate(-0%, -50%);
  white-space: nowrap; color: #ffffff;
  font-weight: 500;
  text-shadow: -1px 0 0 #000, 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000;
  line-height: 1; user-select: none;
  font-family: "CADCJK", "Microsoft YaHei", "PingFang SC", "SimHei", "SimSun", sans-serif;
  letter-spacing: 0.5px;
}

/* 窗口缩放选择框 */
.cad-zoom-window {
  position: absolute;
  border: 1px solid #00aaff;
  background: rgba(0,170,255,.15);
  pointer-events: none;
  z-index: 4;
}

/* 测量标签 */
.cad-measure-label {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(0,255,136,.95);
  color: #000;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  z-index: 7;
  white-space: nowrap;
}
.cad-measure-label .measure-value { font-family: "Consolas", monospace; }
.cad-measure-label .measure-angle { font-size: 10px; color: #333; margin-top: 2px; }

/* ===== CAD 全屏覆盖层 ===== */
.cad-fullscreen-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: #111;
  display: flex; flex-direction: column;
  animation: cad-fs-fadein 0.2s ease;
}
@keyframes cad-fs-fadein { from { opacity: 0; } to { opacity: 1; } }

.cad-fs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}
.cad-fs-title {
  display: flex; align-items: center; gap: 12px;
  color: #fff; font-size: 14px; font-weight: 600;
}
.cad-fs-back {
  cursor: pointer; border: 1px solid #444; background: #333;
  border-radius: 4px; padding: 4px 12px; font-size: 12px; color: #ccc;
}
.cad-fs-back:hover { background: #444; color: #fff; }
.cad-fs-actions { display: flex; gap: 8px; }
.cad-fs-btn {
  cursor: pointer; border: 1px solid #444; background: #333;
  border-radius: 4px; padding: 5px 14px; font-size: 12px; color: #ccc;
  text-decoration: none; display: inline-flex; align-items: center;
}
.cad-fs-btn:hover { background: #444; color: #fff; }
.cad-fs-close { background: #663333; border-color: #884444; }
.cad-fs-close:hover { background: #884444; }

.cad-fs-body {
  flex: 1; display: flex; min-height: 0; overflow: hidden;
}

/* 左侧文件树 */
.cad-fs-sidebar {
  width: 240px; background: #1a1a1a; border-right: 1px solid #333;
  display: flex; flex-direction: column; flex-shrink: 0;
  overflow: hidden;
}
.cad-fs-sidebar-title {
  padding: 10px 12px; font-size: 12px; color: #888;
  border-bottom: 1px solid #333; font-weight: 600;
}
.cad-fs-file-tree {
  flex: 1; overflow-y: auto; padding: 8px 0;
}
.cad-fs-file-tree::-webkit-scrollbar { width: 6px; }
.cad-fs-file-tree::-webkit-scrollbar-track { background: #111; }
.cad-fs-file-tree::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

.cad-fs-folder { margin-bottom: 4px; }
.cad-fs-folder-name {
  padding: 6px 12px; font-size: 12px; color: #aaa;
  cursor: default; font-weight: 600;
}
.cad-fs-file {
  padding: 6px 12px 6px 24px; font-size: 12px; color: #ccc;
  cursor: pointer; transition: background 0.1s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cad-fs-file:hover { background: #2a2a2a; color: #fff; }
.cad-fs-file.active { background: #003366; color: #fff; border-left: 3px solid #0088ff; }

/* 右侧 CAD 主区域 */
.cad-fs-main {
  flex: 1; min-width: 0; position: relative;
}
.cad-fs-main .cad-container {
  width: 100%; height: 100%; border: none; border-radius: 0;
}

/* ===== 问题定位按钮 ===== */
.issue-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-locate { white-space: nowrap; }


/* ===== 首页总览 ===== */
.app-brand { display: flex; align-items: center; gap: 10px; }
.brand-cube { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; letter-spacing: .5px; }
.app-header .app-title { font-size: 16px; font-weight: 600; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.user-menu { display: flex; align-items: center; gap: 8px; }

.home-view { flex: 1; overflow: auto; background: var(--bg); }
.home-layout { display: grid; grid-template-columns: 250px 1fr 260px; gap: 16px; padding: 18px; max-width: 1500px; margin: 0 auto; }

/* 左侧用户卡 + 快捷入口 */
.home-side { display: flex; flex-direction: column; gap: 14px; }
.home-user-card { background: linear-gradient(135deg, var(--primary), #3a7fc0); border-radius: var(--radius); color: #fff; padding: 22px 18px; text-align: center; box-shadow: var(--shadow); }
.home-user-avatar { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.25); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; border: 2px solid rgba(255,255,255,.5); }
.home-user-name { font-size: 16px; font-weight: 600; }
.home-user-role { font-size: 12px; opacity: .85; margin-top: 4px; }
.home-quick { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.home-quick-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.home-quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-item { background: var(--surface-2); border-radius: 10px; padding: 12px 4px; text-align: center; cursor: pointer; transition: .15s; border: 1px solid transparent; }
.quick-item:hover { background: var(--primary-soft); border-color: var(--primary-2); }
.quick-icon { font-size: 20px; }
.quick-label { font-size: 11px; color: var(--text-2); margin-top: 5px; }

/* 中部统计 + 项目网格 */
.home-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-big { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); text-align: center; }
.stat-num { font-size: 34px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.stat-num.open { color: var(--amber); }
.stat-num.closed { color: var(--green); }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.home-section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 4px 2px 0; }
.section-bar { width: 4px; height: 16px; border-radius: 2px; background: var(--primary); display: inline-block; }
.home-search { width: 220px; margin-left: auto; padding: 6px 10px; font-size: 12px; }
.home-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.hp-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: .18s; border: 1px solid var(--border); }
.hp-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(20,30,50,.14); }
.hp-cover { height: 150px; position: relative; display: flex; align-items: center; justify-content: center; }
.hp-cover-text { font-size: 34px; opacity: .9; }
.hp-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.hp-cover-btn { position: absolute; right: 8px; bottom: 8px; border: 0; border-radius: 11px; padding: 3px 9px; font-size: 11px; line-height: 1.5; color: #fff; background: rgba(15,25,40,.62); cursor: pointer; opacity: 0; transition: .18s; }
.hp-card:hover .hp-cover-btn { opacity: 1; }
.hp-cover-btn:hover { background: var(--primary); }
/* 触屏没有 hover，按钮得一直摆着，不然手机上谁也找不到入口 */
@media (hover: none), (max-width: 860px) { .hp-cover-btn { opacity: 1; } }
.hp-badge { position: absolute; top: 8px; right: 8px; background: var(--red); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.hp-body { padding: 12px 14px; }
.hp-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.hp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.hp-enter { color: var(--primary); font-weight: 600; }
.hp-empty { grid-column: 1 / -1; background: var(--surface); border-radius: var(--radius); padding: 46px; text-align: center; color: var(--text-3); box-shadow: var(--shadow); }

/* 项目封面编辑弹窗 */
.cv-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px 16px; text-align: center; color: var(--text-3); font-size: 13px; cursor: pointer; transition: .15s; }
.cv-zone:hover, .cv-zone.over { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.cv-preview { margin: 12px 0 4px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.cv-preview img { display: block; width: 100%; max-height: 230px; object-fit: cover; }
.cv-none { padding: 26px; text-align: center; color: var(--text-3); font-size: 13px; }
.cv-tip { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }

/* 右侧待办 */
.home-todo { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { background: var(--surface); border-radius: 10px; padding: 11px 12px; cursor: pointer; border-left: 3px solid var(--primary); box-shadow: var(--shadow); transition: .15s; }
.todo-item:hover { transform: translateX(2px); }
.todo-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-empty { background: var(--surface); border-radius: 10px; padding: 30px 14px; text-align: center; color: var(--text-3); font-size: 13px; box-shadow: var(--shadow); }

/* ===== 项目工作台：左侧竖菜单 ===== */
.proj-menu { width: 200px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; transition: width .18s; overflow: hidden; }
#projectLayout.folded .proj-menu { width: 48px; }
#projectLayout.folded .proj-nav-item span.pn-label, #projectLayout.folded .proj-back { display: none; }
.proj-back { background: var(--surface-2); border: none; border-radius: 8px; padding: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; margin-bottom: 10px; }
.proj-back:hover { background: var(--primary-soft); color: var(--primary); }
.proj-nav { display: flex; flex-direction: column; gap: 2px; }
.proj-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; border-radius: 8px; padding: 10px 12px; font-size: 14px; color: var(--text-2); cursor: pointer; text-align: left; }
.proj-nav-item:hover { background: var(--surface-2); color: var(--text); }
.proj-nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pni { font-size: 16px; width: 20px; text-align: center; }
.proj-topbar { height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.proj-fold { background: var(--surface-2); border: none; border-radius: 6px; width: 30px; height: 30px; font-size: 15px; cursor: pointer; color: var(--text-2); }
.proj-fold:hover { background: var(--primary-soft); color: var(--primary); }
.proj-crumb { font-size: 15px; font-weight: 600; }
/* 【2026-10-18】顶栏 CAD 内核切换 pill；【2026-10-23】三态：自研 / 经典(warn) / 本机 CAD快速看图(quick) */
.proj-kernel { margin-left: auto; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 5px 13px; font-size: 12px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.proj-kernel:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.proj-kernel.warn { border-color: #e8a33d; color: #a06a00; background: #fff8ec; }
.proj-kernel.quick { border-color: #3fa77f; color: #1f7a58; background: #eefaf4; }
.workspace { flex: 1; overflow: auto; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.project-view { flex: 1; padding: 16px 18px; overflow: auto; }

/* ===== 控制台 ===== */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 14px; align-items: start; }
.dash-card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.dash-card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.dash-info { display: flex; flex-direction: column; gap: 9px; }
.di-row { display: flex; justify-content: space-between; font-size: 13px; }
.di-row span { color: var(--text-3); }
.di-row b { font-weight: 500; }
.dash-issue { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--surface-2); font-size: 13px; cursor: pointer; }
.dash-issue:last-child { border-bottom: none; }
.dash-issue:hover { background: var(--surface-2); border-radius: 6px; }
.di-no { color: var(--primary); font-weight: 600; white-space: nowrap; }
.di-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.di-status { color: var(--text-3); font-size: 12px; white-space: nowrap; }

/* ===== 项目资料 ===== */
.mat-toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.mat-tb-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.mat-tb-btn:hover { border-color: var(--primary-2); color: var(--primary); background: var(--primary-soft); }
/* 下载申请按钮上的待审批数 */
.dl-badge { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 2px; border-radius: 8px; background: #f56c6c; color: #fff; font-size: 11px; line-height: 16px; text-align: center; font-weight: 600; }
.mat-tb-spacer { flex: 1; }
/* 「文件层级」文字只在手机端出现（桌面这个按钮仍是纯图标） */
#matCollapse .mc-label { display: none; }
.mat-tb-search { width: 180px; padding: 6px 10px; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; }
.mat-body { display: flex; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); min-height: 500px; }
.mat-tree { width: 200px; border-right: 1px solid var(--border); padding: 10px 6px; overflow-y: auto; flex-shrink: 0; }
.mat-tree-item { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-tree-item:hover { background: var(--surface-2); }
.mat-tree-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.mat-tree-icon { font-size: 14px; flex-shrink: 0; }
.mat-tree-badge { font-size: 11px; background: var(--surface-2); border-radius: 8px; padding: 0 6px; color: var(--text-3); margin-left: auto; flex-shrink: 0; }
.mat-right { flex: 1; min-width: 0; overflow: auto; }
.mat-breadcrumb { padding: 10px 16px; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--surface-2); }
.mat-bc-item { cursor: pointer; color: var(--text-2); }
.mat-bc-item:hover { color: var(--primary); }
.mat-bc-sep { color: var(--text-3); }
.mat-bc-total { margin-left: auto; color: var(--text-3); font-size: 12px; }
.mat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mat-table th { text-align: left; color: var(--text-3); font-weight: 500; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.mat-table td { padding: 10px 12px; border-bottom: 1px solid var(--surface-2); vertical-align: middle; }
.mat-table tr:hover td { background: #fafbfc; }
.mat-seq { color: var(--text-3); width: 50px; }
.mat-name { font-weight: 500; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 备注名（图纸真实名称）：可点着填，所以给指针；没填时是淡占位 */
.mat-alias { cursor: pointer; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-alias:hover { background: #f2f6fb; }
.mat-alias-empty { color: #c2c8d0; }
/* 项目资料表和 BIM 表曾经同一个病：九列宽度加起来就超过右栏，auto 布局于是把每一列
   都压到内容宽度以下 —— 「大小」「修改时间」竖排、操作列三个按钮叠成一列、一行 81px。
   现在砍掉序号/大小/修改时间（大小和时间收进名称底下那行小字），再用固定表宽兜住。
   归属列改回真列（上传人/时间、修改人/时间各占一格，一行两人两时间），兜底宽度 860。 */
#viewMaterials .mat-table { table-layout: fixed; min-width: 860px; }
#viewMaterials .mat-table th, #viewMaterials .mat-table td { white-space: nowrap; }
#viewMaterials .mat-name { max-width: none; padding-right: 16px; }
#viewMaterials .mat-ops { white-space: nowrap; }
/* 「上传人 / 上传时间」「修改人 / 修改时间」：一行放两项，表头也跟着排两行。
   时间只写「月-日 时:分」（跨年才带年份），完整时间戳在单元格悬停提示里 */
.mat-table th .th-2 { font-weight: 400; font-size: 11px; color: #aab0b9; }
#viewMaterials .mat-table td.mat-meta { line-height: 1.4; padding-left: 8px; padding-right: 6px; }
.mat-meta .mc-n { overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; color: var(--text-2); }
.mat-meta .mc-t { font-size: 11.5px; color: var(--text-3); }
.mat-meta .mc-none { color: #c2c8d0; }
.mat-dash { color: #c2c8d0; }
/* 手机上归属两列整个收掉，这些信息改摆在名称下面那行小字里（默认不显示，见 @media 760） */
.mat-meta-m { display: none; }
.mat-icon-folder { font-size: 16px; margin-right: 4px; }
.mat-conv { font-size: 12px; font-weight: 400; margin-left: 6px; white-space: nowrap; }
tr.mat-row-folder { cursor: pointer; }
tr.mat-row-folder:hover td { background: #f0f5ff; }
tr.mat-row-cad { cursor: pointer; }
tr.mat-row-cad:hover td { background: #f0f5ff; }
.mat-empty { text-align: center; padding: 60px 20px; color: var(--text-3); font-size: 14px; }

/* ===== 右键菜单 ===== */
.ctx-menu { position: fixed; z-index: 2000; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); min-width: 160px; padding: 4px 0; }
.ctx-item { padding: 8px 16px; font-size: 13px; cursor: pointer; color: var(--text); }
.ctx-item:hover { background: var(--primary-soft); color: var(--primary); }
.ctx-danger { color: var(--red); }
.ctx-danger:hover { background: var(--red-soft); }

/* ===== 拖拽上传覆盖层 ===== */
.mat-drop-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(24,95,165,.18); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.mat-drop-inner { background: var(--surface); border: 3px dashed var(--primary-2); border-radius: 16px; padding: 40px 60px; text-align: center; box-shadow: 0 10px 40px rgba(24,95,165,.3); }
.mat-drop-icon { font-size: 48px; margin-bottom: 12px; }
.mat-drop-text { font-size: 16px; font-weight: 600; color: var(--primary); }

/* ===== 通用文件预览覆盖层 ===== */
.file-preview-overlay { position: fixed; inset: 0; z-index: 1000; background: #f5f6f8; display: flex; flex-direction: column; }
.fp-header { height: 48px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-shrink: 0; }
.fp-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-close { background: var(--surface-2); border: none; border-radius: 6px; padding: 6px 14px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.fp-close:hover { background: var(--red-soft); color: var(--red); }
.fp-body { flex: 1; overflow: hidden; position: relative; }

/* ===== 问题截图缩略图 ===== */
.issue-screenshot { position: relative; margin-top: 8px; display: inline-block; max-width: 240px; }
.issue-screenshot-img { max-width: 100%; max-height: 120px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; object-fit: cover; }
.issue-screenshot-img:hover { border-color: var(--primary); }
.btn-locate-img { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-locate-img:hover { background: var(--primary); }

/* ============ 图迈式 CAD 内嵌查看面板 ============ */
#viewCadViewer { display: flex; flex-direction: column; height: 100%; padding: 0 !important; background: #141414; }
.cv-view.hidden { display: none !important; }
.cv-topbar {
    height: 44px; background: #1f1f1f; border-bottom: 1px solid #333;
    display: flex; align-items: center; gap: 8px; padding: 0 12px; flex-shrink: 0;
}
.cv-tb-btn {
    background: #2c2c2c; color: #ccc; border: 1px solid #454545; border-radius: 4px;
    padding: 6px 13px; cursor: pointer; font-size: 12.5px; font-family: inherit;
    white-space: nowrap;
}
.cv-tb-btn:hover { background: #3a3a3a; color: #fff; }
.cv-tb-blue { background: #1e5a74; border-color: #4fc3f7; color: #fff; }
.cv-tb-green { background: #2c5a34; border-color: #66bb6a; color: #fff; }
.cv-tb-red { background: #5a2c2c; border-color: #e57373; color: #fff; }
.cv-sep { width: 1px; height: 20px; background: #3d3d3d; }
.cv-fname { color: #7fd4fa; font-size: 13px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-spacer { flex: 1; }
.cv-main { flex: 1; display: flex; min-height: 0; background: #0f0f0f; }
#cvFrame { flex: 1; border: none; background: #111; min-width: 0; }
.cv-dock {
    width: 270px; background: #1b1b1b; border-left: 1px solid #333;
    display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
}
.cvd-head {
    padding: 10px 14px; color: #ddd; font-size: 13px; font-weight: bold;
    border-bottom: 1px solid #333; background: #232323; flex-shrink: 0;
}
.cvd-tree {
    padding: 8px 6px; border-bottom: 1px solid #2e2e2e; max-height: 46%;
    overflow: auto; flex-shrink: 0;
}
.cvd-tree .mat-tree-item {
    color: #bbb; font-size: 12.5px; padding-top: 5px; padding-bottom: 5px;
    border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.cvd-tree .mat-tree-item:hover { background: #2a2a2a; }
.cvd-tree .mat-tree-item.active { background: #1e5a74; color: #fff; }
.cvd-tree .mat-tree-badge { margin-left: auto; color: #777; font-size: 11px; }
.cvd-files { flex: 1; overflow: auto; padding: 8px 6px; }
.cvd-file {
    display: flex; align-items: center; gap: 7px; padding: 6px 9px;
    border-radius: 4px; cursor: pointer; color: #ccc; font-size: 12.5px;
}
.cvd-file:hover { background: #2a2a2a; }
.cvd-file.active { background: #1e5a74; color: #fff; }
.cvd-cad .cvd-name { color: #8fd3f4; }
.cvd-file.active .cvd-name { color: #fff; }
.cvd-icon { flex-shrink: 0; }
.cvd-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvd-empty { color: #666; font-size: 12px; padding: 14px; text-align: center; }
#viewCadViewer:fullscreen .cv-main { height: calc(100% - 44px); }

/* ============ BIM 模型功能区 ============ */
.bim-tip { color: #999; font-size: 12px; margin-left: 8px; }
/* 模型表和合模方案并排。左栏至少要 760px 才装得下那张 4 列表，装不下就整块换行
   到第二排（各占满宽），而不是把列压扁 —— 之前 flex:1.4 给到 638px，于是
   「就绪」竖排、操作列三个按钮叠成一列、一行模型高 191px。 */
.bim-wrap { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 4px; align-items: flex-start; }
/* BIM 页只剩方案这一栏，不必再两列并排 */
.bim-wrap-one { display: block; }
/* BIM 表用固定表宽：名称列吃掉剩余宽度并省略号收尾，其余三列绝不换行。
   极端窄时由 .bim-fed-list 的横向滚动兜底，不会再撑高行。 */
#viewBim .mat-table { table-layout: fixed; min-width: 620px; }
#viewBim .mat-table th, #viewBim .mat-table td { white-space: nowrap; }
#viewBim .mat-name { max-width: none; padding-right: 16px; }
.mat-nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-nm .mat-ext { color: #999; font-size: 11px; font-weight: 400; }
.mat-sub { color: var(--text-3); font-size: 11.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
#viewBim .mat-ops { white-space: nowrap; }
.bim-sec-title { font-weight: bold; margin: 4px 0 8px; color: #444; }
/* 「只列常驻」这类限定说明收在标题后面，别占整行 —— 原来那两行灰字会折到
   「点过「加入模型库」的」这种半截话，看着像界面坏了 */
.bim-sec-hint { font-weight: 400; font-size: 11.5px; color: var(--text-3); margin-left: 8px; cursor: help; }
/* 成员一行一个：同名批次的模型摆成 chip 根本分不清是哪个，状态和体积也得看得见 */
.bim-fed-members { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; margin-bottom: 8px; }
.fed-mb { display: flex; align-items: center; gap: 7px; padding: 4px 0; font-size: 12.5px; border-bottom: 1px dashed #eef1f4; }
.fed-mb:last-child { border-bottom: 0; }
.fed-mb.off { opacity: .55; }
.fed-mb-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fed-mb-m { flex: 0 0 auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
/* 方案的磁盘实体：路径、几个文件、多大、缺哪几个，一眼看完才谈得上复制走 */
.bim-fed-folder { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 7px 9px; margin-bottom: 8px; background: #f7f9fb; border: 1px solid var(--border); border-radius: 6px; font-size: 11.5px; color: var(--text-2); }
.bim-fed-folder.none { background: #fffdf5; border-style: dashed; }
.ff-p { font-family: Consolas, Menlo, monospace; color: var(--text); word-break: break-all; }
.ff-s { color: var(--text-3); }
.ff-warn { color: var(--red); }

/* ===== 合模方案：就是一张文件列表 ===== */
/* BIM 页平铺全部方案，资料页把住在本文件夹里的几条排进同一张资料表里；
   两处的行都用下面这套类名，看起来就是同一个东西住在同一个目录树里 */
.bim-feds { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.bim-fed-list { overflow-x: auto; }
.fed-plan-row { cursor: pointer; }
.fed-caret { display: inline-block; width: 11px; color: #9aa3ad; font-size: 10px; }
.mat-icon-fed { margin-right: 2px; }
.fed-more { padding-left: 9px; padding-right: 9px; }
/* 资料里的方案行：hover 手感跟文件行一致，否则它看起来像一张不能点的表格 */
#viewMaterials .mat-row-fed { cursor: pointer; }
#viewMaterials .mat-row-fed:hover td { background: var(--primary-soft); }
.mat-fed-desc { color: var(--text-2); }
/* 名称下面那行的「住在哪个资料文件夹」；没归类的灰到底，别让人以为路径丢了 */
.fed-loc { display: inline-block; margin: 1px 6px 1px 0; padding: 0 6px; border-radius: 4px; background: #f4f6f8; color: var(--text-2); font-size: 11.5px; }
.fed-loc.none { background: none; color: var(--text-3); font-style: italic; padding-left: 0; }
/* 一条方案可以同时挂在几个文件夹里，位置标签就会有好几枚：这一行允许折到两行再省略，
   比挤成一行只看得见第一个强（td 上的 nowrap 是 #viewBim .mat-table 给的，得盖掉） */
#viewBim .fed-plan-row .mat-sub { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* 折叠态也得能看出磁盘状态：这一枚标记是列表行上唯一的「它真是个文件夹」证据，
   没落盘 / 文件夹被人删了 / 缺文件，都只在这一格报，不用点开才发现 */
.ff-mark { margin-left: 6px; }
.ffm { display: inline-block; font-size: 10.5px; line-height: 1.5; padding: 0 6px; border-radius: 8px; vertical-align: 1px; }
.ffm.ok { background: #eef6ef; color: #2f7d32; }
.ffm.warn { background: var(--red-soft); color: var(--red); }
/* 详情格里是整段中文说明，跟着 #viewBim .mat-table td 的 nowrap 会把列表撑出横向滚动条
   （实测 1440 宽下溢出 218px）；成员行自己写了 nowrap+省略号，这里放开不影响它们。
   必须带 #viewBim：光 .fed-detail-row > td 的特指度比不过那条。 */
#viewBim .fed-detail-row > td { background: #fbfcfd; padding: 10px 14px 12px; white-space: normal; }
.fed-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.fed-d-h { font-size: 12px; color: var(--text-3); margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fed-d-close { border: none; background: none; color: var(--text-3); font-size: 11.5px; cursor: pointer; }
.fed-d-close:hover { color: var(--primary); }
.fed-d-tip { color: var(--text-3); font-size: 11.5px; line-height: 1.6; }
.fed-detail .bim-fed-members, .fed-detail .bim-fed-folder { margin-bottom: 8px; }
/* 「移到…」弹窗里的文件夹候选 */
.fed-move-tip { color: var(--text-2); font-size: 12.5px; margin-bottom: 8px; }
.fed-move-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px; }
.fed-move-pick { text-align: left; background: none; border: 1px solid transparent; border-radius: 5px; padding: 6px 9px; font-size: 13px; cursor: pointer; color: var(--text); }
.fed-move-pick:hover { background: var(--primary-soft); }
.fed-move-pick.sel { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
/* 层级树：缩进跟 --d（深度）走，深到几层都不用改样式；「项目文件」那一层显示成「资料根目录」，
   正文里不再把前缀重复一遍——完整路径留在 title 上，一屏能多看两层 */
.fed-move-list { max-height: 268px; }
.fed-move-pick { display: flex; align-items: center; gap: 6px; padding-left: calc(9px + var(--d, 0) * 15px); }
.fed-move-pick .fp-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fed-move-pick .fp-in { flex: 0 0 auto; font-style: normal; font-size: 11px; line-height: 1.6; padding: 0 6px; border-radius: 8px; background: #eef6ef; color: #2f7d32; font-weight: 400; }
.fed-move-pick .fp-in.part { background: #f2f4f7; color: var(--text-3); }
.fed-move-pick.out { color: var(--text-3); font-style: italic; }
/* 折叠手柄：有子层或有东西的行才有，真正空的夹留同宽的空位，名字才不会一列一列错位。
   align-self:stretch + 负外边距把点击区撑满整行高——手机上 11px 的箭头按不准 */
.fed-move-pick .fp-caret { flex: 0 0 auto; align-self: stretch; display: flex; align-items: center; justify-content: center;
    width: 18px; margin: -6px 0 -6px -4px; border-radius: 4px; color: var(--text-3); font-size: 11px; }
.fed-move-pick .fp-caret:hover { background: #dfe6ee; color: var(--text); }
.fed-move-pick .fp-caret.blank { visibility: hidden; }
/* 这一层里装了多少：折起来也看得见，不然收起就变成一串认不出干啥用的名字 */
.fed-move-pick .fp-n { flex: 0 0 auto; font-style: normal; font-size: 11px; color: var(--text-3);
    white-space: nowrap; font-weight: 400; }
/* 展开后逐行列出的文件名（只是参考，点不选，所以不是 button）。
   左边缩进 = 子层那一档 + 手柄那一格，名字正好和同层文件夹对齐 */
.fed-move-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3);
    padding: 2px 9px 2px calc(29px + var(--d, 0) * 15px); cursor: default; }
.fed-move-item .fp-ico { flex: 0 0 auto; font-size: 11px; opacity: .8; }
.fed-move-item .fp-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fed-move-item.more { font-style: italic; padding-top: 0; }
/* 新建方案里那棵归属树挤在一张表单中间，但它现在还要列出每一层的文件，给一点滚动的余地 */
.fed-move-list.compact { max-height: 214px; }
/* 没转完的模型单独一条横幅：模型库撤了之后这是站上唯一能看到转换进度的地方，只报进度不给动作 */
.bim-busy { background: #f7f9fb; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.bim-busy-t { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.bim-busy-i { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; }
.bim-busy-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bim-busy-s { flex: 0 0 auto; }
.bim-fed-pick { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; border: 1px solid #e3e6ea; border-radius: 6px; padding: 8px; }
.bim-fed-pick-item { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 2px; }
/* .modal .form-row label 是 display:block、里面的 input 又被全局规则撑成 100% 宽，
   于是勾选框跑到行中间。这一栏现在是加模型的唯一入口，勾没勾上必须一眼看得出来。 */
.modal .form-row label.bim-fed-pick-item { display: flex; }
.bim-fed-pick-item input[type="checkbox"] { width: 15px; height: 15px; flex-shrink: 0; accent-color: #1e5a74; cursor: pointer; }
.fed-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
#fedPickUpload { align-self: flex-start; margin: 4px 0 6px; }
/* 全局 input 是 100% 宽，套到 flex 里的勾选框上就成了"方框在左、字在右、中间一大截空白" */
#fedColorize { width: 15px; height: 15px; flex-shrink: 0; accent-color: #1e5a74; }
.bim-fed-pick { max-height: 300px; }
.fed-group { color: #7a828c; font-size: 12px; margin: 6px 0 2px; border-top: 1px dashed #e3e6ea; padding-top: 6px; }
.fed-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.fed-sub { color: #9aa3ad; font-size: 11px; }
.bim-fed-pick-empty { color: #98a1ab; font-size: 13px; padding: 10px 2px; }

/* ============ 上传进度面板 ============ */
#uploadPanel {
    position: fixed; right: 16px; bottom: 16px; z-index: 300;
    background: #23262b; color: #ddd; border: 1px solid #3a3d44;
    border-radius: 8px; padding: 12px 14px; width: 320px; max-width: 92vw;
    box-shadow: 0 6px 24px rgba(0,0,0,.4); font-family: inherit;
    max-height: 72vh; display: flex; flex-direction: column;
}
#uploadPanel .upl-head { font-size: 13px; font-weight: bold; margin-bottom: 8px; color: #fff; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
#uploadPanel .upl-headtxt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 文件多时可滚动查看全部上传项，不再被顶出屏幕外 */
#uploadPanel .upl-list { max-height: 48vh; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
#uploadPanel .upl-foot { flex-shrink: 0; margin-top: 8px; }
#uploadPanel .upl-item { margin-bottom: 8px; position: relative; padding-right: 26px; }
#uploadPanel .upl-name { font-size: 12px; color: #bbb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
#uploadPanel .upl-sub { color: #999; font-size: 11px; }
#uploadPanel .upl-bar { height: 6px; background: #3a3d44; border-radius: 3px; overflow: hidden; }
#uploadPanel .upl-fill { height: 100%; width: 0%; background: #4a9eff; border-radius: 3px; transition: width .2s; }
#uploadPanel .upl-item.ok .upl-fill { background: #66bb6a; }
#uploadPanel .upl-item.fail .upl-fill { background: #e57373; }
#uploadPanel .upl-item.cancel .upl-fill { background: #7a7f88; }
#uploadPanel .upl-item.cancel .upl-name { color: #888; text-decoration: line-through; }
#uploadPanel .upl-pct { font-size: 11px; color: #999; margin-top: 2px; }
/* 取消按钮：标题栏「全部取消」+ 每行右侧「×」（任一上传中都可随时点） */
#uploadPanel .upl-x {
    flex-shrink: 0; background: none; border: 1px solid #4a4f57; color: #9aa0a8;
    border-radius: 4px; width: 20px; height: 20px; padding: 0; cursor: pointer;
    font-size: 13px; line-height: 18px; text-align: center; font-family: inherit;
}
#uploadPanel .upl-x:hover { color: #fff; border-color: #7a8088; background: #3a3d44; }
#uploadPanel .upl-cancelall { width: auto; padding: 1px 8px; font-size: 11px; }
#uploadPanel .upl-item .upl-x { position: absolute; top: -2px; right: 0; }

/* ============ 上传前核对弹窗（浅色主题，走 modal 容器） ============ */
.urv-sum { font-size: 13px; color: var(--text); margin-bottom: 6px; }
.urv-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; font-size: 11.5px; border: 1px solid var(--border); color: var(--text-2); }
.urv-tag.new { background: #eef6ff; border-color: #bcd8f5; color: #1e5a74; }
.urv-tag.upd { background: #fff6e5; border-color: #f0d49a; color: #9a6700; }
.urv-tag.dup { background: #f2f3f5; color: #7a828c; }
.urv-note { font-size: 12px; color: var(--text-2); background: #fafbfc; border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; margin-bottom: 8px; line-height: 1.6; }
.urv-tree { max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; }
.urv-dir { color: var(--text-2); font-weight: 600; margin: 6px 0 2px; word-break: break-all; }
.urv-dir:first-child { margin-top: 0; }
.urv-file { display: flex; align-items: baseline; gap: 8px; padding: 2px 0 2px 14px; border-bottom: 1px dashed #f0f1f3; }
.urv-file.is-upd { background: #fffbf0; }
.urv-fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urv-fsize { flex-shrink: 0; width: 72px; text-align: right; color: var(--text-3); }
.urv-fdate { flex-shrink: 0; width: 112px; text-align: right; color: var(--text-3); }
.urv-flag { flex-shrink: 0; font-size: 11px; color: #9a6700; }
.urv-more { color: var(--text-3); font-size: 12px; padding: 2px 0 2px 14px; }
@media (max-width: 700px) { .urv-fdate { display: none; } .urv-tree { max-height: 40vh; } }

/* 问题卡片：选择框前置样式 */
.issue-card > input[type="checkbox"] { flex-shrink: 0; width: 15px; height: 15px; margin-top: 3px; accent-color: #1e5a74; cursor: pointer; }

/* ===== 看图批注卡片：内联详情与编辑（不打开图纸） ===== */
.fi-card .fi-detail { display: none; margin-top: 8px; }
.fi-card.open .fi-detail { display: block; }
.fi-imgs { margin: 6px 0; }
.fi-imgs img { max-width: 240px; max-height: 150px; border-radius: 6px; border: 1px solid var(--border); margin: 0 8px 8px 0; display: inline-block; }
.fi-noimg { color: var(--text-3); font-size: 12px; }
.fi-edit { display: flex; flex-direction: column; gap: 6px; }
.fi-edit-row { display: flex; gap: 6px; flex-wrap: wrap; }
.fi-edit-row select, .fi-edit-row input, .fi-e-note { border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 12.5px; background: var(--surface); color: var(--text); }
.fi-e-note { width: 100%; min-height: 56px; resize: vertical; }
.fi-edit-ops { text-align: right; }

/* ===== 用户管理（管理员弹窗） ===== */
.ua-add { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.ua-add input, .ua-add select { flex: 1; min-width: 120px; border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-size: 13px; background: var(--surface); color: var(--text); }
.ua-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ua-table th, .ua-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: middle; }
.ua-table th { background: var(--surface-2, #f2f4f8); font-weight: 600; }
.ua-table .ua-remark, .ua-table .ua-role { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 5px; padding: 4px 6px; font-size: 12.5px; background: var(--surface); color: var(--text); }
.ua-ops { display: flex; gap: 4px; flex-wrap: wrap; }
.ua-on { color: #1c7c3c; }
.ua-off { color: #c0392b; }
.ua-hint { color: var(--text-3); font-size: 12px; margin-top: 10px; }

/* ===== 资料文件夹分享（免登录链接） ===== */
/* 弹窗自上而下四块：分享什么 → 勾哪些方案 → 链接设置 → 生成，最后才是已有链接。
   方案勾选必须排在生成按钮之前——它原来在按钮下面，是「点了才想起来没勾」的根因。 */
.sh-sec { margin: 0 0 14px; }
.sh-sec-t { display: flex; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.fed-sub { font-weight: 400; font-size: 11.5px; color: var(--text-3); }
/* 两种分享模式做成两张可点卡片：手机上小圆点按不中，卡片连标题带解释一起点得中 */
.share-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 10px; }
.share-mode .sm-item { display: flex; flex-direction: row; align-items: flex-start; gap: 9px; margin: 0; padding: 10px 12px;
    cursor: pointer; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
    font-size: 13px; color: var(--text); transition: border-color .15s, background .15s; }
.share-mode .sm-item:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.share-mode .sm-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.share-mode .sm-item input { flex: none; width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--primary); }
.share-mode .sm-t { flex: 1; min-width: 0; font-weight: 600; line-height: 1.45; }
.share-mode .sm-t b { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
/* 「能看到 / 看不到」逐条打勾打叉，比一坨蓝底说明文字好扫，也逼着把权限差说清楚 */
.sh-see { margin-top: 10px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.see-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.65; color: var(--text-2); padding: 2px 0; }
.see-row b { color: var(--text); font-weight: 600; }
.see-row.no { color: var(--text-3); }
.see-row.no b { color: var(--text-2); }
.see-i { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; font-size: 10px; line-height: 16px; text-align: center; }
.see-row.ok .see-i { background: #e4f4e9; color: #1c7c3c; }
.see-row.no .see-i { background: #fbe9e8; color: var(--red); }
/* 链接设置：两列自适应 + 备注独占一行。原来是一条 flex-wrap，控件宽度各不相同，
   弹窗一窄就错行成三排，看着像排版坏了 */
.sh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
.sh-cell { display: flex; flex-direction: column; gap: 5px; margin: 0; font-size: 12px; color: var(--text-2); }
.sh-cell select, .sh-cell input:not([type=checkbox]) { box-sizing: border-box; width: 100%; border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 10px; font-size: 13px; background: var(--surface); color: var(--text); }
.sh-cell select:focus, .sh-cell input:focus { outline: none; border-color: var(--primary-2); }
.sh-full { grid-column: 1 / -1; }
.sh-days { display: flex; gap: 8px; }
.sh-days select { flex: 1; min-width: 0; width: auto; }
/* 自定义天数只在选「自定义…」时亮出来，宽度按死，否则把下拉挤扁 */
.sh-days-custom { flex: none; width: 76px; }
.sh-chk-row { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); }
.sh-chk-row input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.sh-cell-sub { font-size: 11px; font-weight: 400; color: var(--text-3); }
/* 生成按钮独占一行，字上直接写清发出去的是几个方案、管多久 */
.sh-gen { display: block; width: 100%; padding: 11px 18px; font-size: 13.5px; font-weight: 600; }
.sh-gen:disabled { opacity: .5; cursor: not-allowed; }
/* 项目里一个合模方案都没有时的那句解释 */
.fed-none { grid-column: 1 / -1; color: var(--text-3); font-size: 12px; line-height: 1.7; padding: 9px 11px; border: 1px dashed var(--border); border-radius: 9px; }
.fed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 10px; }
.fed-item { display: flex; align-items: center; gap: 9px; margin: 0; padding: 8px 10px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 12.5px; color: var(--text); }
.fed-item:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.fed-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.fed-item input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.fed-item .fi-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fed-item .fi-c { flex: none; font-size: 11px; color: var(--text-3); }
.sh-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.sh-hint { font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.share-list { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.share-loading, .share-empty { color: var(--text-3); font-size: 12.5px; line-height: 1.8; padding: 18px 0; text-align: center; }
.share-empty span { color: var(--text-3); font-size: 12px; }

/* 一条分享 = 一张卡：顶上说明数量和状态，中间一条地址一行，底下是操作 */
.share-i { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.share-i.dead { opacity: .62; box-shadow: none; }
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 13px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.sh-count { font-size: 12.5px; font-weight: 600; color: var(--text); }
/* 每条分享的第一行先说"这是什么文件"，再说几个文件、什么时候到期：
   模型名动辄三十字，独占一行打点，完整路径留在 title 上 */
.sh-obj { flex: 1 1 100%; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sh-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.sh-chip.warn { background: var(--amber-soft); color: var(--amber); border-color: #eed9ac; }
.sh-chip.bad { background: var(--red-soft); color: var(--red); border-color: #f0c4c2; }
/* 谁分享的、什么时候建的、到哪一天结束：头部徽章只报"还剩几天/已失效"这种状态，
   查"这条是谁、哪天生成的、什么时候开始打不开的"得逐条落到具体值 */
.sh-meta { display: flex; flex-wrap: wrap; gap: 3px 18px; padding: 8px 13px; border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); }
.sh-meta span { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.sh-meta i { font-style: normal; color: var(--text-3); }
.sh-meta b { font-weight: 600; color: var(--text); }
.sh-meta b.bad { color: var(--red); }
.sh-links { display: flex; flex-direction: column; }
.sh-link { display: flex; align-items: center; gap: 11px; padding: 11px 13px; }
.sh-link + .sh-link { border-top: 1px dashed var(--border); }
.sh-url-wrap { flex: 1; min-width: 0; }
.sh-url { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; color: var(--primary); background: var(--surface-2); }
.sh-url:focus { background: var(--surface); border-color: var(--primary-2); }
.sh-note { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.sh-tag { flex: 0 0 auto; width: 34px; text-align: center; font-size: 11px; font-weight: 600; padding: 3px 0; border-radius: 6px; }
.sh-tag.pub { background: var(--green-soft); color: var(--green); }
.sh-tag.lan { background: var(--primary-soft); color: var(--primary); }
.sh-tag.local { background: var(--surface-2); color: var(--text-3); }
.sh-copy { flex: 0 0 auto; }
.sh-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 8px 13px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-3); }

/* ===== 手机端适配（≤760px）：单栏 + 横向导航 + 资料表只留关键列 ===== */
@media (max-width: 760px) {
    .app-header { height: 48px; padding: 0 10px; }
    .app-header .app-title { font-size: 14px; }
    .user-menu > span:not(.user-avatar) { display: none; }
    .home-layout { grid-template-columns: 1fr; padding: 10px; gap: 12px; }
    #projectLayout { flex-direction: column; }
    .proj-menu, #projectLayout.folded .proj-menu {
        width: 100%; flex-direction: row; align-items: center; gap: 6px; overflow-x: auto;
        border-right: none; border-bottom: 1px solid var(--border); padding: 6px 8px;
    }
    .proj-nav { flex-direction: row; gap: 4px; }
    .proj-nav-item { width: auto; padding: 7px 9px; font-size: 13px; white-space: nowrap; }
    .proj-fold { display: none; }
    .project-view { padding: 10px; }
    .mat-toolbar { flex-wrap: wrap; gap: 5px; padding: 8px 10px; }
    .mat-tb-btn { padding: 6px 8px; font-size: 12px; }
    .mat-tb-search { flex: 1 1 100%; }
    .mat-body { flex-direction: column; min-height: 0; }
    /* 项目资料左侧文件夹树在手机上隐藏（见 #viewMaterials 规则）；其它用 .mat-tree 的页面保留 */
    .mat-tree { width: 100%; max-height: 170px; border-right: none; border-bottom: 1px solid var(--border); }
    .mat-table th:nth-child(4), .mat-table td:nth-child(4),
    .mat-table th:nth-child(6), .mat-table td:nth-child(6),
    .mat-table th:nth-child(7), .mat-table td:nth-child(7) { display: none; }
    /* 资料表砍成 6 列（☐/名称/备注名/创建人/修改人/操作）：一屏只放得下 ☐+名称+操作。
       上面那条通用规则按旧 9 列的列号写的，会把「操作」一起收掉，所以这里显式留回第 6 列。
       两张表都叫 .mat-table 但列数不同（资料 6 列 / BIM 4 列），只能按视图分别收。 */
    #viewMaterials .mat-table th:nth-child(3), #viewMaterials .mat-table td:nth-child(3),
    #viewMaterials .mat-table th:nth-child(4), #viewMaterials .mat-table td:nth-child(4),
    #viewMaterials .mat-table th:nth-child(5), #viewMaterials .mat-table td:nth-child(5) { display: none; }
    #viewMaterials .mat-table th:nth-child(6), #viewMaterials .mat-table td:nth-child(6) { display: table-cell; }
    #viewMaterials .mat-table { min-width: 0; }
    /* 归属两列放不下，就把「谁传的、什么时候」挪回名称下那行小字，别让人在手机上查不到人 */
    .mat-meta-m { display: inline; }
    /* 手机上操作列放不下三个按钮，收回允许换行（配套下面 .mat-ops .btn 的手指尺寸） */
    #viewMaterials .mat-ops { white-space: normal; }
    /* 回收站 9 列：上面那条通用规则是按旧列号写的，会把「名称」一起收掉，这里留回名称，
       换成收序号和所属项目（手机上这两个信息用处最小）。 */
    #viewTrash .mat-table th:nth-child(4), #viewTrash .mat-table td:nth-child(4) { display: table-cell; }
    #viewTrash .mat-table th:nth-child(2), #viewTrash .mat-table td:nth-child(2),
    #viewTrash .mat-table th:nth-child(5), #viewTrash .mat-table td:nth-child(5) { display: none; }
    /* BIM 页只剩方案这一张表（名称/大小/模型/更新于/操作）：通用规则收掉第 4 列「更新于」，
       这里再把第 3、4 列改成"占位但宽度归零"。不能只写 display:none —— 固定表布局下
       "第一行没给宽度的列"会和名称列平分剩余空间，实测展开详情行时名称被压到 43px。
       手机因此留 名称+大小+操作（⋯ 菜单承担归类/改名/删除）。
       资料页的方案行不在这儿：它跟着 .mat-row-fed 走资料表那套列号。 */
    #viewBim .bim-fed-list .mat-table th:nth-child(3), #viewBim .bim-fed-list .mat-table td:nth-child(3),
    #viewBim .bim-fed-list .mat-table th:nth-child(4), #viewBim .bim-fed-list .mat-table td:nth-child(4) {
        display: table-cell; width: 0; max-width: 0; padding: 0; border: 0; overflow: hidden; font-size: 0; }
    #viewBim .mat-table { min-width: 0; }
    .mat-table th, .mat-table td { padding: 7px 5px; font-size: 12.5px; }
    .mat-name { max-width: 44vw; }
    /* 操作列里最多四个按钮，收进 215/235px 的格子里必然挤爆：让它换行且按手指尺寸给够高 */
    .mat-ops .btn { min-height: 30px; padding: 4px 7px; font-size: 12px; margin: 1px 3px 1px 0; }
    .ctx-menu { max-width: 78vw; }
    .ctx-item { padding: 11px 16px; font-size: 14px; }
    /* 项目资料：手机只留右侧文件列表（含文件夹层级），左侧文件夹树太占地方，直接藏掉 */
    #viewMaterials .mat-tree { display: none !important; }
    #viewMaterials .mat-body { min-height: 0; }
    .bim-wrap { flex-direction: column; gap: 10px; padding: 8px 0; }
    .bim-tip { display: block; margin: 2px 0 0; }
    /* 展开的详情行两栏在手机上竖着排：成员一栏、磁盘文件夹一栏，横排的话路径只剩几个字；
       成员行的体积另起一行贴名字下面，路径整行给 ff-p */
    .fed-detail { grid-template-columns: 1fr; gap: 8px; }
    .fed-detail-row > td { padding: 8px 8px 10px; }
    .fed-mb { flex-wrap: wrap; }
    .fed-mb-m { flex: 1 1 100%; margin-left: 17px; }
    .bim-fed-folder .ff-p { flex: 1 1 100%; }
    .bim-fed-folder .btn { flex: 0 0 auto; }
    .modal-root { padding: 0; align-items: flex-end; }
    .modal, .modal.wide {
        max-width: 100%; padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
        max-height: 82vh; border-radius: 14px 14px 0 0;
    }
    /* 手机上三块都收成单列：模式卡、链接设置、方案勾选，各占一行才按得中 */
    .share-mode, .sh-grid, .fed-list { grid-template-columns: 1fr; }
    /* 地址行在手机上竖排：标签、地址、复制按钮各占一行，不然 URL 会被挤成几个字 */
    .sh-link { flex-wrap: wrap; gap: 8px; }
    .sh-tag { width: auto; padding: 2px 8px; }
    .sh-url-wrap { flex: 1 1 100%; order: 2; }
    .sh-link .sh-tag { order: 1; }
    .sh-link .sh-copy { order: 3; margin-left: auto; }
    /* 手机上四项信息竖着排：标签靠左、值靠右，一行一条才读完（时间串加"（剩 N 天）"很长，横排会顶出卡片） */
    .sh-meta { gap: 5px 18px; }
    .sh-meta span { flex: 1 1 100%; justify-content: space-between; white-space: normal; }
    .sh-meta b { text-align: right; }
    .login-card { width: 100%; padding: 22px 18px; }
}

/* ============ 问题闭环列表：表头筛选 + 压缩网格行 + 分页 ============ */
/* 列宽要和 .issue-thead 完全一致，改一处要改两处，所以写在同一个选择器里 */
.issue-thead, .issue-card { grid-template-columns: 56px minmax(160px, 1.8fr) 72px minmax(120px, 1.2fr) 108px minmax(110px, 1.1fr) 88px; }
.issue-thead {
    display: grid; gap: 8px; padding: 8px 12px 6px; font-size: 11px; font-weight: 600;
    color: var(--text-3); background: var(--surface-2, #f3f5f8); border: 1px solid var(--border);
    border-radius: 8px 8px 0 0; border-bottom: none; align-items: end;
}
.issue-thead .thc { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.issue-thead .thc em { font-style: normal; line-height: 1.2; }
.hf {
    width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 4px;
    padding: 3px 6px; font-size: 11px; font-weight: 400; color: var(--text);
    background: var(--surface); min-width: 0;
}
.hf:focus { outline: none; border-color: var(--primary); }
.issue-list { display: flex; flex-direction: column; gap: 4px; }
.issue-card {
    display: grid; align-items: center; gap: 8px;
    padding: 5px 10px; border-radius: 6px; font-size: 12px;
    background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: .12s;
}
.issue-card:hover { box-shadow: var(--shadow); border-color: var(--primary-2); }
.c-no { display: flex; flex-direction: row; align-items: center; gap: 5px; font-weight: 700; color: var(--primary); }
.c-no input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: #1e5a74; cursor: pointer; flex-shrink: 0; }
.disp-no { font-variant-numeric: tabular-nums; font-size: 12px; }
.c-title { min-width: 0; }
.issue-title {
    font-weight: 600; font-size: 12.5px; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.issue-sub {
    font-size: 11px; color: var(--text-3); margin-top: 1px;
    display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; align-items: center;
}
.issue-sub > * { flex-shrink: 0; }
.issue-sub .badge { padding: 0 6px; line-height: 16px; font-size: 10.5px; }
.cell-1 {
    display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 11.5px; color: var(--text-2);
}
.c-who, .c-time { font-size: 11.5px; color: var(--text-2); min-width: 0; }
.c-op, .c-rv { font-size: 11.5px; color: var(--text-2); min-width: 0; }
.c-op .tl-meta, .c-rv .tl-meta { margin: 0; }
.c-rv .rv-ap { display: none; }
.c-act { display: flex; flex-direction: row; gap: 4px; align-items: center; flex-wrap: wrap; }
.c-act .btn { white-space: nowrap; padding: 2px 7px; font-size: 11px; line-height: 1.5; min-height: 0; }
.btn-xs { padding: 1px 6px !important; font-size: 11px !important; line-height: 1.5; min-height: 0; }
/* 列表里不再铺开标注截图（会把行高顶成卡片）；只留 📷 入口，详情里再看 */
.issue-screenshot { display: none; }
.b-st-approving { background: #e2f1f5; color: #0d6d80; }
/* 分页条 */
.issue-page {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 4px 4px; font-size: 12.5px; color: var(--text-2);
}
.issue-page .ip-total b { color: var(--text); font-variant-numeric: tabular-nums; }
.issue-page .ip-size, .issue-page .ip-go { display: inline-flex; align-items: center; gap: 5px; }
.issue-page select, .issue-page input {
    border: 1px solid var(--border); border-radius: 5px; padding: 4px 7px;
    font-size: 12.5px; background: var(--surface); color: var(--text); width: auto;
}
.issue-page .ip-custom { width: 64px; }
.issue-page .ip-go input { width: 56px; }
.issue-page .ip-nav { display: inline-flex; align-items: center; gap: 8px; }
.issue-page #issPageInfo { font-variant-numeric: tabular-nums; min-width: 48px; text-align: center; }
.issue-page .btn:disabled { opacity: .45; cursor: default; }
/* 贴图区（新建问题 / 整改回复 / 复核 / 通过共用）：没有这组样式时粘贴的截图会按原始尺寸铺开 */
.paste-zone { border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 6px; font-size: 12px; color: var(--text-3); cursor: pointer; background: var(--surface-2); }
.paste-zone:hover { border-color: var(--primary); color: var(--text-2); }
.new-issue-imgs { flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ni-thumb { position: relative; width: 110px; height: 78px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; flex: 0 0 auto; }
.ni-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ni-x { position: absolute; top: 2px; right: 4px; cursor: pointer; color: #fff; background: rgba(0, 0, 0, .55); border-radius: 50%; width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 12px; }
@media (max-width: 1080px) {
    .issue-thead { display: none; }
    .issue-card { grid-template-columns: 46px 1fr; padding: 8px 10px; }
    .c-title, .c-who, .c-op, .c-time, .c-rv, .c-act { grid-column: 2; }
    .c-no { grid-row: 1 / span 6; flex-direction: column; align-items: flex-start; }
    .c-act { flex-direction: row; flex-wrap: wrap; }
    .cell-1 { white-space: normal; }
}

/* ============ 复制到…（目标文件夹选择器） ============ */
.mat-tb-btn.mat-tb-hot { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.cp-tip { font-size: 13px; color: var(--text-2); margin-bottom: 10px; word-break: break-all; }
.cp-crumb { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.cp-crumb-item { cursor: pointer; padding: 2px 5px; border-radius: 4px; }
.cp-crumb-item:hover { color: var(--primary); background: var(--primary-soft); }
.cp-sep { color: var(--text-3); }
.cp-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.cp-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; }
.cp-item:hover { background: var(--primary-soft); }
.cp-item.cp-bad { opacity: .45; cursor: not-allowed; }
.cp-item.cp-bad:hover { background: none; }
.cp-badge { margin-left: auto; font-size: 11px; color: var(--text-3); }
.cp-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 12px; }
.cp-oklist { max-height: 30vh; overflow-y: auto; font-size: 12px; color: var(--green); margin: 6px 0; }
.cp-badlist { max-height: 30vh; overflow-y: auto; font-size: 12px; color: var(--red); margin: 6px 0; }

/* ============ 角色与权限（两轴：账号级 + 项目级） ============ */
/* 这张表故意不挂 .mat-table：通用手机规则按列号收列（见 @media 760 那段），会把角色列一起收掉 */
.pm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pm-table th { text-align: left; color: var(--text-3); font-weight: 500; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.pm-table td { padding: 10px 12px; border-bottom: 1px solid var(--surface-2); vertical-align: middle; }
.pm-table tr:hover td { background: #fafbfc; }
.member-row .m-sub { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.m-tip { font-size: 12px; color: var(--text-3); margin: 10px 0 0; }
.ua-plain { font-size: 12px; color: var(--text-2); }
.ua-table .ua-dept, .ua-table .ua-pos { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 5px; padding: 4px 6px; font-size: 12.5px; background: var(--surface); color: var(--text); }
.ua-table .ua-dept:disabled, .ua-table .ua-pos:disabled { background: var(--surface-2, #f2f4f8); color: var(--text-3); }
/* 项目内身份：一个人可能在几个项目里各有一个身份，所以一格排多枚小牌子 */
.ua-pr { display: inline-block; font-size: 11.5px; line-height: 1.6; padding: 1px 7px; margin: 2px 4px 2px 0; border-radius: 9px; background: var(--surface-2, #f2f4f8); color: var(--text-2); white-space: nowrap; }
.ua-pr.pm { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.ua-pr.none { color: var(--text-3); }
/* 账号管理：加了「项目内身份」一共九列，880px 的壳子装不下，控件会被挤到竖排。
   给它一个更宽的壳子 + 一个放大按钮，表格自己横向滚，宁可滚动也不要挤。
   选择器要压过 .modal.wide，不然桌面上还是 880px。 */
.modal.wide.ua-modal { max-width: 1200px; }
.modal.wide.ua-modal.ua-max { width: calc(100vw - 12px); max-width: none; height: calc(100vh - 12px); max-height: none; border-radius: 10px; }
.ua-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ua-head h2 { margin-bottom: 0; }
.ua-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.ua-scroll { overflow: auto; max-height: 56vh; margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; }
.modal.wide.ua-modal.ua-max .ua-scroll { max-height: calc(100vh - 300px); }
.ua-scroll .ua-table { width: auto; min-width: 1240px; }
.ua-scroll .ua-table th, .ua-scroll .ua-table td { white-space: nowrap; }
.ua-scroll .ua-table th { position: sticky; top: 0; z-index: 2; }
.ua-ops { flex-wrap: nowrap; }
@media (max-width:760px) {
    /* 手机上弹窗已经是整屏底栏，没有"放大"可给；表格照旧横向滚 */
    .ua-head .btn { display: none; }
    .ua-modal .ua-scroll { max-height: 62vh; }
}
.modal .form-row label.chk-row { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); margin-bottom: 0; }
.modal .form-row label.chk-row input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.badge.b-esc { background: #fbe6ef; color: #b0306a; }
.audit-mark { margin-top: 6px; display: inline-block; font-size: 11.5px; line-height: 1.5; color: var(--amber); background: var(--amber-soft); border-radius: 5px; padding: 3px 8px; }
.pm-table { margin-bottom: 4px; }
.pm-table td.mat-name { white-space: normal; max-width: 190px; font-weight: 500; }
.pm-table .pm-group td { background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12px; padding: 6px 12px; }
.pm-table .pm-yes, .pm-table .pm-no { text-align: center; width: 88px; }
.pm-table .pm-yes { color: var(--green); font-weight: 600; }
.pm-table .pm-no { color: #c4c9d4; }
.pm-table .pm-note { color: var(--text-3); font-size: 12px; }
.pm-table th.pm-me { color: var(--primary); background: var(--primary-soft); }
.pm-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); line-height: 1.9; }
@media (max-width: 760px) {
    .pm-table th, .pm-table td { padding: 7px 6px; }
    .pm-table .pm-yes, .pm-table .pm-no { width: 44px; }
    .pm-table td.mat-name { max-width: 120px; font-size: 12px; }
    .pm-note-h, .pm-table .pm-note { display: none; }
}
/* 永久删除项目的三步确认（回收站 → 类型「整个项目」那一行） */
.ppm-steps { display: flex; gap: 8px; margin: 4px 0 12px; }
.ppm-dot { flex: 1; text-align: center; font-size: 12px; color: var(--text-3); background: var(--surface-2); border-radius: 6px; padding: 6px 4px; }
.ppm-dot.on { color: #fff; background: var(--red); font-weight: 600; }
.ppm-dot.done { color: var(--amber); background: var(--amber-soft); }
.ppm-warn { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin: 8px 0; }
.ppm-ack { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.6; margin: 4px 0 10px; cursor: pointer; }
.ppm-ack input { flex: none; width: 16px; height: 16px; margin-top: 2px; accent-color: var(--red); }
.ppm-ack b { color: var(--red); }
@media (max-width: 760px) {
    .ppm-steps { gap: 5px; }
    .ppm-dot { font-size: 11px; padding: 5px 2px; }
}

/* ============ 手机端补漏（≤860px）：文件层级可见 + 名称不截断 + CAD 查看面板重排 ============
   上面 ≤760 那段把项目资料的文件夹树整个藏了（怕占地方），结果是手机上完全看不到
   文件层级；名称又统一 nowrap+ellipsis，长图名只剩几个字。这里把树以「可折叠」方式放回来，
   并让层级/名称换行完整显示。 */
@media (max-width: 860px) {
    /* 文件夹树：不再彻底藏掉，改成默认折叠、点工具栏「📁 文件层级」展开的抽屉 */
    #viewMaterials .mat-tree { display: none !important; }
    #viewMaterials.tree-open .mat-tree { display: block !important; width: auto; max-height: 42vh; border-right: none; border-bottom: 1px solid var(--border); }
    #matCollapse { display: inline-flex !important; }
    #matCollapse .mc-label { display: inline; }
    .mat-tree-item { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.45; }
    .mat-tree-label { min-width: 0; overflow-wrap: anywhere; }

    /* 名称列：省略号改成换行，长图名整行读完。
       #viewMaterials/#viewBim 的 td 级 nowrap（优先级 1,1,1）和 .mat-nm 内层 nowrap 都要压住。 */
    .mat-name, #viewMaterials .mat-name, #viewBim .mat-name,
    #viewMaterials .mat-table td.mat-name, #viewBim .mat-table td.mat-name,
    .mat-nm, #viewMaterials .mat-nm, #viewBim .mat-nm {
        max-width: none; white-space: normal; overflow: visible; text-overflow: clip;
        overflow-wrap: anywhere; line-height: 1.4;
    }
    .mat-breadcrumb { flex-wrap: wrap; row-gap: 2px; }
    .mat-bc-item { overflow-wrap: anywhere; }
    /* 操作列同理：手机上按钮排不下就换行，别把最后一个挤没（td 级 nowrap 优先级更高，要一起压） */
    #viewMaterials .mat-ops, #viewBim .mat-ops,
    #viewMaterials .mat-table td.mat-ops, #viewBim .mat-table td.mat-ops { white-space: normal; }

    /* 图迈式 CAD 内嵌查看：右侧 270px 文件面板在手机上会把画布挤没，改成上下堆叠 */
    #viewCadViewer { height: auto; min-height: 100%; }
    .cv-topbar { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .cv-topbar::-webkit-scrollbar { display: none; }
    .cv-fname { max-width: 40vw; }
    .cv-main { flex-direction: column; }
    #cvFrame { flex: none; height: 52vh; min-height: 260px; }
    .cv-dock { width: auto; border-left: none; border-top: 1px solid #333; flex: none; min-height: 150px; max-height: 40vh; }
    .cvd-tree { max-height: 150px; }
    .cvd-name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
}

/* ============ 手机端「在手机上打开图纸」弹层 ============ */
.qc-mb-tip { font-size: 12px; color: var(--text-3); margin: 0 0 12px; line-height: 1.6; }
.qc-mb-acts { display: flex; flex-direction: column; gap: 10px; }
.qc-mb-acts .btn { width: 100%; padding: 12px; font-size: 14px; }
.qc-mb-msg { font-size: 12px; color: var(--primary); line-height: 1.7; margin-top: 12px; min-height: 18px; }
.qc-mb-warn { font-size: 12.5px; line-height: 1.6; color: #a06a00; background: #fff8ec; border: 1px solid #e8a33d; border-radius: 8px; padding: 9px 11px; margin-bottom: 10px; }
.qc-mb-diag { font-size: 11px; color: var(--text-3); margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }

/* ============ 站内通知 / 版本历史 / 二维码（2026-11-07）============ */
.notif-wrap { position: relative; }
.notif-btn { position: relative; background: none; border: 0; font-size: 19px; line-height: 1; cursor: pointer; padding: 6px 4px; border-radius: 8px; }
.notif-btn:hover { background: rgba(125,140,160,.12); }
.notif-badge { position: absolute; top: -2px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #f56c6c; color: #fff; font: 700 10.5px/17px system-ui; text-align: center; }
.notif-panel { position: fixed; top: 56px; right: 14px; width: min(380px, calc(100vw - 20px)); max-height: min(560px, calc(100vh - 90px)); display: flex; flex-direction: column; background: var(--panel, #fff); border: 1px solid var(--border, #d9dee6); border-radius: 12px; box-shadow: 0 12px 36px rgba(20,40,80,.16); z-index: 95; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border, #e5e9f0); font-size: 13.5px; }
.notif-list { overflow: auto; }
.notif-empty { padding: 26px 16px; text-align: center; color: var(--text-3, #8a93a3); font-size: 12.5px; line-height: 1.8; }
.notif-item { padding: 10px 14px; border-bottom: 1px dashed var(--border, #edf0f4); cursor: pointer; }
.notif-item:hover { background: rgba(45,108,223,.06); }
.notif-item.unread { background: rgba(45,108,223,.075); }
.notif-item.unread .nt-t span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2d6cdf; margin-right: 6px; vertical-align: 2px; }
.nt-t { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text-1, #23304a); }
.nt-time { font-weight: 400; font-size: 11px; color: var(--text-3, #98a1b0); flex: none; }
.nt-b { margin-top: 3px; font-size: 12.5px; color: var(--text-2, #4d5a70); line-height: 1.55; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nt-a { margin-top: 2px; font-size: 11px; color: var(--text-3, #98a1b0); }
@media (max-width: 760px) { .notif-panel { top: 50px; right: 8px; } }
.mat-ver { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; background: rgba(45,108,223,.1); color: #2d6cdf; font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.fver-box { max-height: 62vh; overflow: auto; }
.fver-head { font-size: 12.5px; color: var(--text-2, #4d5a70); padding: 4px 2px 10px; line-height: 1.6; }
.fver-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fver-table th, .fver-table td { border-bottom: 1px solid var(--border, #edf0f4); padding: 7px 8px; text-align: left; white-space: nowrap; }
.fver-table th { color: var(--text-3, #8a93a3); font-weight: 600; background: rgba(125,140,160,.05); }
.fver-ops .btn { margin-right: 6px; }
.fver-chip { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; background: rgba(45,108,223,.12); color: #2d6cdf; font-size: 11px; }
.fver-chip.bad { background: rgba(245,108,108,.12); color: #f56c6c; }
.fver-curmark { font-size: 11px; color: var(--text-3, #98a1b0); }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; }
.qr-box { width: 208px; height: 208px; background: #fff; border: 1px solid var(--border, #e5e9f0); border-radius: 10px; padding: 8px; }
.qr-box img, .qr-box canvas { display: block; width: 100%; height: 100%; }
.qr-url { width: 100%; }
.qr-url input { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--border, #dfe4ec); border-radius: 8px; font-size: 12px; color: var(--text-2, #4d5a70); }
.qr-note { font-size: 12.5px; color: var(--text-1, #23304a); text-align: center; }
.qr-tip { font-size: 11.5px; color: var(--text-3, #98a1b0); text-align: center; line-height: 1.6; }
