/* 经营分析数据收集系统 —— 样式（取自《样板.html》的设计语言） */
:root {
  --bg-body: #f5f9fc;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #526071;
  --text-muted: #8a94a6;
  --border: #e2e8f0;
  --accent-teal: #14b8a6;
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .03), 0 1px 3px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .04);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all .25s ease;
  --font-sans: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-sans); background: var(--bg-body); color: var(--text-primary);
  min-height: 100vh; display: flex; flex-direction: column;
}

/* ---------------- 顶部导航 ---------------- */
.topbar {
  height: 60px; background: rgba(255,255,255,.9); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-badge {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 12px rgba(20,184,166,.3);
}
.company-info { line-height: 1.2; }
.company-cn { font-size: 14px; font-weight: 700; }
.company-en { font-size: 9px; color: var(--text-muted); letter-spacing: 1.5px; }
.system-title { font-size: 16px; font-weight: 700; letter-spacing: .5px; color: #0f766e; margin-left: 8px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.pill {
  display: flex; align-items: center; gap: 8px; background: #ecfdf5;
  border: 1px solid #d1fae5; padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; color: #065f46;
}
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-green); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.topbar-time { font-size: 13px; color: var(--text-secondary); font-family: var(--font-mono); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #f0fdfa; color: #0f766e;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
  cursor: pointer; transition: var(--transition); font-size: 13px;
}
.avatar:hover { background: #ccfbf1; }

.layout { display: flex; flex: 1; overflow: hidden; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: 214px; background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 14px 12px; display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; flex-shrink: 0;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  cursor: pointer; transition: var(--transition); color: var(--text-secondary);
  font-size: 13px; font-weight: 500; border: 1px solid transparent; text-decoration: none;
}
.nav-item:hover { background: #f0fdfa; color: #0f766e; }
.nav-item.active { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; font-weight: 600; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: #fee2e2; color: #b91c1c; padding: 1px 7px;
  border-radius: 10px; font-size: 10px; font-weight: 700;
}
.nav-ro { margin-left: auto; font-size: 10px; color: var(--text-muted); }
.nav-group { font-size: 11px; color: var(--text-muted); font-weight: 700; padding: 10px 12px 4px; letter-spacing: .5px; }
.sidebar-footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;
}
.status-line { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-green); }

