/* ==========================================================================
   第三方检验报告管理系统 · 视觉主题（品牌蓝 / 瑞隆新材料）
   ========================================================================== */
:root {
  --brand: #0b3f91;
  --brand-2: #1557b0;
  --brand-3: #3b82f6;
  --brand-soft: #eaf1fc;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --border: #e5eaf2;
  --ink: #16233a;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #1557b0;
  --primary-d: #0b3f91;
  --accent: #0f766e;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --shadow: 0 4px 18px rgba(16,42,89,.07), 0 1px 3px rgba(16,42,89,.05);
  --shadow-lg: 0 18px 50px rgba(8,28,66,.22);
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  background-image: radial-gradient(circle at 100% 0%, #e8f0fd 0, transparent 42%);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d5e8; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #a8bddb; background-clip: padding-box; }

/* ---------------- 布局 / 侧边栏 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(165deg, #0a3273 0%, #062a63 55%, #052353 100%);
  color: #c7d7f0; box-shadow: 4px 0 24px rgba(6,32,80,.12);
}
.brand { padding: 12px 12px 10px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-logo {
  width: 62px; height: 54px; margin: 0 auto 7px; background: #fff; border-radius: 11px;
  padding: 5px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.20);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { color: #fff; font-size: 13.5px; font-weight: 700; line-height: 1.35; letter-spacing: .3px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 8px; }
.sidebar .nav-item {
  padding: 7px 11px; margin: 1px 0; cursor: pointer; border-radius: 8px;
  font-size: 13px; display: flex; align-items: center; gap: 8px;
  color: #c7d7f0; border-left: 3px solid transparent;
  transition: background .15s, color .15s, transform .15s;
}
.nav-item .ni {
  width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.09);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,.09); color: #fff; transform: translateX(2px); }
.sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(59,130,246,.30), rgba(59,130,246,.07));
  color: #fff; border-left-color: #60a5fa; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.sidebar .nav-item.active .ni { background: rgba(255,255,255,.20); }
.side-foot { padding: 8px 10px 9px; border-top: 1px solid rgba(255,255,255,.09); background: rgba(3,20,48,.26); }
.help-btn {
  width: 100%; display: flex; align-items: center; gap: 9px; font-family: inherit;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16);
  color: #eaf2ff; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; cursor: pointer;
  transition: background .15s, transform .15s;
}
.help-btn:hover { background: rgba(255,255,255,.20); transform: translateY(-1px); }
.help-btn .ni { width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.14);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.help-arrow { margin-left: auto; opacity: .65; font-size: 13px; }
.clock-card { margin-top: 7px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.11);
  border-radius: 9px; padding: 6px 10px 7px; text-align: center; }
.clock-date { font-size: 11px; color: #b9cdee; letter-spacing: .3px; }
.clock-time { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 2px;
  font-variant-numeric: tabular-nums; line-height: 1.35; margin: 1px 0; }
.clock-week { font-size: 10.5px; color: #8fb0e0; }

/* ---------------- 顶部栏 / 主区域 ---------------- */
.main { flex: 1; min-width: 0; padding: 0 28px 34px; overflow-x: hidden; }
.topbar {
  position: sticky; top: 0; z-index: 30; margin: 0 -28px 20px; padding: 0 28px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 8px rgba(16,42,89,.04);
}
.topbar-left { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.crumb { color: var(--muted); }
.crumb-sep { color: #cbd5e1; }
#topbarTitle { font-size: 15px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-company { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.topbar-logo { width: 34px; height: 34px; object-fit: contain; background: #fff;
  border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; margin: 0; color: var(--ink); font-weight: 700;
  display: flex; align-items: center; gap: 11px; }
.page-head h1::before { content: ""; width: 5px; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand-3), var(--brand)); }
/* 多按钮模块：两个按钮组成靠右的一组，避免被 space-between 拆到中间 */
.page-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.sec-title { font-size: 14px; font-weight: 700; color: var(--ink); margin: 16px 0 8px;
  padding-left: 10px; border-left: 4px solid var(--brand-3); }

/* ---------------- 卡片 / 表格 ---------------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s; }
.card:hover { box-shadow: 0 8px 26px rgba(16,42,89,.10); }
.card .card-body { padding: 18px; }
.scroll { overflow-x: auto; border-radius: 10px; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 13px; }
table.grid th, table.grid td { border-bottom: 1px solid #edf1f7; border-right: 1px solid #f1f4f9;
  padding: 9px 11px; text-align: left; }
table.grid th:last-child, table.grid td:last-child { border-right: none; }
table.grid tr:last-child td { border-bottom: none; }
table.grid th { background: linear-gradient(180deg, #f8fbff, #eef4fd); font-weight: 700;
  color: var(--ink); white-space: nowrap; font-size: 12.5px; letter-spacing: .2px; }
table.grid tr:hover td { background: #f7fbff; }

/* 检验报告：全局搜索框 + 表头逐列筛选 */
.search-input { min-width: 320px; padding: 8px 11px; border: 1px solid #dce4ef;
  border-radius: 8px; font-size: 13px; outline: none; }
.search-input:focus { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
table.grid tr.filter-row th { background: #f9fbff; padding: 6px 7px; font-weight: 400; white-space: normal; }
.col-filter { width: 100%; min-width: 72px; box-sizing: border-box; padding: 5px 7px;
  border: 1px solid #dce4ef; border-radius: 6px; font-size: 12px; background: #fff; color: var(--text); }
.col-filter:focus { border-color: var(--brand-3); outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,.10); }

/* ---------------- 按钮 / 表单 ---------------- */
button.btn { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; border: none;
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: inherit; box-shadow: 0 3px 10px rgba(11,63,145,.20);
  transition: transform .15s, box-shadow .15s, filter .15s, background .15s; }
button.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(11,63,145,.28); }
button.btn:active { transform: translateY(0); }
button.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
button.btn.secondary { background: #eef2f8; color: #334155; border: 1px solid #e0e7f1; box-shadow: none; }
button.btn.secondary:hover { background: #e2e9f4; filter: none; }
button.btn.ghost { background: #fff; color: var(--brand-2); border: 1px solid #bcd2f2; box-shadow: none; }
button.btn.ghost:hover { background: var(--brand-soft); filter: none; }
button.btn.danger { background: linear-gradient(135deg, #e5484d, #c92127); box-shadow: 0 3px 10px rgba(201,33,39,.18); }
button.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
input, select, textarea { font-family: inherit; font-size: 13px; padding: 8px 10px;
  border: 1px solid #dce4ef; border-radius: 8px; width: 100%; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
/* 自动计算 / 自动带入的只读字段：灰底填充，与可手动输入的白底区分 */
input[readonly], textarea[readonly], select[disabled], input:disabled,
select:disabled, textarea:disabled {
  background: #eef2f7; color: #475569; border-color: #d5dde8; cursor: default;
}
input[readonly]:focus, textarea[readonly]:focus {
  border-color: #d5dde8; box-shadow: none;
}
input[type=file] { padding: 6px; }
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 5px; font-weight: 600; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 160px; }
/* 检验标准：原文上传与「识别原文信息」按钮同一行 */
.std-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.std-upload-row input[type=file] { flex: 1 1 240px; min-width: 0; }
.std-upload-row .btn { flex: 0 0 auto; white-space: nowrap; }
/* 其他费用：可重复物品/服务明细行 */
.oe-items-head { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 4px 0 8px; }
.oe-items-title { font-size: 12px; color: var(--muted); font-weight: 600; }
.oe-item-row { border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; margin-bottom: 8px; background: #fafcff; }
.oe-item-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; }
.oe-item-row .field { margin-bottom: 8px; }
.oe-item-row .row { gap: 8px; }
.oe-item-row .row .field { min-width: 120px; margin-bottom: 0; }
.oe-total-row { margin: 2px 0 8px; }
.oe-total-row .field input[readonly] { font-weight: 600; }
/* 供应商联系人：每个联系人一行（姓名/电话/邮箱/职位/备注/删除），姓名与职位较窄 */
.contact-item { border: 1px solid var(--border); border-radius: 9px; padding: 7px 9px;
  margin-bottom: 7px; background: #fafcff; }
.contact-item .row { gap: 6px; flex-wrap: nowrap; align-items: center; }
.contact-item .row input { min-width: 0; }
.contact-item .row .btn { flex: 0 0 auto; }

/* ---------------- 弹窗 ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(8,22,48,.55); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; z-index: 50;
  padding: 34px 12px; overflow-y: auto; }
.modal-mask.show { display: flex; animation: fadeIn .18s ease; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 880px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: popIn .22s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; position: relative;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfdff, #f4f8ff); }
.modal-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand-3), var(--brand)); }
.modal-head h3 { margin: 0; font-size: 16px; color: var(--ink); font-weight: 700; }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--border); background: #fbfcfe;
  display: flex; justify-content: flex-end; gap: 10px; }
.x { cursor: pointer; font-size: 20px; color: var(--muted); border: none; background: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-12px) scale(.985); }
                   to { opacity: 1; transform: none; } }

/* ---------------- 标签 / 徽标 / 提示 ---------------- */
.tabs { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 15px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  background: #fff; font-size: 13px; color: var(--muted); transition: background .15s, color .15s; }
.tab:hover { background: var(--brand-soft); color: var(--brand); }
.tab.active { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff;
  border-color: transparent; font-weight: 600; box-shadow: 0 3px 10px rgba(11,63,145,.18); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.muted { background: #e5e7eb; color: #374151; }
/* 超期未支付：比普通 danger 更醒目的红底白字，列表里一眼可见 */
.badge.overdue { background: #dc2626; color: #fff; box-shadow: 0 1px 5px rgba(220,38,38,.28); }
.link { color: var(--primary); cursor: pointer; text-decoration: underline; }
/* 发票处理表单：状态区与支付信息之间的分隔线 */
hr.sec-line { border: 0; border-top: 1px dashed var(--border); margin: 14px 0 12px; }
.muted { color: var(--muted); }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: linear-gradient(135deg, #16233a, #0f172a); color: #fff; padding: 11px 20px;
  border-radius: 10px; z-index: 99; opacity: 0; transition: opacity .2s, transform .2s;
  box-shadow: 0 10px 30px rgba(0,0,0,.28); font-size: 13px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sub-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.sub-table th, .sub-table td { border: 1px solid var(--border); padding: 6px 8px; font-size: 12px; }
.sub-table th { background: #f7faff; }
.upload-row { display: flex; align-items: center; gap: 8px; }
.file-link { color: var(--primary); text-decoration: underline; font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); margin: 5px 0 10px; line-height: 1.7; }
.alert { padding: 11px 15px; border-radius: 9px; margin-bottom: 12px; font-size: 13px; border: 1px solid transparent; }
.alert.danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert.ok { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

/* ---------------- 检验报告：样品分组区块与多报告文件 ---------------- */
.rep-sample-sec { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; margin: 10px 0; background: #fbfcff; }
.rep-sample-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rep-sample-head .repSampleName { font-weight: 600; }
.rep-block { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  margin: 10px 0; background: #fbfcff; box-shadow: 0 1px 2px rgba(16,42,89,.03); }
.rep-block-head { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.rep-block-head .field { margin: 0; }
.rep-block-head .repBlockNo { min-width: 180px; }
.rep-block-head .repBlockDate { min-width: 150px; }
.rep-block-head .repQualSel { min-width: 110px; }
.rep-file-area { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #dbe4f0; }
.rep-file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; background: #eaf1fc; color: #0b3f91;
  border: 1px solid #cfdef7; border-radius: 12px; padding: 2px 8px; font-size: 12px; }
.file-chip a { color: #0b3f91; text-decoration: underline; }
.chip-x { border: none; background: transparent; color: #6b7280; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.chip-x:hover { color: #ef4444; }

/* ---------------- 汇总看板：统计卡片 / 图表 ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 18px 15px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .18s, box-shadow .18s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16,42,89,.11); }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-3), var(--brand)); }
.stat-card.tone-indigo::before { background: linear-gradient(90deg, #6366f1, #4338ca); }
.stat-card.tone-green::before { background: linear-gradient(90deg, #34d399, #059669); }
.stat-card.tone-amber::before { background: linear-gradient(90deg, #fbbf24, #d97706); }
.stat-ico { position: absolute; right: 16px; top: 14px; width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-soft); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.tone-indigo .stat-ico { background: #eef0ff; }
.tone-green .stat-ico { background: #e7f8ef; }
.tone-amber .stat-ico { background: #fff5e0; }
.stat-val { font-size: 26px; font-weight: 800; color: var(--brand); letter-spacing: -.5px;
  font-variant-numeric: tabular-nums; }
.tone-indigo .stat-val { color: #4338ca; }
.tone-green .stat-val { color: #059669; }
.tone-amber .stat-val { color: #b45309; }
.stat-title { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 600; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-bottom: 18px; }
.chart-box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); }
.chart-title { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; color: var(--ink);
  display: flex; align-items: center; gap: 8px; }
.chart-title::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--brand-3); }
/* 看板两组统计的分组标题（第三方 / 其他费用，口径独立） */
.dash-group { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 11px;
  font-size: 15px; font-weight: 700; color: var(--ink); }
.dash-group::before { content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: var(--brand-3); align-self: center; }
.dash-group.alt::before { background: #8b5cf6; }
.dash-group small { font-size: 12px; font-weight: 500; color: var(--muted); }
/* 甜甜圈饼图：4 列自适应，图例与数值对齐 */
.chart-grid.pie-grid { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.pie-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pie-wrap svg { flex: 0 0 auto; }
.pie-legend { list-style: none; margin: 0 auto; padding: 0; flex: 0 1 215px;
  width: 215px; max-width: 100%; font-size: 12px; }
.pie-legend li { display: flex; align-items: center; gap: 6px; padding: 5px 0;
  border-bottom: 1px dashed #eef2f7; }
.pie-legend li:last-child { border-bottom: none; }
.pie-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.pie-label { flex: 1 1 auto; color: #334155; white-space: nowrap; }
.pie-val { color: #0f172a; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pie-pct { color: #94a3b8; min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 检验标准：标准名称 / 查新提示 ---------------- */
.std-name { min-width: 220px; max-width: 460px; white-space: normal; word-break: break-word; line-height: 1.5; }
/* 查新确认提醒（系统启动时全局提示，可点 × 关闭） */
.std-alert { line-height: 1.8; margin: 10px 0; position: relative; padding-right: 34px; }
.std-alert-x { position: absolute; top: 5px; right: 9px; border: none; background: transparent;
  color: inherit; opacity: .6; font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.std-alert-x:hover { opacity: 1; }
.std-alert-list { margin-top: 6px; font-size: 13px; }
.std-alert-list > div { margin: 2px 0; }
.global-std-alert { margin-top: 4px; }
.global-std-alert .btn { margin-left: 10px; vertical-align: middle; }
/* 标准管理：查新周期状态条 / 版本信息 / 备注 */
.std-check-bar { background: #f8fbff; border: 1px solid var(--border);
  border-left: 4px solid var(--brand-3); border-radius: 9px;
  padding: 9px 13px; margin-bottom: 12px; font-size: 13px; color: #334155; line-height: 1.8; }
.std-check-cycle { color: var(--muted); font-size: 12px; }
/* 历史查新记录弹窗表格：列内容不换行，过长的报告文件名省略显示 */
table.grid.std-history th, table.grid.std-history td { white-space: nowrap; }
table.grid.std-history .file-link { display: inline-block; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.std-note { max-width: 220px; white-space: normal; word-break: break-word; }
.danger-text { color: #dc2626; font-weight: 700; }

/* ---------------- 委托书：标准手动输入 + 推荐 ---------------- */
.std-cell { min-width: 230px; }
.std-input.std-invalid, .sup-input.std-invalid { border-color: var(--danger); background: #fff7f7; }
.std-warn, .sup-warn { color: var(--danger); font-size: 11px; margin-top: 3px; line-height: 1.35; white-space: normal; }
.std-suggest { position: fixed; z-index: 120; max-height: 260px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 12px 30px rgba(15,23,42,.18); padding: 4px 0; }
.std-sg-item { padding: 7px 11px; cursor: pointer; font-size: 12px; line-height: 1.4; }
.std-sg-item:hover, .std-sg-item.active { background: #e8f0fe; }
.std-sg-item b { color: var(--text); }
.std-sg-cat { margin-left: 8px; color: var(--primary); font-size: 11px; }
.std-sg-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ---------------- 模块统计行 / 项目进度条 ---------------- */
.stat-line { background: linear-gradient(90deg, #f2f7ff, #fff); border: 1px solid #e0eaf8;
  border-left: 4px solid var(--brand-3); border-radius: 9px;
  padding: 10px 15px; margin: -2px 0 15px; font-size: 13px; color: var(--text); }
.stat-line b { color: var(--brand); font-size: 15px; font-weight: 700; margin: 0 2px; }
.prog { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.prog-track { flex: 1; height: 8px; background: #e9edf2; border-radius: 5px; overflow: hidden; }
.prog-fill { display: block; height: 100%; border-radius: 5px; }
.prog-fill.ok { background: var(--ok); }
.prog-fill.warn { background: var(--warn); }
.prog-fill.muted { background: #94a3b8; }
.prog span { font-size: 12px; color: var(--muted); min-width: 34px; text-align: right; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .sidebar { width: 204px; }
  .main { padding: 0 18px 28px; }
  .topbar { margin: 0 -18px 16px; padding: 0 18px; }
  .brand-logo { width: 56px; height: 48px; }
  .brand-name { font-size: 12.5px; }
}
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-wrap: wrap; }
  .brand { width: 100%; padding: 8px 14px; }
  .brand-logo { width: 46px; height: 40px; margin: 0 auto 4px; }
  .nav { display: flex; flex-wrap: wrap; width: 100%; padding: 6px; }
  .sidebar .nav-item { padding: 6px 9px; font-size: 12px; }
  .side-foot { width: 100%; display: flex; gap: 10px; align-items: center; padding: 8px; }
  .help-btn { width: auto; }
  .clock-card { margin-top: 0; flex: 1; padding: 5px 10px; }
  .clock-time { font-size: 17px; }
  .main { padding: 0 14px 26px; }
  .topbar { margin: 0 -14px 14px; padding: 0 14px; }
  .topbar-company { display: none; }
}

/* 极矮窗口（如浏览器窗口被缩到很扁）：进一步压缩侧栏，避免导航出现滚动条 */
@media (min-width: 821px) and (max-height: 640px) {
  .brand { padding: 6px 10px 5px; }
  .brand-logo { width: 44px; height: 38px; margin-bottom: 4px; padding: 4px; }
  .brand-name { font-size: 12px; line-height: 1.25; }
  .nav { padding: 3px 7px; }
  .sidebar .nav-item { padding: 4px 10px; margin: 0; font-size: 12.5px; }
  .nav-item .ni { width: 18px; height: 18px; font-size: 11px; }
  .side-foot { padding: 5px 9px 6px; }
  .help-btn { padding: 5px 9px; }
  .help-btn .ni { width: 18px; height: 18px; }
  .clock-card { margin-top: 5px; padding: 4px 10px 5px; }
  .clock-date { font-size: 10px; }
  .clock-time { font-size: 16px; margin: 0; line-height: 1.25; letter-spacing: 1px; }
  .clock-week { display: none; }
}

/* ==========================================================================
   账号登录 / 权限 / 管理员后台
   ========================================================================== */
/* 页面状态：未判定前先隐藏主系统，避免未登录时闪现业务界面 */
body.auth-pending .layout { display: none; }
body.auth-pending::after {
  content: "正在检查登录状态…"; position: fixed; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 14px; color: var(--muted);
  background: var(--bg); z-index: 999;
}
body.auth-anonymous .layout, body.auth-force .layout { display: none; }
body.auth-anonymous #loginScreen, body.auth-force #forcePwdScreen { display: flex; }
body.auth-logged-in #loginScreen, body.auth-logged-in #forcePwdScreen { display: none; }

.auth-screen {
  /* 低于 .modal-mask(50)，否则注册 / 忘记密码弹窗会被登录页盖住 */
  display: none; position: fixed; inset: 0; z-index: 40; flex-direction: column;
  overflow: auto; color: var(--text);
  background: radial-gradient(circle at 18% 12%, #dce9ff 0, transparent 38%),
              radial-gradient(circle at 88% 88%, #e3f0ff 0, transparent 40%), #f4f7fb;
}
.auth-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 34px; flex-shrink: 0;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; color: var(--brand); text-decoration: none; cursor: pointer; }
.auth-brand:hover span { color: var(--brand-2, var(--brand)); text-decoration: underline; }
.auth-brand img { width: 40px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; box-shadow: var(--shadow); }
.auth-admin-link {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--brand); font-size: 13px; font-weight: 600;
  text-decoration: none; box-shadow: var(--shadow);
}
.auth-admin-link:hover { background: var(--brand-soft); border-color: var(--brand-3); }
.auth-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 64px; padding: 12px 34px 28px; flex-wrap: wrap;
}
.auth-intro { max-width: 400px; }
.auth-intro h1 { margin: 0 0 14px; font-size: 38px; line-height: 1.32; letter-spacing: 2px; color: var(--brand); font-weight: 800; }
.auth-intro p { margin: 0 0 26px; font-size: 15px; color: var(--muted); }
.auth-points { display: grid; gap: 11px; font-size: 13px; color: var(--text); }
.auth-points div { display: flex; align-items: center; gap: 10px; }
.auth-points span { width: 30px; height: 30px; border-radius: 9px; background: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); font-size: 15px; }
.auth-card {
  width: 100%; max-width: 390px; background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 30px 30px 24px; box-shadow: 0 20px 55px rgba(8,28,66,.14);
}
.auth-card h2 { margin: 0 0 4px; font-size: 21px; color: var(--ink); font-weight: 700; }
.auth-desc { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.auth-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.auth-label > input, .auth-label > select { display: block; width: 100%; margin-top: 6px; height: 40px; font-size: 14px; }
.captcha-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.captcha-row input { flex: 1; min-width: 0; height: 40px; margin: 0; }
.captcha-img {
  width: 132px; height: 44px; border: 1px solid var(--border); border-radius: 8px;
  background: #f8fbff; cursor: pointer; object-fit: contain; flex-shrink: 0;
}
.captcha-img:hover { border-color: var(--brand-3); }
.modal-captcha { align-self: flex-end; margin-bottom: 12px; }
.auth-submit { width: 100%; height: 42px; font-size: 15px; font-weight: 700; margin-top: 4px; }
.auth-links { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 13px; }
.auth-links a { color: var(--primary); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-links span { color: #cbd5e1; }
.auth-note { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.auth-err { min-height: 18px; margin: -4px 0 8px; font-size: 12.5px; color: var(--danger); font-weight: 600; }
.auth-footer { flex-shrink: 0; text-align: center; padding: 14px; font-size: 11.5px; color: var(--muted); }
.beian-line { margin-top: 7px; font-size: 13px; }
.force-screen { align-items: center; justify-content: center; }
.force-screen .auth-card { max-width: 430px; }
.modal.modal-sm { max-width: 500px; }
.readonly-tag { font-size: 12.5px; color: var(--muted); background: var(--brand-soft);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; }

/* 顶栏用户信息 */
.topbar-user { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px;
  border: 1px solid var(--border); border-radius: 22px; background: #fff; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta b { font-size: 12.5px; color: var(--ink); }
.user-meta small { font-size: 10.5px; color: var(--muted); }

/* 管理员后台布局 */
body.admin-anonymous #adminLogin, body.admin-force #adminForce { display: flex; }
body.admin-logged-in #adminConsole { display: flex; }
.admin-layout { display: none; min-height: 100vh; }
.admin-side {
  width: 224px; flex-shrink: 0; background: linear-gradient(165deg, #0a3273, #052353);
  color: #c7d7f0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-side-brand img { width: 40px; height: 36px; object-fit: contain; background: #fff;
  border-radius: 8px; padding: 3px; }
.admin-side-brand b { display: block; color: #fff; font-size: 14px; }
.admin-side-brand small { color: #9fb8df; font-size: 10.5px; }
.admin-side nav { flex: 1; padding: 10px 8px; }
.admin-nav-item { padding: 10px 12px; margin: 2px 0; border-radius: 8px; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; gap: 9px; color: #c7d7f0; }
.admin-nav-item:hover { background: rgba(255,255,255,.08); }
.admin-nav-item.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 700; }
.admin-side-foot { padding: 12px; display: grid; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.admin-side-foot .btn { width: 100%; color: #fff; border-color: rgba(255,255,255,.25); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-content { padding: 20px 24px 32px; }
.init-pwd-box { display: grid; gap: 10px; padding: 14px 16px; background: #f8fbff;
  border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.init-pwd-box > div { display: flex; align-items: center; gap: 12px; }
.init-pwd-box .muted { width: 90px; flex-shrink: 0; }
.init-pwd-box code { font-size: 15px; font-weight: 700; color: var(--brand);
  background: #fff; padding: 5px 10px; border: 1px dashed var(--brand-3); border-radius: 6px;
  user-select: all; word-break: break-all; }
.row-role { padding: 4px 6px; font-size: 12px; }
@media (max-width: 900px) {
  .auth-wrap { gap: 24px; }
  .auth-intro { display: none; }
  .topbar-company { display: none; }
  .admin-side { width: 176px; }
}

/* ==========================================================================
   页面不再显示说明性小字；附件改为独立条目
   ========================================================================== */
.hint { display: none !important; }
.attach-row {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 12px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: #f8fbff;
}
.attach-row .file-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-ico { font-size: 15px; flex-shrink: 0; }
.info-line { font-size: 13px; color: var(--ink); margin: 4px 0 10px; }

/* ==========================================================================
   按 NBRL 编号中的年份分组折叠（六个业务列表共用）
   ========================================================================== */
.year-group-row > td {
  padding: 0 !important;
  background: var(--brand-soft, #eef4ff);
  border-top: 2px solid var(--border);
}
.year-group-row.open > td { border-bottom: 1px solid var(--border); }
.year-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 0; background: transparent;
  cursor: pointer; font-size: 14px; color: var(--ink); text-align: left;
}
.year-toggle:hover { background: rgba(10, 50, 115, .06); }
.year-arrow { display: inline-block; width: 14px; color: var(--brand); font-size: 14px; }
.year-count { font-size: 13px; color: var(--muted); }

/* ==========================================================================
   ICP 备案号展示：页脚显著位置 + 链接工信部（合规要求）
   ========================================================================== */
.site-footer {
  margin-top: 22px; padding: 14px 0 0; border-top: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--muted);
}
.beian-link { color: var(--muted); text-decoration: none; }
.beian-link:hover { color: var(--primary); text-decoration: underline; }
.auth-footer .beian-link { font-size: 13px; }
.copyright-line { margin-top: 4px; font-size: 12px; color: var(--muted); }
