* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f5f5f5;
  --card: #fff;
  /* 福达香料品牌色系 */
  --primary: #006A47;
  --primary-light: #E8F5E9;
  --primary-dark: #004D35;
  --brand-gold: #C9A961;
  /* 隐患类别色标 */
  --cat-fire: #E53935;
  --cat-fire-bg: #FFEBEE;
  --cat-elec: #F9A825;
  --cat-elec-bg: #FFF8E1;
  --cat-leak: #1E88E5;
  --cat-leak-bg: #E3F2FD;
  --cat-mech: #546E7A;
  --cat-mech-bg: #ECEFF1;
  --cat-chem: #8E24AA;
  --cat-chem-bg: #F3E5F5;
  --cat-strike: #EF6C00;
  --cat-strike-bg: #FFF3E0;
  --cat-fall: #00897B;
  --cat-fall-bg: #E0F2F1;
  --cat-other: #757575;
  --cat-other-bg: #F5F5F5;
  --warning: #D81E35;
  --warning-light: #FFEBEE;
  --danger: #B71C1C;
  --danger-light: #FFEBEE;
  --success: #1E8E3E;
  --success-light: #E6F4EA;
  --text: #202124;
  --text-secondary: #5f6368;
  --text-hint: #9aa0a6;
  --border: #dadce0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  /* Safe-area 变量 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  /* 纵向 flex：内容不足一屏时，页脚（ICP 备案号）也能贴到页面最底部。
     流程内只有 #app 和 .icp-footer 两个子元素（导航条/版本角标/断网条都是 fixed，不占位） */
  display: flex;
  flex-direction: column;
}

/* flex:1 0 auto → 内容再少也把剩余高度吃掉，把页脚顶到底部。
   原来这里留的 64px（给 fixed 底部导航让位）已移到 .icp-footer 的 padding-bottom，
   否则两份留白叠加，备案号上方会出现一大块空洞 */
#app { flex: 1 0 auto; padding: 0; }

/* ===== 页脚 · ICP 备案号 =====
   工信部要求：底部展示备案号并链接至工信部备案官网首页（腾讯云备案成功页的「必须」项）。
   字小、灰、不吃空间；底部 70px 让开 fixed 底部导航(约 56px) + 安全区，避免被导航盖住 */
.icp-footer {
  flex: 0 0 auto;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-hint);
  padding: 14px 16px calc(70px + var(--safe-bottom));
}
.icp-footer a { color: var(--text-hint); text-decoration: none; }

