/* =========================================================
   拾录清单 · 管理后台
   设计基线：墨黑 #191710 / 纸色 #f4f1ea / 卡片 #fffdf8
             强调红 #cf3a26 / 点缀荧光绿 #d8ff3e
   ========================================================= */

* {
  box-sizing: border-box;
}

:root {
  --ink: #191710;
  --ink-soft: #2b2822;
  --paper: #f8f4eb;
  --card: #fffdf8;
  --card-2: #f8f4eb;
  --line: #eee9dd;
  --line-strong: #ded8ca;
  --muted: #776f66;
  --muted-2: #aaa396;
  --red: #cf3a26;
  --red-dark: #b52f1d;
  --red-soft: #fdecea;
  --lime: #d8ff3e;
  --lime-ink: #43570a;
  --lime-soft: #eef6d6;
  --green: #2f6b3f;
  --green-soft: #e6f2e8;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-1: 0 1px 2px rgba(25, 23, 16, 0.05);
  --shadow-2: 0 8px 24px rgba(25, 23, 16, 0.09);
  --shadow-3: 0 24px 64px rgba(25, 23, 16, 0.22);

  --ctrl-h: 38px;
  --topbar-h: 60px;
  --focus-ring: 0 0 0 3px rgba(207, 58, 38, 0.22);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  --font-num: "DIN Alternate", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, "Courier New", monospace;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font: 500 11px/1 var(--font-mono);
}

input,
select {
  font: inherit;
  color: inherit;
  width: 100%;
  height: var(--ctrl-h);
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input::placeholder {
  color: var(--muted-2);
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--red);
  cursor: pointer;
}

input[type="checkbox"] {
  border-radius: 4px;
}

input[type="radio"] {
  border-radius: 50%;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: var(--focus-ring);
}

[hidden] {
  display: none !important;
}

/* ============================ 顶栏 ============================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--topbar-h);
  padding: 0 28px;
  background: var(--ink);
  color: #f6f1e6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  overflow: hidden;
  border-radius: 10px;
  background: var(--lime);
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy b {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.2;
}

.brand-copy small {
  color: rgba(246, 241, 230, 0.55);
  font-size: 11.5px;
  letter-spacing: 0.4px;
}

.tabs {
  display: flex;
  gap: 4px;
  height: 100%;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: rgba(246, 241, 230, 0.62);
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.16s ease;
}

.tab svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.tab::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.16s ease;
}

.tab:hover {
  color: #f6f1e6;
}

.tab.is-active {
  color: #fff;
}

.tab.is-active::after {
  background: var(--lime);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ghost-invert {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(246, 241, 230, 0.22);
  border-radius: 999px;
  background: transparent;
  color: #f6f1e6;
  font-size: 13px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.ghost-invert:hover {
  background: rgba(246, 241, 230, 0.1);
  border-color: rgba(246, 241, 230, 0.42);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  transition: background 0.16s ease, color 0.16s ease;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  background: rgba(25, 23, 16, 0.06);
}

.ghost-invert.icon-btn:hover {
  background: rgba(246, 241, 230, 0.12);
}

/* ============================ 布局 ============================ */

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 28px 88px;
}

.tab-panel {
  display: none;
  animation: panel-in 0.2s ease;
}

