:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e8f0;
  --accent: #1e6fd0;
  --accent-2: #4aa3e8;
  --accent-soft: #e9f2fc;
  --ok: #12805c;
  --ok-soft: #e7f7ef;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 12% 8%, #dcebfc 0%, transparent 60%),
    radial-gradient(700px 420px at 92% 96%, #e4f3ff 0%, transparent 55%),
    #f4f6fb;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 32px 26px;
  box-shadow: var(--shadow);
}

.login-logo, .brand-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e6fd0, #4aa3e8);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.login-card h1 { font-size: 22px; margin: 18px 0 4px; }
.login-card > p { margin: 0 0 22px; font-size: 13px; }

.login-card label { display: block; margin-bottom: 14px; }
.login-card label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.12);
}

.login-error { min-height: 20px; color: var(--danger); font-size: 13px; margin: 2px 0 8px; }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: #f8fafc; border-color: #d3dae8; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #3350c4; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: #f2c9c4; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.block { width: 100%; padding: 11px; }

/* ---------- 主框架 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-btn { width: 36px; height: 36px; padding: 0; font-size: 17px; color: #475467; flex: 0 0 36px; }

.side-search { padding: 4px 10px 10px; }
.side-search input { padding: 8px 10px; font-size: 13px; }

.module-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #1f2a44;
  text-align: left;
}
.module-head:hover { background: #f5f7fb; }
.module-head .chev { margin-left: auto; }
.doc-title { width: 100%; border: 0; background: transparent; font-family: inherit; cursor: default; text-align: left; }
.doc-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; font: inherit; color: inherit; padding: 0; cursor: pointer; text-align: left; }
.doc-actions { display: none; align-items: center; gap: 2px; margin-left: 2px; }
.doc-title:hover .doc-actions { display: flex; }
.icon-mini { border: 0; background: transparent; cursor: pointer; color: #98a2b3; padding: 2px 4px; border-radius: 4px; font-size: 12px; line-height: 1; }
.icon-mini:hover { background: #eef2f7; color: #475467; }
.icon-mini.danger:hover { background: var(--danger-soft); color: var(--danger); }
.doc-title .doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-title .chev { margin-left: 4px; }
.chev { color: #98a2b3; font-size: 10px; }
.search-hit { padding-left: 12px; }
.search-hit .hit-doc { font-size: 11px; color: var(--muted); margin-right: 6px; flex: 0 0 auto; }
.search-hit .hit-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar {
  width: 258px;
  flex: 0 0 258px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.18s ease, flex-basis 0.18s ease;
}

.app.collapsed .sidebar {
  width: 0;
  flex-basis: 0;
  border-right: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--muted); }

.side-scroll { flex: 1; overflow: auto; padding: 4px 10px 12px; }

.side-group { margin-top: 10px; }
.side-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 6px 8px;
  text-transform: uppercase;
}

.doc-block { margin-bottom: 6px; }
.doc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  color: #1f2a44;
}
.doc-title .dot, .module-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); flex: 0 0 7px; }
.doc-title .badge { margin-left: auto; }

.sheet-link {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 10px 7px 25px;
  border-radius: 8px;
  color: #475467;
  cursor: pointer;
  font-size: 13px;
}
.sheet-link:hover { background: #f5f7fb; color: var(--ink); }
.sheet-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sheet-link .count { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; }
.sheet-link .lock { font-size: 11px; color: #98a2b3; }

.side-foot { border-top: 1px solid var(--line); padding: 10px; }
.side-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: #475467;
  font-size: 13px;
}
.side-link:hover { background: #f5f7fb; }
.side-link.side-sub { padding-left: 26px; font-size: 12px; color: #6b7280; }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link.danger { color: var(--danger); }
.side-link.danger:hover { background: var(--danger-soft); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { font-weight: 700; font-size: 16px; }

.userchip { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700;
}
.userchip-text { display: flex; flex-direction: column; line-height: 1.25; }
.userchip-text strong { font-size: 13px; }
.userchip-text span { font-size: 11px; color: var(--muted); }

.view { flex: 1; overflow: auto; padding: 20px 22px 40px; }

/* ---------- 卡片 / 面板 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-title { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.card-desc { color: var(--muted); font-size: 12px; margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #eef2f7;
  color: #475467;
  white-space: nowrap;
}
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #2c3f8f;
  font-size: 13px;
  border: 1px solid #dbe3ff;
}
.notice.warn { background: var(--warn-soft); color: #8a4b05; border-color: #f7dfbc; }
.notice .ico { font-weight: 700; }

/* ---------- 数据表 ---------- */
.sheet-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sheet-head h2 { margin: 0; font-size: 19px; }
.sheet-meta { color: var(--muted); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}
.search input { padding-left: 34px; }
.search::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-52%);
  color: #98a2b3;
  font-size: 18px;
}
.select-page { width: auto; padding: 8px 10px; }

