/* 默认：FastAdmin 风 — 深色侧栏 + 浅色内容 */
:root,
html[data-theme="light"] {
  --bg: #ecf0f5;
  --sidebar: #222d32;
  --sidebar-text: #b8c7ce;
  --sidebar-muted: #8aa4af;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: #1e282c;
  --sidebar-active-text: #ffffff;
  --bg-elevated: #ffffff;
  --bg-soft: #f4f6f9;
  --header-bg: #ffffff;
  --table-head: #fafbfc;
  --line: #d2d6de;
  --text: #333333;
  --muted: #777777;
  --accent: #3c8dbc;
  --accent-hover: #367fa9;
  --accent-soft: rgba(60, 141, 188, 0.12);
  --accent-border: rgba(60, 141, 188, 0.28);
  --hover-fill: rgba(0, 0, 0, 0.04);
  --link: #3c8dbc;
  --danger: #dd4b39;
  --danger-soft: rgba(221, 75, 57, 0.1);
  --danger-text: #c23321;
  --warn: #f39c12;
  --input-bg: #ffffff;
  --auth-card: #ffffff;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --font: "Source Sans Pro", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sidebar-w: 220px;
  --auth-glow-1: rgba(60, 141, 188, 0.16);
  --auth-glow-2: rgba(0, 0, 0, 0.04);
  --row-hover: rgba(60, 141, 188, 0.06);
  --row-selected: rgba(60, 141, 188, 0.12);
  color-scheme: light;
}

