:root {
  --bg: #f3f5fb;
  --card: #ffffff;
  --text: #151a2d;
  --muted: #6b7390;
  --line: #e4e8f2;
  --primary: #5b5bf0;
  --primary-2: #8b5cf6;
  --primary-soft: #eeefff;
  --success: #0f9d6e;
  --success-soft: #e6f7f1;
  --warn: #c2740b;
  --warn-soft: #fdf3e2;
  --danger: #dc4b4b;
  --danger-soft: #fdeeee;
  --shadow-lg: 0 24px 70px rgba(27, 35, 74, 0.13);
  --shadow-sm: 0 8px 24px rgba(27, 35, 74, 0.06);
  --radius: 20px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }

/* ------------------------------ 背景装饰 ------------------------------ */
.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.orb-a { width: 520px; height: 520px; top: -180px; left: -120px; background: #c7c9ff; }
.orb-b { width: 460px; height: 460px; right: -160px; top: 180px; background: #bfe7ff; }
.orb-c { width: 420px; height: 420px; bottom: -200px; left: 38%; background: #e3d4ff; }

/* ------------------------------ 通用控件 ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(91, 91, 240, 0.28);
}
.btn.primary:hover { box-shadow: 0 14px 30px rgba(91, 91, 240, 0.36); }
.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: #3c435c;
}
.btn.ghost:hover { border-color: #c9cfe2; background: #fbfcff; }
.btn.subtle {
  background: #f4f5fb;
  border-color: transparent;
  color: #454d6b;
}
.btn.subtle:hover { background: #e9ebf7; }
.btn.danger-ghost {
  background: #fff;
  border-color: #f3d4d4;
  color: var(--danger);
}
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.block { width: 100%; padding: 12px 18px; }
.btn.small { padding: 8px 14px; font-size: 12.5px; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.control {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 40px;
}
.control:focus {
  border-color: #b6b9ff;
  box-shadow: 0 0 0 3px rgba(91, 91, 240, 0.12);
}
select.control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 8l3-3.5' fill='none' stroke='%236b7390' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}
.textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.7;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13px;
}
.mono { font-family: "Cascadia Code", Consolas, "Courier New", monospace; }
.grow { flex: 1 1 180px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.field b { color: var(--danger); font-weight: 700; }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #b6b9ff;
  box-shadow: 0 0 0 3px rgba(91, 91, 240, 0.12);
}
.field textarea { resize: vertical; line-height: 1.6; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: #4f4fd8;
  white-space: nowrap;
}
.tag.soft { background: #f1f3fa; color: var(--muted); font-weight: 500; }

/* ------------------------------ 登录页 ------------------------------ */
.auth-shell {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 32px;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 36px;
  align-items: center;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 54px 50px 46px;
  color: #fff;
  background: linear-gradient(150deg, #141a35 0%, #2a2a69 52%, #4b2a89 100%);
  box-shadow: var(--shadow-lg);
  min-height: 620px;
  display: flex;
  flex-direction: column;
}
.auth-brand::before {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: -150px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 68%);
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  left: -110px;
  bottom: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.36), transparent 70%);
}
.auth-brand > * { position: relative; z-index: 1; }

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  margin-bottom: 30px;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-mark.small {
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  box-shadow: 0 8px 20px rgba(91, 91, 240, 0.28);
}
.brand-mark.small svg { width: 22px; height: 22px; }

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 14px;
}
.auth-brand h1 {
  font-size: 46px;
  line-height: 1.15;
  margin-bottom: 18px;
}
.brand-sub {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  max-width: 380px;
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 38px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}
.feature-list span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.auth-foot {
  margin-top: auto;
  padding-top: 34px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.03em;
}

.auth-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 38px 40px 34px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 460px;
  justify-self: center;
}