.table-wrap { overflow: auto; max-height: calc(100vh - 300px); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th, table.data td {
  padding: 8px 12px;
  border-bottom: 1px solid #edf0f5;
  border-right: 1px solid #f3f5f9;
  text-align: left;
  white-space: nowrap;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  font-weight: 600;
  color: #344054;
  cursor: pointer;
  user-select: none;
}
table.data thead th:hover { background: #eef2f7; }
table.data thead th .sort { color: var(--accent); font-size: 11px; margin-left: 4px; }
table.data tbody tr:nth-child(even) { background: #fcfdff; }
table.data tbody tr:hover { background: #f5f8ff; }
table.data td.num { font-variant-numeric: tabular-nums; }
table.data td.empty { text-align: center; color: var(--muted); padding: 30px 0; }

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pager .pages { display: flex; gap: 4px; }
.pager button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  padding: 0 8px;
}
.pager button:hover:not(:disabled) { border-color: #c8d2e4; }
.pager button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 演唱会合集 ---------- */
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.collection-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.collection-cover { height: 170px; overflow: hidden; background: #f8fafc; cursor: pointer; }
.collection-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.collection-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.collection-title { font-weight: 700; font-size: 14px; }
.collection-meta { font-size: 12px; color: var(--muted); }
.collection-actions { display: flex; gap: 8px; margin-top: 6px; }
.collection-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.collection-images.longroll { display: block; }
.collection-images.longroll .collection-image { border: none; border-radius: 0; margin-bottom: 0; }
.collection-images.longroll .collection-image img { width: 100%; height: auto; display: block; }
.collection-images.longroll .collection-image .cap { position: sticky; top: 0; background: rgba(91,33,182,.92); color: #fff; padding: 6px 10px; font-size: 12px; border-top: none; z-index: 2; }
.collection-image { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.collection-image img { width: 100%; height: auto; display: block; }
.collection-image .cap { padding: 6px 10px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 管理页 ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; margin: 0; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); }

table.simple { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple th, table.simple td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
table.simple th { color: var(--muted); font-weight: 600; font-size: 12px; background: #fafbfd; }
table.simple tr:last-child td { border-bottom: 0; }

.rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f4f6fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
}
.rule-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; }
.rule-chip button:hover { color: var(--danger); }

.column-list { display: flex; flex-wrap: wrap; gap: 6px; }
.col-tag {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f4f6fb;
  border: 1px solid var(--line);
  color: #475467;
}
.col-tag.hit { background: var(--danger-soft); border-color: #f6d2cd; color: var(--danger); text-decoration: line-through; }
.column-list .col-tag { cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.column-list .col-tag:hover { border-color: var(--accent); color: var(--accent); }
.column-list .col-tag.hit:hover { border-color: var(--danger); color: var(--danger); }
.col-tag.pending { outline: 2px dashed var(--accent); outline-offset: 1px; }
.col-tag.sel { background: var(--accent-soft); border-color: #c7d2fe; color: var(--accent); }

.sheet-block { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.sheet-block:last-child { border-bottom: 0; }
.sheet-block .name { font-weight: 600; font-size: 13px; margin-bottom: 8px; }

/* PDF 导出页：左选表、右选列 */
.pdf-split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.4fr); gap: 16px; }
.scroll-box { max-height: 62vh; overflow: auto; }

/* ---------- 同步 ---------- */
.stat { padding: 16px 18px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.progress { height: 8px; background: #eef2f7; border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width 0.3s; }

.log {
  font-family: var(--mono);
  font-size: 12px;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.log .ok { color: #6ee7b7; }
.log .warn { color: #fcd34d; }
.log .error { color: #fca5a5; }
.log .time { color: #64748b; }

.preview-box {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.preview-canvas { position: relative; }
.preview-canvas img { display: block; width: 100%; height: auto; }

.preview-stitch {
  display: flex;
  width: 100%;
  overflow: hidden;
  background: #fff;
}
.preview-slice {
  position: relative;
  overflow: hidden;
  height: 100%;
  flex: 0 0 auto;
}
.preview-title { position: relative; overflow: hidden; width: 100%; background: #fff; }
.preview-title img { position: absolute; max-width: none; height: auto; }

.preview-slice img {
  position: absolute;
  top: 0;
  max-width: none;
  height: auto;
}

/* ---------- 弹窗 / toast ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.38);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.22);
  padding: 22px;
}
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #101828;
  color: #fff;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13px;
  z-index: 80;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.25);
}
.toast.error { background: var(--danger); }

.empty-state { padding: 40px; text-align: center; color: var(--muted); }

/* 移动端抽屉侧栏的遮罩（桌面隐藏） */
.sidebar-mask {
  display: none;
}

@media (max-width: 900px) {
  .sidebar { width: 210px; flex-basis: 210px; }
  .view { padding: 14px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------------- 手机适配（≤768px） ---------------- */
@media (max-width: 768px) {
  body { font-size: 14px; -webkit-text-size-adjust: 100%; }

  /* 侧栏 → off-canvas 抽屉 */
  .app { height: 100dvh; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: min(82vw, 320px) !important;
    flex-basis: auto !important;
    z-index: 60;
    padding-top: env(safe-area-inset-top);
    background: var(--panel);
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.25);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .app.collapsed .sidebar { transform: translateX(-100%); }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .side-scroll { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .side-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .sidebar-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.45);
    z-index: 55;
  }

  /* 顶栏紧凑（刘海屏留出状态栏） */
  .topbar { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 8px; }
  .topbar-left { flex: 1; min-width: 0; }
  .topbar-left > div { min-width: 0; }
  .crumb { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sub { display: none; }
  .userchip-text { display: none; }
  .userchip .avatar { width: 30px; height: 30px; }

  /* 内容区 */
  .view { padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); }
  .card { border-radius: 12px; }
  .card-pad { padding: 14px; }
  .grid-2 { grid-template-columns: 1fr; gap: 10px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .row { flex-wrap: wrap; }
  .stat { padding: 12px; }
  .stat .k { font-size: 11px; }
  .stat .v { font-size: 18px; }

  /* 工具条：搜索独占一行 */
  .toolbar { padding: 10px 12px; gap: 8px; }
  .toolbar .search { flex: 1 1 100%; max-width: none; min-width: 0; }
  .toolbar .select-page { flex: 0 0 auto; }

  /* 合集卡片/长图单列铺满 */
  .collection-grid { grid-template-columns: 1fr; gap: 10px; }
  .collection-images { grid-template-columns: 1fr; gap: 10px; }
  .collection-actions { flex-wrap: wrap; gap: 6px; }
  .collection-image .cap { white-space: normal; flex-wrap: wrap; }
  .collection-image .cap > span { min-width: 0; word-break: break-word; }
  .collection-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .collection-toolbar .btn { width: 100%; }

  /* 表格 → 逐行卡片：字段名（data-label）+ 值 */
  table.data, table.simple { width: 100%; min-width: 0; display: block; }
  table.data thead, table.simple thead { display: none; }
  table.data tbody, table.simple tbody { display: block; }
  table.data tbody tr, table.simple tbody tr {
    display: block;
    margin: 8px 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  table.data tbody tr:nth-child(even),
  table.simple tbody tr:nth-child(even) { background: #fff; }
  table.data tbody tr:hover,
  table.simple tbody tr:hover { background: #fff; }
  table.data td, table.simple td {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 3px 0 !important;
    border: 0;
    font-size: 13px;
    text-align: left;
    white-space: normal;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }
  table.data td::before, table.simple td::before {
    content: attr(data-label);
    flex: 0 0 76px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
  }
  table.data td:not([data-label])::before,
  table.simple td:not([data-label])::before { content: none; }
  table.data td.empty, table.simple td.empty {
    display: block;
    text-align: center;
    color: var(--muted);
    padding: 24px 0 !important;
  }
  table.data td.empty::before, table.simple td.empty::before { content: none; }
  .table-wrap { max-height: none; overflow: visible; padding: 2px 10px 0; }
  .card > table.simple { padding: 0 10px 10px; }
  .card-pad > table.simple { margin-top: 4px; }

  /* PDF 导出页：双栏 → 单栏，去掉内部滚动 */
  .pdf-split { grid-template-columns: 1fr; }
  .scroll-box { max-height: none; overflow: visible; }

  /* 弹窗改成底部抽屉，超长可滚动 */
  .modal-mask { padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: calc(100dvh - 28px + env(safe-area-inset-bottom));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px;
    border-radius: 14px 14px 0 0;
  }
  .modal .actions .btn { flex: 1; }
  .login-card { padding: 24px 20px 20px; }

  /* 卡片行内的定宽输入框改为自适应 */
  .card .row > input:not([type="checkbox"]):not([type="radio"]),
  .card .row > select { flex: 1 1 140px; width: auto !important; min-width: 0; }

  /* 触控目标；16px 避免 iOS 聚焦时自动放大 */
  .btn { min-height: 38px; padding: 8px 14px; font-size: 13px; }
  .btn.small { min-height: 34px; padding: 6px 10px; }
  .side-link { padding: 12px 14px; font-size: 14px; }
  input, select, textarea { font-size: 16px; }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); max-width: 92vw; text-align: center; }

  /* 图标按钮稍大易点 */
  .icon-btn { width: 38px; height: 38px; flex-basis: 38px; }
  .pager button { min-width: 34px; height: 34px; }
}

@media (max-width: 480px) {
  .view { padding: 10px 10px calc(24px + env(safe-area-inset-bottom)); }
  .stat { padding: 10px; }
  .stat .v { font-size: 17px; }
  .grid-3 { gap: 6px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > * { grid-column: auto !important; }
  .login-wrap { padding: 16px; }
  .login-card { padding: 26px 18px 22px; }
  table.data td::before, table.simple td::before { flex-basis: 68px; }
}

/* 登录页语言选择 */
.login-locale { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; color: #667085; }
.login-locale select { padding: 7px 10px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font-size: 13px; color: #1f2329; }

/* 蝴蝶 Logo：登录页与侧栏的标志位 */
.login-logo img, .brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #fff;
}