.header {
  background: var(--primary);
  color: #fff;
  padding: calc(16px + var(--safe-top)) 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header h1 { font-size: 17px; font-weight: 500; }
.header .user-tag { font-size: 13px; opacity: 0.9; background: rgba(255,255,255,0.15); padding: 4px 10px; border-radius: 20px; }
.header.back-header { background: var(--bg); color: var(--text); border-bottom: 1px solid var(--border); }
.header.back-header .back-btn { font-size: 16px; padding: 4px 8px; cursor: pointer; color: var(--primary); }

.stats-row { display: flex; gap: 12px; padding: 16px 16px 0; margin-bottom: 12px; }
.stat-card {
  flex: 1; background: var(--card); border-radius: var(--radius);
  padding: 16px 6px; text-align: center; box-shadow: var(--shadow);
}
.stat-card .num { font-size: 26px; font-weight: 700; }
.stat-card .num small { font-size: 14px; margin-left: 2px; }
.stat-card .num.pending { color: var(--danger); }
.stat-card .num.today { color: var(--primary); }
.stat-card .num.total { color: var(--text); }
.stat-card .num.rectified { color: var(--success); }
.stat-card .num.rate { color: var(--warning); }
.stat-card .label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* 统计页 KPI 卡片（带图标） */
.stats-kpis { display: flex; gap: 12px; padding: 16px; }
.stats-kpi-card {
  flex: 1; background: var(--card); border-radius: var(--radius);
  padding: 18px 8px 14px; text-align: center; box-shadow: var(--shadow);
}
.stats-kpi-icon {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.stats-kpi-icon.total { background: #E8F0FE; }
.stats-kpi-icon.rectified { background: var(--success-light); }
.stats-kpi-icon.rate { background: var(--warning-light); }
.stats-kpi-num { font-size: 28px; font-weight: 700; margin-bottom: 2px; line-height: 1.2; }
.stats-kpi-num small { font-size: 14px; margin-left: 1px; }
.stats-kpi-num.total { color: var(--text); }
.stats-kpi-num.rectified { color: var(--success); }
.stats-kpi-num.rate { color: var(--warning); }
.stats-kpi-label { font-size: 12px; color: var(--text-secondary); }

/* 首页隐患类别统计 */
.cat-stats-section { padding: 0 16px; margin-bottom: 20px; }
.cat-stats-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 14px; padding-left: 12px;
  border-left: 3px solid var(--primary);
  line-height: 1.3;
}
.cat-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cat-stat-card {
  border-radius: var(--radius-sm); padding: 16px 8px;
  text-align: center; box-shadow: var(--shadow);
  background: var(--card); transition: transform 0.15s;
}
.cat-stat-card:active { transform: scale(0.96); }
.cat-stat-count { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.1; }
.cat-stat-pct { font-size: 16px; color: var(--text-secondary); font-weight: 500; margin: 4px 0 8px; }
.cat-stat-name { font-size: 12px; font-weight: 600; }
/* 类别色标 — 统计卡片彩色底色 */
.cat-stat-card[data-cat="消防"] { background: var(--cat-fire-bg); }
.cat-stat-card[data-cat="消防"] .cat-stat-name { color: var(--cat-fire); }
.cat-stat-card[data-cat="消防"] .cat-stat-count { color: var(--cat-fire); }
.cat-stat-card[data-cat="电气"] { background: var(--cat-elec-bg); }
.cat-stat-card[data-cat="电气"] .cat-stat-name { color: var(--cat-elec); }
.cat-stat-card[data-cat="电气"] .cat-stat-count { color: var(--cat-elec); }
.cat-stat-card[data-cat="漏水"] { background: var(--cat-leak-bg); }
.cat-stat-card[data-cat="漏水"] .cat-stat-name { color: var(--cat-leak); }
.cat-stat-card[data-cat="漏水"] .cat-stat-count { color: var(--cat-leak); }
.cat-stat-card[data-cat="机械"] { background: var(--cat-mech-bg); }
.cat-stat-card[data-cat="机械"] .cat-stat-name { color: var(--cat-mech); }
.cat-stat-card[data-cat="机械"] .cat-stat-count { color: var(--cat-mech); }
.cat-stat-card[data-cat="化学品"] { background: var(--cat-chem-bg); }
.cat-stat-card[data-cat="化学品"] .cat-stat-name { color: var(--cat-chem); }
.cat-stat-card[data-cat="化学品"] .cat-stat-count { color: var(--cat-chem); }
.cat-stat-card[data-cat="物体打击"] { background: var(--cat-strike-bg); }
.cat-stat-card[data-cat="物体打击"] .cat-stat-name { color: var(--cat-strike); }
.cat-stat-card[data-cat="物体打击"] .cat-stat-count { color: var(--cat-strike); }
.cat-stat-card[data-cat="高处坠落"] { background: var(--cat-fall-bg); }
.cat-stat-card[data-cat="高处坠落"] .cat-stat-name { color: var(--cat-fall); }
.cat-stat-card[data-cat="高处坠落"] .cat-stat-count { color: var(--cat-fall); }
.cat-stat-card[data-cat="其他"] { background: var(--cat-other-bg); }
.cat-stat-card[data-cat="其他"] .cat-stat-name { color: var(--cat-other); }
.cat-stat-card[data-cat="其他"] .cat-stat-count { color: var(--cat-other); }

/* 类别色标 — 列表/详情中的类别标签 */
.cat-tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px;
  font-weight: 500; white-space: nowrap;
}
.cat-tag[data-cat="消防"] { background: var(--cat-fire-bg); color: var(--cat-fire); }
.cat-tag[data-cat="电气"] { background: var(--cat-elec-bg); color: var(--cat-elec); }
.cat-tag[data-cat="漏水"] { background: var(--cat-leak-bg); color: var(--cat-leak); }
.cat-tag[data-cat="机械"] { background: var(--cat-mech-bg); color: var(--cat-mech); }
.cat-tag[data-cat="化学品"] { background: var(--cat-chem-bg); color: var(--cat-chem); }
.cat-tag[data-cat="物体打击"] { background: var(--cat-strike-bg); color: var(--cat-strike); }
.cat-tag[data-cat="高处坠落"] { background: var(--cat-fall-bg); color: var(--cat-fall); }
.cat-tag[data-cat="其他"] { background: var(--cat-other-bg); color: var(--cat-other); }
/* 类别色标 — 详情页类别文字 */
.detail-cat[data-cat="消防"] { color: var(--cat-fire); font-weight: 600; }
.detail-cat[data-cat="电气"] { color: var(--cat-elec); font-weight: 600; }
.detail-cat[data-cat="漏水"] { color: var(--cat-leak); font-weight: 600; }
.detail-cat[data-cat="机械"] { color: var(--cat-mech); font-weight: 600; }
.detail-cat[data-cat="化学品"] { color: var(--cat-chem); font-weight: 600; }
.detail-cat[data-cat="物体打击"] { color: var(--cat-strike); font-weight: 600; }
.detail-cat[data-cat="高处坠落"] { color: var(--cat-fall); font-weight: 600; }
.detail-cat[data-cat="其他"] { color: var(--cat-other); font-weight: 600; }

.btn-row { display: flex; gap: 12px; padding: 0 16px 16px; }
.btn-big {
  flex: 1; height: 72px; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: none; font-size: 15px; font-weight: 500; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.1s;
}
.btn-big:active { transform: scale(0.97); }
.btn-big .icon { font-size: 26px; margin-bottom: 4px; }
.btn-report { background: var(--primary); color: #fff; }
.btn-rectify { background: var(--warning); color: #fff; }
.btn-query { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-stats { background: var(--card); color: var(--primary); border: 1px solid var(--primary); }

.page { padding: 16px 16px calc(16px + var(--safe-bottom)); }
.section-title { font-size: 15px; font-weight: 500; margin: 20px 0 12px; color: var(--text); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; background: var(--card);
  color: var(--text); outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; font-family: inherit; }

.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  background: var(--card); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); max-height: 200px;
  overflow-y: auto; display: none;
}
.autocomplete-dropdown.show { display: block; }
.autocomplete-item {
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #eee;
  font-size: 14px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:active, .autocomplete-item.active { background: var(--primary-light); }
.autocomplete-item .ac-code { font-weight: 500; }
.autocomplete-item .ac-name { font-size: 12px; color: var(--text-secondary); margin-left: 8px; }

.photo-upload-area { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border); }
.photo-add {
  width: 72px; height: 72px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border); display: flex; align-items: center;
  justify-content: center; font-size: 28px; color: var(--text-hint);
  cursor: pointer; background: var(--card);
}
.photo-wrap { position: relative; }
.photo-wrap .photo-del {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px;
  background: var(--danger); color: #fff; border-radius: 50%; border: none;
  font-size: 14px; line-height: 22px; text-align: center; cursor: pointer;
}

.btn-primary {
  width: 100%; padding: 14px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 16px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
}
.btn-primary:active { background: var(--primary-dark); }
.btn-secondary {
  width: 100%; padding: 14px; background: var(--card); color: var(--primary);
  border: 1px solid var(--primary); border-radius: var(--radius-sm);
  font-size: 15px; cursor: pointer; margin-top: 10px;
}

.quick-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qbtn {
  padding: 6px 14px; background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; cursor: pointer; color: var(--text-secondary);
  transition: all 0.15s;
}
.qbtn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.hazard-card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  margin-bottom: 14px; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
}
.hazard-card .hcard-thumb {
  width: 56px; height: 56px; border-radius: 6px; object-fit: cover;
  background: #e8eaed; flex-shrink: 0;
}
.hazard-card .hcard-info { flex: 1; min-width: 0; }
.hazard-card .hcard-loc { font-size: 14px; font-weight: 500; }
.hazard-card .hcard-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hazard-card .hcard-meta { font-size: 11px; color: var(--text-hint); margin-top: 4px; }
.hazard-card .hcard-status { flex-shrink: 0; align-self: center; }
.status-badge { font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 500; white-space: nowrap; }
.status-badge.pending { background: var(--danger-light); color: var(--danger); }
.status-badge.done { background: var(--success-light); color: var(--success); }

