:root {
  --bg: #f5faf6;
  --panel: #ffffff;
  --ink: #20302a;
  --muted: #6c7d74;
  --line: #e7efea;
  --brand: #1fb574;        /* 绿：主色/已完成/改善 */
  --brand-d: #169a60;
  --accent: #ff8a3d;       /* 橙：强调/行动 */
  --accent-d: #f5742a;
  --warn: #ff8a3d;         /* 橙：提醒/整改中 */
  --danger: #ef5350;       /* 红：逾期/恶化 */
  --info: #2bb0e6;         /* 蓝：待核验 */
  --radius: 14px;
  --shadow: 0 6px 20px rgba(31, 181, 116, 0.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
  width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { resize: vertical; min-height: 70px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fff3e8, #e9f8f0); }
.login-card { background: #fff; padding: 34px 30px; border-radius: 16px; box-shadow: var(--shadow); width: 340px; text-align: center; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .sub { color: var(--muted); margin: 0 0 20px; }
.login-card input { margin-bottom: 12px; }
.login-card button { background: linear-gradient(135deg, var(--accent), var(--brand)); color: #fff; border: none; padding: 11px; border-radius: 8px; font-size: 15px; width: 100%; font-weight: 600; }
.login-card button:hover { filter: brightness(1.05); }
.remember-row { display: flex; align-items: center; gap: 6px; margin: 4px 2px 14px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.remember-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--brand); }
.remember-row:hover { color: var(--ink); }
.error { color: var(--danger); min-height: 18px; font-size: 13px; margin: 6px 0; }
/* 食安红线标语块 */
.slogan-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 14px 14px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff5f3 0%, #ffe9e5 100%);
  border-left: 4px solid #d7263d;
  box-shadow: 0 2px 6px rgba(215, 38, 61, 0.08);
  text-align: left;
}
.slogan-block .slogan-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(215, 38, 61, 0.18));
  flex-shrink: 0;
}
.slogan-block .slogan-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.slogan-block .slogan-line-main {
  color: #b50017;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.25;
}
.slogan-block .slogan-line-sub {
  color: #5b0010;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.25;
  opacity: 0.92;
}
/* 移动端收紧字号 */
@media (max-width: 380px) {
  .slogan-block .slogan-line-main { font-size: 15px; }
  .slogan-block .slogan-line-sub { font-size: 12px; }
  .slogan-block .slogan-icon { font-size: 24px; }
}
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: linear-gradient(165deg, #ff9a3d 0%, #1fb574 100%); color: #fff; display: flex; flex-direction: column; }
.brand { padding: 18px 18px; font-size: 18px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 1px 3px rgba(0,0,0,.15); }
.sidebar nav { flex: 1; padding: 6px 10px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 9px; color: rgba(255,255,255,.92); cursor: pointer; margin-bottom: 4px; }
.nav-item:hover { background: rgba(255,255,255,.18); }
.nav-item.active { background: rgba(255,255,255,.28); color: #fff; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
a.nav-item { text-decoration: none; }
.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.22); font-size: 13px; }
.side-foot .role { color: rgba(255,255,255,.92); }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
#view-title { font-size: 17px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.bell { position: relative; background: none; border: none; font-size: 19px; }
.badge { position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; }
.ghost { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; color: var(--muted); }
.ghost:hover { border-color: var(--brand); color: var(--brand); }

.view { padding: 22px; padding-bottom: 46px; overflow: auto; }
.wb-frame { width: 100%; border: 0; display: block; background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(20,30,50,.06), 0 6px 20px rgba(20,30,50,.05); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.row.gap { gap: 12px; flex-wrap: nowrap; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }

/* 按钮 */
.btn { border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; background: linear-gradient(135deg, var(--accent), var(--brand)); color: #fff; font-weight: 600; }
.btn:hover { filter: brightness(1.05); }
.btn.warn { background: var(--warn); } .btn.warn:hover { background: var(--accent-d); filter: none; }
.btn.danger { background: var(--danger); } .btn.danger:hover { background: #d8443f; filter: none; }
.btn.ghost2 { background: #fff; border: 1px solid var(--line); color: var(--ink); } .btn.ghost2:hover { border-color: var(--brand); color: var(--brand); }
.btn.ghost.danger { color: var(--danger); border-color: #f0c6c4; }
.btn.ghost.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--brand); }
.btn.ghost:hover { background: var(--brand); color: #fff; }
.export-btn { font-size: 13px; padding: 7px 12px; }

/* 统计卡 */
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 28px; font-weight: 700; color: var(--brand); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat .l { color: var(--muted); margin-top: 4px; }
.stat.total { border-color: rgba(31,181,116,.35); background: linear-gradient(135deg, #fff7f0, #f1fbf5); }
.stat.total .n { background: linear-gradient(135deg, var(--accent), var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 环比徽标：上升=恶化(红) 下降=改善(绿) */
.mom { font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.mom.up { background: #fde8e6; color: var(--danger); }
.mom.down { background: #e6f7ee; color: var(--brand); }
.mom.flat { background: #eef1f5; color: var(--muted); }
.mom-l { font-weight: 500; opacity: .8; font-size: 11px; }

/* 个人板块：我负责的项目 */
.pp-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.pp-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fbfdfb; }
.pp-block.focus { border-color: var(--danger); background: #fff6f5; }
.tag-role { display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent-d); background: #fff1e6; border-radius: 20px; padding: 1px 8px; margin-left: 4px; }

/* 条形图 */
.bar-row { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row .name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: #eef1f5; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 6px; transition: width .4s; }
.bar-fill.warn { background: var(--warn); } .bar-fill.info { background: var(--info); }
.bar-fill.ok { background: #1eb579; }
.bar-fill.danger { background: var(--danger); }
/* 整改率排名 */
.rank-block { margin-bottom: 4px; }
.rank-block.mt { margin-top: 14px; }
.rank-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 2px 0 8px; }
/* 整改率排名：项目点较多时改为可滚动，避免把仪表盘页面拉得过长（电脑端/手机端均生效） */
.rank-rows { max-height: 210px; overflow-y: auto; padding-right: 4px; }
.rank-rows::-webkit-scrollbar { width: 6px; }
.rank-rows::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.rank-row { display: grid; grid-template-columns: 22px 1fr 52px 1fr 56px; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.rank-row:last-child { margin-bottom: 0; }
.rank-row.no-data { opacity: .5; }
.rank-no { width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: var(--line); color: var(--muted); font-weight: 700; font-size: 12px; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-rate { font-weight: 700; text-align: right; }
.rank-rate.ok { color: #1eb579; }
.rank-rate.warn { color: var(--warn); }
.rank-rate.danger { color: var(--danger); }
.rank-meta { text-align: right; color: var(--muted); font-size: 12px; }
.rank-row .bar-track { height: 14px; }
@media (max-width: 600px){ .rank-row { grid-template-columns: 20px 1fr 44px 1fr 44px; gap: 6px; } }

/* 状态徽标 */
.tag { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag.rectifying { background: #fff1e0; color: var(--warn); }
.tag.verifying { background: #e6f0ff; color: var(--info); }
.tag.managing { background: #f0e9ff; color: #7b4ddb; }
.tag.done { background: #e6f7ee; color: var(--brand); }
.tag.self { background: #e8f4ff; color: #1f6fb2; }
.tag.overdue { background: #fde8e6; color: var(--danger); }

/* 登记分类（问题等级 A/B/C） */
.sev { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; border: 1px solid transparent; }
.sev-A { background: #fde8e6; color: #b71c1c; border-color: #f5c6c2; }
.sev-B { background: #fff4e0; color: #c66900; border-color: #ffd9a8; }
.sev-C { background: #e6f0ff; color: #1565c0; border-color: #c5dcfb; }
/* 详情页头部紧凑展示 */
.sev + .tag { margin-left: 0; }

/* 列表/表格 */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; }
.item:hover { border-color: var(--brand); }
.item .top { display: flex; justify-content: space-between; align-items: center; }
.item .title { font-weight: 600; font-size: 15px; }
.item .meta { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.7; }
.photo { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); margin-top: 8px; }

/* 表单 */
.form-grid { display: grid; gap: 14px; max-width: 560px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 8px 14px; color: var(--muted); }
.seg button.active { background: var(--brand); color: #fff; }
/* 登记分类 segmented 选择：active 时按钮变对应等级颜色 */
.seg button.sev-A.active { background: #e53935; color: #fff; }
.seg button.sev-B.active { background: #fb8c00; color: #fff; }
.seg button.sev-C.active { background: #1e88e5; color: #fff; }
/* 不同等级按钮未选中时的边框/底色提示（一眼能看出对应颜色） */
.seg button.sev-A { background: #fff5f5; color: #b71c1c; }
.seg button.sev-B { background: #fff8f0; color: #c66900; }
.seg button.sev-C { background: #f0f7ff; color: #1565c0; }

/* 时间线 */
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 16px; }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item::before { content: ''; position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.tl-item .t { font-size: 12px; color: var(--muted); }
.tl-item .d { font-size: 13px; margin-top: 2px; }

/* 通知 */
.noti { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; }
.noti.unread { border-left: 3px solid var(--brand); }
.noti .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; }
.noti.read .dot { background: transparent; }
.noti .title { font-weight: 600; }
.noti .body { color: var(--muted); font-size: 13px; margin-top: 3px; }
.noti .time { color: var(--muted); font-size: 11px; margin-top: 4px; }

/* tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* 多选负责人 */
/* 详情页返回条 */
.detail-back { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-back .btn { padding: 7px 14px; font-weight: 600; }
.detail-back .btn:hover { background: #fff; }

/* 待我核验板块 */
.nav-with-badge { position: relative; justify-content: flex-start; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; min-width: 18px; text-align: center; }
.verify-head { background: linear-gradient(120deg, #fff7ed, #ecfdf3); border: 1px solid #ffe0bd; }
.verify-num { font-size: 34px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.verify-num .unit { font-size: 13px; font-weight: 500; color: var(--muted); -webkit-text-fill-color: var(--muted); margin-left: 3px; }
.warn-tip { background: #fff4ec; border: 1px solid #ffd7b5; color: #b4550c; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.v-item { cursor: pointer; border-left: 4px solid var(--warn); }
.v-item:hover { border-color: var(--brand); border-left-color: var(--brand); }
.v-item .rectify-line { color: var(--brand-d, #15693a); }
/* 快捷通过/驳回按钮 */
.qa { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.qa .btn { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.qa .v-go { margin-top: 0; }
.btn.ok { background: linear-gradient(135deg, var(--brand), var(--brand-d)); }
.btn.ok:hover { filter: brightness(1.05); }
.btn.big { padding: 11px 20px; font-size: 15px; flex: 1; }
.action-card { border: 2px solid var(--accent); box-shadow: 0 6px 18px rgba(255, 138, 61, 0.15); }
.action-card h3 { color: #b4550c; }

.review-item { border-left-color: var(--info); }
.review-item:hover { border-left-color: var(--brand); }
.v-go { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--brand); }
.empty-box { text-align: center; padding: 40px 20px; }
.empty-ico { font-size: 40px; }
.empty-txt { font-size: 15px; font-weight: 600; margin: 6px 0 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #1f2733; color: #fff; padding: 11px 20px; border-radius: 10px; box-shadow: var(--shadow); z-index: 50; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- 顶部食品安全标语滚动条 ---------- */
.slogan-ticker {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, #fff3e0 0%, #fff8e7 50%, #e8f7ee 100%);
  border-bottom: 1px solid #ffe0b2;
  padding: 7px 16px;
  font-size: 13px; color: #8a4a00;
  overflow: hidden;
}
.slogan-icon { font-size: 16px; flex: 0 0 auto; }
.slogan-track { flex: 1; overflow: hidden; position: relative; height: 22px; }
.slogan-rail { display: inline-flex; white-space: nowrap; will-change: transform; animation: slogan-roll 40s linear infinite; }
.slogan-rail span { padding: 0 28px; position: relative; }
.slogan-rail span::after { content: "·"; position: absolute; right: 4px; color: #f0a060; }
.slogan-rail span:last-child::after { content: ""; }
.slogan-ticker:hover .slogan-rail { animation-play-state: paused; }
@keyframes slogan-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 详情弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(20, 30, 40, 0.45); backdrop-filter: blur(2px); }
.modal-card { position: relative; background: #fff; width: min(720px, 92vw); max-height: 86vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff3e0, #e8f7ee); }
.modal-title { font-size: 16px; font-weight: 700; color: #2f5d3a; }
.modal-close { border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-body .insp-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all .15s; background: #fafdfb; }
.modal-body .insp-row:hover { border-color: var(--brand); background: #fff; transform: translateX(2px); }
.modal-body .empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* 整改提交后：返回列表 / 整改下一项 弹窗 */
.rc-modal-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(20,30,40,.45); }
.rc-modal { background: #fff; width: min(420px, 90vw); border-radius: 14px; padding: 22px 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.rc-modal .rc-ico { font-size: 40px; line-height: 1; }
.rc-modal h3 { font-size: 18px; }
.rc-btns { display: flex; gap: 10px; margin-top: 16px; }
.rc-btns .btn { flex: 1; }
.rc-done { text-align: center; padding: 64px 20px; }
.rc-done-ico { font-size: 64px; line-height: 1; }
.rc-done h2 { margin: 10px 0; }
.top-user { font-size: 12px; color: var(--muted); margin-right: 2px; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 仪表盘可点击项 */
.card.clickable { cursor: pointer; transition: all .15s; }
.card.clickable:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(255, 138, 61, 0.18); transform: translateY(-1px); }
.bar-row.clickable { cursor: pointer; }
.bar-row.clickable:hover .bar-track { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.stat.clickable { cursor: pointer; transition: all .15s; }
.stat.clickable:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(255, 138, 61, 0.18); transform: translateY(-1px); }
.click-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 照片展示 ---------- */
.photo-label { font-size: 13px; font-weight: 600; color: #2f5d3a; margin-bottom: 6px; }
.photo-empty { padding: 18px; text-align: center; color: var(--muted); background: #f7faf8; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; }
img.photo.zoomable { cursor: zoom-in; }
img.photo.zoomable:hover { opacity: .92; }

/* ---------- 状态筛选 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 移动端适配（手机/窄屏） ---------- */
.menu-btn { display: none; background: none; border: none; font-size: 22px; line-height: 1; padding: 8px 10px; margin-left: -10px; color: var(--ink); cursor: pointer; }
.menu-btn:active { background: #f1f5f3; border-radius: 6px; }
#backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s; }
#backdrop.open { opacity: 1; pointer-events: auto; }

@media (max-width: 768px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  #backdrop { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 250px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
    box-shadow: 0 0 30px rgba(0,0,0,.3);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 0 10px; gap: 6px; }
  #view-title { font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { gap: 6px; }
  .top-actions .ghost { padding: 6px 10px; font-size: 13px; }
  .view { padding: 12px; }
  .slogan-ticker { font-size: 12px; }
  .slogan-icon { padding: 6px 8px; font-size: 13px; }
  /* 列表 / 卡 / 表单 */
  .item { padding: 12px; }
  .item .title { font-size: 14px; }
  .card { padding: 14px; }
  .form-grid { max-width: 100%; }
  /* 统计卡：手机端允许更小宽度 */
  .stats { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat .n { font-size: 22px; }
  /* 柱状图：名字列窄一些 */
  .bar-row { grid-template-columns: 80px 1fr 32px; gap: 8px; }
  /* 详情页 / 操作卡 */
  .detail-back { padding: 8px 12px; flex-wrap: wrap; }
  .detail-back .btn { padding: 6px 12px; font-size: 13px; }
  .action-card { padding: 12px; }
  .action-card .btn.big { padding: 9px 14px; font-size: 14px; }
  /* 列表 QA 按钮（核验/审核） */
  .qa { padding: 10px 12px; }
  .qa-btn { padding: 6px 10px; font-size: 13px; }
  /* 模态框：几乎全屏，保留安全边距 */
  .modal-card { width: calc(100vw - 24px); max-width: 100%; max-height: 85vh; border-radius: 12px; }
  /* 照片 */
  .photo { max-height: 200px; }
  /* 模态照片预览：全屏 */
  #modal.photo-modal .modal-card { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; background: rgba(0,0,0,.92); }
  #modal.photo-modal .modal-head { background: transparent; color: #fff; }
  #modal.photo-modal .modal-close { color: #fff; font-size: 28px; }
  #modal.photo-modal .modal-body { padding: 0; display: flex; align-items: center; justify-content: center; }
  #modal.photo-modal .modal-body img { max-width: 100%; max-height: 90vh; object-fit: contain; }
/* 导出按钮：手机上更紧凑 */
  .export-btn { padding: 6px 10px; font-size: 12px; }
  .verify-num { font-size: 22px; }
}
@media (max-width: 480px) {
  /* 极窄屏：导出按钮 + 数字行换成垂直堆叠 */
  .verify-head .row.gap { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat .n { font-size: 20px; }
  .bar-row { grid-template-columns: 70px 1fr 28px; }
}

/* ============ 表单质检（qc） ============ */
.btn.tiny { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--brand)); color: #fff; }
.qc-row { padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.qc-row:hover { background: #fafaf8; }
.qc-sec-head { border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.qc-dim { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; background: #fff; }
.qc-dim-head { align-items: flex-start; }
.qc-rule { background: #fff8ee; border-left: 3px solid var(--warn); padding: 6px 8px; margin-top: 8px; border-radius: 4px; line-height: 1.6; }
.qc-pt { border-top: 1px dashed var(--line); padding: 10px 0 4px; border-radius: 4px; }
.qc-pt.ok { background: #f6fbf7; }
.qc-pt.bad { background: #fff6f5; }
.qc-pt-text { font-size: 13px; line-height: 1.55; }
.qc-pt-rule { margin-top: 4px; line-height: 1.6; }
/* 照片卡：图在上、两个大按钮在下（手机上好按） */
.qc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.qc-ph { position: relative; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: #fff; }
.qc-ph-img { height: 96px; background: #f2f2f0; }
.qc-ph-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qc-ph-del { position: absolute; top: 0; right: 0; width: 30px; height: 30px; line-height: 28px; text-align: center; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 0 0 8px 0; font-size: 20px; cursor: pointer; padding: 0; }
.qc-ph.add { display: flex; align-items: center; justify-content: center; min-height: 140px; border: 2px dashed var(--line); font-size: 14px; font-weight: 600; color: var(--brand); cursor: pointer; }
.qc-warn { background: #fff6f5; border-left: 3px solid var(--danger); padding: 10px; border-radius: 6px; font-size: 13px; line-height: 1.7; }
.qc-edit-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.qc-edit-row input[type="text"], .qc-edit-row input:not([type]), .qc-edit-row textarea { font-size: 13px; }

/* 大项 / 维度 折叠：靠 class 显隐，不重建 DOM（避免闪屏、自动关闭） */
.qc-sec-body { display: none; }
.qc-sec.open .qc-sec-body { display: block; }
.qc-dim-body { display: none; }
.qc-dim.open .qc-dim-body { display: block; }
.qc-sec-head h3, .qc-dim-head { user-select: none; }

/* 合格/不合格/清除 大按钮（显眼、不漏点） */
.btn.verdict { padding: 12px 20px; font-size: 16px; font-weight: 700; border-radius: 10px; min-width: 96px; min-height: 46px; }
.btn.verdict.primary, .btn.verdict.ok { background: linear-gradient(135deg, #43a047, #2e7d32); color: #fff; border-color: transparent; }
.btn.verdict.danger, .btn.verdict.bad { background: linear-gradient(135deg, #ef5350, #c62828); color: #fff; border-color: transparent; }
.btn.verdict.ghost { background: #fff; border: 2px solid #c9c9c4; color: #333; }
.qc-verdict-row { margin-top: 8px; }
.qc-verdict-row .btn.verdict { flex: 1 1 96px; }

/* 报告操作区：保存 / 打印 / 返回 三个主按钮与流程按钮分组，颜色区分 */
.qc-actions { margin-top: 12px; }
.qc-act-main { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qc-act-main .btn { min-height: 42px; }
.qc-act-sub { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.btn.save { background: linear-gradient(135deg, #43a047, #2e7d32); color: #fff; }
.btn.print { background: linear-gradient(135deg, #42a5f5, #1565c0); color: #fff; }
.btn.print.ghost { background: #fff; color: #1565c0; border: 1px solid #90caf9; }
.btn.back { background: #fff; color: #555; border: 1px solid #c9c9c4; }
.btn:disabled { opacity: .6; }

/* 单张照片评定：按钮在图片下方，整宽平分，44px 高易点击 */
.qc-ph.ok { border-color: #2e7d32; }
.qc-ph.bad { border-color: #c62828; }
.qc-ph.pending { border-color: #f9a825; }
.qc-ph-v { display: flex; border-top: 1px solid var(--line); }
.qc-ph-v .btn.verdict { flex: 1; min-width: 0; min-height: 44px; height: 44px; line-height: 40px; padding: 0 4px; font-size: 15px; border: none; border-radius: 0; border-right: 1px solid var(--line); }
.qc-ph-v .btn.verdict:last-child { border-right: none; }
.qc-ph-badge { text-align: center; font-size: 14px; font-weight: 700; padding: 9px 0; border-top: 1px solid var(--line); color: #777; background: #fafaf8; }
.qc-ph-badge.ok { background: rgba(46,125,50,.12); color: #2e7d32; }
.qc-ph-badge.bad { background: rgba(198,40,40,.12); color: #c62828; }

/* 提交跳转高亮 */
.qc-flash { animation: qcflash 1.3s ease; }
@keyframes qcflash { 0%,100% { background: transparent; } 25% { background: #fff3cd; } }

/* 质检报告打印 / 导出 PDF：隐藏导航与按钮，卡片分页不切断 */
@media print {
  .sidebar, .topbar, .slogan-ticker, .btn, .menu-btn, .top-actions { display: none !important; }
  body, .content, .view, .card { background: #fff !important; }
  .content { margin: 0 !important; padding: 0 !important; }
  .card { break-inside: avoid; border: 1px solid #ddd; box-shadow: none; }
  .qc-dim { break-inside: avoid; }
  .qc-ph-del, .qc-verdict-row { display: none !important; }
  .qc-photos { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 备案信息 footer（合规公示） ---------- */
.beian-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 7px 14px;
  font-size: 12px; line-height: 1.5; color: #5b6b62;
  background: rgba(255, 255, 255, .92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(4px);
}
.beian-footer a { color: #4a8a66; text-decoration: none; }
.beian-footer a:hover { text-decoration: underline; }
.beian-footer .beian-sep { opacity: .5; margin: 0 4px; }
.beian-footer .beian-gongan { color: #9aa6a0; }
.beian-footer .beian-icon { height: 14px; width: 14px; vertical-align: -2px; margin-right: 3px; }
@media (max-width: 480px) {
  .beian-footer { font-size: 11px; padding: 6px 10px; }
}

