/* =========================================================
   德梦安全台账 · 统一样式
   配色与「dream_app 数据字典」保持一致：
   深青 #10323b / 纸灰 #eef0ec / 细线 #d8ddd7 / 等宽标识
   ========================================================= */

:root {
  --ink: #17201f;
  --ink-2: #5c6864;
  --ink-3: #7d8984;
  --paper: #eef0ec;
  --card: #ffffff;
  --line: #d8ddd7;
  --line-soft: #edf0eb;
  --deep: #10323b;
  --deep-2: #164450;
  --pk: #0f6b5c;
  --uk: #8a5a12;
  --idx: #3a6280;
  --danger: #a83b2c;
  --ok: #0f6b5c;
  --mono: "Cascadia Code", "Consolas", "SFMono-Regular", ui-monospace, monospace;
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--deep); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--deep);
  color: #fff;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}
.brand .b-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}
.brand .b-sub {
  font-size: 11px;
  color: #8fb0b4;
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-spacer { flex: 1 1 auto; }

.top-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #cfe0e2;
  white-space: nowrap;
}
.top-user .u-name { color: #fff; font-weight: 600; text-decoration: none; }
.top-user .u-role {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #9db9bd;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 2px;
  padding: 1px 5px;
}
.top-link {
  color: #cfe0e2;
  text-decoration: none;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 3px;
}
.top-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 3px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.burger svg { width: 16px; height: 16px; }

/* ---------------- 侧栏 ---------------- */
.shell { min-height: calc(100vh - 54px); }

.sidebar {
  position: fixed;
  top: 54px;
  bottom: 0;
  left: 0;
  z-index: 35;
  width: 214px;
  padding: 16px 0 28px;
  background: #f7f8f6;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .2s ease;
}
.sidebar.is-open { transform: translateX(0); }

.side-group {
  padding: 0 12px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: #9aa5a0;
}
.side-nav { display: flex; flex-direction: column; }

.side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 13px;
  border-left: 2px solid transparent;
  color: #42504c;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
}
.side-item .si-no {
  font-family: var(--mono);
  font-size: 10px;
  color: #9aa5a0;
  flex: none;
}
.side-item:hover { background: #e9ece6; color: var(--deep); }
.side-item.is-on {
  border-left-color: var(--deep);
  background: #e9ece6;
  color: var(--deep);
  font-weight: 600;
}
.side-item.is-on .si-no { color: #4a5651; }
.side-item .si-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}

.side-foot {
  margin-top: 22px;
  padding: 14px 13px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.7;
  color: #8a9590;
}

.side-mask {
  display: none;
  position: fixed;
  inset: 54px 0 0;
  z-index: 34;
  background: rgba(16, 50, 59, .35);
}
.sidebar.is-open + .side-mask { display: block; }

/* ---------------- 内容区 ---------------- */
.main {
  padding: 18px 14px 48px;
  min-width: 0;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.page-title { min-width: 0; }
.page-title h1 {
  font-size: 20px;
  line-height: 1.3;
  color: var(--deep);
  word-break: break-word;
}
.page-title .p-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

/* 面包屑 */
.crumbs {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: #8a9590;
}
.crumbs a { color: #5c6864; text-decoration: none; }
.crumbs a:hover { color: var(--deep); text-decoration: underline; }
.crumbs span { margin: 0 5px; color: #b6bfba; }

/* 提示 */
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #fbf4e6;
  border: 1px solid #ecd9b0;
  border-left: 3px solid var(--uk);
  border-radius: 3px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #6b4a12;
}
.notice code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: #fff;
  border: 1px solid #e6d7b8;
  padding: 1px 4px;
  border-radius: 2px;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 14px;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid #e3e7e1;
}
.card-head h2 {
  font-size: 14px;
  color: var(--deep);
  line-height: 1.4;
}
.card-head .c-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--mono);
}
.card-head .c-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 14px; }
.card-body.is-flush { padding: 0; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 620px;
}
.data-table th {
  padding: 8px 10px;
  background: #f4f6f2;
  border-bottom: 1px solid #dfe4de;
  font-size: 11px;
  font-weight: 600;
  color: #59645f;
  text-align: left;
  white-space: nowrap;
}
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  line-height: 1.55;
  color: #33403b;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fafbf8; }
