/* ============================================================
   美食榜单 — 简约黑白灰 + 绿色系
   ============================================================ */

:root {
  --bg:            #f6f7f6;
  --surface:       #ffffff;
  --surface-2:     #fafbfa;
  --ink:           #17181a;
  --ink-2:         #4b5057;
  --ink-3:         #8b9096;
  --line:          #e7e9e8;
  --line-strong:   #d5d8d6;

  --green:         #178a4c;
  --green-strong:  #0f6e3c;
  --green-soft:    #eaf6ef;
  --green-line:    #c6e6d3;

  --danger:        #c0392b;
  --danger-soft:   #fbeeec;

  --radius:        10px;
  --radius-sm:     7px;
  --shadow:        0 1px 2px rgba(20, 24, 22, .05), 0 6px 18px rgba(20, 24, 22, .05);
  --shadow-pop:    0 8px 28px rgba(20, 24, 22, .14);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------------- 顶部栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  height: 60px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  user-select: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: .5px;
}

.module-nav {
  display: flex;
  gap: 4px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.module-nav::-webkit-scrollbar { display: none; }

.module-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.module-tab:hover { background: var(--surface-2); color: var(--ink); }
.module-tab.active {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green-strong);
  font-weight: 600;
}

.topbar-right { flex: 0 0 auto; }

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.sync-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3);
  transition: background .2s;
}
.sync-status.ok .dot { background: var(--green); }
.sync-status.busy .dot { background: #d9a400; animation: pulse 1s infinite; }
.sync-status.err .dot { background: var(--danger); }

@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---------------- 二级导航 ---------------- */
.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px 0;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.subtabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
}