.tab-panel.is-active {
  display: block;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================ 页面标题 ============================ */

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.page-heading-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.page-heading h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

button.primary.lg {
  height: 42px;
  padding: 0 20px;
  font-size: 14px;
}

/* ============================ 工具条 ============================ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}

.search-box input {
  height: var(--ctrl-h);
  padding-left: 36px;
  padding-right: 68px;
  border-radius: 10px;
  background: #fff;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 34px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e9e3d5;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.search-clear:hover {
  background: #ded7c6;
  color: var(--ink);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -9px;
  pointer-events: none;
}

.filter-select {
  position: relative;
  flex: 0 0 auto;
}

.filter-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 152px;
  height: var(--ctrl-h);
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.filter-trigger:hover {
  border-color: #c3b9a1;
}

.filter-select.is-open .filter-trigger,
.filter-trigger:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: var(--focus-ring);
}

.filter-select[data-value]:not([data-value=""]) .filter-trigger {
  background: var(--card-2);
  border-color: var(--line-strong);
}

.filter-select[data-value]:not([data-value=""]) .filter-value {
  font-weight: 600;
}

.filter-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-caret {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease, margin 0.16s ease;
}

.filter-select.is-open .filter-caret {
  margin-top: 3px;
  transform: rotate(225deg);
}

.filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  display: none;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
  max-height: 300px;
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
}

.filter-select.is-open .filter-menu {
  display: block;
}

.filter-menu [role="option"] {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 12px 0 30px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.filter-menu [role="option"]:hover,
.filter-menu [role="option"]:focus {
  outline: none;
  background: var(--card-2);
}

.filter-menu [role="option"][aria-selected="true"] {
  font-weight: 600;
}

.filter-menu [role="option"][aria-selected="true"]::before {
  content: "✓";
  position: absolute;
  left: 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

/* 分类筛选：赛道分组标题 + 二级分类缩进 */
.filter-menu .filter-group {
  padding: 10px 12px 4px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.filter-menu .filter-group:not(:first-child) {
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.filter-menu [role="option"].is-child {
  padding-left: 38px;
  color: var(--muted);
  font-size: 13px;
}

/* ============================ 按钮 ============================ */

button.primary,
button.ghost,
button.danger,
button.danger-solid,
button.soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--ctrl-h);
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    box-shadow 0.16s ease, transform 0.06s ease;
}

button.primary svg,
button.soft svg,
button.ghost svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

button.primary:active,
button.ghost:active,
button.danger:active,
button.danger-solid:active,
button.soft:active {
  transform: translateY(1px);
}

button.primary {
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-1);
}

button.primary:hover {
  background: var(--red-dark);
}

button.ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
}

button.ghost:hover {
  background: var(--card-2);
  border-color: #c3b9a1;
}

button.danger {
  background: #fff;
  border-color: rgba(207, 58, 38, 0.32);
  color: var(--red);
}

button.danger:hover {
  background: var(--red-soft);
  border-color: rgba(207, 58, 38, 0.55);
}

button.danger-solid {
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-1);
}

button.danger-solid:hover {
  background: var(--red-dark);
}

button.soft {
  background: var(--lime-soft);
  border-color: #d7e6ae;
  color: var(--lime-ink);
}

button.soft:hover {
  background: #e4efc3;
  border-color: #c8db96;
}

button.text-btn {
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease;
}

button.text-btn:hover {
  background: rgba(25, 23, 16, 0.05);
  color: var(--ink);
}

.toolbar .primary {
  margin-left: auto;
}

/* ============================ 结果条 ============================ */

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.result-count {
  color: var(--ink);
  font-weight: 600;
}

.result-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted-2);
}

/* ============================ 表格 ============================ */

.table-wrap {
  border-radius: var(--radius);
}

.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* clip 而非 hidden：不生成滚动容器，表头 sticky 才能相对视口吸附 */
  overflow: clip;
}

.grid th,
.grid td {
  padding: 12px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.grid thead th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 10;
  padding: 10px 12px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.grid tbody tr:last-child td {
  border-bottom: 0;
}

.grid tbody tr {
  transition: background 0.14s ease;
}

.grid tbody tr:hover {
  background: #fbf8f1;
}

.grid tbody tr.is-selected {
  background: #fdf7e6;
}

.num-col {
  text-align: right !important;
}

.check-col {
  width: 42px;
  text-align: center !important;
}

.sort-col {
  width: 46px;
}

.act-col {
  width: 1%;
  text-align: right !important;
}

.sort-cell {
  width: 46px;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.sort-cell button,
.channel-sort button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0 0 2px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.sort-cell button:hover:not(:disabled),
.channel-sort button:hover:not(:disabled) {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
}

.sort-cell button:disabled,
.channel-sort button:disabled {
  opacity: 0.28;
}

/* 商品单元格 */
.cell-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.thumb {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: #efe9dc;
  display: block;
}

.thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  font-size: 16px;
}

.cell-title-copy {
  min-width: 0;
}

.cell-title b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font: 10.5px/1.4 var(--font-mono);
  letter-spacing: 0.2px;
}

