/* ==========================================================================
   衡阳市生态环境污染防治资金管理系统 —— 政务浅色主题样式表
   配色：主色深蓝 #1a4a7a / 辅色墨绿 #1f7a5c / 预警红 #c0392b / 提醒黄 #d68910
   ========================================================================== */

/* --------------------------------- 设计变量 --------------------------------- */
:root {
  --c-primary: #1a4a7a;
  --c-primary-dark: #123555;
  --c-primary-light: #2f6ea8;
  --c-primary-soft: #e8f0f8;
  --c-accent: #1f7a5c;
  --c-accent-soft: #e6f4ef;
  --c-danger: #c0392b;
  --c-danger-soft: #fbeceb;
  --c-warn: #d68910;
  --c-warn-soft: #fdf4e3;
  --c-text: #1f2933;
  --c-text-sub: #5b6b7c;
  --c-text-mute: #8a97a5;
  --c-border: #d8e0e8;
  --c-border-strong: #b9c6d3;
  --c-bg: #f4f6f9;
  --c-surface: #ffffff;
  --c-row-hover: #f0f6fc;
  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(26, 74, 122, 0.08);
  --shadow-md: 0 4px 16px rgba(26, 74, 122, 0.14);
  --shadow-lg: 0 12px 40px rgba(18, 53, 85, 0.22);
  --font-cn: "Microsoft YaHei", "微软雅黑", "Source Han Sans CN", "Noto Sans CJK SC",
             "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-num: "Segoe UI", "Microsoft YaHei", Tahoma, sans-serif;
}

/* --------------------------------- 基础重置 --------------------------------- */
* { box-sizing: border-box; }

/* hidden 属性必须压过元素自身的 display 声明（.drawer/.modal 为 flex），
   否则 el.hidden = true 不生效，抽屉与弹窗关闭不掉。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
table { border-collapse: collapse; }

.hidden-file { display: none; }

/* --------------------------------- 顶部标题栏 --------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: linear-gradient(100deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 30;
}

.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

/* 局徽（圆形透明 PNG）：深蓝顶栏上直接呈现，不再垫底色 */
.app-logo-img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: block;
  object-fit: contain;
  background: #fff;               /* 徽标间隙透白，保持制式观感 */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.app-title { font-size: 19px; letter-spacing: 1px; white-space: nowrap; }

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.meta-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 12px;
  white-space: nowrap;
}
/* 空态（无文本）不渲染药丸，避免顶栏出现空白胶囊 / 移动端整行空白带 */
.meta-chip:empty { display: none; }

/* --------------------------------- 按钮 --------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover { background: #eef2f7; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--c-primary-light) 0%, var(--c-primary) 100%);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(26, 74, 122, .28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3a7cb4 0%, var(--c-primary-dark) 100%);
  border-color: var(--c-primary-dark);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.22); }

.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #a32e21; border-color: #a32e21; }

.btn-danger-text { color: #ffd9d4; }
.btn-danger-text:hover { background: rgba(192, 57, 43, 0.35); }

.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }

.icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.08); }

/* --------------------------------- 导航 --------------------------------- */
.app-nav {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 25;
}

.nav-item {
  position: relative;
  padding: 11px 20px;
  font-size: 14px;
  color: var(--c-text-sub);
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.nav-item:hover { color: var(--c-primary); background: var(--c-primary-soft); }
.nav-item.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }

/* --------------------------------- 主区域 --------------------------------- */
.app-main { padding: 18px 24px 28px; min-height: calc(100vh - 190px); }
.view { display: none; }
.view.is-active { display: block; animation: fadeIn .18s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --------------------------------- 面板 --------------------------------- */
.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, #fcfdff 0%, #f4f8fc 100%);
  flex-wrap: wrap;
}

.panel-title { font-size: 15px; color: var(--c-primary); }
.panel-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  background: var(--c-primary);
  border-radius: 2px;
}