.subtab {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.subtab:hover { color: var(--ink); }
.subtab.active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.btn-ghost {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost.active { border-color: var(--green-line); color: var(--green-strong); background: var(--green-soft); }
.gear { font-size: 14px; }

/* ---------------- 主内容 ---------------- */
.main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px 60px;
}

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

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.section-head h2 {
  font-size: 17px;
  font-weight: 650;
  margin: 0;
}
.section-sub {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------------- 表单 ---------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px 18px;
  padding: 22px;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 600;
  letter-spacing: .2px;
}
.field .req { color: var(--green); margin-left: 3px; }

.input, .select, .textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 138, 76, .12);
}
.input::placeholder { color: #b3b7b4; }

.switch-row { display: flex; align-items: center; gap: 10px; padding-top: 3px; }
.switch {
  position: relative;
  width: 44px; height: 25px;
  border-radius: 999px;
  background: #d7dad8;
  border: none;
  cursor: pointer;
  transition: background .18s;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s;
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(19px); }
.switch-label { font-size: 13.5px; color: var(--ink-2); }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 22px 22px;
}

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-strong); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f0d4cf; }
.btn-danger:hover { background: #f6ddd9; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------------- 工具栏 ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}
.search-box input {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { background: #fff; border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,138,76,.12); }
.search-box .ico {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 13px;
  pointer-events: none;
}

.toolbar-spacer { flex: 1 1 auto; }
.count-note { font-size: 12.5px; color: var(--ink-3); }
.count-note b { color: var(--ink-2); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
table.grid th, table.grid td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
table.grid thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .2px;
  z-index: 5;
  border-bottom: 1px solid var(--line-strong);
}
table.grid thead th .th-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}
.th-filter {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px 3px;
  border-radius: 5px;
  color: var(--ink-3);
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.th-filter:hover { background: #eceeec; color: var(--ink); }
.th-filter.active { color: var(--green-strong); background: var(--green-soft); }
.th-filter .funnel { font-size: 11px; }

table.grid tbody tr:hover { background: #fbfcfb; }
table.grid tbody tr.editing { background: var(--green-soft); }

td.cell { position: relative; cursor: text; }
td.cell:hover { box-shadow: inset 0 0 0 1px var(--line-strong); border-radius: 4px; }
td.cell .val { display: block; min-height: 19px; }
td.cell .val.empty { color: #c3c7c4; }

td.cell .cell-input {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 5px 8px;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23,138,76,.12);
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  background: #eef0ee;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.rank-badge.top1 { background: var(--green); color: #fff; }
.rank-badge.top2 { background: #cfe8da; color: var(--green-strong); }
.rank-badge.top3 { background: #e2f0e8; color: var(--green-strong); }
.rank-badge.none { background: transparent; color: #c3c7c4; }

.rank-col { width: 62px; }
.act-col { width: 52px; }

/* 评分标记 */
.tag-rate {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green-strong);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}

/* 可按此列排序的表头 */
.th-sort { cursor: pointer; border-bottom: 1px dashed transparent; }
.th-sort:hover { color: var(--green-strong); border-bottom-color: var(--green-line); }
.th-sort.active { color: var(--green-strong); font-weight: 700; border-bottom-color: var(--green); }

/* 排序控件 */
.sort-ctl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.sort-ctl .lbl { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.select-sm { width: auto; min-width: 82px; padding: 5px 8px; font-size: 13px; }

/* 复选框 */
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  white-space: nowrap;
}
.check input { accent-color: var(--green); width: 15px; height: 15px; cursor: pointer; }

/* 弹窗底部左右分栏 */
.modal-foot.between { justify-content: space-between; }
.modal-foot .foot-right { display: inline-flex; gap: 10px; }

/* 平均分列：与录入字段做视觉分隔 */
.avg-col { border-left: 1px solid var(--line); }

/* ---------------- 批量导入 ---------------- */
.import-hint {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.7;
  margin: 0 0 16px;
}
.import-hint code {
  display: inline-block;
  margin-top: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green-strong);
  font-size: 12px;
  word-break: break-all;
}
textarea.textarea {
  resize: vertical;
  min-height: 116px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.7;
}
.import-preview:not(:empty) { margin-top: 16px; }
.import-summary { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.import-summary b { color: var(--green-strong); }
.import-warn {
  margin: 0 0 10px;
  padding: 8px 12px 8px 26px;
  border-radius: 8px;
  background: #FAEEDA;
  border: 1px solid #FAC775;
  font-size: 12.5px;
  color: #633806;
  line-height: 1.7;
}
.import-table-wrap {
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table.import-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.import-table th, table.import-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
table.import-table thead th {
  position: sticky; top: 0;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 600;
}
table.import-table td:first-child, table.import-table th:first-child { color: var(--ink-3); }
.import-more { margin-top: 8px; font-size: 12px; color: var(--ink-3); }

/* 评分：只显示数字，不做可视化 */
.rating-num {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.pill.yes { background: var(--green-soft); color: var(--green-strong); }
.pill.no  { background: #f0f1f0; color: var(--ink-3); }

.row-actions { white-space: nowrap; }
.icon-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #f0f1f0; color: var(--ink); }
.icon-btn.del:hover { background: var(--danger-soft); color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 70px 24px;
  color: var(--ink-3);
}
.empty-state .big { font-size: 34px; margin-bottom: 12px; opacity: .5; }
.empty-state .t { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.empty-state .s { font-size: 13px; }

/* ---------------- 筛选浮层 ---------------- */
.popover-layer { position: fixed; inset: 0; z-index: 60; display: none; }
.popover-layer.open { display: block; }

.popover {
  position: absolute;
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.popover-head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
}
.popover-head .title { font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 8px; }
.popover-search {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--surface-2);
}
.popover-search:focus { border-color: var(--green); background: #fff; }
.popover-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}
.popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}
.popover-item:hover { background: var(--surface-2); }
.popover-item input { accent-color: var(--green); width: 14px; height: 14px; cursor: pointer; }
.popover-item .txt { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover-item.all { font-weight: 600; color: var(--ink); border-bottom: 1px dashed var(--line); border-radius: 0; margin-bottom: 4px; padding-bottom: 9px; }
.popover-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.link-btn {
  appearance: none; border: none; background: none;
  color: var(--green-strong); font-family: inherit; font-size: 13px;
  cursor: pointer; padding: 3px 4px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.muted { color: var(--ink-3); }

/* ---------------- 弹窗 ---------------- */
.modal-layer { position: fixed; inset: 0; z-index: 70; display: none; }
.modal-layer.open { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(18, 22, 20, .35); }
.modal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 12px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-body { padding: 6px 22px 8px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px 20px;
}
.modal-close {
  appearance: none; border: none; background: transparent;
  font-size: 18px; color: var(--ink-3); cursor: pointer; line-height: 1;
  padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: #f0f1f0; color: var(--ink); }

/* 设置页 */
.settings-hint {
  font-size: 12.5px; color: var(--ink-3);
  padding: 14px 22px 0;
}
.field-list { padding: 14px 22px 6px; display: flex; flex-direction: column; gap: 10px; }
.field-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}
.field-item .drag { color: var(--ink-3); cursor: default; font-size: 14px; }
.field-item .meta { flex: 1 1 auto; min-width: 0; }
.field-item .name { font-size: 14px; font-weight: 600; }
.field-item .type { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.field-item .ops { display: flex; align-items: center; gap: 4px; }
.field-item.disabled { opacity: .55; }
.field-item .lock-tag {
  font-size: 11px; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}

.add-field-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 6px 22px 20px;
}
.add-field-row .field { flex: 1 1 160px; }

/* ---------------- toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

/* ---------------- 响应式 ---------------- */

/* 移动端表格滑动提示（默认隐藏） */
.scroll-hint {
  display: none;
  width: 100%;
  font-size: 12px;
  color: var(--ink-3);
}

/* 平板 / 小屏笔记本 */
@media (max-width: 1024px) {
  .topbar { padding: 0 18px; gap: 16px; }
  .subnav, .main { padding-left: 18px; padding-right: 18px; }
}

/* 手机 */
@media (max-width: 720px) {
  body { font-size: 13.5px; }

  /* 顶栏 */
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .brand { order: 1; }
  .brand-name { font-size: 15px; }
  .brand-mark { width: 26px; height: 26px; font-size: 14px; }
  .topbar-right { order: 2; margin-left: auto; }
  .sync-status { padding: 4px 9px; font-size: 11.5px; }

  .module-nav {
    order: 3;
    flex-basis: 100%;
    gap: 2px;
    margin: 0 -14px;
    padding: 2px 14px;
  }
  .module-tab { padding: 6px 12px; font-size: 13px; }

  /* 二级导航 */
  .subnav {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px 0;
  }
  .subtabs { width: 100%; }
  .subtab { flex: 1 1 0; text-align: center; padding: 8px 10px; }
  .btn-ghost { justify-content: center; }

  /* 主区 */
  .main { padding: 14px 14px 48px; }
  .section-head { flex-wrap: wrap; gap: 2px 10px; }
  .section-head h2 { font-size: 15.5px; }
  .section-sub { font-size: 12px; }

  /* 表单 */
  .form-grid { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .form-actions { padding: 0 16px 16px; flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; }

  /* 工具栏 */
  .toolbar { padding: 12px 14px; gap: 8px; }
  .search-box { flex: 1 1 100%; max-width: none; }
  .count-note { width: 100%; }
  .scroll-hint { display: block; }

  /* 表格：横向滚动 + 首列吸附，保证滚动时不丢失行标识 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table.grid { font-size: 13px; }
  table.grid th, table.grid td { padding: 9px 11px; }
  table.grid th:first-child,
  table.grid td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    box-shadow: 1px 0 0 var(--line);
  }
  table.grid thead th:first-child { z-index: 7; background: var(--surface-2); }
  table.grid tbody tr:hover td:first-child { background: #fbfcfb; }

  /* 筛选浮层铺满可用宽度 */
  .popover { width: calc(100vw - 24px) !important; }

  /* 设置 */
  .settings-hint { padding: 12px 16px 0; }
  .field-list { padding: 12px 16px 6px; }
  .field-item { flex-wrap: wrap; row-gap: 10px; }
  .field-item .drag { order: 1; }
  .field-item .meta { order: 2; flex: 1 1 100%; }
  .field-item .ops { order: 3; flex: 1 1 100%; justify-content: flex-end; }
  .add-field-row { flex-direction: column; align-items: stretch; padding: 6px 16px 18px; }
  .add-field-row .field { flex: 1 1 auto; }
  .add-field-row .btn { width: 100%; }

  /* 弹窗 */
  .modal { width: calc(100vw - 24px); max-height: calc(100vh - 48px); }
  .modal-head { padding: 16px 18px 10px; }
  .modal-body { padding: 4px 18px 8px; }
  .modal-foot { padding: 12px 18px 18px; }

  .empty-state { padding: 48px 18px; }
  .empty-state .big { font-size: 30px; }
}

/* 超窄屏 */
@media (max-width: 380px) {
  .module-tab { padding: 6px 10px; font-size: 12.5px; }
  .brand-name { display: none; }
}