/* 平台 / 分类 */
.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.platform-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.tax-line {
  color: var(--muted);
  font-size: 11.5px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag.on {
  background: var(--green-soft);
  color: var(--green);
}

.tag.off {
  background: #efeade;
  color: var(--muted);
}

.channel-tag {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}

.sub-line {
  color: var(--muted);
  font-size: 12px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 状态 */
.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-cell.is-on {
  color: var(--green);
}

.status-cell.is-on .status-dot {
  background: #4c9a5e;
}

.status-cell.is-off {
  color: var(--muted);
}

/* 价格 */
.price-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.35;
}

.price-now {
  font: 700 16px/1.2 var(--font-num);
  color: var(--ink);
}

.price-old {
  color: var(--muted-2);
  font: 400 11.5px/1.3 var(--font-num);
}

.price-save {
  margin-top: 3px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font: 600 11px/1.6 var(--font-num);
}

/* 口令 */
.token-cell {
  max-width: 300px;
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 290px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
}

.token-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.token-value {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 12.5px/1.5 var(--font-mono);
  color: var(--ink);
}

.token-value.is-link {
  color: #1d5fa8;
}

.token-kind {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: #eaf1fb;
  color: #1d5fa8;
  font: 600 10px/1.6 var(--font);
}

.token-lite {
  display: block;
  margin-top: 5px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font: 11.5px/1.5 var(--font-mono);
}

.copy-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  transition: color 0.16s ease, background 0.16s ease;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-btn:hover {
  color: var(--red);
  background: var(--red-soft);
}

.copy-btn.is-done {
  color: var(--green);
  background: var(--green-soft);
}

/* 数据列 */
.num-cell {
  font: 600 14px/1 var(--font-num);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.num-cell.is-zero {
  color: var(--muted-2);
  font-weight: 400;
}

.num-cell.is-hot {
  color: var(--red);
}

/* 行内操作 */
.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.row-actions button {
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12.5px;
  opacity: 0.55;
  transition: opacity 0.14s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

tr:hover .row-actions button,
.row-actions button:focus-visible {
  opacity: 1;
}

/* ============================ 空状态 ============================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 56px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}

.empty-state.small {
  padding: 28px 20px;
}

.empty-icon {
  font-size: 30px;
  line-height: 1;
  opacity: 0.7;
}

.empty-title {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.empty-desc {
  margin: 0;
  max-width: 380px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state .primary {
  margin-top: 12px;
}

/* ============================ 分页 ============================ */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.pager-info {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ============================ 批量浮层 ============================ */

.batch-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 16px;
  background: rgba(25, 23, 16, 0.96);
  border-radius: 999px;
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(8px);
  z-index: 45;
  animation: batch-in 0.2s ease;
}

@keyframes batch-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.batch-bar span {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(246, 241, 230, 0.14);
  color: #f6f1e6;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.batch-bar button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
}

.batch-bar button.ghost {
  background: rgba(246, 241, 230, 0.1);
  border-color: rgba(246, 241, 230, 0.2);
  color: #f6f1e6;
}

.batch-bar button.ghost:hover {
  background: rgba(246, 241, 230, 0.2);
  border-color: rgba(246, 241, 230, 0.35);
}

.batch-bar button.text-btn {
  color: rgba(246, 241, 230, 0.62);
}

.batch-bar button.text-btn:hover {
  background: rgba(246, 241, 230, 0.12);
  color: #f6f1e6;
}

.batch-bar button.soft {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}

.batch-bar button.soft:hover {
  background: #c9f22f;
}

.batch-bar button.danger-solid {
  background: var(--red);
}

.batch-bar button.danger-solid:hover {
  background: var(--red-dark);
}

/* ============================ 面板 / 分类赛道 ============================ */

.panel {
  padding: 20px 22px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.panel-head .field-note {
  margin-top: 5px;
  max-width: 640px;
}

.field-note {
  margin: 0;
  padding: 2px 0;
  font-size: 12px;
  color: var(--muted);
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.panel .grid {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.panel .grid thead th {
  position: static;
  background: transparent;
  padding-left: 6px;
  padding-right: 6px;
}

.panel .grid td {
  padding: 9px 6px;
}

.panel .grid tbody tr:hover {
  background: #fbf8f1;
}

.channels-panel {
  margin-bottom: 0;
}

.channel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.channel-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}

.channel-card.is-off {
  background: var(--card-2);
  opacity: 0.82;
}

.channel-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.channel-card-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 11px;
  object-fit: cover;
  background: var(--ink);
}

.channel-card-icon.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lime);
  font-size: 19px;
  font-weight: 800;
}

.channel-card-copy {
  flex: 1;
  min-width: 0;
}

.channel-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-card-title b {
  font-size: 15px;
}

.channel-card-copy small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--muted);
}