.auth-tabs {
  display: flex;
  padding: 4px;
  background: #f0f2fa;
  border-radius: 12px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
}
.auth-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 3px 10px rgba(30, 38, 80, 0.08);
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form h2 { font-size: 25px; }
.form-sub { color: var(--muted); font-size: 12.8px; margin-top: -8px; }
.auth-form .field { gap: 6px; }
.auth-form .field + .field { margin-top: -2px; }
.auth-form .btn { margin-top: 6px; }
.form-switch {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.link {
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 600;
  padding: 0 2px;
  font-size: inherit;
}
.link:hover { text-decoration: underline; }
.auth-message {
  min-height: 20px;
  margin-top: 14px;
  font-size: 12.5px;
  text-align: center;
  color: var(--danger);
  transition: color 0.2s ease;
}
.auth-message.ok { color: var(--success); }

/* ------------------------------ 主界面 ------------------------------ */
.app {
  max-width: 1340px;
  margin: 0 auto;
  padding: 22px 24px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}
.app-brand { display: flex; align-items: center; gap: 13px; }
.app-brand h1 { font-size: 17px; }
.app-brand p { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: #f4f6fc;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #3b4260;
}
.avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0 18px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}
.tab {
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.tab em {
  font-style: normal;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8ebf6;
  color: #6d7594;
  font-weight: 600;
}
.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(30, 38, 80, 0.09);
}
.tab.active em { background: var(--primary-soft); color: var(--primary); }

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.panel-head h2 { font-size: 20px; }
.panel-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.head-actions { display: flex; align-items: center; gap: 9px; }

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px;
  background: #fff;
  border: 1px solid #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.toolbar .control { min-height: 38px; padding-top: 8px; padding-bottom: 8px; }
.toolbar .control[type="text"] { width: 160px; }
.toolbar .control.grow { width: auto; flex: 1 1 190px; }
.toolbar-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 3px;
}
.bulk-write-toolbar { margin-top: 10px; }
.toolbar-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7c849e;
  white-space: nowrap;
}
.auto-mark-status-field { margin-top: 14px; }
.paoma-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.compact-card .table-scroll { max-height: none; }
.compact-table { min-width: 760px; }
.compact-table tbody td { padding-top: 9px; padding-bottom: 9px; }

.table-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid #fff;
}
.table-scroll { overflow: auto; max-height: calc(100vh - 330px); }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1130px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f9fe;
  color: #5d6584;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table thead th.num { text-align: right; }
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f2f9;
  font-size: 13px;
  color: #303752;
  white-space: nowrap;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .rest { color: #2f3752; }
.data-table .rest.zero { color: var(--danger); }
.data-table th.col-check, .data-table td.col-check { width: 42px; padding-right: 0; }
.data-table th.col-actions, .data-table td.col-actions { text-align: right; }
.data-table .dim { color: #9aa1b9; }
.data-table td .row-name { color: var(--muted); }

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: #f1f3fa;
  color: #6b7390;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
}
.status-badge.idle { background: var(--success-soft); color: var(--success); }
.status-badge.busy { background: #e9f0ff; color: #3b6fe0; }
.status-badge.out { background: #f0f2f8; color: #737b99; }
.status-badge.error { background: var(--danger-soft); color: var(--danger); }
.status-badge.warn { background: var(--warn-soft); color: var(--warn); }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-btn {
  border: none;
  background: transparent;
  color: #5a648a;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 7px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.row-btn:hover { background: #eef0fa; color: var(--primary); }
.row-btn.del:hover { background: var(--danger-soft); color: var(--danger); }

.empty-state {
  padding: 64px 20px;
  text-align: center;
}
.empty-title { font-size: 14px; font-weight: 600; color: #4b5372; }
.empty-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  color: var(--muted);
  font-size: 12px;
}
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pager .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ------------------------------ 数据概览 ------------------------------ */
.overview-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--stat-color, var(--primary));
}
.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #5b6382;
}
.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stat-color, var(--primary));
}
.stat-value {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-unit {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #98a0b8;
}
.overview-meta {
  padding: 14px 4px 0;
  color: var(--muted);
  font-size: 12px;
}

/* ------------------------------ 批量添加 ------------------------------ */
.span-2 { grid-column: 1 / -1; }
.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 7px 0 2px;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4c5476;
  cursor: pointer;
}
.radio-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}
.account-resource-check { margin-top: 4px; }
.order-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  min-height: 20px;
}
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: #4f4fd8;
  white-space: nowrap;
}
.member-del {
  border: 0;
  background: transparent;
  color: #4f4fd8;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  font-weight: 700;
}
.member-del:hover { color: var(--danger); }
#addOrderAccountBtn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(91, 91, 240, 0.28);
}
#addOrderAccountBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(91, 91, 240, 0.36);
}
.order-eat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}
.batch-account-field { margin-top: 14px; }
.batch-res-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 16px;
}
.batch-res-title {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}
.resource-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcff;
}
.resource-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #4c5476;
  cursor: pointer;
}
.resource-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}
.batch-hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

