:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-2: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}
.login-wrap { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.brand-mark {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.brand-mark.small {
  width: 30px; height: 30px; margin: 0 8px 0 0; font-size: 16px; border-radius: 8px;
}
.login-brand h1 { font-size: 20px; margin-bottom: 6px; }
.login-brand p { color: var(--text-2); font-size: 13px; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-2); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

.login-hint {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); text-align: center;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: #f3f4f6; }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-icon { padding: 5px 10px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; margin-right: 14px; flex-shrink: 0; }
.topbar-title { font-weight: 600; font-size: 15px; white-space: nowrap; }
.topbar-nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: 10px; flex-shrink: 0; }
.topbar-user { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.role-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary);
}
.role-badge.super { background: #fef3c7; color: var(--warning); }
.role-badge.guest { background: #f3f4f6; color: var(--text-2); }

.nav-btn {
  padding: 7px 12px;
  border: none; background: transparent;
  border-radius: 8px;
  font-size: 14px; color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-btn:hover { background: #f3f4f6; color: var(--text); }
.module-tab {
  padding: 7px 14px;
  border: none; background: transparent;
  border-radius: 8px;
  font-size: 14px; color: var(--text-2);
  cursor: pointer; position: relative;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.module-tab:hover { background: #f3f4f6; }
.module-tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------- 汉堡按钮（桌面端隐藏，移动端显示） ---------- */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px;
  border: 1px solid var(--border); background: #fff;
  border-radius: 8px; cursor: pointer;
  padding: 9px; margin-left: 4px;
}
.hamburger span {
  display: block; height: 2px; width: 100%;
  background: var(--text-2); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 移动端菜单 ---------- */
.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 260px; max-width: 80vw;
  background: var(--surface);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 300;
  display: flex; flex-direction: column;
  padding: 16px 12px;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu-user {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 10px 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.mobile-menu-user strong { font-size: 15px; }
.mobile-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 13px 10px; margin-bottom: 2px;
  border: none; background: transparent;
  border-radius: 8px;
  font-size: 15px; color: var(--text); cursor: pointer;
}
.mobile-menu-item:hover { background: #f3f4f6; }
.mobile-menu-item.danger { color: var(--danger); }
.mobile-menu-item.danger:hover { background: var(--danger-soft); }
/* 手机端点击菜单外区域关闭：透明遮罩由 JS 处理点击，无需额外元素 */

/* ---------- 内容区 ---------- */
.content { max-width: 1280px; margin: 0 auto; padding: 24px 20px; }

.page-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.page-desc { color: var(--text-2); font-size: 13px; margin-top: -10px; margin-bottom: 16px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px; width: 240px;
}
.search-input:focus { outline: none; border-color: var(--primary); }

/* ---------- 卡片 / 表格 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* 不设 overflow:hidden——会截断 position:sticky 元素的滚动祖先链
     导致表格固定吸附列失效。圆角由 card-header/table-wrap 单独提供 */
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
}

.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
thead th {
  background: #f9fafb;
  font-weight: 600; font-size: 13px; color: var(--text-2);
  white-space: nowrap;
}
/* 列表文本：超长省略号截断，悬停显示完整内容 */
.cell-text {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  cursor: default;
}
tbody tr:hover { background: #f9fafb; }
td { font-size: 14px; }
td.actions { white-space: nowrap; }
/* 批量选择列 */
th.col-check, td.col-check { width: 40px; padding: 11px 6px; text-align: center; }
th.col-check input, td.col-check input { width: 15px; height: 15px; cursor: pointer; vertical-align: middle; }
/* 固定吸附列：JS 在 wrap scroll 时给 .sticky 元素设 transform: translateX(-scrollLeft)
   实现"冻结首列"效果（用 transform 而非 position:sticky，因为后者在某些 Chromium
   版本对 display:table-cell 元素水平方向不生效）。z-index/背景仍由 CSS 处理。*/
th.sticky, td.sticky {
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 var(--border);
  will-change: transform;
}
thead th.sticky { z-index: 3; background: #f9fafb; }
tbody tr:hover td.sticky { background: #f9fafb; }
/* 选择模式的复选列冻结（最左，由 JS 设 left:0） */
th.sticky-check, td.sticky-check {
  position: sticky; left: 0; z-index: 4;
  background: #f9fafb;
}
tbody td.sticky-check { background: #fff; z-index: 3; }
tbody tr:hover td.sticky-check { background: #f9fafb; }
/* 列表单项选中：点击行高亮 */
tbody tr.row-selected,
tbody tr.row-selected td { background: var(--primary-soft); }
tbody tr.row-selected td.sticky,
tbody tr.row-selected td.sticky-check { background: var(--primary-soft); }
/* 近似色搜索跳转定位：目标行黄色高亮闪烁 */
@keyframes row-locate-flash {
  0%, 100% { background: #fef9c3; }
  50% { background: #fde68a; }
}
tbody tr.row-locate,
tbody tr.row-locate td { animation: row-locate-flash 0.9s ease-in-out 2; }
tbody tr.row-locate td.sticky,
tbody tr.row-locate td.sticky-check { animation: row-locate-flash 0.9s ease-in-out 2; }
.required-mark { color: var(--danger); }
.empty-state {
  padding: 48px 20px; text-align: center; color: var(--text-2);
}

/* 列表分页：加载更多按钮 */
.load-more-cell { text-align: center; padding: 12px; }
.load-more-cell .btn { min-width: 180px; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: #f3f4f6; color: var(--text-2);
}
.status-badge.blue { background: var(--primary-soft); color: var(--primary); }
.status-badge.green { background: #ecfdf5; color: var(--success); }
.status-badge.orange { background: #fff7ed; color: var(--warning); }
.status-badge.red { background: var(--danger-soft); color: var(--danger); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  z-index: 200;
  overflow-y: auto;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; }
.modal-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 20px; color: var(--text-2); line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid > .form-field { min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
.form-field .hint { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.checkbox-field {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 14px; color: var(--text);
  width: fit-content; user-select: none; padding: 4px 0;
}
.checkbox-field input[type="checkbox"] {
  width: 16px; height: 16px; padding: 0; margin: 0;
  border: 1px solid var(--border); border-radius: 4px;
  accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
  box-shadow: none;
}
.checkbox-field input[type="checkbox"]:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.checkbox-field span { line-height: 1; }

/* ---------- 图片字段 ---------- */
.image-field .img-file { width: 100%; padding: 8px; }
.img-preview {
  margin-top: 8px; position: relative;
  display: inline-block; min-width: 96px; min-height: 64px;
  border: 1px dashed var(--border); border-radius: 8px;
  background: #fafafa;
}
.img-preview.empty { display: block; }
.img-preview img {
  display: block; max-width: 160px; max-height: 160px;
  border-radius: 8px; border: 1px solid var(--border);
}
.img-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; line-height: 18px;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 13px;
}
.img-remove:hover { background: var(--danger); }
.img-placeholder {
  display: inline-block; padding: 22px 18px;
  color: var(--text-2); font-size: 12px;
  cursor: pointer;
}
/* 列表缩略图 */
.thumb {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
  cursor: zoom-in; display: block;
}
.thumb:hover { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }

/* ---------- 图片灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 400; cursor: zoom-out; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 92vw; max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  background: #fff;
}
.lightbox-close {
  position: absolute; top: 18px; right: 24px;
  width: 42px; height: 42px; font-size: 26px; line-height: 38px;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  border: none; border-radius: 50%; cursor: pointer;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.32); }
.options-editor { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.option-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-soft); color: var(--primary);
  padding: 2px 8px; border-radius: 6px; font-size: 12px;
}
.option-tag button {
  border: none; background: transparent; color: var(--primary);
  cursor: pointer; font-size: 13px; padding: 0;
}

/* ---------- 两栏布局（设置页） ---------- */
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .li-main { display: flex; align-items: center; gap: 10px; }
.list-item .li-main > div { min-width: 0; }
.list-item .li-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.list-item .li-title { font-weight: 500; }
.list-item .li-sub { font-size: 12px; color: var(--text-2); }
/* 拖拽排序 */
.drag-handle { cursor: grab; color: var(--text-3); font-size: 16px; user-select: none; margin-right: 2px; }
.list-item[draggable] { cursor: grab; }
.list-item[draggable].dragging { opacity: 0.4; }
.list-item[draggable].drag-before { box-shadow: inset 0 2px 0 var(--primary); }
.list-item[draggable].drag-after { box-shadow: inset 0 -2px 0 var(--primary); }
.btn-icon[disabled] { opacity: 0.35; cursor: not-allowed; }
/* 超链接字段按钮 */
.link-btn { color: var(--primary); border-color: #bfdbfe; }
.link-btn:hover { background: var(--primary-soft); border-color: var(--primary); }

/* ---------- LAB 数据字段 ---------- */
.lab-field { min-width: 0; }
.lab-inputs {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
  min-width: 0;
}
.lab-part {
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.lab-part .lab-label {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  line-height: 1;
}
.lab-part input[type="number"] { width: 100%; padding: 9px 10px; }
.lab-preview {
  width: 100%; height: 34px;
  border-radius: 8px; border: 1px solid var(--border);
  margin-top: 10px; background: #f3f4f6;
}
/* 列表 LAB 色块：纯正方形缩略图 */
.lab-swatch {
  display: inline-block;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  vertical-align: middle; cursor: default;
}
.field-type-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: #f3f4f6; color: var(--text-2);
}
.sys-badge { font-size: 11px; color: var(--text-2); }

.log-table td { font-size: 13px; }
.log-action { font-weight: 500; }

/* ---------- 近似色搜索 ---------- */
.nearby-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
/* 手动输入 LAB 的目标颜色实时预览 */
.near-lab-preview {
  grid-column: 1 / -1;
  width: 100%; height: 40px;
  border-radius: 8px; border: 1px solid var(--border);
  margin-top: 2px;
}
.nearby-tab {
  flex: 1; padding: 8px 10px;
  border: 1px solid var(--border); background: #fff;
  border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer;
  transition: all 0.15s;
}
.nearby-tab.active { background: var(--primary-soft); color: var(--primary); border-color: #bfdbfe; font-weight: 600; }
.nearby-pane { margin-bottom: 14px; }
.nearby-img-info { display: flex; align-items: center; gap: 8px; margin: 8px 0; min-height: 32px; }
.nearby-res-head { font-size: 12px; color: var(--text-2); margin: 10px 0 8px; }
.near-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 6px; background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.near-item:hover {
  border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  background: var(--primary-soft);
}
.near-item:active { transform: scale(0.995); }
.near-rank {
  width: 22px; height: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #f3f4f6; color: var(--text-2);
  font-size: 12px; font-weight: 600;
}
.near-item:nth-child(2) .near-rank { background: #fef9c3; color: #a16207; }
.near-item:nth-child(3) .near-rank { background: #f3f4f6; }
.near-item .lab-swatch { width: 34px; height: 34px; flex-shrink: 0; }
.near-info { min-width: 0; }
.near-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-sub { font-size: 12px; color: var(--text-2); }

.section-gap { margin-bottom: 20px; }

/* ---------- 响应式：平板 / 手机 ---------- */
/* 中宽（≤1100px）：顶栏改两行，模块导航横向滚动，右侧按钮收进汉堡 —— 避免单行拥挤 */
@media (max-width: 1100px) {
  .topbar {
    flex-wrap: wrap; height: auto;
    padding: 10px 14px 8px; gap: 6px 8px;
    position: sticky; top: 0;
  }
  .topbar-left { margin-right: 0; }
  .topbar-title { font-size: 15px; }
  .topbar-right { margin-left: auto; align-items: center; }
  .topbar-right .nav-btn,
  .topbar-right #btnLogout { display: none; }
  .hamburger { display: inline-flex; }
  .topbar-nav {
    order: 3; width: 100%;
    flex: 0 0 100%;
    display: flex; gap: 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; margin-top: 2px;
    scrollbar-width: none;
  }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .module-tab { flex-shrink: 0; padding: 7px 14px; font-size: 13px; }
  .module-tab.active::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px;
    height: 2px; border-radius: 2px; background: var(--primary);
  }
}

@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }

  /* 顶栏：两行布局（品牌行 + 模块导航行） */
  .topbar {
    flex-wrap: wrap; height: auto;
    padding: 10px 12px 8px; gap: 6px 8px;
    position: sticky; top: 0;
  }
  .topbar-left { margin-right: 0; }
  .topbar-title { font-size: 14px; }
  .topbar-right { margin-left: auto; align-items: center; }
  /* 桌面端按钮收进汉堡菜单 */
  .topbar-right .nav-btn,
  .topbar-right #btnLogout { display: none; }
  .hamburger { display: inline-flex; }

  /* 模块导航：横向滚动条，始终可见 */
  .topbar-nav {
    order: 3; width: 100%;
    flex: 0 0 100%; /* 覆盖桌面端 flex:1，强制占满整行换行 */
    display: flex; gap: 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; margin-top: 2px;
    scrollbar-width: none;
  }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .module-tab { flex-shrink: 0; padding: 7px 14px; font-size: 13px; }
  .module-tab.active { position: relative; }
  .module-tab.active::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px;
    height: 2px; border-radius: 2px; background: var(--primary);
  }

  /* 移动端用户信息：只显示用户名，隐藏角色徽标（菜单内可见） */
  .topbar-user .role-badge { display: none; }

  /* 内容区紧凑 */
  .content { padding: 16px 12px; }
  .page-title { font-size: 16px; margin-bottom: 12px; }
  .page-desc { margin-top: -8px; margin-bottom: 12px; }

  /* 工具栏：搜索框自适应 + 按钮同行 */
  .toolbar { gap: 8px; }
  .search-input { order: 1; flex: 1; min-width: 0; }
  .toolbar .btn { order: 2; flex: 0 0 auto; }
  .toolbar .spacer { display: none; }

  /* 表格：单元格紧凑 */
  th, td { padding: 9px 10px; }
  td .thumb { width: 38px; height: 38px; }
  .cell-text { max-width: 120px; }

  /* 弹窗：接近全屏，按钮撑开 */
  .modal-mask { padding: 12px 10px; align-items: flex-start; }
  .modal { max-width: 100%; max-height: calc(100vh - 24px); }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
  .modal-footer .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }

  /* 设置页卡片内边距 */
  .card-header { padding: 12px 14px; }
  .list-item { padding: 11px 14px; }

  /* 表单控件在手机端保持可点尺寸，避免 iOS 聚焦缩放 */
  .form-field input, .form-field select, .form-field textarea,
  .btn, .search-input, .mobile-menu-item { font-size: 16px; }
  .form-field input, .form-field select, .form-field textarea {
    padding: 12px 12px; border-radius: 10px;
  }
  .btn { padding: 11px 16px; }

  /* 登录页适配 */
  .login-wrap { padding: 16px; }
  .login-card { padding: 32px 22px 24px; }

  /* 灯箱 */
  .lightbox { padding: 16px; }
  .lightbox-close { top: 14px; right: 16px; width: 38px; height: 38px; }
}
