/* 汇报材料生成器 · 样式（沿用 001 号三件套小样的 V1 政务蓝令牌与模板样式，另加工具界面样式）
   红线：圆角 ≤8px、无投影、状态=颜色+文字、零外部依赖。 */
:root {
  --navy: #1B3A6B; --blue: #2563EB; --gold: #B45309; --red: #DC2626; --green: #15803D;
  --bg: #F3F5F9; --card: #FFFFFF; --line: #D8DEE8;
  --ink: #18263A; --ink2: #52637A;
  --navy-soft: #E9EEF6; --blue-soft: #E8EFFB; --gold-soft: #FBEED3; --red-soft: #FBE5E5; --green-soft: #E3F1E8; --gray-soft: #E9EDF3;
  --font: -apple-system, "PingFang SC", "MiSans", "HarmonyOS Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; } body { margin: 0; color: var(--ink); font: 14px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; } ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.sec { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; color: var(--navy); }
.sec::before { content: ""; flex: none; width: 4px; height: 14px; background: var(--navy); border-radius: 1px; }
.place-note { display: inline-block; padding: 3px 10px; border: 1px solid #E9CE97; border-radius: 4px; background: var(--gold-soft); color: #7A4A0A; font-size: 12px; font-weight: 600; }

/* ============ 工具界面 ============ */
.tool-body { background: var(--bg); min-height: 100vh; }
.tool-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 20px; background: linear-gradient(180deg, #1F4179, var(--navy) 60%, #14294D); color: #fff; border-bottom: 4px solid var(--gold); }
.tool-head h1 { font-size: 20px; letter-spacing: .06em; }
.tool-head .sub { font-size: 12px; opacity: .85; }
.tool-head .spacer { flex: 1; }
.tool-head label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #DCE4F0; }
.tool-head input[type="text"] { width: 170px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; background: rgba(255,255,255,.12); color: #fff; font: inherit; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: #5A6B8C; transition: background .15s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { left: 20px; }
.tool-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; display: flex; flex-direction: column; gap: 14px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px 16px; }
.step > h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--navy); margin-bottom: 10px; }
.step > h2 .no { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--navy); color: #fff; font-size: 13px; }
.step > h2 .hint { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ink2); }
.step.is-off { opacity: .55; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border: 1px solid var(--navy); border-radius: 6px; background: var(--navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: var(--card); color: var(--navy); }
.btn.gold { background: var(--gold); border-color: var(--gold); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.file-label { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border: 1px dashed var(--navy); border-radius: 6px; color: var(--navy); font-weight: 700; cursor: pointer; background: var(--blue-soft); }
.file-label input { display: none; }
.tip { margin-top: 8px; font-size: 12px; color: var(--ink2); line-height: 1.7; }
.msg { margin-top: 10px; padding: 9px 13px; border-radius: 6px; font-size: 13px; display: none; }
.msg.show { display: block; }
.msg.err { background: var(--red-soft); border: 1px solid #F0B4B4; color: #8A1E1E; }
.msg.ok { background: var(--green-soft); border: 1px solid #BBDCC6; color: #14532D; }
/* 概况格 */
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ov { padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 6px; background: #FBFCFE; }
.ov b { display: block; font-size: 20px; color: var(--navy); font-variant-numeric: tabular-nums; }
.ov span { font-size: 12px; color: var(--ink2); }
.ov-meta { margin-top: 10px; font-size: 12px; color: var(--ink2); line-height: 1.8; }
/* 周期选择 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { padding: 7px 18px; border: 0; background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--navy); color: #fff; }
.range-line { margin-top: 10px; font-size: 13px; color: var(--ink); }
.range-line b { color: var(--navy); }
.custom-dates { display: none; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.custom-dates.show { display: flex; }
.custom-dates input { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
/* 数字口径表 */
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th, .stats-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; line-height: 1.6; }
.stats-table th { background: #FBFCFE; color: var(--ink2); font-weight: 700; white-space: nowrap; }
.stats-table .grp td { background: var(--navy-soft); color: var(--navy); font-weight: 800; }
.stats-table td.v { text-align: right; font-size: 16px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-table td.v.is-global { color: var(--gold); }
.no-data { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--gray-soft); color: var(--ink2); font-size: 12px; font-weight: 600; }
.discipline { margin-top: 12px; padding: 10px 14px; border: 1px solid #E9CE97; border-radius: 6px; background: var(--gold-soft); color: #7A4A0A; font-size: 12.5px; line-height: 1.8; }
.discipline b { font-weight: 800; }
/* 案例编辑 */
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .case-grid { grid-template-columns: 1fr; } }
.case-box { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.case-box > header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--navy-soft); color: var(--navy); font-weight: 800; font-size: 13px; }
.case-box > header .chip { padding: 1px 10px; border-radius: 4px; background: var(--navy); color: #fff; font-size: 12px; }
.case-box > header .src { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--ink2); }
.case-box .fld { padding: 6px 10px 8px; border-top: 1px solid var(--line); }
.case-box .fld label { display: block; font-size: 11px; color: var(--ink2); margin-bottom: 3px; font-weight: 700; }
.case-box textarea { width: 100%; min-height: 54px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 12.5px; line-height: 1.6; resize: vertical; background: #FBFCFE; }
.case-box textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
/* 预览与动作 */
.preview-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tabs button { padding: 7px 16px; border: 0; background: var(--card); font: inherit; font-weight: 700; cursor: pointer; border-left: 1px solid var(--line); color: var(--ink2); }
.tabs button:first-child { border-left: 0; }
.tabs button.on { background: var(--navy); color: #fff; }
.preview-box { margin-top: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); max-height: 70vh; padding: 14px; }
.preview-scaler { margin: 0 auto; width: max-content; }
/* 隐藏的导出/打印容器 */
.offstage { position: fixed; left: -11000px; top: 0; width: 1200px; }
#printArea { display: none; }
/* 大屏翻页条 */
.dp-pager { display: flex; align-items: center; gap: 12px; margin-top: 10px; justify-content: center; }
.dp-pager .dots { display: flex; gap: 6px; }
.dp-pager .dots i { width: 9px; height: 9px; border-radius: 50%; background: #C4CCD9; cursor: pointer; }
.dp-pager .dots i.on { background: var(--navy); }
.dp-stage { background: linear-gradient(165deg, #24304A, #131A28); }
.dp-stage .dp-holder { width: 1280px; height: 720px; transform-origin: top left; }
/* 全屏时 */
.tool-body.is-fs { overflow: hidden; }
#fsLayer { position: fixed; inset: 0; z-index: 60; background: #0E1420; display: none; align-items: center; justify-content: center; }
#fsLayer.show { display: flex; }
#fsLayer .dp-holder { position: relative; }
#fsLayer .fs-close { position: fixed; right: 14px; top: 12px; z-index: 61; padding: 6px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; font: inherit; cursor: pointer; }
#fsLayer .fs-nav { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 61; }
#fsLayer .fs-nav button { padding: 6px 18px; border-radius: 6px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.foot-note { text-align: center; font-size: 12px; color: var(--ink2); line-height: 1.9; padding: 10px 0 0; }

/* ============ 模板样式（与 001 号小样同名同款） ============ */
/* 长图（1080） */
.changtu { width: 1080px; margin: 0 auto; background: var(--bg); }
.ct-head { padding: 56px 40px 44px; background: linear-gradient(180deg, #1F4179, var(--navy) 60%, #14294D); color: #fff; border-bottom: 6px solid var(--gold); text-align: center; }
.ct-org { font-size: 20px; letter-spacing: .3em; opacity: .9; }
.ct-title { margin-top: 14px; font-size: 64px; font-weight: 800; letter-spacing: .06em; }
.ct-sub { margin-top: 12px; display: inline-block; padding: 8px 26px; border: 1px solid rgba(255,255,255,.45); border-radius: 6px; font-size: 26px; letter-spacing: .18em; }
.ct-main { padding: 32px 40px 0; }
.ct-sec { margin: 30px 0 14px; font-size: 26px; }
.ct-sec .sec-tag { margin-left: auto; font-size: 16px; font-weight: 400; color: var(--ink2); }
.ct-band { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.stat { padding: 26px 8px 20px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 56px; font-weight: 800; line-height: 1.15; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat b i { font-style: normal; font-size: 24px; font-weight: 700; margin-left: 2px; }
.stat b .no-data { font-size: 26px; }
.stat span { display: block; margin-top: 8px; font-size: 20px; color: var(--ink2); white-space: nowrap; }
.led { margin-bottom: 22px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.led-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: var(--navy-soft); border-bottom: 1px solid var(--line); font-size: 20px; font-weight: 800; color: var(--navy); }
.led-head .chip { padding: 2px 12px; border-radius: 4px; background: var(--navy); color: #fff; font-size: 15px; font-weight: 700; }
table.led-tbl { width: 100%; border-collapse: collapse; font-size: 19px; }
.led-tbl th { width: 8.5em; padding: 13px 18px; border-top: 1px solid var(--line); background: #FBFCFE; color: var(--ink2); font-size: 17px; font-weight: 700; text-align: left; vertical-align: top; white-space: nowrap; }
.led-tbl td { padding: 13px 18px 13px 0; border-top: 1px solid var(--line); line-height: 1.6; }
.led-tbl tr.is-ok td, .led-tbl tr.is-ok th { color: var(--green); font-weight: 700; }
.led-tbl tr.is-ok th { background: var(--green-soft); }
.slot-empty { color: #94A3B8; }
.ct-qr { display: flex; align-items: center; gap: 22px; padding: 24px 28px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.qr-box { flex: none; width: 150px; height: 150px; display: grid; place-items: center; border: 2px dashed #94A3B8; border-radius: 8px; background: #FBFCFE; color: #94A3B8; font-size: 16px; font-weight: 700; text-align: center; }
.ct-qr b { display: block; font-size: 22px; color: var(--navy); }
.ct-qr p { margin-top: 8px; font-size: 16px; color: var(--ink2); }
.ct-foot { margin-top: 26px; padding: 20px 0 30px; border-top: 1px solid var(--line); text-align: center; font-size: 16px; color: var(--ink2); }
/* 大屏（1280×720） */
.dapin { width: 1280px; height: 720px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.dp-head { flex: none; display: flex; justify-content: space-between; align-items: flex-end; padding: 20px 28px 14px; background: linear-gradient(180deg, #1F4179, var(--navy) 60%, #14294D); color: #fff; border-bottom: 3px solid var(--gold); }
.dp-org { font-size: 12px; letter-spacing: .24em; opacity: .88; }
.dp-title { margin-top: 3px; font-size: 26px; font-weight: 800; letter-spacing: .06em; }
.dp-date { flex: none; font-size: 14px; opacity: .95; padding-bottom: 3px; }
.dp-main { flex: 1; min-height: 0; padding: 18px 28px; display: flex; flex-direction: column; gap: 14px; }
.dp-foot { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 9px 28px; background: var(--card); border-top: 1px solid var(--line); font-size: 13px; color: var(--ink2); }
.dp-foot .place-note { padding: 1px 8px; font-size: 11px; }
.sq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sq { padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--navy); border-radius: 8px; }
.sq h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; color: var(--navy); }
.sq h3::before { content: ""; flex: none; width: 4px; height: 13px; background: var(--navy); border-radius: 1px; }
.sq b { display: block; margin-top: 8px; font-size: 34px; font-weight: 800; line-height: 1.15; color: var(--navy); font-variant-numeric: tabular-nums; }
.sq b i { font-style: normal; font-size: 16px; font-weight: 700; margin-left: 2px; }
.sq b .no-data { font-size: 16px; }
.sq b.ask { display: inline; font-size: 13px; margin-top: 0; }
.sq p { margin-top: 5px; font-size: 13px; color: var(--ink2); line-height: 1.55; }
.map-ph { position: relative; flex: 1; background: var(--navy-soft); border: 1px dashed #94A3B8; border-radius: 8px; overflow: hidden; }
.map-ph .dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }
.dot.d-low { background: var(--green); } .dot.d-mid { background: var(--gold); } .dot.d-high { background: var(--red); }
.map-ph .map-cap { position: absolute; left: 12px; top: 12px; padding: 3px 12px; border-radius: 4px; background: rgba(27,58,107,.85); color: #fff; font-size: 13px; font-weight: 700; }
.map-leg { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 14px; padding: 6px 12px; border-radius: 6px; background: rgba(255,255,255,.92); border: 1px solid var(--line); font-size: 12px; color: var(--ink); }
.map-leg i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 50%; }
.legend { display: flex; justify-content: center; gap: 26px; font-size: 13px; color: var(--ink); }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
.chart { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; flex: 1; min-height: 0; padding: 14px 10px 0; }
.ch-m { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.ch-bars { display: flex; align-items: flex-end; gap: 7px; height: 300px; }
.ch-bars i { width: 26px; border-radius: 3px 3px 0 0; position: relative; }
.ch-bars i em { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink2); font-variant-numeric: tabular-nums; }
.ch-bars .c-a { background: var(--navy); } .ch-bars .c-b { background: var(--gold); } .ch-bars .c-c { background: var(--green); }
.ch-m > b { font-size: 14px; color: var(--ink2); font-weight: 700; }
.concl { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border: 1px solid var(--line); border-left: 5px solid var(--navy); border-radius: 8px; background: var(--card); font-size: 15px; }
.concl b { color: var(--navy); }
.tl { display: flex; gap: 14px; }
.tl-step { flex: 1; position: relative; padding: 16px 16px 14px; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--navy); border-radius: 8px; }
.tl-step.s1 { border-top-color: var(--gold); } .tl-step.s2 { border-top-color: var(--blue); } .tl-step.s3 { border-top-color: var(--green); }
.tl-no { position: absolute; right: 14px; top: 12px; font-size: 34px; font-weight: 800; color: var(--navy-soft); font-variant-numeric: tabular-nums; }
.tl-step b { display: block; font-size: 18px; color: var(--ink); }
.tl-step time { display: inline-block; margin: 7px 0 8px; padding: 2px 10px; border-radius: 4px; background: var(--navy-soft); color: var(--navy); font-size: 13px; font-weight: 700; }
.tl-step p { font-size: 14px; line-height: 1.6; color: var(--ink); }
.b-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.b-mini > div { padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.b-mini b { display: block; font-size: 28px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.b-mini b.is-red { color: var(--red); } .b-mini b.is-green { color: var(--green); }
.b-mini b .no-data { font-size: 15px; }
.b-mini span { font-size: 13px; color: var(--ink2); }
.badge-ok { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border: 1px solid var(--green); border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: 14px; font-weight: 800; }
.badge-ok::before { content: "✓"; font-size: 12px; }
.plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan > div { display: flex; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.plan i { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--navy); color: #fff; font-style: normal; font-size: 17px; font-weight: 800; }
.plan p { font-size: 14px; line-height: 1.55; }
/* 简报（A4） */
.paper { width: 760px; aspect-ratio: 210 / 297; margin: 0 auto; padding: 72px 76px 60px; background: #fff; border: 1px solid var(--line); }
.jb-title { text-align: center; font-size: 23px; line-height: 1.5; font-weight: 800; letter-spacing: .02em; }
.jb-rule { margin: 26px 0 22px; border: 0; border-top: 2px solid var(--ink); }
.jb-h { margin: 18px 0 8px; font-size: 16px; font-weight: 800; }
.jb-p { text-indent: 2em; font-size: 15px; line-height: 1.9; text-align: justify; }
.jb-sign { margin-top: 34px; text-align: right; font-size: 15px; line-height: 1.9; }
.jb-note { margin-top: 40px; text-align: center; }
/* 简报预览容器（屏显灰底） */
.jb-holder { background: var(--gray-soft); padding: 20px 0 30px; }
/* 打印：只出简报 */
@media print {
  @page { size: A4 portrait; margin: 0; }
  body.tool-body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  #printArea .paper { width: 100%; aspect-ratio: auto; min-height: 100vh; border: 0; padding: 22mm 20mm 18mm; }
}