.data-table .empty-row {
  padding: 22px 12px;
  text-align: center;
  color: #8a9590;
  font-size: 12.5px;
}
.data-table .ta-right { text-align: right; }.data-table .ta-center { text-align: center; }
.data-table .nowrap { white-space: nowrap; }

/* 可点击排序的表头 */
.data-table .sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.data-table .sort-link:hover { color: #10323b; text-decoration: underline; text-underline-offset: 3px; }
.data-table .sort-link.is-on { color: #10323b; }
.data-table .sort-link .arrow { font-size: 10px; color: #a8b2ad; line-height: 1; }
.data-table .sort-link.is-on .arrow { color: #0f6b57; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dash { color: #b6bfba; }
.t-strong { font-weight: 600; color: var(--ink); }

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 5px;
  border: 1px solid #cfd9d4;
  border-radius: 2px;
  font-size: 11px;
  text-decoration: none;
  color: var(--idx);
  white-space: nowrap;
}
.file-link:hover { background: #eef3f0; border-color: var(--idx); }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-ok { background: #e2f1ec; color: var(--pk); border-color: #c9e5dc; }
.badge-warn { background: #f9efda; color: var(--uk); border-color: #efdfc0; }
.badge-danger { background: #f7e6e2; color: var(--danger); border-color: #eccfc8; }
.badge-info { background: #e7eef4; color: var(--idx); border-color: #d3e0ea; }
.badge-brand { background: #e0ecef; color: var(--deep); border-color: #c8dbe0; }
.badge-muted { background: #f1f3ef; color: #8a9590; border-color: #e4e8e1; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid #cfd6cf;
  border-radius: 3px;
  background: #fff;
  color: #33403b;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--deep); color: var(--deep); background: #f7f9f6; }
.btn:focus-visible { outline: 2px solid var(--deep); outline-offset: 1px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn-primary:hover { background: var(--deep-2); border-color: var(--deep-2); color: #fff; }

.btn-sm { min-height: 30px; padding: 3px 10px; font-size: 12px; }
.btn-xs { min-height: 26px; padding: 2px 8px; font-size: 11.5px; }

.btn-ghost { background: transparent; }
.btn-danger-ghost { color: var(--danger); border-color: #e2c7c1; background: #fff; }
.btn-danger-ghost:hover { background: #fbf1ef; border-color: var(--danger); color: var(--danger); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f3024; border-color: #8f3024; color: #fff; }

.btn-link {
  border: 0;
  background: transparent;
  color: var(--idx);
  padding: 0 2px;
  min-height: 0;
  font-size: 12px;
}
.btn-link:hover { color: var(--deep); text-decoration: underline; }

/* ---------------- 筛选条 ---------------- */
.filter-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 14px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.filter-actions .f-tip {
  font-size: 11.5px;
  color: #8a9590;
  margin-left: auto;
}

/* ---------------- 表单 ---------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.field { min-width: 0; }
.field.is-full { grid-column: 1 / -1; }
.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #42504c;
}
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint {
  margin: 3px 0 0;
  font-size: 11px;
  color: #8a9590;
  line-height: 1.6;
}

.input, .select, .textarea {
  width: 100%;
  border: 1px solid #cfd6cf;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 7px 9px;
  min-height: 36px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--deep);
  box-shadow: 0 0 0 3px rgba(16, 50, 59, .09);
}
.input::placeholder, .textarea::placeholder { color: #a9b3ae; }
.textarea { min-height: 82px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6b7772 50%), linear-gradient(135deg, #6b7772 50%, transparent 50%); background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.form-actions .f-note { font-size: 11.5px; color: #8a9590; }

/* ---------------- 标签页 ---------------- */
.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}
.tab {
  flex: none;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #5c6864;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.tab:hover { color: var(--deep); background: #f7f9f6; }
.tab.is-on {
  color: var(--deep);
  font-weight: 600;
  border-bottom-color: var(--deep);
  background: #f4f7f4;
}
.tab .tab-n {
  margin-left: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: #9aa5a0;
}
.tab-panel { display: none; }
.tab-panel.is-on { display: block; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  padding: 16px;
  overflow-y: auto;
  background: rgba(16, 50, 59, .42);
}
.modal.is-open { display: flex; align-items: flex-start; justify-content: center; }
.modal-card {
  width: 100%;
  max-width: 560px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid #c9d2cb;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(16, 50, 59, .18);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e3e7e1;
}
.modal-head h3 { font-size: 14px; color: var(--deep); }
.modal-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid #d7ddd6;
  border-radius: 3px;
  background: #fff;
  color: #5c6864;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { border-color: var(--deep); color: var(--deep); }
.modal-body { padding: 14px; max-height: 66vh; overflow-y: auto; }
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid #e3e7e1;
  background: #fafbf8;
}

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
}
.pager-info {
  margin-right: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d3dad2;
  border-radius: 3px;
  background: #fff;
  color: #42504c;
  font-family: var(--mono);
  font-size: 11.5px;
  text-decoration: none;
}
.pg:hover { border-color: var(--deep); color: var(--deep); }
.pg-on { background: var(--deep); border-color: var(--deep); color: #fff; }
.pg-dots { color: #9aa5a0; font-size: 11px; padding: 0 2px; }

/* ---------------- 空态 ---------------- */
.empty {
  padding: 40px 16px;
  text-align: center;
  background: #fff;
  border: 1px dashed #cfd6cf;
  border-radius: 4px;
  color: #6b7772;
  font-size: 13px;
  line-height: 1.8;
}
.empty strong { display: block; font-size: 14px; color: var(--deep); margin-bottom: 4px; }

/* ---------------- Toast ---------------- */
.toast-box {
  position: fixed;
  top: 66px;
  right: 14px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 28px);
}
.toast {
  min-width: 180px;
  max-width: 360px;
  padding: 9px 12px;
  border-radius: 3px;
  background: var(--deep);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.6;
  box-shadow: 0 8px 20px rgba(16, 50, 59, .24);
}
.toast.is-error { background: var(--danger); }
.toast.is-ok { background: var(--pk); }

/* ---------------- 数据字典式信息条 ---------------- */
.kv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line-soft);
}
.kv {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.kv .k {
  flex: none;
  width: 108px;
  color: #7d8984;
}
.kv .v { min-width: 0; color: #33403b; word-break: break-word; }

/* ---------------- 统计卡 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 13px;
}
.stat .s-n {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.stat .s-l {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.stat.is-alert .s-n { color: var(--danger); }

/* ---------------- 登录 / 注册 ---------------- */
.auth-page {
  min-height: 100vh;
  background: var(--deep);
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 100% 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 14px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}
.auth-brand {
  padding: 20px 22px 18px;
  background: var(--deep-2);
  color: #fff;
}
.auth-brand .a-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: #8fb0b4;
}
.auth-brand h1 {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: .03em;
}
.auth-brand p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #a9c3c7;
}
.auth-body { padding: 20px 22px 24px; }
.auth-foot {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  font-size: 12px;
  color: #7d8984;
  flex-wrap: wrap;
}
.auth-foot a { color: var(--idx); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-note {
  margin: 0 0 14px;
  padding: 8px 10px;
  background: #f4f7f4;
  border-left: 2px solid var(--deep);
  font-size: 12px;
  line-height: 1.65;
  color: #5c6864;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #42504c;
  padding: 2px 0;
}
.check-line input { width: 16px; height: 16px; }

/* ---------------- 其他 ---------------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-family: var(--mono);
  color: #59645f;
}
.section-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line-soft);
}

.inline-form { display: inline; }
.text-muted { color: #8a9590; }
.text-danger { color: var(--danger); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.btn-block { width: 100%; min-height: 40px; font-size: 13.5px; }
.chip-doc {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  margin: 0 2px 2px 0;
  border-radius: 2px;
  border: 1px solid #e0e5de;
  background: #f4f6f2;
  color: #8a9590;
  font-size: 10.5px;
  line-height: 1.6;
  white-space: nowrap;
}
.chip-doc.is-on { background: #e2f1ec; border-color: #c9e5dc; color: var(--pk); }
.chip-doc.is-off { background: #f7f2ee; border-color: #ecdfd7; color: #a86b50; }

.alert-inline {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #ecd9b0;
  background: #fbf4e6;
  border-radius: 3px;
  font-size: 12px;
  color: #6b4a12;
}
.alert-danger {
  border-color: #eccfc8;
  background: #fbf1ef;
  color: #8f3024;
}
.alert-ok {
  border-color: #cbe4d9;
  background: #eff8f4;
  color: #1d6a55;
}

/* ---------------- 说明列表 ---------------- */
.rule-list {
  margin: 0;
  padding-left: 17px;
  font-size: 12.5px;
  color: #5c6864;
  line-height: 1.95;
}
.rule-list li { margin-bottom: 3px; }

/* ---------------- 宽屏 ---------------- */
@media (min-width: 700px) {
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { padding: 7px 12px 7px 0; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .main { padding: 22px 20px 56px; }
}

@media (min-width: 1000px) {
  .burger { display: none; }
  .sidebar { transform: none; }
  .side-mask { display: none !important; }
  .main {
    margin-left: 214px;
    padding: 24px 24px 60px;
    max-width: 1440px;
  }
  .page-head { margin-bottom: 16px; }
  .page-title h1 { font-size: 22px; }
  .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal-card { margin: 60px auto; }
}

@media (min-width: 1280px) {
  .main { padding: 26px 32px 60px; }
}

/* ---------------- 手机 / 平板（≤999px） ---------------- */
@media (max-width: 999px) {
  .main { padding: 14px 12px 40px; }

  /* 顶栏压缩，给内容让位 */
  .topbar { padding: 0 12px; }
  .brand .b-sub { display: none; }
  .top-user { gap: 4px; }
  .top-user .u-role { display: none; }
  .top-user .u-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .top-link { padding: 8px 10px; }

  /* 侧栏项做成 46px 触控条 */
  .side-item { min-height: 46px; font-size: 14px; padding-left: 16px; }
  .side-group { font-size: 11px; }

  /* 表单控件统一 16px：小于 16px 时 iOS 聚焦会自动放大整页 */
  .field input, .field select, .field textarea,
  .field input[type="date"], .field input[type="number"],
  .filter-bar input, .filter-bar select,
  .modal-body input, .modal-body select, .modal-body textarea { font-size: 16px; }
  .field label { font-size: 12.5px; }

  /* 按钮够高才好点 */
  .btn { min-height: 40px; padding: 8px 14px; }
  .btn-sm { min-height: 34px; padding: 5px 12px; font-size: 12.5px; }
  .btn-xs { min-height: 32px; padding: 5px 10px; font-size: 12.5px; }

  /* 表格横向滑动更顺，单元格略紧 */
  .table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .data-table { min-width: 540px; }
  .data-table th, .data-table td { padding: 9px 8px; }

  /* 标签页同样用触控条 */
  .tab { min-height: 44px; padding: 12px 14px; }

  .page-title h1 { font-size: 19px; }
  .modal { padding: 10px; }
  .modal-card { max-width: none; }
}

/* ---------------- 窄屏手机（≤560px） ---------------- */
@media (max-width: 560px) {
  .modal { padding: 0; }
  .modal.is-open { align-items: stretch; }
  .modal-card {
    max-width: none; margin: 0; height: 100%;
    border: 0; border-radius: 0; box-shadow: none;
    display: flex; flex-direction: column;
  }
  .modal-head { flex: none; }
  .modal-body { flex: 1 1 auto; max-height: none; }
  .modal-foot {
    flex: none;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .modal-foot .btn { flex: 1 1 0; }

  .page-actions { width: 100%; margin-left: 0; }
  .page-actions .btn { flex: 1 1 auto; }

  .kv { padding: 8px 0; }
  .kv .k { width: 92px; }

  .pager-info { display: none; }
  .side-foot { display: none; }

  .auth-page { padding: 0; }
  .auth-card { max-width: none; min-height: 100vh; border-radius: 0; }
  .auth-brand { padding: 32px 22px 24px; }
}

/* 抽屉打开时锁住背景滚动（仅窄屏由 JS 加类） */
body.is-locked { overflow: hidden; }

/* ---------------- 批量导入 ---------------- */
.import-steps { display: grid; gap: 12px; }
.import-steps .st {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.import-steps .st .n {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--deep);
  background: #e8eee8;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.import-steps .st b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #243330;
}
.import-steps .st p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #6b7772;
  line-height: 1.65;
}

.import-meta {
  margin: 14px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: #5c6864;
}
.import-meta p { margin: 0 0 4px; }

.sub-title {
  margin: 18px 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--deep);
}

.import-warns {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #7b6a3c;
  line-height: 1.7;
}

.import-confirm { margin-top: 16px; }

/* ---------------- 打印 ---------------- */
@media print {
  .topbar, .sidebar, .side-mask, .page-actions, .tabs, .filter-bar, .pager, .btn, .toast-box { display: none !important; }
  body { background: #fff; }
  .main { margin: 0; padding: 0; }
  .card { border-color: #bbb; }
  .data-table th { background: #eee !important; }
  .data-table { min-width: 0; }
}

/* ---------------- 企业档案表格（预览 / 下载） ---------------- */
.doc-card .card-body { overflow-x: auto; }
.doc-sheet {
  font-family: "宋体", SimSun, serif;
  color: #1c2623;
  background: #fff;
  padding: 22px 20px 18px;
  border: 1px solid #dfe4e0;
  max-width: 920px;
  margin: 0 auto;
}
.doc-title { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: 1px; margin-bottom: 6px; }
.doc-sub { text-align: center; font-size: 12px; color: #6b7671; margin-bottom: 16px; }
.doc-sheet .a-h { font-size: 13px; font-weight: 700; margin: 16px 0 8px; color: #10323b; }
.doc-sheet .a-h:first-of-type { margin-top: 0; }
.a-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.a-tbl th, .a-tbl td { border: 1px solid #cfd6d1; padding: 6px 8px; vertical-align: middle; line-height: 1.65; }
.a-tbl th { width: 22%; text-align: center; background: #f4f6f3; font-weight: 500; color: #26332f; }
.a-tbl-simple th { width: auto; }
.a-tbl-simple td { text-align: center; }
.a-chk { display: inline-block; margin-right: 10px; color: #4a5651; }
.a-chk.is-on { color: #10323b; font-weight: 600; }
.a-dash { color: #b6bfba; }
.a-empty { text-align: center; color: #7d8782; }
.doc-foot { margin-top: 14px; font-size: 11px; color: #7d8782; }

@media (max-width: 720px) {
  .doc-sheet { padding: 14px 10px; }
  .a-tbl { font-size: 12px; }
  .a-tbl th { width: 26%; }
  .a-tbl th, .a-tbl td { padding: 5px 6px; }
  .doc-title { font-size: 16px; }
}

@media print {
  .page-head, .page-actions { display: none !important; }
  .card { border: 0 !important; }
  .card-head { display: none !important; }
  .doc-sheet { border: 0; padding: 0; max-width: none; }
  .doc-title { font-size: 15pt; }
  .a-tbl { font-size: 10.5pt; }
  .a-tbl th { background: #f2f2f2 !important; }
  .doc-sheet .a-h { font-size: 11pt; }
}