.channel-card-stats {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  font-size: 12px;
  color: var(--muted);
}

.channel-card-stats b {
  margin-right: 4px;
  color: var(--ink);
  font-size: 16px;
  font-family: var(--font-num);
}

.channel-card-id {
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 11px/1.4 var(--font-mono);
  color: var(--muted-2);
}

.channel-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.channel-card-foot .row-actions {
  justify-content: flex-start;
}

.channel-sort {
  display: flex;
  flex: none;
  gap: 4px;
}

.group-row td {
  padding: 9px 6px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line);
}

.group-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--muted);
}

.group-cell b {
  font-size: 13px;
  letter-spacing: 0.4px;
  color: var(--ink);
}

.group-icon {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 5px;
  object-fit: cover;
  background: var(--ink);
}

.group-icon.is-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
}

.group-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}

.cat-row.is-child td:first-child {
  box-shadow: inset 3px 0 0 var(--line-strong);
}

.cat-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-mark {
  color: var(--muted-2);
}

.mini-chip {
  padding: 1px 6px;
  border: 1px solid #d7e6ae;
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--lime-ink);
  font-size: 10px;
  font-weight: 600;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1ece0;
  font: 600 12px/1 var(--font-num);
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  vertical-align: -2px;
}

/* ============================ 统计 ============================ */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.stat-value {
  font: 700 32px/1.1 var(--font-num);
  letter-spacing: -0.5px;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--muted-2);
}

.stat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.chart-panel,
.top-panel {
  display: flex;
  flex-direction: column;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 240px;
  margin-top: 6px;
  padding: 14px 8px 0;
  border-top: 1px dashed var(--line);
  background-image: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent calc(25% - 1px),
    #f1ece0 calc(25% - 1px),
    #f1ece0 25%
  );
}

.chart-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.chart-bars {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.chart-bar {
  width: 15px;
  max-width: 26%;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}

.chart-bar.views {
  background: var(--ink);
}

.chart-bar.copies {
  background: var(--red);
}

.chart-bar.is-zero {
  opacity: 0.14;
}

.chart-label {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.series-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 6px;
}

.top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #f1ece0;
  color: var(--muted);
  font: 700 11px/1 var(--font-num);
}

.top-rank.is-top {
  background: var(--ink);
  color: var(--lime);
}

.top-main {
  flex: 1;
  min-width: 0;
}

.top-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.top-bar {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #f1ece0;
}

.top-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--red);
}

.top-nums {
  display: flex;
  flex: none;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.top-nums b {
  margin-right: 2px;
  color: var(--ink);
  font: 600 13px/1 var(--font-num);
}

/* ============================ 设置 ============================ */

.settings-card {
  max-width: 820px;
  padding: 24px 26px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.settings-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  margin-top: 22px;
}

.settings-field > label,
.settings-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--muted);
}

.settings-field input {
  max-width: 320px;
}

.logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-preview {
  margin-top: 26px;
}

.brand-preview-card {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 320px;
  margin-top: 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-2);
}

.brand-preview-card img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
}

.brand-preview-card b {
  display: block;
  font-size: 15px;
}

.brand-preview-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.upload-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.upload-row label.upload {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.upload-row label.upload:hover {
  background: var(--card-2);
  border-color: #b9b19c;
  color: var(--ink);
}

.upload-row input[type="file"] {
  display: none;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-status {
  margin-right: auto;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.settings-status.ok {
  color: var(--green);
}

.settings-status.err {
  color: var(--red);
}

.settings-card-secondary {
  margin-top: 18px;
}

.settings-card-secondary .settings-head {
  margin-bottom: 18px;
}

.secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.secret-row input {
  flex: 1 1 260px;
  max-width: 360px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.field-note.ok {
  color: var(--green);
}

/* ============================ 采集 ============================ */

.collector-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  align-items: start;
  max-width: 1180px;
}

.collector-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.collector-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.collector-card-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.collector-card-head .field-note {
  margin-top: 5px;
}

.collector-field > label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--muted);
}

.collector-field textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: 12.5px/1.6 var(--font-mono);
  resize: vertical;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.collector-field textarea::placeholder {
  color: var(--muted-2);
  font-family: var(--font);
}

.collector-field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: var(--focus-ring);
}