.panel-sub { font-size: 12px; color: var(--c-text-mute); }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-label { font-size: 12px; color: var(--c-text-sub); }

.panel-row { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.panel-grow { flex: 1 1 620px; }
.panel-fixed { flex: 0 1 380px; }

.select-sm {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}
.select-sm:focus { outline: none; border-color: var(--c-primary-light); box-shadow: 0 0 0 2px rgba(47, 110, 168, .18); }

/* 分段按钮 */
.seg-group { display: inline-flex; border: 1px solid var(--c-border-strong); border-radius: var(--radius); overflow: hidden; }
.seg-btn {
  height: 30px;
  padding: 0 12px;
  border: none;
  border-right: 1px solid var(--c-border-strong);
  background: #fff;
  font-size: 13px;
  color: var(--c-text-sub);
  cursor: pointer;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--c-primary-soft); }
.seg-btn.is-active { background: var(--c-primary); color: #fff; }

/* --------------------------------- KPI 卡片 --------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kpi-card {
  position: relative;
  padding: 14px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.kpi-card.is-accent { border-left-color: var(--c-accent); }
.kpi-card.is-warn { border-left-color: var(--c-warn); }
.kpi-card.is-danger { border-left-color: var(--c-danger); }

.kpi-label { font-size: 12px; color: var(--c-text-sub); }
.kpi-value {
  margin-top: 4px;
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.25;
  word-break: break-all;
}
.kpi-card.is-accent .kpi-value { color: var(--c-accent); }
.kpi-card.is-warn .kpi-value { color: var(--c-warn); }
.kpi-card.is-danger .kpi-value { color: var(--c-danger); }
.kpi-unit { font-size: 12px; font-weight: 400; color: var(--c-text-mute); margin-left: 3px; }
.kpi-foot { margin-top: 4px; font-size: 12px; color: var(--c-text-mute); }

/* --------------------------------- 图表 --------------------------------- */
/* width:auto + 外边距，保证 clientWidth 就是 SVG 可用宽度，不产生横向溢出 */
.chart-box { width: auto; margin: 10px 12px 4px; overflow-x: auto; }
.chart-box svg { display: block; max-width: 100%; }
.chart-empty { padding: 40px 0; text-align: center; color: var(--c-text-mute); font-size: 13px; }

.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 4px 16px 14px;
  font-size: 12px;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 10px; }
.legend-name { color: var(--c-text-sub); }
.legend-val { font-family: var(--font-num); color: var(--c-text); font-weight: 600; }
.legend-pct { color: var(--c-text-mute); }

.chart-tip {
  position: fixed;
  z-index: 200;
  max-width: 320px;
  padding: 8px 10px;
  background: rgba(18, 53, 85, .95);
  color: #fff;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.7;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.chart-tip b { font-weight: 700; }
.chart-tip .tip-row { display: flex; justify-content: space-between; gap: 12px; }
.chart-tip .tip-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* --------------------------------- 筛选区 --------------------------------- */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 16px;
  padding: 14px 16px 4px;
}
.filter-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-item.is-wide { grid-column: span 2; }
.filter-label { font-size: 12px; color: var(--c-text-sub); }
.filter-item select, .filter-item input {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: #fff;
  width: 100%;
}
.filter-item select:focus, .filter-item input:focus {
  outline: none;
  border-color: var(--c-primary-light);
  box-shadow: 0 0 0 2px rgba(47, 110, 168, .18);
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 10px 16px 14px;
  font-size: 13px;
  color: var(--c-text-sub);
}
.filter-summary .fs-item b {
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--c-primary);
  margin-left: 6px;
}
.filter-summary .fs-item.is-accent b { color: var(--c-accent); }
.filter-summary .fs-item.is-warn b { color: var(--c-warn); }

/* --------------------------------- 表格 --------------------------------- */
.table-scroll { width: 100%; overflow-x: auto; }