/* ---- 可收拢的菜单分组 ---- */
.nav-group { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; border-radius: 8px; }
.nav-group:hover { background: #f8fafc; }
.nav-group .caret { transition: transform .2s ease; font-size: 10px; }
.nav-group.collapsed .caret { transform: rotate(-90deg); }
.nav-items { display: flex; flex-direction: column; gap: 3px; overflow: hidden; max-height: 1200px; transition: max-height .25s ease; }
.nav-items.collapsed { max-height: 0; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
/* 只读的菜单也用正常颜色显示 —— 只靠右侧小小的「只读」两个字提示，
   不再整条变淡（那样看着像蒙了一层，反而不好认）。 */
.nav-item.ro { opacity: 1; }
.nav-item.active .nav-name { font-weight: 700; }
.nav-item.active { box-shadow: inset 3px 0 0 0 var(--mc, #14b8a6); }

/* ---- 侧边栏整体收起（只留图标） ---- */
body.mini-nav .sidebar { width: 62px; padding: 14px 8px; }
body.mini-nav .nav-item { justify-content: center; padding: 10px 6px; }
body.mini-nav .nav-item .nav-name,
body.mini-nav .nav-item .nav-ro,
body.mini-nav .nav-group .gtitle,
body.mini-nav .nav-group .caret,
body.mini-nav .sidebar-footer { display: none; }
body.mini-nav .nav-items { max-height: 2000px !important; }

/* ---- 列头编辑 ---- */
.ch { display: inline-flex; align-items: center; gap: 3px; justify-content: center; }
.cfgb {
  font-size: 11px; line-height: 1; padding: 1px 4px; border-radius: 5px;
  border: 1px solid #cbd5e1; background: #fff; color: #64748b; cursor: pointer;
  opacity: .55; transition: var(--transition); font-family: var(--font-sans);
}
th:hover .cfgb, .panel-header:hover .cfgb { opacity: 1; }
.cfgb:hover { border-color: #99f6e4; color: #0f766e; background: #f0fdfa; }
.cfgb.on { border-color: #5eead4; color: #0f766e; background: #f0fdfa; opacity: 1; font-weight: 700; }
.cfgb.danger:hover { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.panel-title .cfgb { margin-left: 4px; }
.tname { margin-right: 4px; }

/* ---- 批量粘贴按钮 ---- */
.btn-paste { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; font-weight: 700; }
.btn-paste:hover { background: #dbeafe; border-color: #93c5fd; }

/* ---- 选项编辑器 ---- */
.optedit { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.optline { display: flex; align-items: center; gap: 6px; padding: 3px 2px; }
.optline .idx { width: 22px; text-align: right; color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); }
.optline input { flex: 1; }
.optline .rowbtn { border: 1px solid var(--border); border-radius: 5px; width: 24px; height: 24px; background: #fff; }
.optline .rowbtn:hover { border-color: #99f6e4; color: #0f766e; }

/* ---- 选项标签 ---- */
.chip {
  display: inline-block; background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4;
  border-radius: 12px; padding: 1px 9px; font-size: 11px; margin: 2px 4px 2px 0;
}

/* ---- 粘贴弹窗的落位提示 ---- */
.pastehint {
  margin-top: 6px; padding: 8px 10px; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 8px; font-size: 12px; color: #1d4ed8; line-height: 1.8;
}
.prow { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.prow > span { display: flex; flex-direction: column; gap: 3px; }
.prow label { margin: 0; }
.prow select { min-width: 130px; }
.pasteprev { margin-top: 8px; }
.pasteprev .pvrow { display: flex; gap: 0; }
.pasteprev .pvrow span {
  flex: 1; min-width: 0; border: 1px solid var(--border); background: #fbfdff;
  padding: 3px 6px; font-size: 11px; font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ================= 门户页 ================= */
body.portal { background: linear-gradient(180deg, #f7fbfe 0%, #eef6f4 100%); }
.portal-main { max-width: 1080px; margin: 0 auto; padding: 34px 20px 60px; }
.portal-hero { text-align: center; padding: 46px 20px 34px; }
.portal-hero .hero-slogan { font-size: 13px; letter-spacing: 4px; color: #94a3b8; }
.portal-hero .hero-brand {
  font-size: 40px; font-weight: 800; margin-top: 12px; letter-spacing: 2px;
  background: linear-gradient(135deg, #14b8a6, #3b82f6);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.portal-hero .hero-desc { font-size: 15px; color: var(--text-secondary); margin-top: 14px; }
.btn-lg { padding: 11px 26px; font-size: 14px; border-radius: 10px; }

.portal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 26px; }
.pcard {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 20px 18px; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.pcard:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.pcard .picon { font-size: 26px; }
.pcard h4 { margin: 10px 0 6px; font-size: 14px; color: #0f766e; }
.pcard p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.9; }

.portal-steps { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }
.portal-steps .step {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border);
  border-radius: 30px; padding: 8px 18px 8px 10px; font-size: 12.5px; color: var(--text-secondary);
}
.portal-steps .step b {
  width: 22px; height: 22px; border-radius: 50%; background: #14b8a6; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}

/* ---- 登录浮层（悬停在门户之上） ---- */
.login-box { max-width: 392px; margin: 6% auto; padding: 20px 22px 18px; }
.login-box h3 { margin-bottom: 10px; font-size: 17px; }
.field-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.field-row label { width: 62px; flex-shrink: 0; margin: 0; }
.field-row input, .field-row select { flex: 1; }
.login-box .tabs { margin-top: 0; margin-bottom: 12px; }
.login-box .tab { padding: 7px; }
.login-box .modal-foot { margin-top: 14px; }
.login-box .mini { margin-top: 2px; }

/* ---- 弹窗里的色板 ---- */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 8px; cursor: pointer; border: 1px solid rgba(0,0,0,.08); }
.swatch:hover { transform: scale(1.08); }
.swatch.sm { width: 16px; height: 16px; border-radius: 5px; }

/* ---- 配色方案弹窗 ---- */
.colorgrid { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow: auto; }
.colorrow {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #fbfdff; border: 1px solid var(--border); border-radius: 8px;
}
.colorrow .cn { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.colorrow .cval { width: 92px; flex-shrink: 0; font-family: var(--font-mono); font-size: 11px; }
.colorrow .swatches { flex-shrink: 0; }

/* ---- 通用弹窗 ---- */
.modal {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 999;
  /* 关键：不加 align-items 的话，flex 会把弹窗盒子拉伸到整屏高 —— 登录框那条大空白就是这么来的 */
  align-items: flex-start; justify-content: center; overflow-y: auto;
}
.modal-box {
  background: #fff; max-width: 520px; margin: 8% auto; padding: 22px 24px;
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.modal-box h3 { margin: 0 0 14px; color: #0f766e; font-size: 15px; }
.modal-box label { display: block; font-size: 12px; color: var(--text-secondary); margin: 6px 0 4px; font-weight: 600; }
.modal-foot { display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end; }
.mini { color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border);
  background: #fff; color: var(--text-muted); cursor: pointer; font-size: 14px;
}
.icon-btn:hover { border-color: #99f6e4; color: #14b8a6; }

/* ---- 权限勾选块 ---- */
.permbox { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 6px; max-height: 300px; overflow: auto; }
.permgroup { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.permgroup:last-child { border-bottom: 0; }
.permgroup .gh { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.permgroup .items { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.permgroup .items label { font-size: 12px; color: var(--text-secondary); display: flex; gap: 4px; align-items: center; }
.permgroup .items.modstates { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; }
.permgroup .items.modstates .mst { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.permgroup .items.modstates .mst > span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.permgroup .items.modstates select { width: 96px; flex-shrink: 0; padding: 2px 4px; font-size: 11px; }

.legend .k-paste { background: #eef6ff; border-color: #bfdbfe; }
.legend .k-lock { background: #f1f5f9; border-color: #cbd5e1; }
input.cell.pasteable:focus { box-shadow: 0 0 0 3px rgba(59,130,246,.18); border-color: var(--accent-blue); }
input.cell.bad { border-color: #fecaca; background: #fef2f2; }
input.cell.saving { background: #eef6ff; }

/* ---- 锁定的列：跟预览模式同一个观感（没有底纹和边框，就是字体在这儿），只是不能改 ---- */
th.th-locked { background: #eef2f7; }
span.ct.lockable { cursor: pointer; border-bottom: 1px dashed #94a3b8; }
span.ct.lockable:hover { color: #0f766e; border-bottom-color: #0f766e; }
span.ct.locked { color: #64748b; border-bottom-color: transparent; }
span.ct .lockicon { margin-right: 2px; font-size: 10px; }
.cell-lock {
  display: block; padding: 3px 4px; min-height: 20px;
  font-family: var(--font-mono); color: var(--text-primary);
  border: 0; background: transparent;
}
.cell-lock.txt { font-family: var(--font-sans); text-align: left; }
td.num > .cell-lock { text-align: right; }

/* ---- 预览模式（只读账号 / 月份锁定）：像查阅一份数据文件，全无框线 ---- */
.pv {
  display: block; padding: 3px 4px; min-height: 20px;
  font-family: var(--font-mono); color: var(--text-primary);
  border: 0; background: transparent;
}
.pv.txt { font-family: var(--font-sans); text-align: left; }
td.num > .pv { text-align: right; }
.pv-inline { font-family: var(--font-mono); color: var(--text-primary); padding: 2px 0; }
body.preview table.grid tbody tr:hover { background: #f8fafc; }
body.preview table.grid th { background: #f8fafc; }
body.preview .rowbtn { display: none; }
body.preview .panel-note { color: #94a3b8; }

/* 未保存的草稿：橙色边框 + 角标，一眼看出哪些还没落库 */
input.cell.dirty, select.cell.dirty, input.param.dirty, input.rowlabel.dirty {
  border-color: #f59e0b !important;
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #f59e0b;
}
#btnSave { position: relative; }
#btnSave.has-draft { background: #f59e0b; border-color: #f59e0b; color: #fff; font-weight: 600; }
.savecount { display: inline-block; margin-left: 4px; font-size: 11px; }
.savecount:not(:empty)::before { content: '('; }
.savecount:not(:empty)::after { content: ')'; }
#btnUndo:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 主内容 ---------------- */
.main-content { flex: 1; padding: 22px 24px 60px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title h1 { font-size: 20px; font-weight: 700; color: #0f172a; }
.page-title p { font-size: 12px; color: var(--text-muted); margin-top: 4px; max-width: 900px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  padding: 8px 15px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  color: #1e293b; cursor: pointer; font-size: 12px; font-weight: 600;
  transition: var(--transition); display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #99f6e4; background: #f0fdfa; }
.btn-primary { background: #14b8a6; border-color: #14b8a6; color: #fff; }
.btn-primary:hover { background: #0d9488; border-color: #0d9488; }
.btn-warning { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.btn-warning:hover { background: #ffedd5; }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 卡片 ---------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: var(--transition);
  display: flex; flex-direction: column; gap: 5px;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: .5px; }
.stat-value { font-size: 24px; font-weight: 700; font-family: var(--font-mono); }
.unit { font-size: 12px; font-weight: 400; color: var(--text-muted); }

.panel {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel-header {
  padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; gap: 12px; background: #fafdfe; flex-wrap: wrap;
}
.panel-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 14px 18px; }
.panel-note { font-size: 11px; color: var(--text-muted); padding: 6px 18px 12px; line-height: 1.6; }

/* ---------------- 表格 ---------------- */
.table-container { overflow-x: auto; }
/* 固定表格布局 + colgroup 显式列宽：拖动列宽才是「拉多少就是多少」，
   不会被单元格内容顶宽（自动布局下 min-width 只是建议，填了长数字就被撑开）。 */
table.grid {
  table-layout: fixed; width: auto; border-collapse: collapse; font-size: 12px;
}
table.grid th, table.grid td {
  border: 1px solid var(--border); padding: 4px 6px; text-align: center;
  white-space: nowrap; vertical-align: middle;
}
table.grid td { overflow: hidden; }
table.grid th { overflow: visible; }        /* 抓手要探出边框一点，别被裁掉 */
table.grid th .ch { flex-wrap: wrap; row-gap: 2px; }   /* 列窄了按钮换行，不往外挤 */
table.grid th {
  background: #f0fdfa; color: #0f766e; font-size: 11px; font-weight: 700;
  position: sticky; top: 0; z-index: 2;
}
table.grid td.txt { text-align: left; white-space: normal; word-break: break-word; }
table.grid td.num { text-align: right; font-family: var(--font-mono); }
/* 只读的数字/文字格：列窄了用省略号提示，而不是悄悄切一半 */
.cell-ro, .pv, .cell-lock { overflow: hidden; text-overflow: ellipsis; }
table.grid tr.total td { background: #fff7ed; font-weight: 700; }
table.grid tr.calc td { background: #f8fafc; font-weight: 600; }
table.grid tr:hover td { background: #fafdfe; }
table.grid tr.total:hover td { background: #ffedd5; }

/* ---- 列操作条：点列名后在列头上方弹出 ---- */
.colbar {
  position: fixed; z-index: 900; display: flex; gap: 6px; align-items: center;
  background: #fff; border: 1px solid #99f6e4; border-radius: 10px;
  padding: 6px 9px; box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
}
.colbar .cname {
  font-size: 11px; font-weight: 700; color: #0f766e; margin-right: 2px;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.colbar button { white-space: nowrap; }
.colbar .colbar-danger { color: #b91c1c; border-color: #fecaca; }
.colbar .colbar-danger:hover { background: #fef2f2; }

/* ---- 列宽抓手：表头右边缘 ---- */
.colgrip {
  position: absolute; top: 0; right: -4px; width: 9px; height: 100%;
  cursor: col-resize; z-index: 4; touch-action: none; border-radius: 3px;
}
.colgrip:hover, .colgrip.dragging { background: rgba(20, 184, 166, .35); }
body.col-resizing { cursor: col-resize !important; user-select: none; }
body.col-resizing * { cursor: col-resize !important; }

/* 黄色 = 可录入（对应 Excel 模板的颜色约定） */
input.cell {
  width: 100%; min-width: 62px; border: 1px solid #fde68a; background: #fffbeb;
  border-radius: 5px; padding: 3px 5px; font-size: 12px; text-align: right;
  font-family: var(--font-mono); color: #1e293b; transition: var(--transition);
}
input.cell:focus { outline: none; border-color: var(--accent-teal); background: #fff; box-shadow: 0 0 0 3px rgba(20,184,166,.12); }
input.cell:disabled { background: #f8fafc; border-color: var(--border); color: var(--text-muted); }
input.txt { text-align: left; font-family: var(--font-sans); }
select.cell { width: 100%; border: 1px solid #fde68a; background: #fffbeb; border-radius: 5px; padding: 3px 4px; font-size: 12px; }
.cell-ro { font-family: var(--font-mono); color: #0f766e; }
.cell-ro.txt { font-family: var(--font-sans); text-align: left; }

/* 各月只读列（之前月份的实绩）：列名就是月份，跟本月的字段区分开 */
table.grid th.th-hist { background: #f1f5f9; }
.cth { display: block; padding: 2px 3px; font-weight: 700; font-size: 11px;
       color: #475569; white-space: nowrap; }
table.grid td.hist { background: #f8fafc; }
.cell-ro.hist, .pv.hist, .cell-lock.hist { color: #94a3b8; }
.legend { display: flex; gap: 16px; font-size: 11px; color: var(--text-muted); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border); vertical-align: -2px; margin-right: 4px; }
.legend .k-in { background: #fffbeb; border-color: #fde68a; }
.legend .k-calc { background: #f0fdfa; border-color: #99f6e4; }
.legend .k-tot { background: #fff7ed; border-color: #fed7aa; }

.rowbtn { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 0 3px; }
.rowbtn:hover { color: var(--accent-red); }

/* ---------------- 表单 / 徽标 ---------------- */
.field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
input.inp, select.inp {
  padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 12px;
  font-family: var(--font-sans); background: #fff;
}
input.inp:focus, select.inp:focus { outline: none; border-color: var(--accent-teal); }
.params-bar {
  display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center;
  padding: 12px 18px; background: #f8fdfb; border-bottom: 1px solid var(--border);
}
.params-bar .p { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.params-bar .p b { color: var(--text-muted); font-weight: 600; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }
.badge-success { background: #ecfdf5; color: #047857; }
.badge-warning { background: #fffbeb; color: #b45309; }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-info { background: #eff6ff; color: #1d4ed8; }
.badge-muted { background: #f1f5f9; color: #64748b; }

.msg { padding: 9px 14px; border-radius: 8px; margin: 8px 0; font-size: 13px; }
.ok { background: #ecfdf5; color: #047857; }
.err { background: #fef2f2; color: #b91c1c; }
.mini { color: var(--text-muted); font-size: 12px; line-height: 1.7; }

/* 进度条 */
.prog { height: 7px; background: #eef2f7; border-radius: 5px; overflow: hidden; }
.prog > i { display: block; height: 100%; background: linear-gradient(90deg, #14b8a6, #3b82f6); }
.prog-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
.prog-row:last-child { border-bottom: 0; }
.prog-row .nm { width: 210px; color: var(--text-secondary); }
.prog-row .bar { flex: 1; }
.prog-row .pc { width: 56px; text-align: right; font-family: var(--font-mono); color: var(--text-muted); }

/* ---------------- 登录页 ---------------- */
.hero {
  text-align: center; padding: 56px 24px; background: linear-gradient(180deg, #fff, #f0fdfa);
  border: 1px solid var(--border); border-radius: 16px; margin-bottom: 14px;
}
.hero-slogan { font-size: 13px; font-weight: 500; letter-spacing: 4px; color: #94a3b8; }
.hero-brand {
  font-size: 34px; font-weight: 800; margin-top: 12px; letter-spacing: 2px;
  background: linear-gradient(135deg, #14b8a6, #3b82f6); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-desc { font-size: 14px; color: var(--text-secondary); margin-top: 14px; }
.hero-hint { font-size: 12px; color: #94a3b8; margin-top: 20px; line-height: 2; }
.login-wrap { max-width: 460px; margin: 0 auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  flex: 1; text-align: center; padding: 9px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-secondary); background: #f1f5f9;
  border: 1px solid transparent; transition: var(--transition);
}
.tab.active { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.login-wrap label { display: block; font-size: 12px; color: var(--text-secondary); margin: 10px 0 4px; font-weight: 600; }
.login-wrap input, .login-wrap select { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; font-family: var(--font-sans); }
.login-wrap input:focus, .login-wrap select:focus { outline: none; border-color: var(--accent-teal); }

/* ---------------- 报告页 ---------------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pick {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff;
  transition: var(--transition);
}
.pick:hover { border-color: #99f6e4; }
.pick .h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pick .fields { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.pick .fields label { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 3px; cursor: pointer; }
.pick .fields label input { margin: 0; }
fieldset { border: 0; }

/* ---------------- Toast ---------------- */
#toast {
  position: fixed; top: 78px; right: 24px; z-index: 9999; display: flex;
  flex-direction: column; gap: 8px; pointer-events: none;
}
.toast-item {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--text-primary);
  box-shadow: 0 8px 30px rgba(0,0,0,.08); animation: toastIn .25s ease;
}
.toast-item.err { border-color: #fecaca; color: #b91c1c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .sidebar { width: 58px; padding: 12px 6px; }
  .nav-item span:not(.nav-icon) { display: none; }
  .nav-item { justify-content: center; }
  .nav-group, .nav-ro { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .prog-row .nm { width: 120px; }
  .topbar { padding: 0 12px; }
  .system-title, .logo-text .company-en { display: none; }
}
@media print {
  .topbar, .sidebar, .btn, .header-actions, #toast { display: none !important; }
  .main-content { padding: 0; }
  .panel { box-shadow: none; border: 0; }
  input.cell { border: 0; background: transparent; }
}