/* 纯黑夜模式 */
html[data-theme="dark"] {
  --bg: #0b1220;
  --sidebar: #0f172a;
  --sidebar-text: #e8eef7;
  --sidebar-muted: #8b9bb0;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(59, 130, 246, 0.18);
  --sidebar-active-text: #ffffff;
  --bg-elevated: #151d2e;
  --bg-soft: #1c2738;
  --header-bg: rgba(15, 23, 42, 0.9);
  --table-head: rgba(255, 255, 255, 0.03);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e8eef7;
  --muted: #8b9bb0;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.18);
  --accent-border: rgba(59, 130, 246, 0.28);
  --hover-fill: rgba(255, 255, 255, 0.04);
  --link: #93c5fd;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --danger-text: #fecaca;
  --warn: #fbbf24;
  --input-bg: rgba(17, 24, 39, 0.72);
  --auth-card: rgba(21, 29, 46, 0.96);
  --radius: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --auth-glow-1: rgba(59, 130, 246, 0.18);
  --auth-glow-2: rgba(37, 99, 235, 0.12);
  --row-hover: rgba(59, 130, 246, 0.05);
  --row-selected: rgba(59, 130, 246, 0.18);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.page { min-height: 100vh; }

/* ===== Login ===== */
.auth-page {
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(900px 420px at 15% -5%, var(--auth-glow-1), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, var(--auth-glow-2), transparent 50%),
    var(--bg);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--auth-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 32px 28px 24px;
}

.brand { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.brand h1 { margin: 10px 0 0; font-size: 22px; font-weight: 650; }
.brand p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}
.field textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--text); background: var(--hover-fill); }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn-icon {
  width: auto;
  min-width: 34px;
  padding: 8px;
}
.btn-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.btn-export {
  gap: 4px;
}
.btn-export .caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.export-dropdown {
  position: relative;
  display: inline-flex;
}
.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  padding: 4px 0;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 40;
}
.export-menu[hidden] { display: none !important; }
.export-tips {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}
.export-menu button {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.export-menu button:hover {
  background: var(--hover-fill);
}

.auth-page .btn-primary { width: 100%; }
.hint { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }

/* ===== Admin shell ===== */
.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  transition: grid-template-columns 0.2s ease;
}
.admin-layout.sidebar-collapsed {
  --sidebar-w: 76px;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar-user-menu {
  position: relative;
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.user-avatar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  text-align: left;
}
.user-avatar-btn:hover,
.sidebar-user-menu.open .user-avatar-btn {
  background: var(--sidebar-hover);
  border-color: rgba(255, 255, 255, 0.08);
}
.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-avatar-btn .user-meta {
  min-width: 0;
  flex: 1;
}
.user-avatar-btn .user-portal-name {
  display: block;
  color: var(--sidebar-muted);
  font-size: 12px;
}
.user-avatar-btn strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-dropdown {
  display: none;
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(100% - 4px);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 20;
}
.sidebar-user-menu.open .user-menu-dropdown {
  display: block;
}
.user-menu-dropdown [data-theme-toggle],
.user-menu-dropdown [data-logout] {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.user-menu-dropdown [data-theme-toggle]:hover {
  background: var(--hover-fill);
}
.user-menu-dropdown [data-logout]:hover {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 4px;
  color: var(--sidebar-text);
  font-size: 13px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.side-nav a:hover {
  color: var(--sidebar-active-text);
  background: var(--sidebar-hover);
}
.side-nav a.active {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
  border-color: transparent;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: transparent;
  color: var(--sidebar-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sidebar-toggle:hover {
  color: var(--sidebar-text);
  background: var(--sidebar-hover);
}
.sidebar-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-toggle-text {
  font-size: 12px;
}

.admin-layout.sidebar-collapsed .user-avatar-btn {
  justify-content: center;
  padding: 8px 0;
}
.admin-layout.sidebar-collapsed .user-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}
.admin-layout.sidebar-collapsed .user-meta,
.admin-layout.sidebar-collapsed .nav-text,
.admin-layout.sidebar-collapsed .sidebar-toggle-text {
  display: none;
}
.admin-layout.sidebar-collapsed .side-nav a {
  justify-content: center;
  padding: 12px 0;
}
.admin-layout.sidebar-collapsed .user-menu-dropdown {
  left: 4px;
  right: 4px;
}
.admin-layout.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-header {
  min-height: 56px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.main-header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
}
.main-header .sub {
  color: var(--muted);
  font-size: 12px;
  margin-left: 10px;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
  margin-left: auto;
}

.main-body {
  padding: 16px 20px 28px;
  flex: 1;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.toolbar .spacer { flex: 1; min-width: 0; }

.toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(16px);
  pointer-events: none;
  transition:
    max-width 0.28s ease,
    opacity 0.2s ease,
    transform 0.28s ease;
}
.filters.is-open {
  max-width: 560px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.filters input,
.filters select {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 140px;
  font-size: 13px;
  flex-shrink: 0;
  outline: none;
}
.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
}
#btn-search.is-active {
  background: var(--accent-hover);
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.panel-pad { padding: 16px; }

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
table.data th,
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}
table.data th {
  background: var(--table-head);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.data tbody tr:hover {
  background: var(--row-hover);
}
table.data tbody tr.is-selected,
table.data tbody tr.is-selected:hover {
  background: var(--row-selected);
}
table.data-orders tbody tr {
  cursor: pointer;
}
table.data-orders tbody tr.is-selected td {
  background: transparent;
}
table.data-orders tbody tr.is-selected td.col-jiafang {
  background: rgba(251, 191, 36, 0.12);
}
table.data a {
  color: var(--link);
}
table.data a:hover { text-decoration: underline; }

/* 子账号表：grid 均分 */
table.data-users {
  display: grid;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  grid-template-columns: repeat(7, minmax(max-content, 1fr));
}
table.data-users thead,
table.data-users tbody,
table.data-users tr {
  display: contents;
}
table.data-users th,
table.data-users td {
  width: auto;
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}
table.data-users th:nth-child(n+2),
table.data-users td:nth-child(n+2) {
  text-align: center;
}
table.data-users td .switch {
  margin: 0 auto;
}
table.data-users tbody td {
  background: transparent;
}
table.data-users tbody tr:hover td {
  background: var(--row-hover);
}

/*
 * 订单表：先按内容量出「自然宽度」，再换成百分比铺满；
 * 窗口拉长/缩小时各列按原比例缩放（链接宽则占比大，排名窄则占比小）。
 */
table.data.data-orders {
  display: table;
  width: 100%;
  min-width: 1100px;
  table-layout: fixed;
  border-collapse: collapse;
}
table.data-orders.is-measuring {
  width: max-content;
  table-layout: auto;
}
table.data-orders thead {
  display: table-header-group;
}
table.data-orders tbody {
  display: table-row-group;
}
table.data-orders tr {
  display: table-row;
}
table.data-orders th,
table.data-orders td {
  display: table-cell;
  width: auto;
  max-width: none;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  overflow-wrap: normal;
}
table.data-orders th {
  text-align: center;
}
table.data-orders td {
  text-align: left;
}
/* 居中：ID、订单ID、下单日期、订单金额、状态、业务类型、博主、热度、天数、排名、上词日期（及色块列） */
table.data-orders th:nth-child(1),
table.data-orders td:nth-child(1),
table.data-orders th:nth-child(2),
table.data-orders td:nth-child(2),
table.data-orders th:nth-child(3),
table.data-orders td:nth-child(3),
table.data-orders th:nth-child(4),
table.data-orders td:nth-child(4),
table.data-orders th:nth-child(5),
table.data-orders td:nth-child(5),
table.data-orders th:nth-child(6),
table.data-orders td:nth-child(6),
table.data-orders th:nth-child(7),
table.data-orders td:nth-child(7),
table.data-orders th:nth-child(10),
table.data-orders td:nth-child(10),
table.data-orders th:nth-child(11),
table.data-orders td:nth-child(11),
table.data-orders th.col-paiming,
table.data-orders td.col-paiming,
table.data-orders th:nth-child(13),
table.data-orders td:nth-child(13),
table.data-orders th:nth-child(14),
table.data-orders td:nth-child(14),
table.data-orders th:nth-child(15),
table.data-orders td:nth-child(15) {
  text-align: center;
}
table.data-orders td .progress-blocks {
  margin: 0 auto;
}
/* 词汇：自然宽度上限，避免超长词占满整表 */
table.data-orders th.col-cihui,
table.data-orders td.col-cihui {
  max-width: 14em;
  text-align: left;
  overflow: hidden;
}
table.data-orders td.col-cihui .cell-clip {
  display: block;
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.data-orders.is-measuring td.col-cihui .cell-clip {
  max-width: 14em;
}
table.data-orders:not(.is-measuring) td.col-cihui .cell-clip {
  width: 100%;
  max-width: none;
}
table.data-orders th.col-link,
table.data-orders td.col-link {
  overflow: hidden;
  text-overflow: ellipsis;
}
table.data-orders th.col-jiafang {
  color: #111827;
  background: #fbbf24;
}
table.data-orders td.col-jiafang {
  background: rgba(251, 191, 36, 0.12);
  overflow: visible;
  min-width: 120px;
}
table.data-orders th.col-actions,
table.data-orders td.col-actions {
  text-align: center;
  width: 4.5em;
  overflow: visible;
}
table.data-orders td.col-actions {
  vertical-align: middle;
}
.btn-trend {
  width: 28px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #18bc9c;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.btn-trend:hover {
  background: #15a589;
}
.btn-trend svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
table.data-orders .cell-edit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-width: 96px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  outline: none;
  cursor: pointer;
}
table.data-orders .cell-edit[readonly] {
  user-select: none;
}
table.data-orders .cell-edit.is-editing {
  cursor: text;
  border-color: #fbbf24;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
  user-select: text;
}
table.data-orders tbody td {
  background: transparent;
}
table.data-orders tbody tr:hover td {
  background: var(--row-hover);
}
table.data-orders tbody tr.is-selected td,
table.data-orders tbody tr.is-selected:hover td {
  background: var(--row-selected);
}
table.data-orders tbody tr.is-selected td.col-jiafang,
table.data-orders tbody tr.is-selected:hover td.col-jiafang {
  background: rgba(251, 191, 36, 0.16);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
/* 白天：深色字 + 实底，对比更强 */
/* 已完成：绿 */
html[data-theme="light"] .tag-ok,
:root .tag-ok {
  color: #1e6b2f;
  background: #dff5e5;
  border-color: #8fd4a4;
}
/* 进行中 / 重点：黄 */
html[data-theme="light"] .tag-run,
:root .tag-run {
  color: #8a6d00;
  background: #fff3cd;
  border-color: #e0c35a;
}
/* 待更换：橙 */
html[data-theme="light"] .tag-change,
:root .tag-change {
  color: #b35400;
  background: #ffe4c4;
  border-color: #f0a35a;
}
html[data-theme="light"] .tag-wait,
:root .tag-wait {
  color: #8a6d00;
  background: #fff3cd;
  border-color: #e0c35a;
}
html[data-theme="light"] .tag-off,
:root .tag-off {
  color: #a12622;
  background: #fde2e1;
  border-color: #e8a09c;
}
/* 已结算：橙褐色 */
html[data-theme="light"] .tag-settle,
:root .tag-settle {
  color: #8b4513;
  background: #f3e0d0;
  border-color: #d2a679;
}
/* 黑夜 */
html[data-theme="dark"] .tag-ok {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.32);
}
html[data-theme="dark"] .tag-run {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.16);
  border-color: rgba(234, 179, 8, 0.32);
}
html[data-theme="dark"] .tag-change {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(249, 115, 22, 0.35);
}
html[data-theme="dark"] .tag-wait {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.16);
  border-color: rgba(234, 179, 8, 0.32);
}
html[data-theme="dark"] .tag-off {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
}
html[data-theme="dark"] .tag-settle {
  color: #fdba74;
  background: rgba(194, 120, 60, 0.2);
  border-color: rgba(194, 120, 60, 0.35);
}

.progress-blocks {
  display: grid;
  grid-template-columns: repeat(5, 12px);
  gap: 4px;
  width: max-content;
}
.progress-block {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #ccc;
}
.text-muted {
  color: var(--muted);
}

.fujian-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fujian-thumb {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  line-height: 0;
}
.fujian-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #1f2937;
}
.fujian-file {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: #93c5fd;
  font-size: 12px;
}
.fujian-file:hover {
  text-decoration: underline;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 34px;
  height: 18px;
  vertical-align: middle;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #3a4556;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #1f2937;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.switch input:checked + .switch-slider {
  background: #2dd4bf;
}
.switch input:checked + .switch-slider::before {
  transform: translateX(16px);
  background: #111827;
}
.switch input:disabled + .switch-slider {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  max-width: 860px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.form-actions .btn-primary { width: auto; min-width: 120px; }

/* ===== 自助下单 ===== */
.create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
  max-width: 1100px;
}
.create-card,
.create-summary {
  margin: 0;
}
.create-section + .create-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.create-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.type-tab {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.type-tab:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.45);
}
.type-tab.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.create-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.create-fields .full { grid-column: 1 / -1; }
.create-fields .field { margin-bottom: 0; }
.create-fields .field[hidden] { display: none !important; }
.field .optional {
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}
.create-summary {
  position: sticky;
  top: 72px;
}
.price-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.price-row strong {
  color: var(--text);
  font-weight: 600;
}
.price-total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.price-total strong {
  color: #93c5fd;
  font-size: 20px;
  font-weight: 700;
}
.price-tip {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.create-actions {
  margin-top: 18px;
  flex-direction: column;
}
.create-actions .btn {
  width: 100%;
}

@media (max-width: 900px) {
  .create-form {
    grid-template-columns: 1fr;
  }
  .create-summary {
    position: static;
    order: 2;
  }
  .create-card {
    order: 1;
  }
  .create-fields {
    grid-template-columns: 1fr;
  }
}

.empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 8px));
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  font-size: 13px;
  max-width: min(90vw, 360px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.pager-info { color: var(--muted); font-size: 13px; }
.pager-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pager-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.pager-size select {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
}
.pager-page { font-size: 13px; color: var(--text); min-width: 52px; text-align: center; }
.pager .btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