.detail-section { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.detail-section h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 10px; }
.detail-section p { margin-bottom: 4px; font-size: 14px; }
.compare-row { display: flex; gap: 10px; }
.compare-box { flex: 1; text-align: center; }
.compare-box img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.compare-box span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; }
.filter-chip {
  padding: 6px 16px; border-radius: 20px; font-size: 13px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.export-bar { padding: 12px 16px; text-align: center; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-hint); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

.login-page { padding: calc(40px + var(--safe-top)) max(20px, var(--safe-left)) calc(40px + var(--safe-bottom)) max(20px, var(--safe-right)); text-align: center; }
.login-page h2 { margin-bottom: 6px; font-weight: 500; font-size: 16px; }

/* 登录页品牌区 */
.login-brand { text-align: center; margin-bottom: 36px; }
.login-logo-img {
  width: auto; max-width: 220px; height: auto; max-height: 80px;
  margin: 0 auto 20px; display: block; object-fit: contain;
  border-radius: 22%;   /* v36：呈现设计稿 A 的圆角方块观感 */
}
.login-app-name { font-size: 22px; font-weight: 600; color: var(--primary); letter-spacing: 1px; }
.login-subtitle { font-size: 13px; color: var(--text-hint); margin-top: 8px; }
.login-page .user-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.login-page .user-chip {
  padding: 14px 4px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; cursor: pointer;
  box-shadow: var(--shadow); text-align: center;
}
.login-page .user-chip:active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.login-page .reset-link {
  margin-top: 32px; font-size: 13px; color: var(--text-secondary);
  cursor: pointer; text-decoration: underline;
}
.login-page .reset-link:hover { color: var(--primary); }

/* ===== PWA 安装引导横幅 ===== */
.install-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(135deg, #006A47, #008A5E);
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; padding-top: calc(10px + var(--safe-top));
  font-size: 13px; line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
.install-banner-icon { font-size: 22px; flex-shrink: 0; }
.install-banner-text { flex: 1; min-width: 0; }
.install-banner-text b { font-weight: 600; }
.install-banner-btn {
  flex-shrink: 0;
  background: #fff; color: #006A47;
  border: none; border-radius: 16px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.install-banner-btn:active { background: #e0f0e8; }
.install-banner-close {
  flex-shrink: 0;
  font-size: 16px; cursor: pointer; opacity: 0.7;
  padding: 2px;
}
.install-banner-close:active { opacity: 1; }

.admin-reset select.pwd-input { appearance: auto; }

.pwd-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: calc(20px + var(--safe-top)) max(20px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(20px, var(--safe-left));
}
.pwd-box {
  background: var(--card); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 320px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.pwd-title { font-size: 17px; font-weight: 500; text-align: center; margin-bottom: 8px; }
.pwd-user { font-size: 14px; color: var(--text-secondary); text-align: center; margin-bottom: 16px; }
.pwd-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; margin-bottom: 12px;
  outline: none;
}
.pwd-input:focus { border-color: var(--primary); }
.pwd-remember {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary); margin-bottom: 16px;
}
.pwd-btns { display: flex; gap: 12px; }
.pwd-btn {
  flex: 1; padding: 12px; border-radius: var(--radius-sm);
  border: none; font-size: 15px; cursor: pointer;
}
.pwd-btn-cancel { background: #f1f3f4; color: var(--text-secondary); }
.pwd-btn-ok { background: var(--primary); color: #fff; }

.user-menu-wrap { position: relative; }
.user-menu {
  position: absolute; right: 0; top: 42px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 6px 24px rgba(0,0,0,0.16);
  min-width: 130px; z-index: 20; overflow: hidden;
}
.user-menu-item {
  padding: 13px 18px; font-size: 14px; cursor: pointer;
  color: var(--text); border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.user-menu-item:last-child { border-bottom: none; }
.user-menu-item:hover { background: var(--primary-light); }
.user-menu-item:active { background: var(--primary); color: #fff; }

.search-box { margin-bottom: 16px; }
.search-box input { width: 100%; }

.reset-area { text-align: center; padding: 24px 16px 40px; }
.btn-reset {
  background: none; border: 1px dashed var(--border);
  color: var(--text-hint); font-size: 13px;
  padding: 8px 20px; border-radius: 20px;
  cursor: pointer; transition: all .2s;
}
.btn-reset:active { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

/* ===== Toast 顶部提示 ===== */
.app-toast {
  position: fixed; top: calc(20px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 10px; font-size: 14px; font-weight: 500; color: #fff;
  z-index: 200; max-width: 340px; text-align: center; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
  pointer-events: none;
}
.app-toast.success { background: #2E7D32; }
.app-toast.error { background: #C62828; }
.app-toast.info { background: #37474F; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-50%) translateY(-12px); } }

/* ===== Modal 确认弹窗 ===== */
.app-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 150; padding: 20px var(--safe-right) calc(20px + var(--safe-bottom)) var(--safe-left);
  animation: fadeIn .2s ease;
}
.app-modal {
  background: var(--card); border-radius: 16px; width: 100%; max-width: 320px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.2); overflow: hidden;
  animation: modalIn .25s ease;
}
.app-modal-body { padding: 28px 24px 20px; text-align: center; }
.app-modal-icon { font-size: 36px; margin-bottom: 12px; }
.app-modal-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.app-modal-msg { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.app-modal-actions { display: flex; border-top: 1px solid var(--border); }
.app-modal-btn {
  flex: 1; padding: 14px; font-size: 15px; border: none; background: none;
  cursor: pointer; font-weight: 500; transition: background .15s;
}
.app-modal-btn-cancel { color: var(--text-secondary); border-right: 1px solid var(--border); }
.app-modal-btn-cancel:active { background: #f5f5f5; }
.app-modal-btn-confirm { color: var(--primary); }
.app-modal-btn-confirm:active { background: var(--primary-light); }
.app-modal-btn-confirm.danger { color: var(--danger); }
.app-modal-btn-confirm.danger:active { background: var(--danger-light); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ===== 底部导航栏 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 0 calc(6px + var(--safe-bottom));
  z-index: 30;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.nav-tab {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 4px 10px; cursor: pointer;
  color: var(--text-hint); font-size: 10px; font-weight: 500;
  transition: color .2s; -webkit-tap-highlight-color: transparent;
  text-decoration: none; min-width: 56px; user-select: none;
}
.nav-tab .nav-icon { font-size: 22px; line-height: 1; transition: transform .2s; }
.nav-tab.active { color: var(--primary); font-weight: 600; }
.nav-tab.active .nav-icon { transform: scale(1.1); }
.nav-tab:active { opacity: 0.7; }

/* ===== 首页待整改清单 ===== */
.pending-section {
  margin: 4px 16px 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pending-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.pending-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  padding-left: 10px; border-left: 3px solid var(--warning); line-height: 1.3;
}
.pending-sub { font-size: 12px; color: var(--text-hint); }
.pending-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.pending-item:active { background: var(--bg); }
.pending-main { flex: 1; min-width: 0; margin-right: 10px; }
.pending-loc { font-size: 14px; font-weight: 600; color: var(--text); }
.pending-desc {
  font-size: 12px; color: var(--text-hint); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pending-days { font-size: 16px; font-weight: 700; white-space: nowrap; }
/* 天数分级：≥7天红 / 3-6天橙 / 1-2天绿 */
.pending-days[data-level="high"] { color: var(--warning); }
.pending-days[data-level="mid"] { color: #EF6C00; }
.pending-days[data-level="low"] { color: var(--success); }
.pending-more {
  padding: 10px; text-align: center;
  font-size: 13px; font-weight: 500; color: var(--primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pending-more:active { background: var(--bg); }
.pending-empty { padding: 20px; text-align: center; color: var(--text-hint); font-size: 13px; }

/* ===== 首页统计卡可点击（待整改 / 今日上报） ===== */
.stat-card.stat-link { cursor: pointer; transition: transform .1s; -webkit-tap-highlight-color: transparent; }
.stat-card.stat-link:active { transform: scale(.96); }
.stat-arrow { margin-left: 4px; color: var(--text-hint); font-size: 15px; font-weight: 700; vertical-align: middle; }

/* ===== 可展开记录卡片（查询页 / 今日上报共用） ===== */
.qcard {
  background: var(--card); border-radius: var(--radius);
  margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.qcard .hazard-card { margin-bottom: 0; box-shadow: none; }
.qcard-head { position: relative; }
.qcard-head .hcard-status { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qcard-chev { color: var(--text-hint); font-size: 12px; transition: transform .2s; }
.qcard-head.open .qcard-chev { transform: rotate(180deg); }
.qcard-head.open { border-radius: var(--radius) var(--radius) 0 0; }
/* 详情"抽屉"：左右留边 + 主题绿竖线 + 圆角，与卡片头部明确区分 */
.qcard-detail {
  margin: 0 10px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow: hidden;
}
.qd-block { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.6; }
.qd-block:last-child { border-bottom: none; }
.qd-block p { margin: 2px 0; }
.qd-title { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.qd-meta { font-size: 12px; color: var(--text-hint); margin-top: 6px; }
.qd-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.qd-photos img { width: 84px; height: 84px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border); }
/* 照片云端按需加载占位（本地存储满被瘦身降级的设备）：虚线框 + 灰字提示，与正常照片块区分 */
.qd-photos-lazy-tip { font-size: 12px; color: var(--text-hint); background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; margin-top: 4px; }
/* 整改信息块（已整改）：浅绿底，呼应"已整改"徽标 */
.qd-rect { background: var(--primary-light); }
/* 未整改提示条：浅红警示底 */
.qd-notdone { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--warning-light); color: var(--warning); font-weight: 500; }
.btn-sm { display: inline-block; width: auto; padding: 7px 18px; font-size: 13px; }
/* 删除记录区（仅杨宁可见）：与卡片其它色块明显区分 */
.qd-del { padding: 10px 14px; background: var(--bg); border-top: 1px dashed var(--danger); }
.btn-del {
  display: block; width: 100%; padding: 9px 0;
  border: 1px solid var(--danger); border-radius: 8px;
  background: var(--danger-light); color: var(--danger);
  font-size: 13px; font-weight: 600; text-align: center;
}
.btn-del:active { opacity: .75; }

/* 大图查看遮罩（z-index 高于底部导航与顶部 header） */
.photo-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 1100; display: flex; align-items: center; justify-content: center; }
.photo-viewer img { max-width: 94vw; max-height: 88vh; border-radius: 6px; }
.pv-close {
  position: fixed; top: calc(12px + var(--safe-top)); right: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff;
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 1101; -webkit-tap-highlight-color: transparent;
}
.pv-close:active { background: rgba(255,255,255,.32); }

/* 今日上报清单日期提示 */
.list-date-hint { font-size: 12px; color: var(--text-hint); padding: 0 2px 10px; }

/* ===== 诊断弹窗（首页标题连点5次触发） ===== */
.diag-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.diag-box { width: 100%; max-width: 340px; max-height: 80vh; overflow-y: auto; background: var(--card); border-radius: 14px; padding: 18px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.diag-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.diag-body { font-size: 13px; line-height: 1.9; color: var(--text); word-break: break-all; }
.diag-close { display: block; width: 100%; margin-top: 14px; padding: 10px; border: none; border-radius: 10px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; }

/* ===== 整改时效 KPI（阈值 OVERDUE_DAYS 天） ===== */
/* 嵌套在 .cat-stats-section(padding:0 16px) 内，需清掉 .stats-kpis 自带的 16px 左右内边距，避免双层缩进 */
.time-kpis { padding: 14px 0 6px; }
/* 数字带"天/%"，比纯整数宽，略缩字号防溢出 */
.time-kpis .stats-kpi-num { font-size: 24px; }
.stats-kpi-icon.overdue { background: var(--warning-light); }
.stats-kpi-num.overdue { color: var(--danger); }
/* 有超期未整改时，整卡描红边提示 */
.stats-kpi-card.is-warn { border: 1px solid var(--danger); }
/* 口径说明：写清基于多少条样本，指标才可信 */
.time-note { font-size: 12px; color: var(--text-secondary); padding: 0 2px; margin-top: -2px; line-height: 1.6; }
.time-note b { color: var(--danger); }

/* ===== 近 N 月趋势（纯 CSS 双柱，无第三方库） ===== */
.trend-legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.trend-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.trend-legend .lg.report { background: #1E88E5; }   /* 上报=冷蓝（新增隐患） */
.trend-legend .lg.rect { background: var(--success); } /* 整改=绿（完成闭环） */
.trend-legend .lg-note { margin-left: auto; font-size: 11px; color: var(--text-hint); }
.trend-chart { display: flex; align-items: flex-end; justify-content: space-between; background: var(--card); border-radius: var(--radius); padding: 12px 8px 8px; box-shadow: var(--shadow); }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
/* 柱顶数值：上报(蓝) / 整改(绿) */
.trend-vals { display: flex; gap: 6px; font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.tv-report { color: #1E88E5; }
.tv-rect { color: var(--success); }
/* 柱区必须有固定高度，子元素的百分比高度才生效 */
.trend-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.trend-bar { width: 14px; border-radius: 3px 3px 0 0; background: #ccc; min-height: 0; }
.trend-bar.report { background: #1E88E5; }
.trend-bar.rect { background: var(--success); }
.trend-label { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.trend-rate { font-size: 10px; color: var(--text-hint); margin-top: 1px; }

/* ===== 责任人功能（2026-09-15 新增）===== */
/* 上报表单字段提示 */
.form-hint { font-size: 12px; color: var(--text-hint); font-weight: 400; }

/* 首页标签切换（方案C：我的责任 / 待整改 / 未指派） */
.home-tabs {
  display: flex; gap: 8px; padding: 12px 12px 10px;
  overflow-x: auto; border-bottom: 1px solid var(--border);
}
.home-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 20px; font-size: 13px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; transition: all .15s;
}
.home-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.home-tab-count {
  min-width: 18px; padding: 0 5px; text-align: center;
  font-size: 11px; line-height: 16px; border-radius: 9px;
  background: var(--bg); color: var(--text-secondary);
}
.home-tab.active .home-tab-count { background: rgba(255,255,255,0.25); color: #fff; }

/* 「全部」标签下，属于本人责任的条目角标 */
.mine-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 10px; font-weight: 700; border-radius: 4px;
  background: var(--warning-light); color: var(--warning);
  vertical-align: middle;
}

/* 「未指派」清单项的指派按钮 */
.assign-btn {
  flex: none; margin-right: 10px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; border-radius: 16px;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid var(--primary); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.assign-btn:active { background: var(--primary); color: #fff; }

/* 指派责任人弹窗 */
.assign-modal {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45);
  align-items: center; justify-content: center; padding: 20px;
}
.assign-box {
  width: 100%; max-width: 340px; max-height: 80vh; overflow-y: auto;
  background: var(--card); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.assign-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.assign-sub { font-size: 12px; color: var(--text-hint); margin-bottom: 12px; }
.assign-user-list {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-height: 40vh; overflow-y: auto; margin-bottom: 12px;
}
.assign-user-item {
  padding: 9px 4px; text-align: center; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.assign-user-item:active { background: var(--primary-light); border-color: var(--primary); }
.assign-manual { display: flex; gap: 8px; margin-bottom: 10px; }
.assign-manual input {
  flex: 1; padding: 9px 10px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none;
}
.assign-manual input:focus { border-color: var(--primary); }
.assign-ok {
  flex: none; padding: 9px 16px; font-size: 14px; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; cursor: pointer;
}
.assign-actions { display: flex; gap: 8px; }
.assign-actions .assign-cancel { flex: 1; width: auto; }
.assign-actions .assign-ok { flex: 1; }
.assign-user-item.selected {
  background: var(--primary); border-color: var(--primary);
  color: #fff; font-weight: 600;
}
.assign-cancel {
  display: block; width: 100%; padding: 10px; font-size: 14px;
  border: none; border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-secondary); cursor: pointer;
}

/* ===== 隐患三态（2026-09-26 新增「整改中」）===== */
/* 状态徽章：未整改红 / 整改中橙 / 已整改绿 */
.status-badge.doing { background: #FFF3E0; color: #EF6C00; }

/* 首页顶部卡片（方案 C）：主数字 | 竖线 | 超期数，两段各自可点 */
.stat-card.stat-split { padding: 16px 6px; }
.stat-nums {
  display: flex; justify-content: center;
  /* ⚠️ 必须用基线对齐，不能用 center：
     主数字 26px 与超期数字 18px 的盒子高度不同，center 居中的是"盒子"而不是"文字底线"，
     实测右侧整组会比主数字高 4px，看着就是"没对齐"（2026-09-27 实测确证）。 */
  align-items: baseline;
  min-height: 34px;
}
.stat-divider {
  display: inline-block; width: 1px; height: 24px;
  background: var(--border); margin: 0 7px; flex: none;
  align-self: center;   /* 竖线是纯装饰块，不参与基线对齐，单独竖直居中 */
}
/* 超期数：数字承担警示（红），文字只作说明（灰）——满血红文字过刺眼 */
.stat-overdue { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.stat-overdue b { font-size: 20px; font-weight: 700; color: var(--danger); margin-right: 2px; }
/* 超期数为 0 时整组转灰：没有超期就不是警报，别让 "0" 也一片红 */
.stat-overdue.is-zero b { color: var(--text-secondary); font-weight: 600; }
.stat-card .num.doing { color: #EF6C00; }
/* 可点数字的按压反馈（只在数字身上生效，整卡不缩放，避免误触） */
.stat-hit { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stat-hit:active { opacity: .45; }

/* 今日上报：从大卡降为卡下方一行细条 */
.today-strip {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 16px 12px; padding: 9px 14px;
  background: var(--card); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: 12px; color: var(--text-secondary);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.today-strip:active { background: var(--bg); }
.today-strip-num { color: var(--primary); font-weight: 600; }

/* 整改详情页顶部的接手状态条；超 7 天整条变红 */
.doing-bar {
  margin: 12px 16px 0; padding: 12px 14px;
  background: #FFF3E0; border: 1px solid #FFCC80; border-radius: var(--radius);
}
.doing-bar.overdue {
  background: var(--warning-light); border-color: var(--danger);
}
.doing-bar-main { font-size: 15px; font-weight: 600; color: #EF6C00; }
.doing-bar.overdue .doing-bar-main { color: var(--danger); }
.doing-bar-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.doing-bar-sub b { color: var(--danger); }
.doing-bar-note {
  font-size: 12px; color: var(--text-hint); margin-top: 5px;
  padding-top: 5px; border-top: 1px dashed var(--border);
}
/* 开始整改区的说明小字 */
.start-rect-tip { font-size: 12px; color: var(--text-hint); margin-top: 10px; line-height: 1.5; }
/* 撤销整改：次级按钮，不抢主按钮的视觉权重 */
.btn-cancel-rect {
  display: block; width: 100%; margin-top: 10px; padding: 10px;
  font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text-secondary); cursor: pointer;
}
.btn-cancel-rect:active { background: var(--bg); }

/* 清单卡片上的"拖了多久"小字 */
.hcard-age { font-size: 11px; color: var(--text-hint); margin-top: 3px; }
.hcard-age.doing { color: #EF6C00; }
.hcard-age.overdue { color: var(--danger); font-weight: 600; }
/* 首页清单里标注整改中的小标签 */
.doing-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 11px; font-weight: 500; border-radius: 8px;
  background: #FFF3E0; color: #EF6C00;
}

/* 查询页展开后的"尚未完成"区块 */
.qd-notdone-text { display: flex; flex-direction: column; gap: 3px; }
.qd-note { font-size: 12px; color: var(--text-hint); }
.qd-overdue { color: var(--danger); font-weight: 600; }
.qd-block.qd-doing { background: #FFF3E0; color: #EF6C00; }

/* 统计页：整改中超期 KPI + 口径说明 */
.stats-kpi-icon.doing { background: #FFF3E0; }
.stats-kpi-num.doing { color: #EF6C00; }
.time-note-sub { color: var(--text-hint); margin-top: 4px; }

/* 统计页卡片下钻（2026-09-26 统计二期⑤）：点卡片 → 跳查询页自动带筛选 */
.stats-kpi-card.clickable, .cat-stat-card.clickable { cursor: pointer; }
.stats-kpi-card.clickable:active, .cat-stat-card.clickable:active { transform: scale(0.97); }
.kpi-drill { margin-left: 4px; font-size: 12px; color: var(--text-hint); }
.section-hint { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--text-hint); }
.drill-link { color: var(--primary); cursor: pointer; text-decoration: underline; }

/* 查询页：下钻条件提示条（让用户看见"为什么只有这几条"，并可一键清除） */
.qry-extra-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.qry-extra-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 12px; border-radius: 12px;
  background: var(--bg); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.qry-extra-chip.warn { background: #FFEBEE; color: var(--danger); border-color: #FFCDD2; }
.qry-extra-chip b { font-weight: 400; opacity: 0.7; font-size: 13px; cursor: pointer; }


/* ===== 统计页时间维度切换（累计 / 今年累计 / 本月累计）2026-10-17 =====
   给「隐患类别统计」「提报人统计」各一个独立切换器（方案A，与 5S 统计页同款交互）。
   视觉刻意照抄 5S 的 .s5-range-cap，两块模块看起来像一套。
   ⚠️ 类名用中性的 .range-cap 而不是 s5- 前缀：隐患侧的样式全在本文件，不存在 5S 那套注入样式。 */
.range-caps { display: flex; gap: 6px; margin: 2px 0 12px; }
.range-cap {
  flex: 1; max-width: 108px; text-align: center; padding: 5px 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  color: var(--text-secondary); font-size: 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.range-cap.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.range-cap:active { opacity: .7; }
/* 卡片带切换器时把标题行下边距收一点，否则整卡被撑高、一屏放不下两张图 */
.pareto-card.has-range .pareto-head { margin-bottom: 10px; }
/* 该时间段无数据：图表位置留一块占位，卡片与切换器必须保留
   —— 否则切到「本月」发现没数据，连切回「累计」的按钮都跟着消失了 */
.pareto-empty {
  height: 100px; display: flex; align-items: center; justify-content: center;
  color: var(--text-hint); font-size: 13px; border-radius: 8px;
  background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 8px, #f5f7f9 8px, #f5f7f9 16px);
}

/* ===== 柏拉图（隐患类别 / 提报人统计）2026-09-27 =====
   纯 DOM + 内联 SVG 折线，零依赖、离线可用。
   柱子用 % 绝对定位，因此天然适配任意屏宽；折线用 preserveAspectRatio=none 拉伸、
   vector-effect=non-scaling-stroke 保证线宽不变形。 */
.pareto-card { padding-bottom: 6px; }
.pareto-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.pareto-sub { font-size: 12px; font-weight: 400; color: var(--text-hint); }
.pareto-body { position: relative; }
.pareto-plot { display: flex; height: 150px; }
.pareto-ytick { position: relative; width: 30px; flex: none; }
.pareto-ytick.right { width: 32px; }
.pareto-tick {
  position: absolute; right: 0; transform: translateY(50%);
  font-size: 9.5px; color: var(--text-hint); white-space: nowrap; line-height: 1;
}
.pareto-ytick.right .pareto-tick { right: auto; left: 0; }
.pareto-area {
  position: relative; flex: 1; height: 100%;
  border-left: 1px solid #e6eaed; border-right: 1px solid #e6eaed; border-bottom: 1px solid #b9c1c9;
}
.pareto-g50 { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed #e8ebee; }
.pareto-bar {
  position: absolute; bottom: 0; background: #0F6E56;
  border-radius: 2px 2px 0 0; box-shadow: inset -1px 0 0 #fff;   /* 1px 白缝：分界而非间隙 */
}
.pareto-bar.is-tail { background: #8FC1B0; }                      /* 累计 80% 以外 = 次要多数 */
.pareto-barnum {
  position: absolute; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 600; color: #fff; line-height: 1; white-space: nowrap;
}
.pareto-barnum.is-out { color: var(--text-secondary); }           /* 矮柱：数字写柱顶上方 */
.pareto-line { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.pareto-dot {
  position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  background: #B26A00; transform: rotate(45deg);                  /* 菱形标记 */
}
.pareto-pct {
  position: absolute; font-size: 10px; font-weight: 600; color: #8A5008; line-height: 1;
  margin: -5px 0 0 4px; white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;         /* 白色 halo：压线也看得清 */
}
.pareto-pct.is-flip { margin: -5px 4px 0 0; transform: translateX(-100%); }  /* 靠右时翻到点左侧 */
/* 与 .pareto-plot 的左右刻度列(30px/32px)等宽内缩，让标签 % 坐标系和柱子所在 .pareto-area 对齐
   （2026-09-28 修复：此前占满整卡宽度，姓名整体比柱子向两侧偏移） */
.pareto-xaxis { position: relative; height: 18px; margin-top: 7px; margin-left: 30px; margin-right: 32px; }
.pareto-xitem {
  position: absolute; transform: translateX(-50%);
  color: var(--text-secondary); white-space: nowrap; line-height: 1.2; text-align: center;
}
.pareto-hits { position: absolute; left: 30px; right: 32px; top: 0; bottom: 0; }
.pareto-hit { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.pareto-hit[onclick] { cursor: pointer; }
.pareto-hit[onclick]:active { background: rgba(15, 110, 86, .10); }
.pareto-legend {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  margin-top: 10px; font-size: 10.5px; color: var(--text-secondary);
}
.pareto-lg { display: inline-flex; align-items: center; gap: 5px; }
.pareto-lgbox { width: 11px; height: 11px; border-radius: 2px; background: #0F6E56; }
.pareto-lgline { position: relative; width: 16px; height: 0; border-top: 1.8px solid #B26A00; }
.pareto-lgline::after {
  content: ''; position: absolute; left: 50%; top: -3px;
  width: 6px; height: 6px; margin-left: -3px; background: #B26A00; transform: rotate(45deg);
}
