* { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  --bg:#f4f5f7; --panel:#fff; --line:#d9dce1; --line2:#e8eaed;
  --txt:#1f2329; --muted:#8a9099; --accent:#2563eb; --accent2:#1d4ed8;
  --head:#f0f2f5; --sel:#2563eb; --selbg:rgba(37,99,235,.12);
  --ok:#16a34a; --warn:#d97706; --err:#dc2626;
  --gutter-w:52px; --head-h:26px; --row-h:22px;
  --cell-font:12px;
  font-family:-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;
}
html,body{height:100%;background:var(--bg);color:var(--txt);font-size:13px;overflow:hidden;}
.hidden{display:none!important;}

/* ---------- 登录 ---------- */
.login-wrap{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#1e3a8a,#2563eb 55%,#3b82f6);}
.login-card{background:#fff;border-radius:16px;padding:40px 38px;width:340px;text-align:center;
  box-shadow:0 24px 60px rgba(0,0,0,.28);}
.login-logo{width:56px;height:56px;border-radius:14px;background:linear-gradient(135deg,#2563eb,#1e40af);
  color:#fff;font-size:30px;font-weight:800;line-height:56px;margin:0 auto 14px;}
.login-card h1{font-size:20px;font-weight:700;}
.login-sub{color:var(--muted);font-size:12px;margin:6px 0 22px;}
#loginForm{display:flex;flex-direction:column;gap:12px;}
#loginForm input{height:42px;border:1px solid var(--line);border-radius:9px;padding:0 14px;font-size:14px;outline:none;transition:.15s;}
#loginForm input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.15);}
#lBtn{height:44px;border:none;border-radius:9px;background:var(--accent);color:#fff;font-size:15px;font-weight:600;cursor:pointer;transition:.15s;margin-top:4px;}
#lBtn:hover{background:var(--accent2);}
#lBtn:disabled{opacity:.6;cursor:default;}
.login-err{color:var(--err);font-size:12px;min-height:16px;}
.login-foot{margin-top:20px;color:var(--muted);font-size:11px;}

/* ---------- 布局 ---------- */
.app{display:flex;flex-direction:column;height:100vh;}
.topbar{height:46px;background:var(--panel);border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 14px;gap:14px;flex:none;}
.brand{font-weight:700;font-size:15px;display:flex;align-items:center;gap:8px;}
.brand-mark{display:inline-block;width:24px;height:24px;background:linear-gradient(135deg,#2563eb,#1e40af);color:#fff;border-radius:7px;text-align:center;line-height:24px;font-size:14px;}
/* 品牌切换器 */
.brand-sw{position:relative;flex:none;}
.brand-sw-btn{display:flex;align-items:center;gap:7px;height:32px;padding:0 9px;border:1px solid var(--line);background:#fff;border-radius:8px;cursor:pointer;font-size:14px;font-weight:600;color:#1f2937;transition:.15s;}
.brand-sw-btn:hover{border-color:#2563eb;background:#f5f8ff;}
.brand-sw-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.brand-sw-caret{font-size:10px;color:var(--muted);}
.brand-menu{position:absolute;top:38px;left:0;z-index:200;min-width:200px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.18);padding:6px;max-height:320px;overflow:auto;}
.brand-item{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:7px;cursor:pointer;font-size:13px;color:#1f2937;}
.brand-item:hover{background:#f2f6ff;}
.brand-item.active{background:#e8f0ff;font-weight:600;}
.bi-mark{width:22px;height:22px;flex:none;background:linear-gradient(135deg,#2563eb,#1e40af);color:#fff;border-radius:6px;text-align:center;line-height:22px;font-size:13px;}
.bi-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.bi-status{font-size:11px;padding:1px 7px;border-radius:10px;}
.bi-status.ok{color:#15803d;background:#dcfce7;}
.bi-status.wait{color:#b45309;background:#fef3c7;}
.bi-status.none{color:#9ca3af;background:#f3f4f6;}
.topbar-title{font-size:14px;font-weight:700;color:var(--muted);letter-spacing:.5px;}
.tb-link{font-size:13px;color:var(--accent);text-decoration:none;padding:4px 10px;border:1px solid var(--line);border-radius:8px;}
.tb-link:hover{background:var(--accent);color:#fff;border-color:var(--accent);}
.sheet-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:15px;line-height:2;text-align:center;white-space:pre-line;pointer-events:none;padding:40px;}
.topbar-mid{flex:1;color:var(--muted);font-size:12px;}
.topbar-right{display:flex;align-items:center;gap:10px;}
.online{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--muted);}
.online .dot{width:8px;height:8px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 3px rgba(22,163,74,.18);}
.tb-btn{height:30px;padding:0 14px;border:1px solid var(--line);background:#fff;border-radius:7px;cursor:pointer;font-size:13px;transition:.15s;}
.tb-btn:hover{border-color:var(--accent);color:var(--accent);}
.tb-btn.ghost{border-color:transparent;color:var(--muted);}
.tb-btn.ghost:hover{color:var(--err);}
.user-chip{display:flex;align-items:center;gap:7px;font-size:13px;}
.role-badge{font-size:11px;padding:2px 8px;border-radius:20px;background:#eef2ff;color:#4338ca;font-weight:600;}
.role-badge.editor{background:#ecfdf5;color:#047857;}
.role-badge.viewer{background:#f1f5f9;color:#64748b;}

.formula-bar{height:32px;background:var(--panel);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;padding:0 10px;flex:none;}

/* ---------- 表头涂色工具条 ---------- */
.paint-bar{height:34px;background:var(--panel);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;padding:0 10px;flex:none;font-size:12px;overflow-x:auto;white-space:nowrap;}
.paint-bar::-webkit-scrollbar{height:6px;}
.paint-bar::-webkit-scrollbar-thumb{background:var(--muted,#b9c0cc);border-radius:3px;}
.paint-bar .pb-label{color:var(--muted);font-weight:600;}
.paint-bar .pb-palette{display:flex;gap:4px;align-items:center;}
.paint-bar .pb-palette .sw{width:20px;height:20px;border-radius:5px;cursor:pointer;border:2px solid transparent;flex:none;}
.paint-bar .pb-palette .sw.active{border-color:var(--accent2);box-shadow:0 0 0 1px var(--accent2);}
.paint-bar input[type=color]{width:34px;height:24px;padding:1px;border:1px solid var(--line);border-radius:6px;background:#fff;cursor:pointer;}
.paint-bar .pb-hint{color:var(--muted);font-size:11px;}
.paint-bar .mini{font-size:12px;padding:4px 10px;}
.paint-bar .pb-sep{width:1px;height:20px;background:var(--line);margin:0 4px;}
.paint-bar.on{background:#fffbe6;}

/* 品牌专属表格底色：草堂浅绿 / 璞觉黄 / 瑜塘卡其 */
body[data-brand="草堂"]{--cell-bg:#eef7ee;}
body[data-brand="璞觉"]{--cell-bg:#fff8d6;}
body[data-brand="瑜塘"]{--cell-bg:#f3ecdc;}
.cell-addr{min-width:66px;font-weight:600;font-size:12px;color:var(--txt);border-right:1px solid var(--line2);padding-right:8px;text-align:center;}
.fx{color:var(--muted);font-style:italic;font-size:12px;}
#fxInput{flex:1;height:24px;border:1px solid transparent;border-radius:5px;padding:0 8px;font-size:13px;outline:none;font-family:"Consolas","Menlo",monospace;}
#fxInput:focus{border-color:var(--accent);background:#fff;}

/* ---------- 网格 ---------- */
.grid-host{flex:1;position:relative;overflow:hidden;background:var(--panel);}
.grid{position:absolute;inset:0;overflow-x:auto;overflow-y:scroll;scrollbar-width:thin;scrollbar-color:#b9c2cf transparent;}
.grid::-webkit-scrollbar{width:10px;height:10px;}
.grid::-webkit-scrollbar-thumb{background:#b9c2cf;border-radius:5px;border:2px solid transparent;background-clip:content-box;}
.grid::-webkit-scrollbar-track{background:transparent;}
.thead{position:sticky;top:0;z-index:30;width:max-content;}
.tbody{position:relative;width:max-content;}
.viewport{position:absolute;left:0;top:0;will-change:transform;}

.hrow{display:flex;height:var(--head-h);}
.hcell{flex:none;height:100%;background:var(--head);border-right:1px solid var(--line);border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--muted);font-weight:600;user-select:none;
  position:relative;padding:0 var(--col-gap,0px);}
.hcell.colsel{background:#dbe6ff;color:var(--accent2);}
.hcell .hlabel{pointer-events:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;}
/* 按列筛选图标：默认透明，悬停/已筛时显示 */
.hcell .hfilter{position:absolute;right:7px;top:1px;width:15px;height:15px;border:none;background:none;cursor:pointer;
  font-size:12px;line-height:1;color:var(--accent);opacity:0;padding:0;transition:opacity .12s;z-index:2;}
.hcell:hover .hfilter{opacity:.55;}
.hcell .hfilter:hover{opacity:1;}
/* 已筛选列：表头整体标红（红底 + 红字 + 红色漏斗 + 底部红条），一眼可辨 */
.hcell .hfilter.on{opacity:1;color:#d32029;}
.hcell.filtered{background:#ffe5e5;border-bottom:2px solid #d32029;}
.hcell.filtered .hlabel{color:#d32029;font-weight:700;}
.hcell.filtered.colsel{background:#ffd3d3;}
/* 冻结表头行里已筛选的列：同步标红（覆盖原单元格样式） */
.frow .cell.fcol{background:#ffe5e5!important;color:#d32029!important;font-weight:700;
  box-shadow:inset 0 -2px 0 #d32029;}
/* 列宽拖拽手柄 */
.hcell .col-resize{position:absolute;right:0;top:0;width:6px;height:100%;cursor:col-resize;z-index:3;}
.hcell .col-resize:hover{background:var(--accent);opacity:.35;}
.hcell .col-resize::after{content:"";position:absolute;right:2px;top:20%;height:60%;width:2px;background:var(--accent);opacity:0;border-radius:2px;}
.hcell .col-resize:hover::after{opacity:.6;}
.corner{position:sticky;left:0;z-index:5;width:var(--gutter-w);background:var(--head);border-right:1px solid var(--line);}

.frow{display:flex;height:var(--head-h);}
.frow .fixedrow{background:#fbfcfe;}

.row{display:flex;position:absolute;left:0;height:var(--row-h);}
.gutter{position:sticky;left:0;z-index:10;width:var(--gutter-w);flex:none;background:var(--head);
  border-right:1px solid var(--line);border-bottom:1px solid var(--line2);
  display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--muted);user-select:none;}
.gutter.rowsel{background:#dbe6ff;color:var(--accent2);}
.gutter{position:relative;}
.gutter .gutter-resize{position:absolute;left:0;right:0;bottom:0;height:4px;cursor:row-resize;z-index:3;}
.gutter .gutter-resize:hover{background:var(--accent);opacity:.5;}
.cell{flex:none;height:100%;border-right:1px solid var(--line2);border-bottom:1px solid var(--line2);
  padding:0 calc(4px + var(--col-gap,0px));display:flex;align-items:center;overflow:hidden;white-space:nowrap;font-size:var(--cell-font,12px)!important;line-height:1;
  background:var(--cell-bg,#fff);cursor:cell;user-select:none;}
.cell.num{justify-content:flex-end;}
.cell.err{color:var(--err);}
.cell.sel{outline:2px solid var(--sel);outline-offset:-2px;z-index:6;}
.cell.insel{background:#e4eefc;box-shadow:inset 0 0 0 0;}
.cell.fz-r{border-bottom:2px solid #a8b4c4;}
.cell.fz-c{border-right:2px solid #a8b4c4;}
.cell.flash{animation:flash 1.1s ease-out;}
/* 底色不变：仅用描边脉冲提示，绝不动 cell 背景（保留 painted fill / 品牌底色） */
@keyframes flash{0%{box-shadow:inset 0 0 0 2px rgba(240,165,0,.85);}100%{box-shadow:inset 0 0 0 0 rgba(240,165,0,0);}}
.cell.stickyc{position:sticky;z-index:8;}

.cell-editor{position:absolute;z-index:40;}
.cell-editor input{width:100%;height:100%;border:2px solid var(--accent);outline:none;padding:0 4px;font-size:var(--cell-font,12px);font-family:inherit;}

/* ---------- 标签页 ---------- */
.tabs{height:34px;background:var(--panel);border-top:1px solid var(--line);display:flex;align-items:stretch;overflow-x:auto;flex:none;}
.tab{flex:none;padding:0 14px;display:flex;align-items:center;font-size:12px;color:var(--muted);cursor:pointer;border-right:1px solid var(--line2);white-space:nowrap;transition:.12s;}
.tab:hover{background:var(--head);}
.tab.active{color:var(--accent2);font-weight:600;background:#fff;border-top:2px solid var(--accent);margin-top:-1px;}
.tabs::-webkit-scrollbar{height:6px;}

/* ---------- 状态栏（WPS 风格：选区行列数 + 求和/平均值/计数） ---------- */
.status-bar{height:26px;background:var(--panel);border-top:1px solid var(--line);display:flex;align-items:center;gap:18px;padding:0 12px;font-size:12px;color:var(--muted);flex:none;white-space:nowrap;overflow-x:auto;}
.status-bar b{color:var(--text);font-weight:600;}
.status-bar .sb-dim{color:#999;}

/* ---------- 授权管理矩阵 ---------- */
.perm-scroll{overflow:auto;max-height:62vh;}
table.perm{border-collapse:collapse;width:100%;font-size:12px;background:var(--panel);border:1px solid var(--line);}
table.perm th,table.perm td{padding:7px 8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;}
table.perm thead th{background:var(--rowhead);position:sticky;top:0;z-index:2;font-weight:600;}
table.perm tbody tr:hover{background:var(--hover);}
table.perm select{font-size:12px;padding:3px 4px;border:1px solid var(--line);border-radius:6px;background:#fff;}
table.perm select:disabled{opacity:.55;}
.perm-badge{display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;}
.perm-none{background:#f1f1f1;color:#999;}
.perm-read{background:#e3f2fd;color:#1e6fb8;}
.perm-write{background:#e6f7e6;color:#1a7f37;}
.perm-on{background:#e6f7e6;color:#1a7f37;}
.perm-off{background:#f1f1f1;color:#999;}
.perm-note{font-size:12px;color:var(--muted);margin-bottom:10px;line-height:1.7;}
.perm-note b{color:var(--text);}
.pdetail{margin-top:5px;font-size:11px;color:var(--muted);}
.pdetail summary{cursor:pointer;user-select:none;}
.psheets{margin:5px 0 2px;padding:6px 8px;background:var(--head);border:1px solid var(--line);border-radius:8px;display:grid;grid-template-columns:1fr 1fr;gap:3px 12px;max-height:240px;overflow:auto;}
.prow{display:flex;align-items:center;justify-content:space-between;gap:8px;white-space:nowrap;}
.prow span{overflow:hidden;text-overflow:ellipsis;max-width:180px;}
.prow select{font-size:11px;padding:2px 3px;}

/* ---------- 弹窗 ---------- */
.modal{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;z-index:100;}
.modal-card{background:#fff;border-radius:14px;width:820px;max-width:94vw;max-height:86vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.35);}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--line);}
.modal-tabs{display:flex;}
.mtab{padding:14px 16px;border:none;background:none;font-size:14px;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;}
.mtab.active{color:var(--accent2);border-bottom-color:var(--accent);font-weight:600;}
.modal-x{border:none;background:none;font-size:26px;color:var(--muted);cursor:pointer;line-height:1;}
/* 弹窗正文：强制常驻纵向滚动条，内容再长也能滚 */
.modal-body{padding:16px;overflow-x:auto;overflow-y:scroll;flex:1;min-height:0;max-height:calc(86vh - 56px);}
.mtab-pane{min-height:0;}
.new-user{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap;}
.new-user input,.new-user select{height:34px;border:1px solid var(--line);border-radius:7px;padding:0 10px;font-size:13px;}
.new-user input{width:130px;}
.new-user button{height:34px;padding:0 16px;border:none;border-radius:7px;background:var(--accent);color:#fff;cursor:pointer;font-size:13px;}
.utable,.atable{width:100%;border-collapse:collapse;font-size:12px;}
.utable th,.utable td,.atable th,.atable td{border-bottom:1px solid var(--line2);padding:8px 8px;text-align:left;}
.utable th,.atable th{color:var(--muted);font-weight:600;background:var(--head);position:sticky;top:0;}
.mini{height:26px;padding:0 10px;border:1px solid var(--line);border-radius:6px;background:#fff;cursor:pointer;font-size:12px;margin-right:4px;}
.mini:hover{border-color:var(--accent);color:var(--accent);}
.atable td{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.toast{position:fixed;bottom:60px;left:50%;transform:translateX(-50%);background:#1f2329;color:#fff;padding:10px 18px;border-radius:8px;font-size:13px;z-index:200;box-shadow:0 8px 24px rgba(0,0,0,.3);}
/* ---------- 滚动条：全站统一、常驻可见 ---------- */
.grid::-webkit-scrollbar,.modal-body::-webkit-scrollbar,.login-wrap::-webkit-scrollbar{width:12px;height:12px;}
.grid::-webkit-scrollbar-thumb,.modal-body::-webkit-scrollbar-thumb,.login-wrap::-webkit-scrollbar-thumb{
  background:#c3c8d0;border-radius:6px;border:3px solid var(--panel);}
.grid::-webkit-scrollbar-thumb:hover,.modal-body::-webkit-scrollbar-thumb:hover,
.login-wrap::-webkit-scrollbar-thumb:hover{background:#a9afb8;}
.grid::-webkit-scrollbar-track,.modal-body::-webkit-scrollbar-track{background:var(--head);}
/* 登录页小屏时也可上下滚，不至于按钮被挤出屏幕 */
.login-wrap{overflow-y:auto;}

/* ---------- 视图调节（缩放 / 字号） ---------- */
.view-ctrl{display:flex;align-items:center;gap:4px;background:#f1f3f6;border:1px solid var(--line);border-radius:8px;padding:3px 8px;font-size:12px;color:var(--muted);}
.vc-label{font-size:11px;color:var(--muted);}
.vc-val{min-width:34px;text-align:center;font-variant-numeric:tabular-nums;color:var(--txt);font-weight:600;}
.vc-sep{width:1px;height:16px;background:var(--line);margin:0 2px;}
.tb-ico{width:24px;height:24px;border:1px solid transparent;background:#fff;border-radius:6px;cursor:pointer;font-size:14px;line-height:1;color:var(--txt);display:flex;align-items:center;justify-content:center;transition:.12s;}
.tb-ico:hover{border-color:var(--accent);color:var(--accent);}
.tb-ico.wide{width:auto;padding:0 8px;font-size:12px;}

/* ---------- 筛选 ---------- */
.filter-box{display:flex;align-items:center;gap:6px;margin-left:12px;background:#fff;border:1px solid var(--line);border-radius:7px;padding:0 8px;height:24px;}
.filter-box:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.12);}
.filter-ico{font-size:12px;opacity:.6;}
#filterInput{border:none;outline:none;height:22px;width:190px;font-size:12px;background:transparent;}
.filter-count{font-size:11px;color:var(--muted);white-space:nowrap;min-width:10px;}
.filter-clear{border:none;background:none;cursor:pointer;color:var(--muted);font-size:13px;line-height:1;padding:0 2px;}
.filter-clear:hover{color:var(--err);}
.filter-clear.hidden{display:none;}

/* ---------- 按列筛选浮层 ---------- */
.col-filter-pop{position:absolute;z-index:60;width:228px;background:#fff;border:1px solid var(--line);
  border-radius:10px;box-shadow:0 12px 32px rgba(15,23,42,.22);overflow:hidden;}
.cfp-head{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;background:var(--head);
  border-bottom:1px solid var(--line2);font-weight:600;font-size:13px;color:var(--txt);}
.cfp-x{border:none;background:none;font-size:18px;line-height:1;color:var(--muted);cursor:pointer;padding:0 4px;}
.cfp-x:hover{color:var(--err);}
.cfp-body{padding:10px;display:flex;flex-direction:column;gap:8px;}
.cfp-op{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);}
.cfp-op select{height:30px;border:1px solid var(--line);border-radius:6px;padding:0 6px;font-size:13px;flex:1;background:#fff;}
#cfpVal{height:32px;border:1px solid var(--line);border-radius:6px;padding:0 8px;font-size:13px;outline:none;}
#cfpVal:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.12);}
.cfp-foot{display:flex;justify-content:flex-end;gap:8px;padding:0 10px 10px;}

/* ── 查找替换弹窗 ── */
.form-col { display: flex; flex-direction: column; gap: 12px; }
.form-col label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-col input[type=text], .form-col select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border, #d9dde3);
  background: var(--input-bg, #fff); color: var(--text); font-size: 14px; outline: none;
}
.form-col input:focus, .form-col select:focus { border-color: var(--accent, #4a7cff); }
.rep-row { flex-direction: row !important; align-items: center; gap: 10px !important; }
.rep-row select { flex: 1; }
.rep-check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; }
.rep-count { min-height: 18px; font-size: 13px; color: var(--accent, #4a7cff); }
.primary-btn {
  margin-top: 4px; padding: 10px 14px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--accent, #4a7cff); color: #fff; font-size: 14px; font-weight: 600;
}
.primary-btn:hover { filter: brightness(1.05); }
.form-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
/* 撤销按钮：无可撤销时置灰 */
button.mini:disabled, .mini[disabled] { opacity: .45; cursor: not-allowed; }

/* ── 行列高亮（非破坏性半透明叠加，不与底色/批注角标冲突）── */
.cell.hl-row, .cell.hl-col { box-shadow: inset 0 0 0 9999px rgba(124,58,237,0.16); }
.cell.hl-row.hl-col { box-shadow: inset 0 0 0 9999px rgba(124,58,237,0.30); }
/* 鼠标悬停行列高亮（淡蓝）；与选中高亮（hl-*）互斥，绝不冲突 */
.cell.hv-row, .cell.hv-col { box-shadow: inset 0 0 0 9999px rgba(33,150,243,0.11); }
.cell.hv-row.hv-col { box-shadow: inset 0 0 0 9999px rgba(33,150,243,0.18); }
/* 单元格批注角标：右上角小三角，任何底色上都可见 */
.cell.hasnote { position: relative; }
.cell.hasnote::after {
  content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-style: solid; border-width: 0 9px 9px 0;
  border-color: transparent #e4572e transparent transparent;
  pointer-events: none; z-index: 7;
}
/* 窄弹窗（批注 / 查找替换） */
.modal-card.small { width: 400px; }
#noteText { width: 100%; resize: vertical; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border, #d9dde3); background: var(--input-bg, #fff); color: var(--text);
  font-family: inherit; font-size: var(--cell-font, 12px); line-height: 1.6; text-align: center; box-sizing: border-box; }
.note-btns { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
/* 被他人建立的单元格：当前账号只读标记（不改动底色，仅描边 + 禁用光标）*/
.cell.locked { outline: 1px dotted var(--muted, #8a9099); outline-offset: -2px; cursor: not-allowed; }
.lock-tip { color: var(--warn, #d97706); font-weight: 600; margin: 4px 0 0; }

/* 列头/行号 多选高亮（用于一次性隐藏多列/多行；用描边不与底色/标头涂色冲突） */
.hcell.colmsel { outline: 2px solid #1a73e8; outline-offset: -2px; z-index: 5; }
.gutter.rowmsel { outline: 2px solid #1a73e8; outline-offset: -2px; background: #e3edff; }
/* 危险操作按钮（隐藏列/行） */
.mini.danger { color: #c0392b; border-color: rgba(192,57,43,0.4); }
.mini.danger:hover { background: rgba(192,57,43,0.10); }

/* 右键隐藏菜单 */
.hide-menu { position: fixed; z-index: 80; min-width: 130px; padding: 4px;
  background: #fff; border: 1px solid #d0d5dd; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.hide-menu.hidden { display: none; }
.hide-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: none; background: transparent; color: #222; font: 13px/1.4 inherit; cursor: pointer; border-radius: 6px; }
.hide-menu button:hover { background: #eef2f7; }

