/* ============================================================
   隐患排查整改管理系统 —— 简洁政务 / 企业管理风
   无外部依赖，便于内网 IIS 部署
   ============================================================ */

:root {
  --blue-900: #0f2f5c;
  --blue-800: #143d79;
  --blue-700: #1b4f9c;
  --blue-600: #2563b8;
  --blue-100: #dbe7f7;
  --blue-50: #eef4fc;

  --ink: #1e293b;
  --ink-2: #475569;
  --muted: #7b8794;
  --line: #e3e8ef;
  --line-2: #eef1f6;

  --bg: #f2f5f9;
  --surface: #ffffff;

  --ok: #0f7b4f;
  --ok-bg: #e6f5ee;
  --warn: #b45309;
  --warn-bg: #fdf3e2;
  --danger: #c0392b;
  --danger-bg: #fdecea;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 47, 92, .06);
  --shadow-md: 0 6px 20px rgba(15, 47, 92, .10);
  --shadow-lg: 0 24px 60px rgba(15, 47, 92, .22);

  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
          "Noto Sans CJK SC", "WenQuanYi Micro Hei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* 兜底：hidden 属性优先级须高于 .modal{display:flex} / .lightbox{display:grid} */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 400px at 15% -10%, rgba(27, 79, 156, .10), transparent 60%),
    radial-gradient(900px 360px at 95% 0%, rgba(37, 99, 184, .07), transparent 55%),
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: auto, auto, 46px 46px, 46px 46px;
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 顶栏 ---------------- */
.appbar {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 55%, var(--blue-700) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(15, 47, 92, .18);
  position: relative;
  overflow: hidden;
}
.appbar::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}
.appbar__inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand__mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  flex: none;
}
.brand__text h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.brand__text p { margin: 1px 0 0; font-size: 12px; color: rgba(255, 255, 255, .72); letter-spacing: .3px; }
.appbar__meta { font-size: 12.5px; color: rgba(255, 255, 255, .78); letter-spacing: .3px; white-space: nowrap; }

/* ---------------- 布局 ---------------- */
.page { max-width: 1360px; margin: 0 auto; padding: 22px 24px 48px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------------- 统计卡片 ---------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  /* 统计卡片是可点击的筛选按钮，这里抹掉浏览器默认按钮样式 */
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.stat:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}
/* 当前生效的筛选卡片 */
.stat.is-active {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 2px rgba(37, 99, 214, .16), var(--shadow-md);
}
.stat.is-active::before { width: 6px; }
.stat--pending.is-active { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(245, 158, 11, .18), var(--shadow-md); }
.stat--ok.is-active { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(16, 163, 90, .18), var(--shadow-md); }
.stat--danger.is-active { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(224, 62, 62, .18), var(--shadow-md); }
.stat::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--blue-600);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat__label { font-size: 13px; color: var(--ink-2); font-weight: 600; letter-spacing: .3px; }
.stat__value {
  font-size: 32px; font-weight: 700; line-height: 1.15; margin: 6px 0 2px;
  color: var(--blue-700); font-variant-numeric: tabular-nums;
}
.stat__foot { font-size: 12px; color: var(--muted); }
.stat--pending::before { background: var(--warn); }
.stat--pending .stat__value { color: var(--warn); }
.stat--ok::before { background: var(--ok); }
.stat--ok .stat__value { color: var(--ok); }
.stat--danger::before { background: var(--danger); }
.stat--danger .stat__value { color: var(--danger); }

/* ---------------- 工具栏 ---------------- */
.toolbar {
  padding: 16px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  justify-content: space-between;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-end;
  flex: 1 1 auto;
}
.toolbar__actions { display: flex; gap: 10px; flex: none; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 132px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; letter-spacing: .2px; }
.field--grow { flex: 1 1 200px; min-width: 180px; }
.field--full { grid-column: 1 / -1; }

input[type="text"], input[type="date"], select, textarea {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #a9b2bd; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 184, .14);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ---------------- 按钮 ---------------- */
.btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .3px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 8px 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue-700); color: #fff; box-shadow: 0 2px 8px rgba(27, 79, 156, .28); }
.btn--primary:hover { background: var(--blue-800); }
.btn--ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--blue-600); color: var(--blue-700); background: var(--blue-50); }
.btn--danger { background: #fff; color: var(--danger); border-color: #f0c8c3; }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }

.icon-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--muted);
  width: 32px; height: 32px; border-radius: 6px;
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