.collector-field textarea.is-invalid {
  border-color: var(--red);
  background: #fffafa;
}

.collector-field .field-note {
  margin-top: 7px;
}

.collector-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.collector-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.collector-option:hover {
  border-color: var(--line-strong);
  background: var(--card-2);
}

.collector-option:has(input:checked) {
  border-color: var(--red);
  background: #fffafa;
  box-shadow: var(--focus-ring);
}

.collector-option input {
  flex: none;
  margin: 2px 0 0;
  accent-color: var(--red);
}

.collector-option span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  line-height: 1.5;
}

.collector-option strong {
  color: var(--ink);
  font-size: 12.5px;
}

.collector-option em {
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
}

.collector-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(207, 58, 38, 0.22);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

.collector-warning strong {
  flex: none;
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.4px;
}

.collector-warning span {
  color: #7d3a2f;
}

.collector-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.collector-actions .settings-status {
  flex: 1 1 200px;
  min-width: 160px;
}

.collector-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.collector-chip.is-ok {
  border-color: #d7e6ae;
  background: var(--lime-soft);
  color: var(--lime-ink);
}

.collector-chip.is-off {
  border-color: rgba(207, 58, 38, 0.2);
  background: var(--red-soft);
  color: var(--red);
}

.collector-progress {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.collector-progress .panel-head {
  margin-bottom: 0;
}

.collector-progress .field-note.err-text {
  color: var(--red);
}

.collector-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.collector-badge.is-running {
  background: var(--ink);
  color: var(--lime);
}

.collector-badge.is-done {
  background: var(--green-soft);
  color: var(--green);
}

.collector-badge.is-failed {
  background: var(--red-soft);
  color: var(--red);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width 0.4s ease;
}

.collector-progress.is-done .progress-track span {
  background: var(--green);
}

.collector-progress.is-failed .progress-track span {
  background: var(--red);
}

.collector-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.collector-stats > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-2);
}

.collector-stats span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.collector-stats b {
  display: block;
  margin-top: 3px;
  font: 600 19px/1.2 var(--font-num);
}

