/* 迎检资料检索系统：桌面默认紧凑清晰（1rem = 14px），“投屏模式”整体放大，移动端可用。
   字号基准：页面标题 22px，区块标题 17px，小标题 15px，正文/表单 14px，表格 13px，辅助信息与徽章 12px。 */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #d1d5db;
  --primary: #0b4f9c;
  --primary-ink: #ffffff;
  --danger: #b91c1c;
  --ok: #15803d;
  --warn: #c2410c;
  --slate: #475d7c;
  --gray: #6b7280;
  --radius: 8px;
  font-size: 14px;
}
html.screen { font-size: 18px; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
h1 { font-size: 1.572rem; line-height: 1.35; margin: .2rem 0 .8rem; }
h2 { font-size: 1.215rem; line-height: 1.4; margin: 1.1rem 0 .5rem; }
h3 { font-size: 1.072rem; line-height: 1.4; margin: .8rem 0 .35rem; }
[hidden] { display: none !important; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding: .4rem 1rem; background: #0f2747; color: #fff;
}
.brand { color: #fff; font-weight: 700; font-size: 1.143rem; text-decoration: none; white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.nav a { color: #dbe7f7; text-decoration: none; padding: .3rem .7rem; border-radius: 6px; font-weight: 600; }
.nav a:hover { background: rgba(255,255,255,.12); }
.nav a.active { background: #fff; color: #0f2747; }
.who { display: flex; align-items: center; gap: .5rem; font-size: .929rem; }
.who .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }

.container { max-width: 1320px; margin: 0 auto; padding: 1.1rem 1.25rem; min-height: 70vh; }
.footer { text-align: center; color: var(--muted); font-size: .857rem; padding: 1rem 1rem 1.6rem; border-top: 1px solid var(--line); }

/* 面板/卡片 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: .9rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: .857rem; line-height: 1.5; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; word-break: break-all; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.3; padding: .4rem .95rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink); text-decoration: none;
  min-height: 2.43rem; /* 34px */
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-sm { padding: .2rem .65rem; min-height: 2rem; /* 28px */ font-size: .929rem; }
.btn-lg { padding: .55rem 1.3rem; font-size: 1.072rem; min-height: 2.86rem; }

/* 表单 */
label { display: block; font-weight: 600; font-size: .929rem; margin: .5rem 0 .2rem; }
label.inline { display: inline-flex; align-items: center; gap: .35rem; font-weight: 500; margin: 0; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=number], input[type=file], select, textarea {
  font: inherit; font-size: 1rem; width: 100%; padding: .4rem .6rem; min-height: 2.43rem; border: 1px solid #9ca3af; border-radius: 6px; background: #fff; color: var(--text);
}
textarea { min-height: 5rem; resize: vertical; line-height: 1.55; }
input[type=checkbox], input[type=radio] { width: 1rem; height: 1rem; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.req::after { content: " *"; color: var(--danger); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: flex-end; }
.filters > * { flex: 1 1 160px; }
.filters > .btn, .filters > .grow0 { flex: 0 0 auto; }
.filters label { margin-top: 0; font-size: .857rem; }

/* 状态徽章：已核验有效=绿、临近失效=橙、已失效=红、待核实=灰蓝、缺失=红色描边、不适用=灰 */
.badge {
  display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-weight: 600; font-size: .857rem;
  border: 1.5px solid transparent; white-space: nowrap; line-height: 1.55; vertical-align: middle;
}
.s-ok { background: var(--ok); color: #fff; }
.s-warn { background: var(--warn); color: #fff; }
.s-expired { background: var(--danger); color: #fff; }
.s-pending { background: var(--slate); color: #fff; }
.s-missing { background: #fff; color: var(--danger); border-color: var(--danger); }
.s-na { background: var(--gray); color: #fff; }
.s-na-pending { background: #fff; color: var(--gray); border-color: var(--gray); border-style: dashed; }
.s-neutral { background: #e5e7eb; color: #1f2937; }
.s-superseded { background: #fff; color: #6b7280; border-color: #9ca3af; text-decoration: line-through; }
.s-rejected { background: #fff; color: var(--danger); border-color: var(--danger); border-style: dashed; }
.lv { display: inline-block; padding: 0 .4rem; border-radius: 4px; font-weight: 600; font-size: .857rem; line-height: 1.6; border: 1px solid; vertical-align: middle; }
.lv-关键 { background: #7f1d1d; color: #fff; border-color: #7f1d1d; }
.lv-重点 { background: #fff7ed; color: #9a3412; border-color: #9a3412; }
.lv-一般 { background: #f3f4f6; color: #374151; border-color: #9ca3af; }
.tag { display: inline-block; background: #eef2ff; color: #3730a3; border-radius: 6px; padding: 0 .4rem; font-size: .857rem; line-height: 1.6; margin: .1rem .2rem .1rem 0; }

/* 提醒/警示 */
.alert { border-radius: var(--radius); padding: .6rem .9rem; margin: .7rem 0; font-weight: 600; border: 1.5px solid; }
.alert-danger { background: #fef2f2; color: #7f1d1d; border-color: var(--danger); }
.alert-warn { background: #fff7ed; color: #7c2d12; border-color: var(--warn); }
.alert-info { background: #eff6ff; color: #1e3a8a; border-color: #3b82f6; }
.empty-hint { font-size: 1.215rem; text-align: center; padding: 1.1rem 1rem; }
.empty-hint .badge { font-size: 1rem; }
.error-box { background: #fef2f2; border: 1.5px solid var(--danger); color: #7f1d1d; padding: .6rem .9rem; border-radius: var(--radius); font-weight: 600; }

/* 首页 */
.hero { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.search-big { display: flex; gap: .5rem; }
.search-big input { font-size: 1.215rem; padding: .55rem .85rem; min-height: 3.14rem; border: 2px solid var(--primary); }
.search-big .btn { font-size: 1.143rem; padding: .5rem 1.6rem; min-height: 3.14rem; white-space: nowrap; }
.nav a { white-space: nowrap; }
.entries { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-top: .75rem; }
.entry {
  font: inherit; font-size: 1.072rem; font-weight: 700; line-height: 1.4; padding: .6rem .5rem; border-radius: var(--radius); cursor: pointer;
  border: 1.5px solid var(--primary); background: #fff; color: var(--primary); text-align: center;
}
.entry small { display: block; font-weight: 400; font-size: .857rem; line-height: 1.45; margin-top: .15rem; color: var(--muted); }
.entry.active { background: var(--primary); color: #fff; }
.entry.active small { color: #dbeafe; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.remind { border-left: 4px solid var(--gray); padding: .8rem 1rem; }
.remind.r-expiring { border-left-color: var(--warn); }
.remind.r-missing { border-left-color: var(--danger); }
.remind.r-pending { border-left-color: var(--slate); }
.remind h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 .25rem; font-size: 1.072rem; }
.remind .num { font-size: 1.572rem; font-weight: 800; line-height: 1.2; }
.remind ul { list-style: none; margin: .3rem 0 0; padding: 0; font-size: .929rem; line-height: 1.5; }
.remind li { padding: .3rem 0; border-top: 1px dashed var(--line); }

/* 结果卡片 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .95rem; margin-bottom: .6rem; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; align-items: baseline; }
.card-title { font-size: 1.143rem; font-weight: 700; line-height: 1.4; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: .45rem 0; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; word-break: break-word; }
.loc { font-weight: 600; color: #0f2747; background: #fefce8; padding: 0 .3rem; border-radius: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: .929rem; line-height: 1.5; }
th, td { text-align: left; padding: .45rem .65rem; border-bottom: 1px solid #e5e7eb; vertical-align: middle; }
th { background: #f1f4f8; font-size: .893rem; font-weight: 600; color: #374151; white-space: nowrap; }
td .small, td.small { font-size: .857rem; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f8fafc; }
tr.superseded td { color: #6b7280; background: #fafafa; }

/* 状态汇总条 */
.summary-bar { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; align-items: center; font-size: .929rem; }
.summary-bar button { font: inherit; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .2rem .55rem; min-height: 2rem; display: inline-flex; gap: .35rem; align-items: center; }
.summary-bar button.on { outline: 2px solid var(--primary); }
.summary-bar b { font-size: 1rem; }
.tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: .7rem; }
.tabs a { padding: .4rem .9rem; text-decoration: none; font-weight: 600; color: var(--muted); border: 2px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0; margin-bottom: -2px; }
.tabs a.active { color: var(--primary); background: #fff; border-color: var(--line); border-bottom: 2px solid #fff; }

/* 条款原文 */
.official { background: #fffef5; border: 1px solid #e5d9a6; border-radius: 8px; padding: .75rem 1rem; line-height: 1.7; }
.official h3 { margin-top: .3rem; }
.source-foot { font-size: .857rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .6rem; }

/* 弹窗 */
dialog.modal { border: none; border-radius: 12px; padding: 0; width: min(900px, 96vw); max-height: 92vh; }
dialog.modal::backdrop { background: rgba(15, 23, 42, .55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; background: #0f2747; color: #fff; position: sticky; top: 0; }
.modal-head h2 { margin: 0; font-size: 1.143rem; }
.modal-head button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 6px; font: inherit; cursor: pointer; padding: .1rem .6rem; min-height: 2rem; }
.modal-body { padding: 1rem; overflow: auto; }
dialog.modal.wide { width: min(1200px, 98vw); }
.preview-frame { width: 100%; height: 75vh; border: 1px solid var(--line); background: #fff; }
.preview-img { max-width: 100%; display: block; margin: 0 auto; background: #fff; }
.readonly-note { background: #eff6ff; color: #1e3a8a; padding: .3rem .6rem; font-size: .857rem; margin-bottom: .5rem; border-radius: 6px; }

.pick-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .5rem; background: #fff; }
.pick-list label { font-weight: 400; margin: .15rem 0; display: flex; gap: .4rem; align-items: flex-start; }
.pick-list input { margin-top: .35rem; }

/* 提示 */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, 92vw); }
.toast { padding: .6rem .9rem; border-radius: 8px; color: #fff; background: #1f2937; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

.login-box { max-width: 420px; margin: 8vh auto; }
.loading { color: var(--muted); padding: 1rem; }

/* 演示/测试环境横幅 */
.env-banner { background: #fde047; color: #422006; border-bottom: 2px solid #a16207; text-align: center; font-weight: 700; padding: .3rem 1rem; letter-spacing: .02em; }

/* 首页紧凑整改卡 */
.remind.r-issues { border-left-color: #7c3aed; }
.remind-mini { display: flex; flex-wrap: wrap; gap: .2rem 1rem; align-items: baseline; font-size: .929rem; }
.remind-mini b { font-size: 1.215rem; }
.remind-mini .over { color: var(--danger); }

/* 子页切换（自查 / 问题单） */
.subtabs { margin-top: -.2rem; }

/* 自查：进度与模拟判定 */
.progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: .35rem 0 .45rem; }
.progress > span { display: block; height: 100%; background: var(--primary); }
.sim-box { border: 2px dashed #7c3aed; background: #faf5ff; }
.sim-box .sim-flag { display: inline-block; background: #7c3aed; color: #fff; font-weight: 700; font-size: .857rem; padding: .05rem .5rem; border-radius: 4px; }
.sim-box .sim-conclusion { font-size: 1.072rem; font-weight: 700; margin: .4rem 0; }
.sim-box ul { margin: .2rem 0 .4rem; padding-left: 1.2rem; }
.sim-box details { margin-top: .35rem; }
.sim-box summary { cursor: pointer; font-weight: 600; font-size: .929rem; min-height: 28px; display: list-item; }
.quote { background: #fffef5; border-left: 3px solid #e5d9a6; padding: .35rem .6rem; margin: .3rem 0; font-size: .857rem; line-height: 1.6; }

/* 行内录入表格 */
table.edit-table td { vertical-align: top; }
table.edit-table select, table.edit-table textarea, table.edit-table input[type=text] {
  font-size: .929rem; min-height: 2rem; padding: .2rem .4rem;
}
table.edit-table textarea { min-height: 2.6rem; height: 2.6rem; }
table.edit-table textarea:focus { height: 5.2rem; }
table.edit-table tr.dirty td { background: #fffbeb; }
table.edit-table tr.saved td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
table.edit-table tr.r-不符合 td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.edit-table tr.r-存在瑕疵 td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.pv-hint { color: var(--danger); font-size: .857rem; font-weight: 600; line-height: 1.45; margin-top: .15rem; }
.pv-hint.strong { background: #fef2f2; border: 1px solid var(--danger); border-radius: 4px; padding: .1rem .35rem; }
.ev-chips { display: flex; flex-wrap: wrap; gap: .2rem; margin-bottom: .2rem; }
.ev-chip { display: inline-flex; align-items: center; gap: .2rem; background: #eef2ff; color: #3730a3; border-radius: 4px; padding: 0 .35rem; font-size: .857rem; line-height: 1.6; }
.row-msg { font-size: .786rem; color: var(--muted); }
.row-msg.err { color: var(--danger); font-weight: 600; }
.overdue { color: var(--danger); font-weight: 700; }

/* 过程记录时间线 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 .9rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: .25rem 0 .55rem .6rem; font-size: .929rem; }
.timeline li::before { content: ""; position: absolute; left: -1.27rem; top: .62rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--primary); }
.timeline .t-meta { font-size: .857rem; color: var(--muted); }

@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
  .entries { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  :root { font-size: 14px; }
  .search-big { flex-direction: column; }
  .container { padding: .6rem; }
  .who span { display: none; }
  .kv { grid-template-columns: 5.5em 1fr; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; }
  .who { margin-left: auto; }
  .hide-sm { display: none; }
}
@media print {
  .topbar, .toasts, .btn { display: none !important; }
}