.data-table { width: 100%; font-size: 13px; }
/* 项目库 / 数据维护列多：固定列宽布局（配合 HTML <colgroup>），使 1920×1080
   （含 150% 显示缩放下 1280 CSS 宽）整屏不出现横向滚动；列宽由 colgroup 指定，
   多余宽度按比例分配，不足时浏览器自动压缩，绝不产生横向溢出。 */
#table-projects, #table-maintain { table-layout: fixed; }
/* 宽文本列（项目名称）解除原 min-width:240，允许换行收缩，避免顶破固定布局导致横向滚动 */
#table-projects .td-name, #table-maintain .td-name { min-width: 0; white-space: normal; }

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 9px 10px;
  background: #eef3f8;
  border-bottom: 1px solid var(--c-border-strong);
  color: var(--c-primary-dark);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.data-table thead th.is-sortable { cursor: pointer; user-select: none; }
.data-table thead th.is-sortable:hover { background: #e2ebf4; }
.sort-arrow { font-size: 10px; margin-left: 3px; color: var(--c-primary-light); }

.data-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: middle;
  word-break: break-all;
}
.data-table tbody tr:hover { background: var(--c-row-hover); }
.data-table tbody tr.is-clickable { cursor: pointer; }
.data-table tbody tr.is-odd { background: #fafcfe; }
.data-table tbody tr.is-odd:hover { background: var(--c-row-hover); }

.td-num { font-family: var(--font-num); text-align: right; white-space: nowrap; }
.td-center { text-align: center; white-space: nowrap; }
.td-name { min-width: 240px; }
.td-ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.table-empty { padding: 44px 0; text-align: center; color: var(--c-text-mute); }

/* 标签 */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.tag-blue { background: var(--c-primary-soft); color: var(--c-primary); }
.tag-green { background: var(--c-accent-soft); color: var(--c-accent); }
.tag-red { background: var(--c-danger-soft); color: var(--c-danger); }
.tag-yellow { background: var(--c-warn-soft); color: var(--c-warn); }
.tag-gray { background: #eef1f5; color: var(--c-text-sub); }

/* 执行率进度条 */
.rate-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.rate-bar {
  position: relative;
  width: 56px;
  height: 7px;
  border-radius: 4px;
  background: #e9eef4;
  overflow: hidden;
  flex: 0 0 56px;
}
.rate-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.rate-fill-high { background: var(--c-accent); }
.rate-fill-mid { background: var(--c-warn); }
.rate-fill-low { background: var(--c-danger); }
.rate-text { font-family: var(--font-num); min-width: 44px; text-align: right; }
.rate-text.is-high { color: var(--c-accent); font-weight: 600; }
.rate-text.is-mid { color: var(--c-warn); font-weight: 600; }
.rate-text.is-low { color: var(--c-danger); font-weight: 600; }

.row-actions { display: flex; gap: 6px; justify-content: center; }

/* --------------------------------- 分页 --------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--c-border);
  background: #fbfcfe;
  font-size: 13px;
  color: var(--c-text-sub);
  flex-wrap: wrap;
}
.pager-info b { font-family: var(--font-num); color: var(--c-text); }
.pager-ctrl { display: flex; align-items: center; gap: 6px; }
.page-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.page-btn:hover:not(:disabled) { border-color: var(--c-primary-light); color: var(--c-primary); }
.page-btn.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

/* --------------------------------- 抽屉 --------------------------------- */
.drawer-mask, .modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(18, 40, 66, .38);
  z-index: 90;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 92vw;
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }

.drawer-head, .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, #fbfdff, #f4f8fb);
}
.drawer-title, .modal-title { font-size: 16px; color: var(--c-primary); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.drawer-foot, .modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--c-border);
  background: #fbfcfe;
}
.modal-foot { justify-content: space-between; }
.form-error { color: var(--c-danger); font-size: 12px; flex: 1; }

