/* ============================================================
   数据查询系统 · 样式（基础层）
   原则：数据优先（表格占满屏幕）、单一强调色、红增绿减
   v2（2026-11-19）：设计变量统一调整；外壳、总览、登录等新版组件见 ui.css
   ============================================================ */

:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --line: #e5e7ec;
  --line-2: #d4d8e0;
  --text: #121826;
  --text-2: #4a5263;
  --text-3: #687082;     /* 对白底 ≥ 4.8:1，满足 AA */
  --accent: #2356d8;
  --accent-hover: #1b47b8;
  --accent-weak: #edf2fd;
  --accent-line: #c6d5f7;
  --pos: #c8312a;        /* 调增 */
  --pos-weak: #fdf0ef;
  --neg: #0d7a55;        /* 调减 */
  --neg-weak: #e8f6f0;
  --warn: #8a5a00;
  --warn-weak: #fff5dc;
  --danger: #c8312a;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --hdr-h: 56px;
  --row-w: 60px;
  --edge-px: clamp(14px, 1.4vw, 24px);
  --cell-px: clamp(12px, 0.9vw, 18px);
  --grid-fs: clamp(13px, 0.2vw + 10.4px, 14.6px);
  --grid-th-fs: clamp(12px, 0.14vw + 10.2px, 13px);
  --grid-row-h: clamp(36px, 0.9vh + 27px, 42px);
  --grid-th-h: clamp(36px, 0.8vh + 28px, 40px);
  --tree-ind: clamp(18px, 1.25vw, 24px);
  --remark-gap: clamp(28px, 2.2vw, 48px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

body.no-scroll {
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic.sm {
  width: 14px;
  height: 14px;
}

.muted { color: var(--text-3); }
.grow { flex: 1; min-width: 0; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.zero, .dash { color: var(--text-3); }

.code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  margin-right: 6px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* 输入类控件已经有 3px 的 focus 光圈，再叠 outline 会出现「双边框」 */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

@media (max-width: 860px) {
  .only-desktop { display: none !important; }
}
@media (min-width: 861px) {
  .only-mobile { display: none !important; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.14s var(--ease-out), border-color 0.14s var(--ease-out), color 0.14s var(--ease-out), box-shadow 0.16s var(--ease-out), transform 0.1s var(--ease-out);
}
.btn:hover { background: var(--surface-2); border-color: #c6ccd6; }
.btn:not(:disabled):active { transform: scale(0.975); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 3px 10px rgba(35, 86, 216, 0.22); }
.btn-primary:not(:disabled):active { box-shadow: 0 1px 3px rgba(35, 86, 216, 0.16); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--pos-weak); border-color: #efc4c1; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #a92a24; border-color: #a92a24; box-shadow: 0 3px 10px rgba(197, 50, 43, 0.22); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn-block { width: 100%; height: 40px; font-size: 14.5px; }
.btn.active { background: var(--accent-weak); border-color: var(--accent-line); color: var(--accent); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  transition: background 0.14s var(--ease-out), color 0.14s var(--ease-out), transform 0.1s var(--ease-out);
}
.icon-btn:hover { background: #eef0f4; color: var(--text); }
.icon-btn:not(:disabled):active { transform: scale(0.92); }
.icon-btn:disabled { opacity: 0.45; cursor: default; background: transparent; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 6px;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- 表单 ---------- */
.field {
  display: block;
  margin-bottom: 14px;
}
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
}

/* 密码输入：右侧显示/隐藏切换 */
.pwd-input {
  position: relative;
  display: block;
}
.pwd-input input { padding-right: 42px; }
.pwd-eye {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
}
.pwd-eye:hover { background: #eef0f4; color: var(--text-2); }
.pwd-eye[aria-pressed="true"] { color: var(--accent); }

/* 新密码规则 */
.pwd-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--text-3);
}
.pwd-rules li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.12s;
}
.pwd-rules li::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  box-sizing: border-box;
  transition: background 0.12s, border-color 0.12s;
}
.pwd-rules li.ok { color: var(--neg); }
.pwd-rules li.ok::before {
  border-color: var(--neg);
  background: var(--neg);
  box-shadow: inset 0 0 0 2px var(--surface);
  animation: rulePop 0.24s var(--ease-spring);
}
@keyframes rulePop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.field-msg {
  margin-top: 6px;
  font-size: 12px;
  color: var(--pos);
}

input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea {
  height: auto;
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 86, 216, 0.14);
}
input:disabled, select:disabled {
  background: var(--surface-2);
  color: var(--text-3);
}
input[readonly].plain {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding-right: 0;
  cursor: default;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
input[readonly].plain:focus { box-shadow: none; border-color: transparent; }

/* 只读提示（2026 年安排数） */
.lock-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 10px;
  font-size: 12.5px;
  color: var(--text-3);
}
.lock-hint .ic { flex: none; color: var(--text-3); }
.lock-hint .link-btn { height: 26px; padding: 0 2px; font-size: 12.5px; }

.form-error {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--pos-weak);
  color: var(--pos);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  animation: errShake 0.28s var(--ease-out);
}
@keyframes errShake {
  0% { opacity: 0; transform: translateX(-5px); }
  35% { opacity: 1; transform: translateX(4px); }
  70% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  cursor: pointer;
}
.check input { margin-top: 3px; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

/* ---------- 启动 / 登录 ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
}
.boot-msg { color: var(--text-2); font-size: 14px; }

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #dfe3ea;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(900px 420px at 50% -80px, rgba(35, 86, 216, 0.065), transparent 72%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 360px;
  padding: 32px 28px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 42px rgba(18, 28, 45, 0.075), 0 1px 3px rgba(18, 28, 45, 0.04);
  animation: cardFloatIn 0.28s var(--ease-out);
}
@keyframes cardFloatIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card h1 {
  margin: 14px 0 4px;
  font-size: 19px;
  font-weight: 650;
}
.login-sub {
  margin: 0 0 22px;
  color: var(--text-3);
  font-size: 13px;
}
.login-foot {
  margin: 14px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  flex: none;
}
.brand-mark.lg { width: 40px; height: 40px; border-radius: 10px; }
.brand-mark.lg .ic { width: 22px; height: 22px; }

/* ---------- 应用骨架 ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.hdr {
  flex: none;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--hdr-h);
  padding: 0 max(10px, calc(var(--edge-px) - 4px)) 0 var(--edge-px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.hdr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}
.hdr-tabs {
  display: flex;
  align-self: stretch;
  gap: 2px;
}
.tab {
  position: relative;
  padding: 0 12px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.15s var(--ease-out);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); font-weight: 600; }
.tab-bar {
  position: absolute;
  left: 10px;
  bottom: -1px;
  width: calc(100% - 20px);
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  pointer-events: none;
}
.hdr-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.hbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.14s var(--ease-out), color 0.14s var(--ease-out), transform 0.1s var(--ease-out);
}
.hbtn:hover { background: #eef0f4; color: var(--text); }
.hbtn:active { transform: scale(0.96); }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- 工具栏 ---------- */
.toolbar {
  flex: none;
  padding: clamp(9px, 0.7vh + 5px, 13px) var(--edge-px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tb-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tb-spacer { flex: 1; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 clamp(240px, 20vw, 360px);
  min-width: 200px;
}
.search > .ic {
  position: absolute;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}
.search input {
  height: 34px;
  padding-left: 34px;
  padding-right: 30px;
  background: var(--surface-2);
  font-size: 13.5px;
  -webkit-appearance: none;
  appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { background: #fff; }
.search-clear {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #dfe3ea;
  color: var(--text-2);
  transition: background 0.12s, transform 0.1s var(--ease-out);
  animation: popMini 0.16s var(--ease-spring);
}
.search-clear:hover { background: #cfd5df; color: var(--text); }
.search-clear:active { transform: scale(0.88); }
@keyframes popMini {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.fbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 250px;
  height: 34px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.14s var(--ease-out), border-color 0.14s var(--ease-out), color 0.14s var(--ease-out), transform 0.1s var(--ease-out);
}
.fbtn:hover { background: var(--surface-2); border-color: #c6ccd6; }
.fbtn:active { transform: scale(0.97); }
.fbtn .fval {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.fbtn .ic { color: var(--text-3); transition: transform 0.15s var(--ease-out), color 0.14s; }
.fbtn.active {
  background: var(--accent-weak);
  border-color: var(--accent-line);
  color: var(--accent);
}
.fbtn.active .ic { color: var(--accent); }

.view-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.seg {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px;
  border-radius: 7px;
  background: #eceef2;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg button {
  position: relative;
  z-index: 0;
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 5px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.16s var(--ease-out);
}
.seg button:hover { color: var(--text); }
.seg button.active {
  color: var(--text);
  font-weight: 600;
}
.seg-pill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: -1;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(18, 28, 45, 0.13), 0 0 0 0.5px rgba(18, 28, 45, 0.04);
  pointer-events: none;
}
.seg-txt {
  position: relative;
  z-index: 1;
}
.seg-label {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  animation: popMini 0.18s var(--ease-spring);
}

/* ---------- 汇总条 ---------- */
.summary {
  flex: none;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px clamp(24px, 2.4vw, 48px);
  padding: clamp(9px, 0.7vh + 5px, 13px) var(--edge-px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.sum-count {
  font-size: clamp(13px, 0.16vw + 11.6px, 14.5px);
  color: var(--text-2);
  line-height: 24px;
}
.sum-count b {
  margin-right: 3px;
  font-size: clamp(16px, 0.28vw + 12.6px, 18.5px);
  font-weight: 650;
  color: var(--text);
}
.sum-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 24px;
}
.sum-item .k { font-size: clamp(12.5px, 0.14vw + 11.2px, 13.8px); color: var(--text-3); }
.sum-item .v { font-size: clamp(16px, 0.28vw + 12.6px, 18.5px); font-weight: 650; }
.sum-item .p { font-size: clamp(12.5px, 0.14vw + 11.2px, 13.8px); }
.sum-sub { font-size: 12px; color: var(--text-3); }
.sum-note {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  line-height: 24px;
  text-align: right;
}

/* ---------- 数据区 ---------- */
.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: clip;
}
.data {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: var(--surface);
  overscroll-behavior: contain;
}
#dataBody.pane-anim {
  animation: paneFadeIn 0.18s var(--ease-out);
}
@keyframes paneFadeIn {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: var(--grid-fs);
}
.grid th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--grid-th-h);
  padding: 0 var(--cell-px);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 -2px 0 var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  font-size: var(--grid-th-fs);
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.grid.two thead tr:first-child th { height: 30px; }
.grid.two thead tr:first-child th[rowspan] { height: 58px; }
.grid.two th.grp {
  text-align: center;
  border-left: 1px solid var(--line);
  border-bottom-color: var(--line);
}
.grid.two thead tr.h2 th {
  top: 30px;
  height: 28px;
  font-weight: 500;
  box-shadow: 0 -1px 0 var(--surface-2);
}
.grid th.g, .grid td.g { border-left: 1px solid var(--line); }
.grid th.num, .grid td.num { text-align: right; }
.grid th.sortable { cursor: pointer; user-select: none; }
.grid th.sortable:hover { background: #eef0f4; color: var(--text); }
.grid th.sorted { color: var(--accent); }
.sort-ind { margin-left: 3px; font-size: 11px; }

.col-rz {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 9px;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 6;
}
.col-rz::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: 0;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background-color 0.14s ease, top 0.14s ease, bottom 0.14s ease;
}
.grid th:last-child > .col-rz::after { right: 1px; }
.grid th:hover > .col-rz::after { background: rgba(35, 86, 216, 0.24); }
.col-rz:hover::after,
.col-rz.active::after {
  top: 0;
  bottom: 0;
  background: var(--accent);
}
body.col-resizing,
body.col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.grid td {
  height: var(--grid-row-h);
  padding: 0 var(--cell-px);
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.grid th:last-child, .grid td:last-child { padding-right: var(--edge-px); }
.grid th.c-row, .grid td.c-row { padding: 0 12px 0 8px; }
.grid td.num { font-variant-numeric: tabular-nums; }
.grid:not(.two) th.num, .grid:not(.two) td.num { padding: 0 clamp(14px, 1.1vw, 22px); }
.grid td.strong { font-weight: 600; }
.grid td.sub { color: var(--text-2); }
.grid th.c-prog, .grid td.c-prog { border-left: 1px solid var(--line); }
.grid td.c-prog.prog-zero { color: var(--text-3); }
.grid:not(.two) th.c-remark, .grid:not(.two) td.c-remark { padding-left: var(--remark-gap); }
.grid.two th.c-remark, .grid.two td.c-remark { padding-left: 24px; border-left: 1px solid var(--line); }
.grid.two th.c-remark { border-left-color: var(--line-2); }
.grid td.c-remark { color: var(--text-2); }

.grid .c-row {
  position: sticky;
  left: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.grid td.c-row { color: var(--text-3); font-size: clamp(12px, 0.16vw + 10.6px, 13.5px); z-index: 1; }
.grid .c-name { position: sticky; left: var(--row-w); }
.grid td.c-name { z-index: 1; }
.grid th.c-row, .grid th.c-name { z-index: 5; }
.grid.scrolled-x .c-name { box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16); }

.grid tr.row { cursor: pointer; }
.grid tr.row td { transition: background-color 0.12s ease; }
.grid tr.row:hover td { background: #f4f7fc; }
.grid tr.sel td, .grid tr.sel:hover td { background: var(--accent-weak); }
.grid tr.sel td.c-row { box-shadow: inset 3px 0 0 var(--accent); color: var(--accent); }
.grid td.cell-saved { animation: cellSaved 650ms ease-out; }
@keyframes cellSaved { from { background-color: #c9ddff; } }
.saved-next-title { animation: nextTitle 150ms ease-out; }
@keyframes nextTitle { from { opacity: .55; transform: translateY(3px); } }
#dataBody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.name-wrap, .tree-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tree-cell {
  gap: 5px;
  padding-left: calc(var(--ind, 0) * var(--tree-ind));
}
.ell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  background: #eef0f4;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-new { background: var(--warn-weak); color: var(--warn); }
.tag.role-admin { background: #fdf0d5; color: #8a5a00; }
.tag.role-editor { background: var(--neg-weak); color: var(--neg); }
.tag.role-viewer { background: var(--accent-weak); color: var(--accent); }
.tag.off { background: var(--pos-weak); color: var(--pos); }

/* 汇总（树形） */
.twist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: transform 0.18s var(--ease-out), color 0.14s;
}
.twist .ic { width: 14px; height: 14px; }
.twist.open { transform: rotate(90deg); color: var(--text-2); }
.twist.none { visibility: hidden; }

.grid tr.lv-0 td { background: #f1f3f7; font-weight: 650; }
.grid tr.lv-1 td { background: #fafbfc; font-weight: 600; }
.grid tr.lv-2 td { font-weight: 600; }
.grid tr.lv-3 td { font-weight: 500; }
.grid tr.parent { cursor: pointer; }
.grid tr.parent td { transition: background-color 0.12s ease; }
.grid tr.parent:hover td { background: #edf1f7; }
.grid tr.row-enter td {
  animation: tdReveal 0.2s var(--ease-out) both;
}
.grid tr.row-enter .tree-cell,
.grid tr.row-enter .name-wrap {
  animation: treeSlideIn 0.22s var(--ease-out) both;
}
@keyframes tdReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes treeSlideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

.empty {
  padding: 72px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty b {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
}
.empty .btn { margin-top: 14px; }

.empty-hint {
  padding: 28px var(--edge-px);
  color: var(--text-3);
  font-size: 13.5px;
}

/* 加载态：细进度条 + 骨架行 */
.load-panel {
  padding: 22px var(--edge-px) 28px;
}
.load-bar {
  height: 2px;
  width: min(420px, 100%);
  margin-bottom: 18px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-line) 0%, var(--accent) 45%, var(--accent-line) 100%);
  background-size: 220% 100%;
  animation: loadSweep 1.15s var(--ease-out) infinite;
}
.load-skel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
}
.skel-row {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef0f4 0%, #f7f8fa 45%, #eef0f4 100%);
  background-size: 220% 100%;
  animation: loadSweep 1.25s var(--ease-out) infinite;
}
.skel-row:nth-child(2) { width: 86%; animation-delay: 0.06s; }
.skel-row.short { width: 58%; animation-delay: 0.12s; }
.load-msg {
  margin: 16px 0 0;
  color: var(--text-3);
  font-size: 13px;
}
@keyframes loadSweep {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .load-bar, .skel-row { animation: none; background: #eef0f4; }
  .load-bar { background: var(--accent-line); }
}

.sentinel td { height: 1px !important; padding: 0 !important; border: none !important; }
div.sentinel { height: 1px; }

/* 手机列表 */
.mlist-cap {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-3);
}
.mrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px calc(12px + var(--ind, 0) * 14px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.1s var(--ease-out);
}
.mrow:active { background: #eef2f9; transform: scale(0.992); }
.mrow.sel { background: var(--accent-weak); }
.mrow.just-saved { animation: rowSavedFlash 1.15s var(--ease-out); }
.mrow.row-enter {
  animation: mrowReveal 0.2s var(--ease-out) both;
}
@keyframes mrowReveal {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.mrow-main { flex: 1; min-width: 0; }
.mrow-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}
.mrow-title .tag { margin-left: 6px; vertical-align: 1px; }
.mrow-sub {
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mrow-nums {
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mrow-amt { font-size: 14.5px; font-weight: 600; }
.mrow-diff { margin-top: 1px; font-size: 12.5px; }
.mrow.lv-0 { background: #f1f3f7; }
.mrow.lv-0 .mrow-title, .mrow.lv-1 .mrow-title, .mrow.lv-2 .mrow-title { font-weight: 650; }
.mrow .twist { margin-left: -4px; }

/* ---------- 详情侧栏 ---------- */
.drawer {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 440px;
  min-height: 0;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.drawer.dw-enter {
  animation: dwSlideIn 0.2s var(--ease-out);
}
.drawer.closing {
  pointer-events: none;
  animation: dwSlideOut 0.15s var(--ease-in) forwards;
}
@keyframes dwSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes dwSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}
.dw-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.dw-hd {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
}
.dw-pos {
  margin-left: 4px;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.dw-rowno {
  margin-left: auto;
  margin-right: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}
.dw-bd {
  flex: 1;
  overflow: auto;
  padding: 18px 20px 24px;
  -webkit-overflow-scrolling: touch;
}
.dw-bd.dw-step-down {
  animation: dwStepDown 0.16s var(--ease-out);
}
.dw-bd.dw-step-up {
  animation: dwStepUp 0.16s var(--ease-out);
}
.dw-bd.dw-mode-fade {
  animation: dwModeFade 0.16s var(--ease-out);
}
@keyframes dwStepDown {
  from { opacity: 0.45; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dwStepUp {
  from { opacity: 0.45; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dwModeFade {
  from { opacity: 0.4; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.dw-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
  word-break: break-word;
}
.dw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.amt {
  width: 100%;
  margin-bottom: 22px;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.amt th, .amt td {
  padding: 8px 0 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
.amt thead th {
  padding-top: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
.amt tbody th {
  width: 70px;
  padding-left: 0;
  text-align: left;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}
.amt tr.total th, .amt tr.total td {
  border-bottom: none;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
}
.amt tr.total td.pos { color: var(--pos); }
.amt tr.total td.neg { color: var(--neg); }
.amt tr.total td.zero { color: var(--text-3); }
.amt small {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.amt input {
  height: 32px;
  padding: 0 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.amt.edit th, .amt.edit td { padding-top: 5px; padding-bottom: 5px; }

.dw-prog {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 18px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--bg-soft, #f6f7fa);
  border: 1px solid var(--line);
}
.dw-prog-lbl { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.dw-prog-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.dw-prog-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.dw-prog-val {
  font-size: 13.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.dw-prog-val.prog-zero { color: var(--text-3); }

.dw-sec { margin-bottom: 18px; }
.dw-sec h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.dw-remark {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.kv {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 13.5px;
}
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-word; }
.kv.kv-num dd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.kv.kv-num { margin-bottom: 22px; row-gap: 10px; }

.dw-ft {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.dw-ft .sp { flex: 1; }
.dw-hint { font-size: 12px; color: var(--text-3); }

details.more {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
details.more > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .ic { transition: transform 0.12s; }
details.more[open] > summary .ic { transform: rotate(90deg); }
details.more[open] > summary { border-bottom: 1px solid var(--line); }
.more-bd { padding: 14px 12px 0; }

@media (max-width: 1099px) {
  .drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(440px, 100vw);
    box-shadow: var(--shadow-pop);
  }
  .drawer.dw-enter {
    animation: dwOverlayIn 0.23s var(--ease-out);
  }
  .drawer.closing {
    animation: dwOverlayOut 0.16s var(--ease-in) forwards;
  }
}
@keyframes dwOverlayIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes dwOverlayOut {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* ---------- 弹窗 ---------- */
.dlg-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 24, 38, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 0.18s var(--ease-out);
}
.dlg-backdrop.top { z-index: 110; }
.dlg-backdrop.closing {
  pointer-events: none;
  animation: fadeOut 0.14s var(--ease-in) forwards;
}
.dlg {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 760px);
  overflow: hidden;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  animation: dlgPopIn 0.2s var(--ease-out);
}
.dlg-backdrop.closing .dlg {
  animation: dlgPopOut 0.14s var(--ease-in) forwards;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes dlgPopIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dlgPopOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(4px) scale(0.98); }
}
.dlg-sm { max-width: 400px; }
.dlg-lg { max-width: 820px; }
.dlg-hd {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 10px 20px;
  border-bottom: 1px solid var(--line);
}
.dlg-hd h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
}
.dlg-bd {
  flex: 1;
  overflow: auto;
  padding: 18px 20px;
  -webkit-overflow-scrolling: touch;
}
.dlg-ft {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.sec-title {
  margin: 22px 0 8px;
  font-size: 13.5px;
  font-weight: 650;
}
.sec-title.first { margin-top: 6px; }
.sec-note {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
}
.hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-2);
}
.meta-box {
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  word-break: break-all;
}
.note-warn {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--warn-weak);
  color: var(--warn);
  font-size: 13px;
  line-height: 1.6;
}
.file-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.file-row input[type="file"] {
  flex: 1;
  min-width: 200px;
  font-size: 13px;
}

/* 上传拖拽区 */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 2px 0 12px;
  padding: 20px 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--accent-line); background: #f6f9fe; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-weak); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone .dz-ic { width: 22px; height: 22px; color: var(--text-3); }
.dropzone .dz-main { font-size: 13.5px; font-weight: 600; color: var(--text); word-break: break-all; }
.dropzone .dz-sub { font-size: 12px; color: var(--text-3); }
.dropzone.has-file { border-style: solid; border-color: var(--accent-line); background: var(--accent-weak); }
.dropzone.has-file .dz-main { color: var(--accent); }
.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.file-meta { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 横向可滚动区域的边缘渐隐，提示「右边还有内容」 */
.sc-hint-r {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent 100%);
}
.sc-hint-l {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26px);
  mask-image: linear-gradient(to right, transparent 0, #000 26px);
}
.sc-hint-l.sc-hint-r {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
}
.rowi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.rowi:last-child, .urow:last-child, .log:last-child { border-bottom: none; }
.confirm-title { margin: 4px 0 8px; font-size: 16px; font-weight: 650; }
.confirm-msg {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* 账号 / 日志 */
.dlg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.urow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.u-main { flex: 1; min-width: 0; }
.u-name { font-weight: 600; }
.u-disp { margin-left: 8px; font-size: 13px; color: var(--text-3); }
.u-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.u-act { flex: none; display: flex; gap: 6px; }
.scope-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 2px 10px;
  max-height: 210px;
  padding: 8px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.scope-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 13.5px;
  cursor: pointer;
}
.back { margin: -6px 0 0 -6px; }
.pwd {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  user-select: all;
}

.log {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.log-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.log-time { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.log-target { margin-top: 2px; font-weight: 500; word-break: break-word; }
.log-changes {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  color: var(--text-2);
  word-break: break-word;
}
.log-changes .old { color: var(--text-3); text-decoration: line-through; }
.log-changes .new { color: var(--text); font-weight: 600; }

/* 手机筛选面板 */
.frow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  font-size: 15px;
  text-align: left;
}
.frow .k { flex: none; color: var(--text); }
.frow .v {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-3);
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.frow.active .v { color: var(--accent); font-weight: 600; }
.frow .ic { color: var(--text-3); }

.chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  height: 28px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 12.5px;
  white-space: nowrap;
  transition: background 0.12s, transform 0.1s var(--ease-out);
  animation: popMini 0.16s var(--ease-out);
}
.chip:active { transform: scale(0.96); }

/* ---------- 浮层菜单 / 选择器 ---------- */
.pop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(18, 24, 38, 0.42);
  animation: fadeIn 0.16s var(--ease-out);
}
.pop-backdrop.closing {
  pointer-events: none;
  animation: fadeOut 0.13s var(--ease-in) forwards;
}
.popover {
  position: fixed;
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-width: 380px;
  max-height: 440px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  transform-origin: top left;
  animation: popIn 0.16s var(--ease-out);
}
.popover.pop-up {
  transform-origin: bottom left;
  animation-name: popInUp;
}
.popover.closing {
  pointer-events: none;
  animation: popOut 0.12s var(--ease-in) forwards;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes popInUp {
  from { opacity: 0; transform: translateY(4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes popOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.98); }
}
.pop-title { display: none; }
.pop-search {
  flex: none;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.pop-search input { height: 32px; font-size: 13px; }
.pop-list {
  padding: 4px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 13.5px;
  text-align: left;
}
.pop-item:hover { background: #f1f3f7; }
.pop-item.selected { color: var(--accent); font-weight: 600; }
.pop-item .lab {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pop-item .cnt {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.pop-item > .ic { color: var(--text-3); }
.pop-item.selected > .ic { color: var(--accent); }
.pop-item.danger, .pop-item.danger > .ic { color: var(--danger); }
.pop-sep { height: 1px; margin: 4px 0; background: var(--line); }
.pop-head {
  padding: 8px 10px 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}
.pop-head b { display: block; font-size: 13.5px; color: var(--text); }
.pop-empty {
  padding: 18px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 130;
  max-width: min(92vw, 460px);
  padding: 10px 16px;
  border-radius: 8px;
  background: #1d2330;
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
  animation: toastIn 0.22s var(--ease-spring);
}
.toast.closing {
  pointer-events: none;
  animation: toastOut 0.15s var(--ease-in) forwards;
}
.toast.error { background: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, 0) scale(1); }
  to { opacity: 0; transform: translate(-50%, 8px) scale(0.97); }
}

/* ============================================================
   手机
   ============================================================ */
@media (max-width: 860px) {
  input[type="text"],
  input[type="password"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;   /* 防止 iOS 聚焦时自动放大页面 */
  }

  .app {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hdr {
    flex-wrap: wrap;
    gap: 0 8px;
    height: auto;
    padding: 8px 6px 0 12px;
  }
  .hdr-brand { height: 36px; }
  .hbtn { width: 36px; padding: 0; justify-content: center; }
  .hbtn .lbl, .hbtn-user .ic.sm { display: none; }
  .hdr-tabs {
    order: 3;
    width: 100%;
    height: 40px;
    margin-top: 2px;
  }
  .tab-bar { bottom: 0; }
  .tab { flex: 1; padding: 0 8px; }
  .hdr.no-tabs { padding-bottom: 8px; }

  .toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 8px 12px;
  }
  .tb-row { flex-wrap: nowrap; }
  .search { flex: 1; min-width: 0; }
  .search input { height: 38px; font-size: 16px; }
  #btnFilterSheet { height: 38px; }
  .tb-row2 {
    justify-content: space-between;
    margin-top: 8px;
  }
  .tb-row2 .btn { height: 34px; max-width: 58%; }
  .tb-row2 .btn .ell { font-weight: 600; }
  .chips {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 8px;
    padding: 10px 12px;
  }
  .sum-count, .sum-note { grid-column: 1 / -1; line-height: 1.5; }
  .sum-note { margin: 0; text-align: left; }
  .sum-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.4;
  }
  .sum-item { min-width: 0; }
  .sum-item .k { font-size: 11.5px; }
  .sum-item .v { font-size: 15px; }
  .sum-item .p { font-size: 11.5px; }

  .workspace { display: block; }
  .data { overflow: visible; }

  .drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
    width: 100%;
    border: none;
    box-shadow: none;
  }
  .dw-hd { height: 48px; }
  .dw-bd { padding: 16px 16px 24px; }
  .dw-ft .btn { height: 40px; }

  .dlg-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .dlg {
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 14px 14px 0 0;
    animation: sheetUp 0.24s var(--ease-out);
  }
  .dlg-backdrop.closing .dlg {
    animation: sheetDown 0.17s var(--ease-in) forwards;
  }
  .dlg-ft { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .dlg-ft .btn { height: 40px; }
  .dlg-backdrop.top {
    align-items: center;
    padding: 24px;
  }
  .dlg-backdrop.top .dlg {
    border-radius: 14px;
    animation: dlgPopIn 0.2s var(--ease-out);
  }
  .dlg-backdrop.top.closing .dlg {
    animation: dlgPopOut 0.14s var(--ease-in) forwards;
  }
  .dlg-backdrop.top .dlg-ft { padding-bottom: 12px; }
  .dlg-backdrop.top .dlg-ft .btn { flex: 1; }

  .grid2 { grid-template-columns: 1fr; }
  .urow { align-items: flex-start; flex-direction: column; gap: 8px; }

  .popover,
  .popover.pop-up {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: 100% !important;
    max-width: none;
    max-height: 72vh !important;
    max-height: 72dvh !important;
    border: none;
    border-radius: 14px 14px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: sheetUp 0.22s var(--ease-out);
  }
  .popover.closing {
    animation: sheetDown 0.16s var(--ease-in) forwards;
  }
  .pop-title {
    display: block;
    flex: none;
    padding: 14px 16px 8px;
    font-size: 15px;
    font-weight: 650;
  }
  .pop-search input { height: 38px; font-size: 16px; }
  .pop-item { min-height: 46px; padding: 8px 12px; font-size: 15px; }
  .pop-head { padding: 12px 12px 8px; }

  .toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes sheetDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

/* ============================================================
   模块选择页 & 模块切换 & 各种标准模块
   ============================================================ */

/* 模块内品牌标统一主色；Hub 卡片保留彩色区分，模块切换用色点标识 */

/* ---------- 模块选择门户 ---------- */

@keyframes hubFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 各种标准模块 ---------- */
/* ============================================================
   各种标准 · Notion 风格文档与简洁表格排版
   ============================================================ */
#stdHdr {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
#stdHdr .tab {
  color: var(--text-2);
  font-weight: 500;
}
#stdHdr .tab:hover {
  color: var(--text);
}
#stdHdr .tab.active {
  color: var(--text);
  font-weight: 600;
}
#stdHdr .tab-bar {
  background: var(--text);
  height: 2px;
}

#stdToolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 7px 16px;
}
#stdToolbar .std-search {
  flex: 0 1 380px;
  min-width: 220px;
  background: var(--surface-2);
  border-color: transparent;
  border-radius: 6px;
  height: 32px;
}
#stdToolbar .std-search:focus-within {
  background: var(--surface);
  border-color: var(--line-2);
  box-shadow: 0 0 0 2px rgba(23, 28, 38, 0.06);
}
#stdToolbar .std-search input {
  font-size: 13.5px;
  color: var(--text);
}
#stdToolbar .std-search input::placeholder {
  color: var(--text-3);
}

.std-summary {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
.std-summary.hidden-bar {
  display: none !important;
}

.std-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}
.std-tabs::-webkit-scrollbar { display: none; }

.std-jumps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.jump-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  max-width: 220px;
  padding: 0 9px;
  border: none;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.14s var(--ease-out), color 0.14s var(--ease-out), transform 0.1s var(--ease-out);
}
.jump-pill:hover {
  background: rgba(23, 28, 38, 0.07);
  color: var(--text);
}
.jump-pill:active {
  transform: scale(0.96);
}

.std-pane {
  background: var(--surface);
  color: var(--text);
}
.std-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 48px 88px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 42px;
}
.std-body.std-anim {
  animation: stdViewIn 0.2s var(--ease-out);
}
@keyframes stdViewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Notion Select 柔和标签色 ---------- */
.n-tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.n-tag-green  { background: var(--neg-weak); color: var(--neg); }
.n-tag-blue   { background: var(--accent-weak); color: var(--accent); }
.n-tag-amber  { background: var(--warn-weak); color: var(--warn); }
.n-tag-purple { background: #f3f0f9; color: #6b578f; }
.n-tag-gray   { background: var(--surface-2); color: var(--text-2); }

.n-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.n-act-btn:hover {
  background: rgba(23, 28, 38, 0.06);
  color: var(--text);
}
.n-act-btn.n-act-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  padding: 0 11px;
}
.n-act-btn.n-act-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.n-act-btn.n-act-soft {
  background: var(--surface-2);
  color: var(--text);
}
.n-act-btn.n-act-soft:hover {
  background: var(--line);
}
.n-act-btn.n-act-danger:hover {
  background: var(--pos-weak);
  color: var(--danger);
}

/* ---------- Notion 标准总览（List View 目录） ---------- */
.std-dir {
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}
.std-dir-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.std-dir-hero h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}
.std-dir-hero p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
}
.std-dir-acts {
  display: flex;
  align-items: center;
  gap: 6px;
}
.std-dir-sec {
  margin-bottom: 28px;
}
.std-dir-sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 4px;
}
.std-dir-sec-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.std-dir-sec-cnt {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.std-dir-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.std-dir-item {
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: background 0.1s;
}
.std-dir-item:hover {
  background: var(--surface-2);
}
.std-dir-item.checked {
  background: var(--surface-2);
}
.std-dir-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: none;
  background: none;
  text-align: left;
  color: var(--text);
}
.std-dir-doc-ic {
  flex: none;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
}
.std-dir-title {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  border-bottom: 1px solid rgba(23, 28, 38, 0.12);
  padding-bottom: 1px;
}
.std-dir-item:hover .std-dir-title {
  border-bottom-color: rgba(23, 28, 38, 0.35);
}
.std-dir-sub {
  flex: 1;
  min-width: 0;
  margin-left: 4px;
  font-size: 12.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.std-dir-rows {
  flex: none;
  margin-left: auto;
  padding-left: 10px;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.std-dir-chk {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.std-dir-chk input {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
  opacity: 0.32;
  transition: opacity 0.12s;
}
.std-dir-item:hover .std-dir-chk input,
.std-dir-chk input:checked {
  opacity: 1;
}

/* ---------- Notion 左侧页面目录栏 ---------- */
.std-side {
  flex: none;
  width: 256px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.std-side-bd {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 24px;
}
.std-side-cat {
  margin: 14px 8px 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}
.std-side-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px 1px 4px;
  border-radius: 6px;
  min-height: 30px;
  transition: background 0.1s;
}
.std-side-row:hover {
  background: rgba(23, 28, 38, 0.05);
}
.std-side-row.active {
  background: rgba(23, 28, 38, 0.07);
}
.std-side-overview {
  margin-bottom: 4px;
}
.std-side-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text-2);
}
.std-side-row:hover .std-side-btn {
  color: var(--text);
}
.std-side-row.active .std-side-btn {
  color: var(--text);
  font-weight: 500;
}
.std-side-ic {
  flex: none;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
}
.std-side-row.active .std-side-ic {
  color: var(--text);
}
.std-side-txt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.std-side-cnt {
  flex: none;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.std-side-chk {
  flex: none;
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--accent);
  opacity: 0;
  transition: opacity 0.12s;
}
.std-side-row:hover .std-side-chk,
.std-side-chk:checked,
.std-side.multi-mode .std-side-chk {
  opacity: 1;
}

.std-pick-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  cursor: pointer;
}
.std-pick-row:last-child { border-bottom: none; }
.std-pick-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--accent);
}

/* ---------- Notion 页面区块与 Simple Table 简洁表格 ---------- */
.std-card {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  scroll-margin-top: 20px;
}
.std-card:not(:last-child) {
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}
.std-card-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 14px 0;
  border: none;
  background: transparent;
}
.std-card-title-wrap {
  min-width: 0;
  flex: 1;
}
.std-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.std-card-hd h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text);
}
.std-sub {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.std-card-acts {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-top: 2px;
}
.std-cnt {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.std-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.std-table {
  width: max-content;
  min-width: min(100%, 480px);
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
}
.std-table th {
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-2);
  white-space: nowrap;
  vertical-align: middle;
}
.std-table td {
  padding: 8px 16px;
  border: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
  vertical-align: middle;
  max-width: 420px;
}
.std-block-wide .std-table th,
.std-block-wide .std-table td {
  padding: 8px 13px;
}
.std-block-wide .std-table th.num {
  white-space: normal;
}
.std-block-wide .std-table th.num .th-in {
  max-width: 120px;
}
.std-table .th-unit {
  display: inline-block;
  white-space: nowrap;
  font-weight: 400;
  color: var(--text-3);
}
.std-table td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.std-table tbody tr:hover td:not(.std-grp):not(.std-span) {
  background: var(--surface-2);
}
.std-table td.std-grp {
  background: var(--surface-2);
  font-weight: 500;
  color: var(--text);
  vertical-align: middle;
}
.std-table td.std-span {
  background: var(--surface);
  vertical-align: middle;
}
.std-table .dash {
  color: var(--line-2);
}

mark.hl {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--warn-weak);
  color: inherit;
}

/* ---------- 标准在线编辑器 ---------- */
.dlg-xl {
  max-width: 980px;
}
.se-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.se-bar-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.se-paste {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
}
.se-paste-ft {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.se-grid-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
}
.se-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.se-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  border-right: 1px solid var(--line);
  min-width: 140px;
}
.se-table th.se-idx,
.se-table td.se-idx {
  width: 42px;
  min-width: 42px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  background: var(--surface-2);
}
.se-table th.se-op,
.se-table td.se-op {
  width: 40px;
  min-width: 40px;
  text-align: center;
  border-right: none;
}
.se-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.se-col-hd {
  display: flex;
  align-items: center;
  gap: 4px;
}
.se-table input[type="text"] {
  height: 30px;
  padding: 0 7px;
  font-size: 13px;
}
.se-col-hd input[type="text"] {
  font-weight: 600;
}

@media (max-width: 860px) {
  
  
  
  
  .std-tabs .tab { flex: none; padding: 0 12px; }
  .std-jumps, .std-side { display: none !important; }
  .std-dir-hero { align-items: flex-start; margin-bottom: 20px; }
  .std-dir-hero h2 { font-size: 22px; }
  .std-dir-sub { display: none; }
  .std-dir-chk input { opacity: 1; }
  .std-body { padding: 20px 16px 56px; gap: 32px; }
  .std-card-hd { flex-direction: column; padding: 0 0 12px 0; gap: 8px; }
  .std-card-hd h3 { font-size: 18px; }
  .std-card-acts { width: 100%; justify-content: flex-start; }
  .std-table { min-width: 100%; }
  .std-table th, .std-table td { padding: 8px 12px; font-size: 13.5px; }
}

/* ---------- 修改记录（2026-11-15） ---------- */
.chg-dot {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 2px;
}
.chg-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-bottom: 12px;
}
.chg-filters .field { margin: 0; min-width: 120px; }
.chg-filters .chg-kw { flex: 1 1 180px; }
.chg-acts { display: flex; gap: 6px; }
.chg-more { padding: 10px 0 2px; font-size: 12.5px; }

/* ---------- 增减较大（2026-11-15） ---------- */
.grid tr.row.big:not(.sel) td { background: #fff8e6; }
.grid tr.row.big:not(.sel):hover td { background: #fdefc8; }
.grid tr.row.big td.c-row { box-shadow: inset 3px 0 0 #e3a008; }
.mrow.big:not(.sel) { background: #fff8e6; box-shadow: inset 3px 0 0 #e3a008; }
.chk-line { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; cursor: pointer; }
.chk-line input { width: auto; margin: 0; }

/* ---------- 备注展开（2026-11-15） ---------- */
.cell-tip {
  position: fixed;
  z-index: 120;
  padding: 8px 11px;
  border: 1px solid var(--line, #dfe3ea);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 28, 45, 0.16);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text, #1f2430);
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
}
.mrow-remark {
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.mrow-remark.open { white-space: pre-wrap; word-break: break-word; overflow: visible; }
.mr-lbl {
  display: inline-block;
  margin-right: 5px;
  padding: 0 4px;
  border-radius: 4px;
  background: #eef1f6;
  font-size: 11px;
  color: var(--text-3);
}

/* ---------- 打印 ---------- */
@media print {
  .hdr-actions, .toolbar, .drawer, .toast, .popover, .pop-backdrop, .dlg-backdrop, .std-card-acts, .std-side, .col-rz { display: none !important; }
  .app { height: auto; }
  .workspace { display: block; }
  .data { overflow: visible; }
  .grid th, .grid td { position: static !important; }
  body { background: #fff; }
}

/* ---------- 打印版式（2026-11-15）：只打印 #printArea ---------- */
#printArea { display: none; }
@media (max-width: 860px) { .hbtn.hide-m { display: none; } }
@page { size: A4 landscape; margin: 12mm 10mm 12mm; }
@media print {
  body.print-mode > *:not(#printArea) { display: none !important; }
  body.print-mode #printArea { display: block; }
  body.print-mode { background: #fff; height: auto; overflow: visible; }
  html:has(body.print-mode) { height: auto; overflow: visible; }
  #printArea { color: #000; font-family: "SimSun", "Songti SC", "Noto Serif CJK SC", serif; font-size: 10pt;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printArea .p-title { margin-bottom: 6px; font-size: 16pt; font-weight: 700; text-align: center; }
  #printArea .p-meta { display: flex; justify-content: space-between; margin: 2px 0; font-size: 9.5pt; }
  #printArea .p-table { width: 100%; margin-top: 6px; border-collapse: collapse; table-layout: fixed; }
  #printArea thead { display: table-header-group; }
  #printArea th, #printArea td { padding: 3px 6px; border: 0.5pt solid #777; vertical-align: top; line-height: 1.4; word-break: break-word; }
  #printArea th { background: #dde5f2; font-weight: 700; text-align: center; }
  #printArea tr { break-inside: avoid; page-break-inside: avoid; }
  #printArea .p-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #printArea .p-remark { font-size: 9pt; }
  #printArea .p-l0 td { background: #dde5f2; font-weight: 700; }
  #printArea .p-l1 td { background: #eef2f8; font-weight: 700; }
  #printArea .p-l2 td { background: #f7f9fc; font-weight: 700; }
}

/* ---------- 尊重系统减弱动态效果设置 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 2025 年安排（只读对比列，2026-11-16） ---------- */
.grid td.y25 { color: var(--text-2); }
.grid tr.y25-only td { color: var(--text-3); }
.grid tr.y25-only td.c-name .ell { font-style: italic; }
.y25-no { color: var(--text-3); }
.tag-y25 { background: #e8eef8; color: #3a5a8c; }
.tag-y25n { background: #f1edf9; color: #644a98; }
.c-name .tag-y25, .c-name .tag-y25n, .tree-cell .tag-y25, .tree-cell .tag-y25n { margin-left: 6px; }
.mrow-y25 { margin-top: 1px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.amt th.y25, .amt td.y25 { color: var(--text-2); }
.amt thead th small { font-size: 10.5px; font-weight: 400; }
@media (max-width: 860px) {
  .summary:has(#sumY25) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 手机：表格左右滑动，行号 + 项目列冻结（2026-11-16） ---------- */
@media (max-width: 860px) {
  .data#dataPane {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #dataPane .grid { --grid-fs: 13px; --grid-th-fs: 12px; --cell-px: 6px; }
  #dataPane .grid th { position: static; }
  #dataPane .grid th.c-row, #dataPane .grid th.c-name { position: sticky; }
  #dataPane .grid th.c-row, #dataPane .grid td.c-row { padding: 0 4px 0 2px; font-size: 10.5px; }
  #dataPane .grid td.c-name .ell {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
  }
  #dataPane .grid td.c-name { padding-top: 5px; padding-bottom: 5px; height: auto; }
  #dataPane .grid .tree-cell { --tree-ind: 8px; }
  #dataPane .grid .c-name { box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16); }
  #dataPane .grid td.c-name .tag { height: 17px; padding: 0 4px; font-size: 10.5px; }
  #dataPane .grid .col-rz { display: none; }
}
@media (max-width: 860px) {
  #dataPane .grid td.c-name .code,
  #dataPane .grid td.c-name .tag-y25n { display: none; }
  #dataPane .grid .tree-cell .twist.none { width: 4px; }
}

/* 2026-11-16 详情金额表 5 列（2027/2026/2025/两列增减）：手机上表头不折行 */
@media (max-width: 640px) {
  .amt.amt5 thead th { white-space: nowrap; font-size: 11.5px; }
  .amt.amt5 td, .amt.amt5 tbody th { padding-left: 4px; padding-right: 4px; }
}

/* ============================================================
   财政收支数据模块（2026-11-16）
   ============================================================ */

/* fis brand-mark 已统一主色；Hub 卡片色保留上方 .hub-card.fis */
#fisToolbar .tb-row { flex-wrap: wrap; }
.fis-search { max-width: 260px; }
#fisFilterBar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fis-grid .c-first { position: sticky; left: 0; }
.fis-grid td.c-first { z-index: 1; font-weight: 500; }
.fis-grid th.c-first { z-index: 5; }
.fis-grid.scrolled-x .c-first { box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16); }
.fis-grid th.num, .fis-grid td.num { text-align: right; padding: 0 clamp(10px, 0.8vw, 16px); }
.fis-grid th.num { white-space: normal; line-height: 1.25; }
.fis-grid td.txt { color: var(--text-2); font-size: 12.5px; }
.fis-grid td.sub, .fis-grid th.sub { color: var(--text-2); }
.fis-grid td.pos { color: var(--pos); }
.fis-grid td.neg { color: var(--neg); }
.fis-grid tr.fl0 td { background: var(--surface-2); font-weight: 650; }
.fis-grid tr.fl1 td { font-weight: 600; }
.fis-grid tr.fl1 td.c-first { color: var(--text); }
.fis-grid tr.row { cursor: pointer; }
.fis-grid tr.row:hover td { background: #f4f7fc; }
#fisBody .empty-hint { padding: 28px var(--edge-px); color: var(--text-3); }
.fis-notes { max-width: 1180px; padding: 18px var(--edge-px) 40px; font-size: 13.5px; line-height: 1.65; }
.fis-notes h2 { margin: 0 0 4px; font-size: 18px; }
.fis-notes h3 { margin: 22px 0 8px; font-size: 15px; }
.fis-notes .muted { color: var(--text-3); margin: 0; }
.fis-doc { width: 100%; border-collapse: collapse; font-size: 13px; }
.fis-doc th, .fis-doc td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.fis-doc th { background: var(--surface-2); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.fis-doc tr.warn td { background: #fff8e8; }
.fis-doc tr.warn td:nth-child(2) { color: var(--warn); font-weight: 600; }
.fis-doc .nowrap { white-space: nowrap; }
.fis-doc a { color: var(--accent); word-break: break-all; }
.fis-ol { margin: 0; padding-left: 22px; }
@media (max-width: 860px) {
  .data#fisPane {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #fisPane .fis-grid { --grid-fs: 13px; --grid-th-fs: 12px; --cell-px: 6px; }
  #fisPane .fis-grid th { position: static; }
  #fisPane .fis-grid th.c-first { position: sticky; }
  #fisPane .fis-grid .c-first { box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16); }
  #fisPane .fis-grid td.c-first .ell { white-space: normal; line-height: 1.3; }
  #fisPane .fis-grid td.c-first { height: auto; padding-top: 5px; padding-bottom: 5px; }
  #fisPane .fis-grid .tree-cell { --tree-ind: 8px; }
  .fis-search { max-width: none; flex: 1 1 100%; }
  #fisSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fis-notes { padding: 14px 12px 30px; }
  .fis-doc { display: block; overflow-x: auto; }
}
@media print {
  #printArea .fis-p { font-size: 9pt; }
  #printArea .fis-p td, #printArea .fis-p th { padding: 2px 4px; }
}

/* ===== 标准：同类按地市切换 / 两市并排对照 ===== */
.std-city-bar { display: flex; align-items: center; gap: 10px; margin-bottom: -18px; flex-wrap: wrap; }
.std-city-lbl { font-size: 13px; color: var(--text-3); }
.std-city-seg { display: inline-flex; background: var(--surface-2, #f1f3f5); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.std-city-seg .seg-btn { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; color: var(--text-2, #555); cursor: pointer; font-family: inherit; }
.std-city-seg .seg-btn:hover { color: var(--text); }
.std-city-seg .seg-btn.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.std-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.std-pair > .std-card { min-width: 0; }
.std-pair .std-table { width: 100%; min-width: 0; }
.std-pair .std-table td, .std-pair .std-table th { white-space: normal; }
@media (max-width: 900px) {
  .std-pair { grid-template-columns: 1fr; gap: 32px; }
  .std-city-bar { margin-bottom: -12px; }
}
@media print { .std-city-bar { display: none !important; } }

/* ============================================================
   2027年预算（双子模块：基本支出 + 项目支出） & 2025年开关（2026-11-16）
   ============================================================ */

@media (max-width: 1280px) {
  .only-wide { display: none; }
}
@media (max-width: 860px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .app,
.hdr,
.toolbar,
.summary,
.workspace {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .hdr, .toolbar, .summary {
    overflow-x: clip;
  }
  .hdr-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hdr-tabs::-webkit-scrollbar {
    display: none;
  }
  
  
  #basicSearchWrap,
  #uinfoSearchWrap,
  #stfSearchWrap,
  #fisSearchWrap {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }
  #basicFilterBar,
  #uinfoFilterBar,
  #stfFilterBar,
  #fisFilterBar {
    width: 100%;
    min-width: 0;
  }
  .view-controls {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
  }
  .view-controls .seg button {
    height: 29px;
    padding: 0 9px;
    font-size: 12.5px;
  }
  .data#basicPane,
  .data#uinfoPane,
  .data#stfPane,
  .data#fisPane,
  .data#dataPane {
    width: 100%;
    max-width: 100%;
  }
}

/* 门户页：部门预算子模块入口与二级选择页 */

/* 基本支出表格（自适应列宽，金额与表头永不截断） */
#basicBody.pane-anim,
#uinfoBody.pane-anim {
  animation: paneFadeIn 0.18s var(--ease-out);
}
.basic-grid th.txt,
.basic-grid td.txt {
  text-align: left;
  padding: 0 10px;
  white-space: nowrap;
  color: var(--text-2);
  font-size: 12.5px;
}
.basic-grid th.txt {
  font-weight: 600;
}
.grid.basic-grid {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
.grid.basic-grid th,
.grid.basic-grid td {
  overflow: visible;
  text-overflow: clip;
}
.grid.basic-grid th.grp {
  text-align: center;
  border-left: 1px solid var(--line);
  padding: 0 8px;
}
.grid.basic-grid thead tr.h2 th {
  padding: 0 10px;
  font-size: 12px;
}
.grid.basic-grid td.num,
.grid.basic-grid th.num,
.grid.basic-grid:not(.two) td.num,
.grid.basic-grid:not(.two) th.num {
  padding: 0 11px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.grid.basic-grid th:last-child,
.grid.basic-grid td:last-child {
  padding-right: 16px;
}
.basic-grid th.grp-s, .basic-grid td.grp-s {
  border-left: 1px solid var(--line);
}
.basic-grid th.sub-sum {
  font-weight: 600;
  background-color: #edf2fb;
  box-shadow: 0 -2px 0 #edf2fb;
}
.basic-grid.two thead tr.h2 th.sub-sum {
  box-shadow: 0 -1px 0 #edf2fb;
}
.basic-grid th.sub-sum.sortable:hover {
  background-color: #e4ebf8;
}
.basic-grid td.sub-sum {
  font-weight: 600;
  background-color: #f7f9fe;
}
.grid.basic-grid .c-unit {
  position: sticky;
  left: 0;
  width: var(--b-unit-w, 276px);
  min-width: var(--b-unit-w, 276px);
  max-width: var(--b-unit-w, 276px);
  box-sizing: border-box;
  overflow: hidden;
  text-align: left;
  padding: 0 10px 0 14px;
}
.basic-grid td.c-unit {
  z-index: 2;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.basic-grid th.c-unit {
  z-index: 6;
  background: var(--surface-2);
  border-right: 1px solid var(--line-2);
}
.basic-grid tr.bsc-lv0 td,
.basic-grid tr.bsc-lv0 td.sub-sum {
  font-weight: 700;
  background: #eef3fb;
}
.basic-grid tr.bsc-lv0 td.c-unit, .basic-grid tr.bsc-lv0 td.c-tot {
  background: #eef3fb;
}
.basic-grid tr.bsc-lv1 td,
.basic-grid tr.bsc-lv1 td.sub-sum {
  font-weight: 650;
  background: var(--surface-2);
}
.basic-grid tr.bsc-lv1 td.c-unit, .basic-grid tr.bsc-lv1 td.c-tot {
  background: var(--surface-2);
}
.basic-grid tr.bsc-lv2 td,
.basic-grid tr.bsc-lv2 td.sub-sum {
  font-weight: 600;
  background: #fafbfd;
}
.basic-grid tr.bsc-lv2 td.c-unit, .basic-grid tr.bsc-lv2 td.c-tot {
  background: #fafbfd;
}
.basic-grid tr.row:hover td,
.basic-grid tr.row:hover td.sub-sum,
.basic-grid tr.row:hover td.c-unit, .basic-grid tr.row:hover td.c-tot,
.basic-grid tr.parent:hover td,
.basic-grid tr.parent:hover td.sub-sum,
.basic-grid tr.parent:hover td.c-unit, .basic-grid tr.parent:hover td.c-tot {
  background: var(--row-hover, #f4f7fc);
}
.basic-grid tr.sel td, .basic-grid tr.sel td.c-unit, .basic-grid tr.sel td.c-tot {
  background: var(--accent-weak) !important;
}
.basic-grid td.c-tot {
  font-weight: 600;
}
.basic-grid td.pos { color: var(--pos); }
.basic-grid td.neg { color: var(--neg); }
.basic-grid td.muted-cell { color: var(--text-3); }
.basic-grid tr.big td { background: #fffbe6; }
.basic-grid tr.big td.c-unit, .basic-grid tr.big td.c-tot { background: #fffbe6; }
@media (min-width: 861px) {
  .basic-grid:not(.no-sticky-tot) .c-tot {
    position: sticky;
    left: var(--b-unit-w, 276px);
  }
  .basic-grid:not(.no-sticky-tot) td.c-tot {
    z-index: 2;
    background: var(--surface);
    border-right: 1px solid var(--line-2);
  }
  .basic-grid:not(.no-sticky-tot) th.c-tot {
    z-index: 6;
    background: var(--surface-2);
    border-right: 1px solid var(--line-2);
  }
  .basic-grid:not(.no-sticky-tot).scrolled-x td.c-tot {
    box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16);
  }
  .basic-grid:not(.no-sticky-tot).scrolled-x th.c-tot {
    box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16), 0 -2px 0 var(--surface-2);
  }
  .basic-grid.no-sticky-tot.scrolled-x td.c-unit {
    box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16);
  }
  .basic-grid.no-sticky-tot.scrolled-x th.c-unit {
    box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16), 0 -2px 0 var(--surface-2);
  }
}
@media (max-width: 860px) {
  .data#basicPane,
  .data#uinfoPane {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #basicPane .basic-grid,
  #uinfoPane .basic-grid { --grid-fs: 13px; --grid-th-fs: 12px; --cell-px: 6px; }
  #basicPane .basic-grid th,
  #uinfoPane .basic-grid th { position: static; }
  #basicPane .basic-grid th.c-unit,
  #uinfoPane .basic-grid th.c-unit { position: sticky; left: 0; }
  #basicPane .basic-grid td.c-unit .ell,
  #uinfoPane .basic-grid td.c-unit .ell {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
  }
  #basicPane .basic-grid td.c-unit,
  #uinfoPane .basic-grid td.c-unit { padding-top: 5px; padding-bottom: 5px; height: auto; }
  #basicPane .basic-grid.scrolled-x .c-unit,
  #uinfoPane .basic-grid.scrolled-x .c-unit { box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16); }
  #basicPane .basic-grid td.c-unit .code,
  #uinfoPane .basic-grid td.c-unit .code { display: none; }
  #basicSummary,
  #uinfoSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#basicToolbar .tb-row,
#uinfoToolbar .tb-row {
  flex-wrap: wrap;
}
.uinfo-attr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  padding: 10px 12px;
  font-size: 12.5px;
}
.uinfo-attr-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.uinfo-attr-item.wide {
  grid-column: 1 / -1;
}
.uinfo-attr-item .ak {
  font-size: 11px;
  color: var(--text-3);
}
.uinfo-attr-item .av {
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

/* 基本支出详情侧栏 */
.bsc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}
.bsc-kpi {
  padding: 10px 10px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.bsc-kpi .k {
  font-size: 11.5px;
  color: var(--text-3);
}
.bsc-kpi .v {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.bsc-kpi .s {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-3);
}
.bsc-sec {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.bsc-sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}
.bsc-sec-hd .sum {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-size: 12.5px;
}
.bsc-bd-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bsc-bd-tbl td {
  padding: 6px 12px;
  border-top: 1px solid var(--line);
}
.bsc-bd-tbl td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.bsc-bd-tbl td.pct {
  width: 62px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  font-size: 12px;
}
.bsc-bd-tbl td.diff {
  width: 78px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.bsc-bd-tbl td.pos, .bsc-yr-tbl td.pos, .bsc-kpi .s.pos { color: var(--pos); }
.bsc-bd-tbl td.neg, .bsc-yr-tbl td.neg, .bsc-kpi .s.neg { color: var(--neg); }
.bsc-yr-box {
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.bsc-yr-box-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.bsc-yr-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.bsc-yr-tbl th, .bsc-yr-tbl td {
  padding: 5px 8px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.bsc-yr-tbl th {
  font-weight: 600;
  color: var(--text-3);
  font-size: 11.5px;
  text-align: right;
  background: #fafbfd;
}
.bsc-yr-tbl th:first-child, .bsc-yr-tbl td:first-child { text-align: left; }
.bsc-yr-tbl td { text-align: right; }
.bsc-yr-tbl tr.yr-row { cursor: pointer; }
.bsc-yr-tbl tr.yr-row:hover td { background: #f4f7fc; }
.bsc-yr-tbl tr.yr-row.active td {
  background: var(--accent-weak);
  font-weight: 650;
}
.bsc-yr-tbl tr.yr-row.active td:first-child { color: var(--accent); }
.bsc-hist-note {
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 6px;
  background: #f6f8fc;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.45;
}

/* ===== 模块四：财供人员信息（自适应列宽，人数与表头永不截断） ===== */

#stfToolbar .tb-row { flex-wrap: wrap; }
#stfFilterBar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#stfBody.pane-anim {
  animation: paneFadeIn 0.18s var(--ease-out);
}
.grid.stf-grid {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
.grid.stf-grid th,
.grid.stf-grid td {
  overflow: visible;
  text-overflow: clip;
}
.grid.stf-grid th.num,
.grid.stf-grid td.num,
.grid.stf-grid:not(.two) th.num,
.grid.stf-grid:not(.two) td.num {
  padding: 0 12px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.grid.stf-grid th:last-child,
.grid.stf-grid td:last-child {
  padding-right: 18px;
}
.stf-grid th.grp {
  text-align: center;
  border-left: 1px solid var(--line);
  padding: 0 8px;
}
.stf-grid th.grp-s, .stf-grid td.grp-s {
  border-left: 1px solid var(--line);
}
.stf-grid th.sub-sum {
  font-weight: 600;
  background-color: #ebf4f2;
  box-shadow: 0 -2px 0 #ebf4f2;
}
.stf-grid td.sub-sum {
  font-weight: 600;
  background-color: #f6fbfa;
}
.grid.stf-grid.four thead tr th {
  height: 29px;
  font-size: 12.5px;
  padding: 0 10px;
  position: sticky;
  background: var(--surface-2);
  z-index: 3;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.grid.stf-grid.four thead tr.r1 th { top: 0; }
.grid.stf-grid.four thead tr.r2 th { top: 29px; }
.grid.stf-grid.four thead tr.r3 th { top: 58px; }
.grid.stf-grid.four thead tr.r4 th { top: 87px; }
.grid.stf-grid .c-first {
  position: sticky;
  left: 0;
  min-width: 116px;
  text-align: left;
  padding: 0 12px 0 16px;
  white-space: nowrap;
}
.grid.stf-grid.tree-mode .c-first {
  min-width: 206px;
}
.stf-grid td.c-first {
  z-index: 2;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.stf-grid th.c-first, .grid.stf-grid.four thead tr th.c-first {
  z-index: 6;
  left: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--line-2);
}
.stf-grid tr.fl0 td {
  font-weight: 700;
  background: #eef3fb;
}
.stf-grid tr.fl0 td.c-first {
  background: #eef3fb;
}
.stf-grid tr.fl1 td {
  font-weight: 650;
  background: var(--surface-2);
}
.stf-grid tr.fl1 td.c-first {
  background: var(--surface-2);
}
.stf-grid tr.fl2 td {
  font-weight: 600;
}
.stf-grid td.warn-ratio {
  color: var(--warn, #b45309);
  font-weight: 650;
}
.stf-grid tr.row:hover td.c-first {
  background: var(--row-hover, #f4f7fc);
}
.stf-grid.scrolled-x .c-first {
  box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16);
}
.stf-pk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stf-pk-chk {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}
.stf-pk-chk:hover {
  background: var(--surface-2);
}
.stf-pk-chk.on {
  border-color: var(--accent-line);
  background: var(--accent-weak);
  font-weight: 600;
}
@media (max-width: 860px) {
  .data#stfPane {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #stfPane .stf-grid { --grid-fs: 13px; --grid-th-fs: 12px; --cell-px: 6px; }
  #stfPane .stf-grid th { position: static; }
  #stfPane .stf-grid th.c-first { position: sticky; left: 0; }
  #stfSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stf-pk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   部门预算 · 综合分析（2026-11-16）：单位全景 / 人均指标 / 匹配说明
   ============================================================ */

/* ana brand-mark 已统一主色 */
#anaToolbar .tb-row { flex-wrap: wrap; }
#anaFilterBar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#anaFilterBar .fbtn .fval { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#anaFilterBar .ana-cnt { font-size: 12.5px; }
#anaBody .empty-hint { padding: 28px var(--edge-px); color: var(--text-3); }
.ana-head { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ana-name { font-size: 17px; font-weight: 650; color: var(--text); }
.ana-meta, .ana-hist { font-size: 12.5px; color: var(--text-3); }
.ana-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ana-doc { padding: 6px var(--edge-px) 40px; max-width: 1180px; }
.ana-sec { margin: 14px 0 6px; }
.ana-sec-hd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ana-sec-hd h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.ana-sec-hd .muted { font-size: 12px; color: var(--text-3); }
.ana-tw { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 8px; }
.ana-tw .ana-grid { width: 100%; }
.ana-tw .ana-grid th { position: static; }
.ana-tw .ana-grid th.c-first { position: sticky; }
.ana-tw .ana-grid .c-first { box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.12); }
.ana-tw .ana-grid td.c-first .ell { white-space: normal; line-height: 1.3; }
.ana-tw .ana-grid td.c-first { height: auto; padding-top: 5px; padding-bottom: 5px; }
.ana-grid td.txt { white-space: normal; line-height: 1.3; }
.ana-empty { padding: 10px 2px; color: var(--text-3); font-size: 13px; }
.ana-more { margin-top: 6px; height: 28px; }
.ana-foot { margin-top: 12px; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.ana-jump { height: 24px; padding: 0 6px; margin: 4px 0 0; display: inline-flex; align-items: center; gap: 4px; }
dd .ana-jump { margin: 0 0 0 8px; }
.ana-link { all: unset; cursor: pointer; color: var(--accent); max-width: 100%; display: block; }
.ana-link:hover { text-decoration: underline; }
.ana-pc td.ana-flag { background: #fff3c4 !important; font-weight: 600; }
.ana-pc tr.ana-any td.c-first { background: #fffbea; }
.ana-pc th.sorted { color: var(--accent); }
@media (max-width: 860px) {
  .data#anaPane { width: 100%; max-width: 100%; }
  .data#anaPane.ana-wide {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #anaPane .fis-grid { --grid-fs: 13px; --grid-th-fs: 12px; --cell-px: 6px; }
  #anaPane .ana-pc th { position: static; }
  #anaPane .ana-pc th.c-first { position: sticky; }
  #anaPane .ana-pc td.c-first .ell { white-space: normal; line-height: 1.3; }
  #anaPane .ana-pc td.c-first { height: auto; padding-top: 5px; padding-bottom: 5px; }
  #anaFilterBar .fbtn .fval { max-width: 180px; }
  .ana-doc { padding-left: 10px; padding-right: 10px; }
}

/* ============================================================
   部门预算 · 财力预测（2026-11-17）：市本级一般公共预算可用财力对比表
   ============================================================ */
/* cap brand-mark 已统一主色 */

@media (max-width: 860px) {
  
  
  
  #capSearchWrap { flex: 1 1 100%; max-width: none; min-width: 0; }
  #capFilterBar { width: 100%; min-width: 0; }
  .data#capPane {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #capSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#capToolbar .tb-row { flex-wrap: wrap; }
#capFilterBar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#capBody.pane-anim { animation: paneFadeIn 0.18s var(--ease-out); }

.grid.cap-grid {
  table-layout: auto;
  width: 100%;
  min-width: 820px;
}
.cap-grid th.c-first,
.cap-grid td.c-first {
  position: sticky;
  left: 0;
  min-width: 248px;
  max-width: 340px;
  text-align: left;
  padding: 6px 12px 6px 14px;
}
.cap-grid td.c-first {
  z-index: 2;
  background: var(--surface);
  border-right: 1px solid var(--line);
  height: auto;
}
.cap-grid th.c-first {
  z-index: 6;
  background: var(--surface-2);
  border-right: 1px solid var(--line-2);
}
.cap-grid.scrolled-x .c-first {
  box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16);
}
.cap-grid th.num,
.cap-grid td.num {
  text-align: right;
  padding: 6px 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cap-grid th.c-rem,
.cap-grid td.c-rem {
  text-align: left;
  padding: 6px 14px;
  min-width: 220px;
  max-width: 520px;
  white-space: normal;
  line-height: 1.42;
  color: var(--text-2);
  font-size: 12.5px;
}
.cap-grid th.c-rem {
  font-weight: 600;
  color: var(--text-2);
}
.cap-grid tr.cap-lv0 td {
  font-weight: 700;
  font-size: 13.5px;
  background: #e8effc;
}
.cap-grid tr.cap-lv0 td.c-first { background: #e8effc; }
.cap-grid tr.cap-lv1 td {
  font-weight: 650;
  background: var(--surface-2);
}
.cap-grid tr.cap-lv1 td.c-first { background: var(--surface-2); }
.cap-grid tr.cap-lv2 td {
  font-weight: 600;
  background: #f9fafd;
}
.cap-grid tr.cap-lv2 td.c-first { background: #f9fafd; }
.cap-grid tr.row { cursor: pointer; }
.cap-grid tr.row:hover td,
.cap-grid tr.row:hover td.c-first,
.cap-grid tr.parent:hover td,
.cap-grid tr.parent:hover td.c-first {
  background: var(--row-hover, #f4f7fc);
}
.cap-grid tr.sel td,
.cap-grid tr.sel td.c-first {
  background: var(--accent-weak) !important;
}
.cap-grid tr.flash td,
.cap-grid tr.flash td.c-first {
  animation: rowFlash 1.4s ease-out;
}
.cap-grid td.pos { color: var(--pos); }
.cap-grid td.neg { color: var(--neg); }
.cap-grid td.strong { font-weight: 600; }
.cap-net-preview {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f8ff;
  border: 1px solid #d5e3fb;
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.cap-net-preview b {
  font-size: 14px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 860px) {
  #capPane .cap-grid { --grid-fs: 13px; --grid-th-fs: 12px; }
  #capPane .cap-grid th { position: static; }
  #capPane .cap-grid th.c-first { position: sticky; left: 0; }
  #capPane .cap-grid td.c-first { min-width: 186px; max-width: 220px; }
  #capPane .cap-grid td.c-first .ell { white-space: normal; line-height: 1.3; }
}

/* ============================================================
   手机：部门预算子模块底栏（顶栏 submod-seg 让出空间给表格）
   ============================================================ */
.dept-subnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: none;
  gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -6px 20px rgba(18, 28, 45, 0.06);
}
.dept-subnav-btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 4px 2px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}
.dept-subnav-btn .ic { width: 18px; height: 18px; }
.dept-subnav-btn.active {
  color: var(--accent);
  background: var(--accent-weak);
  font-weight: 650;
}
.dept-subnav-btn:active { transform: scale(0.97); }

@media (max-width: 860px) {
  
  .dept-subnav:not(.hidden) { display: flex; }
  body.has-dept-subnav .app {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  body.has-dept-subnav .drawer {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
}

/* 首页部门预算直接入口 */
.sum-toggle { display: none; }

@media (max-width: 860px) {
  #summary, #summary:has(#sumY25) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dataPane .grid:not(.two) :is(th, td).num { padding-inline: 4px; }
  #dataPane .grid th.num { white-space: normal; line-height: 1.2; }
  #summary .sum-count { grid-column: 1 / -1; grid-row: 1; padding-right: 6em; }
  #summary .sum-toggle { display: inline-flex; grid-column: 2; grid-row: 1; align-self: start;
    justify-self: end; background: none; border: 0; color: var(--accent); padding: 2px 0 6px 10px; font: inherit; }
  #summary:not(.sum-expanded) .sum-item:has(#sumY25, #sumY26, #sumD25),
  #summary:not(.sum-expanded) .sum-note, #summary:not(.sum-expanded) .sum-sub { display: none; }
  #summary:not(.sum-expanded) .sum-count::after { content: ' · 万元'; color: var(--text-3); font-size: 12px; }
}

/* 三保监测：表格、工具栏、汇总条沿用 .grid / .fis-grid 等公共样式，这里只补模块色、双层表头和手机端 */

#districtToolbar .tb-row { flex-wrap: wrap; }
#districtFilterBar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sb-grid.two thead tr.h2 th.num { white-space: nowrap; }
.sb-grid tr.fl1 td { background: #fafbfc; }
#districtBody .empty-hint { padding: 28px var(--edge-px); color: var(--text-3); }
@media (max-width: 860px) {
  .data#districtPane {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #districtPane .sb-grid { --grid-fs: 13px; --grid-th-fs: 12px; --cell-px: 6px; }
  #districtPane .sb-grid th { position: static; }
  #districtPane .sb-grid th.c-first { position: sticky; }
  #districtPane .sb-grid .c-first { box-shadow: 6px 0 8px -6px rgba(18, 28, 45, 0.16); }
  #districtPane .sb-grid td.c-first .ell { white-space: normal; line-height: 1.3; }
  #districtPane .sb-grid td.c-first { height: auto; padding-top: 5px; padding-bottom: 5px; }
  #districtPane .sb-grid .tree-cell { --tree-ind: 8px; }
  #districtSearchWrap { flex: 1 1 100%; max-width: none; min-width: 0; }
  #districtFilterBar { width: 100%; min-width: 0; }
  #districtSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