/* ---------------- 表格 ---------------- */
.table-card { overflow: hidden; }
.table-card__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.table-card__head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .3px; position: relative; padding-left: 11px; }
.table-card__head h2::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px;
  border-radius: 2px; background: var(--blue-600);
}
.muted { color: var(--muted); font-size: 12.5px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 1080px; }
.table thead th {
  text-align: left;
  padding: 11px 14px;
  background: #f7f9fc;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .3px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
  color: var(--ink);
}
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #f8fafd; }
.table tbody tr.is-overdue { background: #fffaf8; }
.table tbody tr.is-overdue:hover { background: #fef5f2; }
.cell-desc { max-width: 300px; color: var(--ink-2); }
.cell-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.col-op { width: 1%; white-space: nowrap; }
.row-ops { display: flex; gap: 6px; flex-wrap: nowrap; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-100);
  white-space: nowrap;
}
.tag--empty { background: #f4f6f9; color: var(--muted); border-color: var(--line); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pending { background: var(--warn-bg); color: var(--warn); }
.badge--done { background: var(--ok-bg); color: var(--ok); }
.badge--overdue { background: var(--danger-bg); color: var(--danger); }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty p { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.empty span { font-size: 13px; }

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.pager__info { font-size: 12.5px; color: var(--muted); }
.pager__nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pager__nums { display: flex; align-items: center; gap: 4px; }
.pager__gap { color: var(--muted); font-size: 13px; padding: 0 2px; }

.pager__btn,
.pager__num {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pager__btn:hover:not(:disabled),
.pager__num:hover:not(.is-current) { border-color: var(--blue-600); color: var(--blue-700); }
.pager__btn:disabled { opacity: .45; cursor: not-allowed; }
.pager__num.is-current {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
  font-weight: 600;
}
.pager__btn:focus-visible,
.pager__num:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

/* ---------------- 弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 40px 18px; overflow-y: auto; }
.modal__mask { position: fixed; inset: 0; background: rgba(15, 32, 60, .5); backdrop-filter: blur(2px); animation: fade .18s ease; }
.modal__dialog {
  position: relative;
  background: var(--surface);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  animation: pop .2s cubic-bezier(.2, .8, .3, 1);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
}
.modal__dialog--wide { max-width: 820px; }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal__head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfe;
  border-radius: 0 0 10px 10px;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.req { color: var(--danger); font-style: normal; }

/* ---------------- 上传区 ---------------- */
.uploader { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.uploader__btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px dashed var(--blue-600);
  background: var(--blue-50);
  color: var(--blue-700);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.uploader__btn:hover { background: #e3edfa; border-style: solid; }
.uploader__hint { font-size: 12px; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.thumb {
  position: relative; width: 78px; height: 78px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line); background: #f4f6f9;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.thumb__del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(15, 32, 60, .68); color: #fff;
  font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.thumb__del:hover { background: var(--danger); }

/* ---------------- 详情 ---------------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.detail-item { background: #fff; padding: 11px 14px; }
.detail-item dt { font-size: 12px; color: var(--muted); margin: 0 0 3px; letter-spacing: .2px; }
.detail-item dd { margin: 0; font-size: 13.5px; color: var(--ink); word-break: break-word; white-space: pre-wrap; }
.detail-item--full { grid-column: 1 / -1; }

.section-title {
  margin: 22px 0 12px; font-size: 14px; font-weight: 700; color: var(--blue-800);
  display: flex; align-items: center; gap: 8px; letter-spacing: .3px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title:first-child { margin-top: 0; }

/* ---------------- 图片查看 ---------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8, 18, 36, .88);
  display: grid; place-items: center; padding: 40px; cursor: zoom-out;
  animation: fade .16s ease;
}
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: var(--shadow-lg); }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 120;
  background: var(--blue-900); color: #fff;
  padding: 11px 20px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; letter-spacing: .3px;
  box-shadow: var(--shadow-md);
  animation: toastIn .22s ease;
}
.toast--error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------------- 日期区间 ---------------- */
.field--range { min-width: 258px; }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range input { flex: 1 1 0; min-width: 0; }
.date-range__sep { font-style: normal; font-size: 12.5px; color: var(--muted); flex: none; }

/* ---------------- 移动端筛选开关（桌面隐藏） ---------------- */
.filter-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  cursor: pointer;
  min-height: 46px;
}
.filter-toggle__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--blue-700);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.filter-toggle__chev { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
.toolbar.is-open .filter-toggle__chev { transform: rotate(180deg); }

/* ---------------- 移动端记录卡片（桌面隐藏） ---------------- */
.record-list { display: none; }

.record-card {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(27, 79, 156, .09);
}
.record-card:last-child { border-bottom: none; }
.record-card.is-open { background: #fcfdff; }
.record-card.is-overdue { background: #fffaf8; }

.record-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.record-card__title { min-width: 0; flex: 1 1 auto; }
.record-card__place {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  word-break: break-word;
}
.record-card__date {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.record-card__head-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding-top: 2px;
}
.record-card__chev {
  flex: none;
  color: var(--muted);
  transition: transform .2s ease;
}
.record-card.is-open .record-card__chev { transform: rotate(180deg); }
.record-card__desc {
  margin: 0 0 11px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.record-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  padding: 11px 12px;
  background: #f7f9fc;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12.5px;
}
.record-card__meta > div { min-width: 0; }
.record-card__meta > .is-wide { grid-column: 1 / -1; }
.record-card__meta dt { color: var(--muted); margin: 0 0 2px; }
.record-card__meta dd {
  margin: 0;
  color: var(--ink);
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 详情默认折叠，点击卡片展开（同时只展开一张） */
.record-card__details { display: none; margin-top: 12px; }
.record-card.is-open .record-card__details { display: block; }

.record-card__ops { display: flex; gap: 8px; }
.record-card__ops .btn { flex: 1; justify-content: center; min-height: 42px; }

/* ---------------- 悬浮新增按钮（移动端） ---------------- */
.fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 50;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--blue-700);
  color: #fff;
  display: none;
  place-items: center;
  box-shadow: 0 8px 22px rgba(27, 79, 156, .45);
  transition: transform .22s ease, opacity .22s ease, background .15s ease;
}
.fab:active { transform: scale(.94); background: var(--blue-800); }
/* 向下滚动浏览列表时收起，避免遮挡卡片上的操作按钮 */
.fab.is-hidden {
  opacity: 0;
  transform: translateY(84px) scale(.86);
  pointer-events: none;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar__actions { justify-content: flex-end; }
}

/* 平板 / 手机：表格换成卡片列表，筛选默认收起 */
@media (max-width: 768px) {
  .table-wrap { display: none; }
  .record-list { display: block; }
  .filter-toggle { display: flex; }
  .toolbar__actions #btnAdd { display: none; }
  .fab { display: grid; }

  /* 统计卡片压缩成一行四列，让记录更早出现在首屏 */
  .stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .stat { padding: 10px 6px 9px; text-align: center; }
  .stat::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 3px; }
  /* 手机上色条在顶部，选中时改为加粗而不是加宽；同时去掉悬停位移，避免点按后残留 */
  .stat.is-active::before { width: auto; height: 5px; }
  .stat:hover { transform: none; }
  .stat__label { font-size: 11px; letter-spacing: 0; white-space: nowrap; }
  .stat__value { font-size: 20px; margin: 3px 0 0; }
  .stat__foot { display: none; }

  /* 手机端分页：居中并隐藏页码，只留上一页 / 下一页 */
  .pager { padding: 12px 14px; justify-content: center; }
  .pager__info { width: 100%; text-align: center; }
  .pager__nav { margin-left: 0; justify-content: center; }
  .pager__nums { display: none; }
  .pager__btn { min-width: 88px; height: 38px; }

  /* 筛选默认折叠，点击展开 */
  .filters { display: none; }
  .toolbar.is-open .filters { display: grid; }

  .filters {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px dashed var(--line);
  }
  .field--range { min-width: 0; }
  .field--grow { min-width: 0; }
  .toolbar__actions .btn { flex: 1; justify-content: center; min-height: 44px; }

  /* 16px 以下字号会让 iOS Safari 聚焦时自动放大页面 */
  input[type="text"], input[type="date"], select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .icon-btn { width: 40px; height: 40px; }

  /* 弹窗改为全屏，底部操作栏常驻可点 */
  .modal { padding: 0; align-items: stretch; }
  .modal__dialog {
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .modal__head { padding: 14px 16px; flex: none; }
  .modal__body { padding: 18px 16px; }
  .modal__foot { padding: 12px 16px; flex: none; }
  .record-card__ops .btn { min-height: 44px; }
  .thumb { width: 88px; height: 88px; }
  .uploader__btn { min-height: 44px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 32px); }
}

@media (max-width: 640px) {
  .appbar__inner { padding: 13px 16px; }
  .appbar__meta { display: none; }
  .page { padding: 16px 14px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* 刘海屏安全区适配（仅移动端，避免影响桌面内边距） */
@media (max-width: 768px) {
  @supports (padding: max(0px)) {
    .appbar__inner {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
    }
    .page {
      padding-left: max(14px, env(safe-area-inset-left));
      padding-right: max(14px, env(safe-area-inset-right));
      padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }
    .fab {
      bottom: calc(22px + env(safe-area-inset-bottom, 0px));
      right: calc(18px + env(safe-area-inset-right, 0px));
    }
    .modal__foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  }
}