/* ------------------------------ 配置页 ------------------------------ */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #fff;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.card h3 { font-size: 15px; }
.card-desc { color: var(--muted); font-size: 12.3px; margin-bottom: 14px; }
.card .control { width: 100%; }
.config-grid .field { margin-top: 10px; }
.stat-config-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.stat-config-row {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1.1fr 1.1fr auto;
  gap: 7px;
  align-items: center;
}
.stat-config-row .control { min-width: 0; font-size: 12.5px; }
.stat-config-row .btn { white-space: nowrap; }

.match-column-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.match-column-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #e6e9f4;
  border-radius: 8px;
  background: #f8f9fd;
  font-size: 12.5px;
  color: #4d5673;
  cursor: pointer;
}
.match-column-option input { accent-color: var(--primary); }
.match-column-option em {
  color: #9aa2b8;
  font-style: normal;
  font-size: 10.5px;
}

.ui-config-card { grid-column: 1 / -1; }
.ui-form-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f0f2f9;
}
.ui-form-section:first-of-type { border-top: none; padding-top: 0; }
.ui-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.ui-form-head h4 { font-size: 13.5px; color: #3d4568; }
.ui-form-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-config-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-config-row {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1.2fr 1.4fr auto;
  gap: 7px;
  align-items: center;
}
.form-config-row .control { min-width: 0; font-size: 12.5px; min-height: 36px; }
.form-config-buttons { display: flex; gap: 3px; flex-shrink: 0; }
.form-config-buttons .col-btn { width: auto; min-width: 28px; padding: 0 6px; }
.overview-empty {
  grid-column: 1 / -1;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  border: 1px dashed #dfe4f1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.chip {
  border: 1px solid #e2e6f3;
  background: #f8f9fe;
  color: #4c5476;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.chip:hover { border-color: #b9bcff; background: var(--primary-soft); color: var(--primary); }

.preview-panel {
  margin-top: 12px;
  background: #f8f9fe;
  border: 1px dashed #dfe3f0;
  border-radius: 11px;
  padding: 11px 13px;
}
.preview-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: #98a0b8;
  font-weight: 600;
}
.preview-panel pre {
  margin: 6px 0 0;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: #2f3752;
  white-space: pre-wrap;
  word-break: break-all;
}

.status-preview { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; min-height: 22px; }
.status-preview .status-badge { background: #f1f3fa; color: #5f6888; }
.status-preview .status-badge:first-child { background: var(--success-soft); color: var(--success); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #f0f2f9;
}
.switch-row strong { font-size: 13px; }
.switch-row p { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  position: absolute;
  inset: 0;
  background: #d8dcf1;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(20, 28, 60, 0.18);
  transition: transform 0.2s ease;
}
.switch input:checked + .switch-track {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

.api-card { grid-column: 1 / -1; }
.api-key-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.api-key-row .control { flex: 1 1 260px; min-width: 200px; background: #f8f9fe; }
.api-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.api-block {
  border: 1px solid #edf0f8;
  border-radius: 13px;
  padding: 14px;
  background: #fcfdff;
}
.api-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.api-block h4 { font-size: 12.5px; color: #3d4564; }
.code {
  margin: 0;
  background: #151a2d;
  color: #c9d1ff;
  border-radius: 9px;
  padding: 10px 12px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 44px;
}
.api-note { color: var(--muted); font-size: 11.5px; margin-top: 8px; line-height: 1.6; }
.api-note code {
  background: #f0f2fa;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.field-map {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f0f2f9;
}
.field-map-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #98a0b8;
  font-weight: 600;
  display: block;
  margin-bottom: 9px;
}
.field-map-list { display: flex; flex-wrap: wrap; gap: 7px; }
.field-map-list span {
  background: #f6f8fe;
  border: 1px solid #edf0f8;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #5c6484;
}
.field-map-list b { color: var(--primary); margin-right: 3px; font-weight: 700; }

/* ------------------------------ 弹窗 ------------------------------ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 22, 45, 0.45);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: min(640px, 100%);
  max-height: min(88vh, 780px);
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(10, 16, 40, 0.3);
  animation: popIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-card.wide { width: min(780px, 100%); }

.columns-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
  margin: 14px 0;
  padding-right: 4px;
}
.column-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcff;
}
.column-row .col-label { flex: 1 1 auto; min-width: 110px; min-height: 36px; }
.column-row .col-key {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10.5px;
  color: #98a0b8;
  min-width: 56px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.column-row .col-flag {
  font-size: 10.5px;
  color: #6f789b;
  background: #f1f3fa;
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}
.column-row .col-flag.custom { background: var(--primary-soft); color: var(--primary); }
.col-buttons { display: flex; gap: 3px; flex-shrink: 0; }
.col-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: #eef0fa;
  color: #5c6484;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.col-btn:hover { background: #e1e5f7; color: var(--primary); }
.col-btn.del { width: auto; padding: 0 8px; color: var(--danger); }
.col-btn.del:hover { background: var(--danger-soft); }
.add-column-row { display: flex; gap: 8px; }
.add-column-row .control { flex: 1 1 auto; }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-head h3 { font-size: 17px; }
.icon-btn {
  border: none;
  background: #f3f5fb;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 18px;
  line-height: 1;
  color: #6c7492;
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: #e9ecf7; color: var(--text); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-tip { color: var(--muted); font-size: 12px; margin-top: 14px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #f0f2f9;
}
.modal-foot #resetColumnsBtn { margin-right: auto; }

/* ------------------------------ 提示条 ------------------------------ */
.toast-box {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 11px;
  background: #1c2340;
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 12px 34px rgba(15, 20, 45, 0.28);
  animation: toastIn 0.22s ease;
  max-width: 360px;
}
.toast.warn { background: #a5660c; }
.toast.error { background: #b93b3b; }
.toast.success { background: #0e8a61; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1080px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 560px; padding: 30px 20px; }
  .auth-brand { min-height: auto; padding: 38px 34px; }
  .auth-brand h1 { font-size: 34px; }
  .feature-list { display: none; }
  .auth-foot { padding-top: 22px; }
  .auth-card { max-width: none; }
  .config-grid { grid-template-columns: 1fr; }
  .api-card { grid-column: auto; }
  .api-blocks { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app { padding: 14px 12px 40px; }
  .topbar { padding: 12px 14px; flex-wrap: wrap; }
  .top-actions { width: 100%; justify-content: space-between; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { flex: 1; justify-content: center; padding: 8px 12px; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .column-row { flex-wrap: wrap; }
  .column-row .col-label { flex-basis: 100%; }
  .modal-card.wide { width: 100%; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-hint { margin-left: 0; width: 100%; white-space: normal; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-config-row { grid-template-columns: 1fr 1fr; }
  .form-config-row { grid-template-columns: 1fr 1fr; }
  .toolbar .control[type="text"], .toolbar .control.grow { width: 100%; flex-basis: 100%; }
  .toolbar-sep { display: none; }
  .toolbar .btn { flex: 1 1 auto; }
  .table-scroll { max-height: none; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 20px; }
  .toast-box { left: 14px; right: 14px; bottom: 14px; align-items: stretch; }
  .toast { max-width: none; }
  .panel-foot { flex-direction: column; gap: 4px; align-items: flex-start; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; }
  .auth-brand { padding: 30px 24px; }
  .auth-brand h1 { font-size: 29px; }
  .app-brand p { display: none; }
  .user-chip { padding-right: 8px; }
  .overview-grid { grid-template-columns: 1fr; }
  .switch-row { align-items: flex-start; }
}