.collector-log {
  max-height: 210px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbf9f3;
  color: var(--muted);
  font: 11.5px/1.7 var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.collector-log:empty::before {
  content: "采集日志会显示在这里";
  color: var(--muted-2);
}

.collector-result {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.collector-result h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.collector-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.collector-result-grid > div {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.collector-result-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.collector-result-grid b {
  display: block;
  margin-top: 2px;
  font: 600 16px/1.2 var(--font-num);
}

.collector-result .field-note {
  margin-top: 9px;
}

.collector-result .err-text {
  color: var(--red);
}

/* ============================ 弹窗 ============================ */

.modal {
  width: min(880px, 94vw);
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}

.modal.narrow {
  width: min(560px, 94vw);
}

.modal::backdrop {
  background: rgba(25, 23, 16, 0.5);
  backdrop-filter: blur(2px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.3px;
}

.modal-body {
  padding: 18px 22px 20px;
  max-height: 66vh;
  overflow: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--card-2);
}

.form-section + .form-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.form-section-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.form-grid label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-grid .required {
  color: var(--red);
  font-style: normal;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  gap: 22px;
  align-items: center;
  padding-top: 6px;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
}

.check-row input {
  width: 16px;
  height: 16px;
}

.images-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-item {
  width: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.image-item img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  display: block;
}

.image-item .ops {
  display: flex;
}

.image-item .ops button {
  flex: 1;
  height: 26px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  padding: 0 2px;
  transition: background 0.16s ease, color 0.16s ease;
}

.image-item .ops button:hover:not(:disabled) {
  background: var(--card-2);
  color: var(--ink);
}

.image-item .ops button + button {
  border-left: 1px solid var(--line);
}

.color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.color-input {
  height: 38px;
  padding: 3px;
}

.icon-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.icon-upload-row .upload-row {
  margin-top: 0;
}

.icon-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--card-2);
  color: var(--muted);
  font-size: 11px;
  flex: none;
}

.icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.form-error {
  display: none;
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
}

.form-error.is-shown {
  display: block;
}

/* 字段级实时校验 */
input.is-invalid,
select.is-invalid {
  border-color: var(--red);
  background: #fffaf9;
}

input.is-invalid:focus,
select.is-invalid:focus {
  box-shadow: var(--focus-ring);
}

.field-inline-error {
  margin: 6px 0 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.field-inline-error[hidden] {
  display: none;
}

/* ============================ 提示 / 确认 ============================ */

.toast-host {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 200px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: rgba(25, 23, 16, 0.95);
  color: #f6f1e6;
  font-size: 13.5px;
  box-shadow: var(--shadow-3);
  animation: toast-in 0.2s ease;
  pointer-events: auto;
  cursor: pointer;
}

.toast.is-out {
  animation: toast-out 0.2s ease forwards;
}

.toast .toast-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
}

.toast.err .toast-dot {
  background: #ff7a63;
}

.toast.warn .toast-dot {
  background: #ffc35c;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}

.confirm-modal {
  width: min(420px, 92vw);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-3);
}

.confirm-modal::backdrop {
  background: rgba(25, 23, 16, 0.5);
}

.confirm-body {
  padding: 22px 22px 4px;
}

.confirm-title {
  margin: 0 0 8px;
  font-size: 16px;
}

.confirm-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.confirm-list {
  margin: 12px 0 0;
  padding: 10px 12px 10px 26px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.confirm-list[hidden] {
  display: none;
}

.confirm-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px 20px;
}

/* ============================ 登录页 ============================ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--ink);
}

.login-card {
  width: 344px;
  padding: 32px 30px 30px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0.5px;
}

.login-logo {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 14px;
  object-fit: cover;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

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

.login-card button {
  width: 100%;
  height: 44px;
  margin-top: 24px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 4px;
  box-shadow: var(--shadow-2);
  transition: background 0.16s ease, transform 0.06s ease, box-shadow 0.16s ease;
}

.login-card button:hover:not(:disabled) {
  background: var(--red-dark);
}

.login-card button:active:not(:disabled) {
  transform: translateY(1px);
}

.login-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
}

/* ============================ 响应式 ============================ */

@media (max-width: 1180px) {
  .stat-grid,
  .taxonomy-grid {
    grid-template-columns: 1fr;
  }
  .grid {
    display: block;
    overflow-x: auto;
  }
  .grid thead th {
    position: static;
  }
  .grid tbody {
    display: table;
    width: 100%;
  }
  /* 窄屏优先保证「状态 / 操作」可见，浏览复制计数移至统计页查看 */
  .grid .num-col,
  .grid .cell-meta {
    display: none;
  }
  /* 紧凑模式：压缩列宽，避免必须横向滚动才能看到操作按钮 */
  .grid th,
  .grid td {
    padding: 10px 8px;
  }
  .cell-title {
    gap: 9px;
    min-width: 190px;
  }
  .thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .cell-title b,
  .cell-title small {
    max-width: 190px;
  }
  .tax-line {
    max-width: 118px;
  }
  .token-pill {
    max-width: 168px;
    padding-left: 9px;
  }
  .token-value {
    max-width: 108px;
    font-size: 12px;
  }
  .row-actions .ghost,
  .row-actions .soft {
    padding: 0 9px;
  }
}

@media (max-width: 960px) {
  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .channel-cards {
    grid-template-columns: 1fr;
  }
  .collector-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    gap: 14px;
    padding: 0 14px;
    overflow-x: auto;
  }
  .tab {
    padding: 0 10px;
  }
  .tab::after {
    left: 10px;
    right: 10px;
  }
  main {
    padding: 16px 14px 88px;
  }
  .stat-cards {
    grid-template-columns: 1fr;
  }
  .toolbar .primary {
    margin-left: 0;
  }
  .collector-stats,
  .collector-result-grid {
    grid-template-columns: 1fr 1fr;
  }
  .collector-card-head {
    flex-direction: column;
    gap: 8px;
  }
  .collector-choice {
    grid-template-columns: 1fr;
  }
}