/* 详情字段表 */
.detail-group { margin-bottom: 14px; }
.detail-group-title {
  font-size: 13px;
  color: var(--c-primary);
  padding: 6px 0 6px 8px;
  border-left: 4px solid var(--c-primary);
  background: var(--c-primary-soft);
  margin-bottom: 8px;
}
.detail-grid { display: grid; grid-template-columns: 120px 1fr; gap: 1px; background: var(--c-border); border: 1px solid var(--c-border); }
.detail-grid dt { padding: 7px 10px; background: #f7fafc; font-size: 12px; color: var(--c-text-sub); }
.detail-grid dd { padding: 7px 10px; background: #fff; font-size: 13px; margin: 0; word-break: break-all; }
.detail-grid dd.is-num { font-family: var(--font-num); text-align: right; }

/* 资金执行进度条（详情） */
.progress-panel {
  padding: 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fbfcfe;
  margin-bottom: 14px;
}
.progress-panel-title { font-size: 13px; color: var(--c-text-sub); margin-bottom: 8px; }
.progress-track {
  position: relative;
  height: 22px;
  border-radius: 11px;
  background: #e9eef4;
  overflow: hidden;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--c-primary-light), var(--c-primary));
  border-radius: 11px;
  transition: width .3s ease;
}
.progress-fill.is-high { background: linear-gradient(90deg, #3aa17b, var(--c-accent)); }
.progress-fill.is-mid { background: linear-gradient(90deg, #e8a63a, var(--c-warn)); }
.progress-fill.is-low { background: linear-gradient(90deg, #d9584a, var(--c-danger)); }
.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-text-sub);
}
.progress-meta b { font-family: var(--font-num); color: var(--c-text); }

/* --------------------------------- 弹窗表单 --------------------------------- */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 860px;
  max-width: 94vw;
  max-height: 88vh;
  background: var(--c-surface);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.modal-body { flex: 1; overflow-y: auto; padding: 14px 16px; }

.form-section { margin-bottom: 12px; }
.form-section-title {
  font-size: 13px;
  color: var(--c-primary);
  padding: 5px 0 5px 8px;
  border-left: 4px solid var(--c-primary);
  background: var(--c-accent-soft);
  margin-bottom: 10px;
}
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.form-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form-field.is-wide { grid-column: span 3; }
.form-field.is-half { grid-column: span 2; }
.form-field label { font-size: 12px; color: var(--c-text-sub); }
.form-field label .req { color: var(--c-danger); margin-left: 2px; }
.form-field input, .form-field select, .form-field textarea {
  height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: #fff;
  width: 100%;
}
.form-field textarea { height: 62px; resize: vertical; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--c-primary-light);
  box-shadow: 0 0 0 2px rgba(47, 110, 168, .18);
}
.form-field.has-error input, .form-field.has-error select { border-color: var(--c-danger); background: var(--c-danger-soft); }
.form-tip { font-size: 11px; color: var(--c-text-mute); }

/* --------------------------------- Toast --------------------------------- */
.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  padding: 9px 20px;
  border-radius: 20px;
  background: rgba(18, 53, 85, .94);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: toastIn .2s ease;
}
.toast.is-error { background: rgba(160, 40, 30, .95); }
.toast.is-success { background: rgba(24, 97, 71, .95); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* --------------------------------- 页脚 --------------------------------- */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  font-size: 12px;
  color: var(--c-text-mute);
  flex-wrap: wrap;
}

/* --------------------------------- 批量导入 --------------------------------- */
.modal-wide { width: 1040px; max-width: 96vw; }
.import-summary { font-size: 13px; color: var(--c-text-sub); margin-bottom: 10px; }
.import-line { margin: 0 0 4px; line-height: 1.7; }
.import-line b { color: var(--c-text); }
.ok-text { color: var(--c-accent); font-weight: 600; }
.err-text { color: var(--c-danger); font-weight: 600; }
#table-import tr.is-error-row td { background: var(--c-danger-soft); }
#table-import td { font-size: 12.5px; }
#import-modal .table-scroll { max-height: 46vh; }

.footer-access { font-size: 12px; color: var(--c-text-mute); }
.footer-access.is-online { color: var(--c-accent); font-weight: 600; }

/* 数据更新年月（云端 updated_at 最新值） */
.footer-stamp { font-size: 12px; color: var(--c-text-mute); font-weight: 600; }

/* 详情抽屉：数据更新年月信息条 */
.drawer-stamp {
  margin: -6px 0 14px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--c-text-sub);
  background: var(--c-primary-soft);
  border-left: 3px solid var(--c-primary);
  border-radius: 0 4px 4px 0;
}

/* --------------------------------- 分析报告 --------------------------------- */
.report-scroll { max-height: calc(100vh - 260px); overflow-y: auto; padding: 4px 2px 10px; }

.report-doc { max-width: 1000px; margin: 0 auto; background: #fff; }
.rp-title {
  font-size: 20px;
  text-align: center;
  color: var(--c-primary);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.rp-sub { text-align: center; font-size: 12px; color: var(--c-text-sub); margin-bottom: 4px; }
.rp-meta {
  text-align: center;
  font-size: 12px;
  color: var(--c-text-mute);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--c-primary);
  margin-bottom: 14px;
}
.rp-h2 {
  font-size: 16px;
  color: var(--c-primary);
  padding: 6px 0 6px 10px;
  border-left: 4px solid var(--c-primary);
  background: var(--c-primary-soft);
  margin: 20px 0 10px;
}
.rp-p {
  font-size: 14px;
  line-height: 1.9;
  text-indent: 2em;
  text-align: justify;
  margin-bottom: 10px;
}
.rp-table-title { font-size: 13px; font-weight: 600; color: var(--c-text-sub); margin: 12px 0 6px; }
.rp-table { width: 100%; font-size: 13px; margin-bottom: 10px; }
.rp-table th, .rp-table td { border: 1px solid var(--c-border); padding: 6px 8px; }
.rp-table th { background: #eef4fa; color: var(--c-primary-dark); font-weight: 600; white-space: nowrap; }
.rp-table td.pnum { text-align: right; font-family: var(--font-num); white-space: nowrap; }
.rp-table tbody tr:nth-child(even) td { background: #fafcfd; }
.rp-empty { text-align: center; color: var(--c-text-mute); }
.rp-list, .rp-ol { margin: 0 0 10px; padding-left: 24px; }
.rp-list li, .rp-ol li { font-size: 14px; line-height: 1.9; margin-bottom: 8px; text-align: justify; }
.rp-ol li { padding-left: 4px; }
.rp-foot {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px dashed var(--c-border-strong);
  font-size: 12px;
  color: var(--c-text-mute);
}

/* --------------------------------- 打印 --------------------------------- */
.print-only { display: none; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }

  html, body { background: #fff; font-size: 11px; }
  .app-header, .app-nav, .app-footer, .view, .drawer, .drawer-mask,
  .modal, .modal-mask, .toast, .chart-tip { display: none !important; }

  .app-main { padding: 0; min-height: 0; }
  .print-only { display: block !important; }

  .print-report { font-family: var(--font-cn); color: #000; }
  .print-report h1 { font-size: 17px; text-align: center; margin-bottom: 4px; }
  .print-report .pr-sub { text-align: center; font-size: 11px; color: #444; margin-bottom: 10px; }
  .print-report .pr-cond {
    border: 1px solid #999;
    padding: 5px 8px;
    font-size: 10px;
    margin-bottom: 8px;
    line-height: 1.7;
  }
  .print-report table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 9.5px; }
  .print-report th, .print-report td { border: 1px solid #666; padding: 3px 5px; }
  .print-report th { background: #e8eef5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-report td.pnum { text-align: right; font-family: var(--font-num); white-space: nowrap; }
  .print-report .pr-section-title { font-size: 12px; font-weight: 700; margin: 10px 0 5px; }
  .print-report .pr-foot { margin-top: 10px; font-size: 10px; display: flex; justify-content: space-between; }
  .print-report tr { page-break-inside: avoid; }

  /* 分析报告打印：A4 纵向，公文式排版 */
  #report-print .report-doc { max-width: 100%; color: #000; }
  #report-print .rp-title { font-size: 17px; }
  #report-print .rp-meta { border-bottom: 1px solid #333; }
  #report-print .rp-h2 {
    font-size: 13px;
    background: #e8eef5 !important;
    border-left: 4px solid #1a4a7a;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #report-print .rp-p, #report-print .rp-list li, #report-print .rp-ol li { font-size: 11px; line-height: 1.7; }
  #report-print .rp-table { font-size: 9.5px; }
  #report-print .rp-table th, #report-print .rp-table td { border: 1px solid #666; padding: 3px 5px; }
  #report-print .rp-table th { background: #e8eef5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #report-print tr { page-break-inside: avoid; }
  #report-print .rp-h2 { page-break-after: avoid; }
}

/* --------------------------------- 响应式 --------------------------------- */
@media (max-width: 1500px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .panel-fixed { flex: 1 1 100%; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-field.is-wide { grid-column: span 2; }
}
@media (max-width: 900px) {
  .app-header { flex-wrap: wrap; }
  .kpi-grid, .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.is-wide, .form-field.is-half { grid-column: span 1; }
}

/* --------- 移动端 / 窄屏适配（手机浏览器、平板竖屏） --------- */
@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }
  a, button, .nav-item, .seg-btn, .page-btn { -webkit-tap-highlight-color: transparent; }

  /* 顶栏：竖向堆叠，操作按钮可换行 */
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px;
  }
  .header-left { gap: 10px; }
  .app-logo-img { width: 28px; height: 28px; flex: 0 0 28px; }
  .app-title { font-size: 15px; line-height: 1.35; }
  .header-right { flex-wrap: wrap; gap: 6px; }
  .header-right .btn, .header-right label.btn { padding: 6px 10px; font-size: 12px; }
  .meta-chip { width: 100%; font-size: 11px; }

  /* 导航：横向滑动，触摸友好 */
  .app-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 0 10px;
    scrollbar-width: none;
  }
  .app-nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 10px 13px; font-size: 13px; flex: 0 0 auto; }

  .app-main { padding: 10px 10px 22px; min-height: 0; }

  /* KPI 与面板：两列 / 单列 */
  .kpi-grid, .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .panel { padding: 10px; margin-bottom: 12px; }
  .panel-row { flex-direction: column; gap: 12px; }
  .panel-grow, .panel-fixed { flex: 1 1 100%; }
  .panel-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .panel-tools { width: 100%; }
  .panel-title { font-size: 14px; }
  .panel-sub { display: none; }

  /* 图表：压低高度，仍可横向滚动 */
  .chart-box { margin: 8px 4px 4px; }
  .chart-box svg { max-width: 100%; height: auto; }
  .donut-legend { padding: 0 6px; }

  /* 筛选与表格 */
  .filter-grid { grid-template-columns: 1fr; gap: 8px; }
  .filter-item.is-wide { grid-column: span 1; }
  .table-scroll { margin: 0 -4px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 6px 7px; white-space: nowrap; }
  .data-table td.td-name { white-space: normal; min-width: 180px; }

  /* 详情抽屉 / 弹窗：全屏化 */
  .drawer { width: 100vw; max-width: 100vw; }
  .detail-grid { grid-template-columns: 96px 1fr; }
  .modal { width: 96vw; max-width: 96vw; max-height: 92vh; top: 4vh; transform: none; left: 2vw; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.is-wide, .form-field.is-half { grid-column: span 1; }
  .modal-foot { flex-wrap: wrap; gap: 6px; }

  /* 统计分析 / 分组按钮 */
  .seg-group { flex-wrap: wrap; }
  .seg-btn { padding: 6px 10px; font-size: 12px; }
  .pager { flex-wrap: wrap; gap: 6px; }
  .page-btn { padding: 5px 9px; }

  /* 分析报告 */
  .report-scroll { max-height: none; overflow: visible; }
  .report-doc { padding: 0 2px; }
  .rp-title { font-size: 17px; }
  .rp-p, .rp-list li, .rp-ol li { font-size: 13px; line-height: 1.8; }
  .rp-table { font-size: 11.5px; display: block; overflow-x: auto; }
  .rp-table th, .rp-table td { padding: 4px 6px; white-space: nowrap; }

  /* 导入预览 / 页脚 */
  #import-modal .table-scroll { max-height: 42vh; }
  .app-footer { flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 14px; }
}
@media (max-width: 480px) {
  .kpi-grid, .kpi-grid-4 { grid-template-columns: 1fr; }
  .app-title { font-size: 14px; }
  .rp-table { font-size: 11px; }
  .detail-grid { grid-template-columns: 84px 1fr; }
  /* 登录 / 弹窗面板：窄屏内边距与标题收紧 */
  .login-panel { padding: 28px 20px 22px; }
  .login-title { font-size: 16px; }
}

/* ============================ 登录界面 ============================ */
/* 背景（径向高光 + 渐变）统一定义在文末「美化增强 v2」段，此处不重复声明 */
.login-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-mask[hidden] { display: none !important; }
/* 对话框变体：半透明遮罩，保留系统界面可见性（修改密码 / 添加账号） */
.login-mask.is-dialog { background: rgba(10, 34, 55, .55); }
.login-panel {
  width: 100%; max-width: 380px; max-height: calc(100vh - 40px); overflow: auto;
  background: #fff; border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; align-items: center;
}
.login-logo { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 12px; }
.login-title { font-size: 18px; color: #14406b; text-align: center; margin: 0 0 4px; line-height: 1.4; }
.login-sub { font-size: 12px; color: #8a97a5; margin: 0 0 20px; }
.login-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid #cfd8e0; border-radius: 8px;
  font-size: 14px; outline: none;
}
.login-input:focus { border-color: #17618f; box-shadow: 0 0 0 2px rgba(23, 97, 143, .15); }
.login-btn { width: 100%; padding: 10px 0; font-size: 15px; margin-top: 4px; }
/* 白底弹窗内的次按钮（取消）：浅灰描边深灰字，替代深色顶栏用的 btn-ghost */
.btn.login-btn-ghost {
  background: #fff;
  border-color: #c3cdd6;
  color: #5a6a78;
}
.btn.login-btn-ghost:hover { background: #f0f4f7; border-color: #9fb0bd; }
/* 账号管理弹窗（宽面板 + 表格滚动） */
.login-panel.acct-panel { max-width: 760px; }
.acct-table-wrap { width: 100%; max-height: 46vh; overflow: auto; border: 1px solid #dfe6ec; border-radius: 8px; }
.acct-table { width: 100%; }
.acct-table th, .acct-table td { padding: 7px 10px; font-size: 13px; text-align: left; white-space: nowrap; }
.acct-table td.acct-actions { white-space: nowrap; }
.acct-mini-btn {
  border: 1px solid #c3cdd6; background: #fff; color: #17618f;
  border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer; margin-right: 6px;
}
.acct-mini-btn:hover { background: #eef4f8; border-color: #17618f; }
.acct-mini-btn.acct-del { color: #c0392b; }
.acct-mini-btn.acct-del:hover { background: #fdf0ee; border-color: #c0392b; }
/* 账号管理弹窗：工具行 + 添加账号折叠表单 */
.acct-toolbar { width: 100%; display: flex; justify-content: flex-end; margin-bottom: 0.8em; }
#acct-add-form {
  width: 100%; background: var(--color-highlight, #eef3f8);
  border: 1px solid var(--color-border, #c9d3dc); border-radius: 8px;
  padding: 0.9em 1em; margin-bottom: 0.9em;
}
#acct-add-form[hidden] { display: none !important; }
.login-error { min-height: 18px; margin-top: 10px; font-size: 12px; color: #d64541; text-align: center; }

/* ==========================================================================
   美化增强（2026-10 v2）—— 视觉质感统一提升，不改任何结构与交互逻辑
   ========================================================================== */

/* 页面底色：纵向微渐变，弱化大面积纯色的平板感 */
body {
  background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%) fixed;
}

/* 顶栏：底缘高光线，层次更分明 */
.app-header {
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .14), var(--shadow-sm);
}

/* 主按钮：微渐变 + 轻投影（已合并至上方 `.btn-primary` 基础定义，此处不再重复） */

/* KPI 卡片：悬浮上浮 + 数字等宽对齐 */
.kpi-card {
  border-radius: 8px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi-value { font-variant-numeric: tabular-nums; }

/* 面板：圆角提升 + 悬浮投影 */
.panel { border-radius: 8px; transition: box-shadow .18s ease; }
.panel:hover { box-shadow: 0 4px 18px rgba(26, 74, 122, .10); }
/* 面板头背景（已合并至上方 `.panel-head` 基础定义，此处不再重复） */

/* 导航：下划线滑入动画 */
.nav-item::after {
  content: "";
  position: absolute;
  left: 20px; right: 20px; bottom: -1px;
  height: 2px;
  background: var(--c-primary);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform .18s ease;
}
.nav-item:hover::after { transform: scaleX(.6); }
.nav-item.is-active { border-bottom-color: transparent; }
.nav-item.is-active::after { transform: scaleX(1); }

/* 表格：表头微渐变 + 行背景过渡 */
.data-table thead th { background: linear-gradient(180deg, #f0f5fa 0%, #e9f0f7 100%); }
.data-table tbody td { transition: background .12s ease; }

/* 滚动条细化（WebKit 内核） */
.table-scroll::-webkit-scrollbar,
.report-scroll::-webkit-scrollbar,
.acct-table-wrap::-webkit-scrollbar,
.chart-box::-webkit-scrollbar { height: 8px; width: 8px; }
.table-scroll::-webkit-scrollbar-thumb,
.report-scroll::-webkit-scrollbar-thumb,
.acct-table-wrap::-webkit-scrollbar-thumb,
.chart-box::-webkit-scrollbar-thumb { background: #c6d2de; border-radius: 4px; }
.table-scroll::-webkit-scrollbar-thumb:hover,
.report-scroll::-webkit-scrollbar-thumb:hover { background: #a9b9c9; }
.table-scroll::-webkit-scrollbar-track,
.report-scroll::-webkit-scrollbar-track,
.acct-table-wrap::-webkit-scrollbar-track,
.chart-box::-webkit-scrollbar-track { background: transparent; }

/* Toast：投影增强 + 补充警告色（原仅 error/success） */
.toast { box-shadow: 0 6px 20px rgba(18, 53, 85, .35); }
.toast.is-warn { background: rgba(178, 108, 10, .95); }

/* 键盘可达性：焦点可见 */
:focus-visible { outline: 2px solid var(--c-primary-light); outline-offset: 1px; }

/* 登录 / 弹窗浮层：径向高光 + 面板顶边品牌色（`.login-mask` 唯一背景定义处） */
.login-mask {
  background:
    radial-gradient(1100px 560px at 72% 18%, rgba(47, 110, 168, .38), transparent 62%),
    linear-gradient(160deg, #0d3b5e 0%, #10527f 55%, #17618f 100%);
}
/* `.login-mask.is-dialog` 背景统一在「登录界面」段定义，此处不重复 */
.login-panel { border-top: 4px solid var(--c-primary); }
.login-mask.is-dialog .login-panel { border-top: none; box-shadow: 0 18px 50px rgba(0, 0, 0, .30); }

/* 弹窗浮层出现动画（配合 hidden 属性切换） */
.login-panel { animation: dialogIn .18s ease; }
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
