/* ===== MiniMax 风格深色主题 ===== */
:root {
  --bg: #0b0b0d;
  --surface: #14141a;
  --surface-2: #1c1c24;
  --surface-3: #252530;
  --border: #2a2a34;
  --border-strong: #3a3a48;
  --text: #e8e8ee;
  --text-dim: #b6b6c2;
  --muted: #7a7a88;
  --neon: #c8ff00;
  --neon-2: #7c5cff;
  --danger: #ff4d6d;
  --success: #29e39d;
  --warning: #ffb020;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--neon);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  color: var(--text);
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

/* ===== 布局 ===== */
.app {
  min-height: 100vh;
  display: flex;
}

/* ===== 左侧固定侧边栏 ===== */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar__brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 12px var(--neon);
}
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 8px;
}
.nav-group {
  margin-bottom: 12px;
}
.nav-group__label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}
.nav-gico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  padding: 8px 12px 8px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.nav-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar__nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.sidebar__nav a.active {
  color: var(--neon);
  background: rgba(200, 255, 0, 0.1);
}
.sidebar__footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.sidebar__footer form {
  margin: 0;
}

/* ===== 内容区 ===== */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.container {
  padding: 24px;
  max-width: 1440px;
  width: 100%;
  flex: 1;
}

/* ===== 移动端顶条 + 抽屉 ===== */
.topbar-mobile {
  display: none;
}
.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
  }
  .sidebar.is-open {
    transform: none;
    visibility: visible;
  }
  .topbar-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .topbar-mobile .brand-mini {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
  }
  .hamburger {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    width: 34px;
    height: 34px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }
  .sidebar-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s;
}
.card:hover {
  border-color: var(--border-strong);
}
.card.clickable:hover {
  border-left: 3px solid var(--neon);
  padding-left: 18px;
}

.card-title {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* ===== 表单 ===== */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.input,
.select,
.textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-width: 200px;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.input:focus,
.select:focus,
.textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(200, 255, 0, 0.12);
}
textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-primary {
  background: var(--neon);
  color: #0a0a0a;
  border-color: var(--neon);
}
.btn-primary:hover {
  background: #d4ff2a;
  box-shadow: 0 0 16px rgba(200, 255, 0, 0.3);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255, 77, 109, 0.4);
}
.btn-danger:hover {
  background: rgba(255, 77, 109, 0.1);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ===== 标签芯片 ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  background: var(--surface-2);
}
.chip-neon {
  border-color: var(--neon);
  color: var(--neon);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success {
  background: rgba(41, 227, 157, 0.15);
  color: var(--success);
}
.badge-danger {
  background: rgba(255, 77, 109, 0.15);
  color: var(--danger);
}
.badge-muted {
  background: var(--surface-3);
  color: var(--muted);
}
.badge-warning {
  background: rgba(255, 176, 32, 0.15);
  color: var(--warning);
}
.status-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.status-chip.active {
  box-shadow: 0 0 0 1px currentColor inset;
}
.status-chip-all.active {
  color: var(--text);
}
.status-chip-pending.active {
  color: var(--muted);
}
.status-chip-processing.active {
  color: var(--warning);
}
.status-chip-success.active {
  color: var(--success);
}
.status-chip-failed.active {
  color: var(--danger);
}
.status-chip-cancelled.active {
  color: var(--muted);
}

/* ===== 数据卡片(Dashboard) ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--neon);
  opacity: 0.6;
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.stat .value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat.accent-purple::before {
  background: var(--neon-2);
}
.stat.accent-purple .value {
  color: var(--neon-2);
}
.trend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trend-row {
  display: grid;
  grid-template-columns: 56px 90px minmax(120px, 1fr) 110px 130px;
  gap: 10px;
  align-items: center;
}
.trend-day {
  color: var(--text-dim);
  font-size: 12px;
}
.trend-metric {
  font-size: 12px;
  color: var(--text);
}
.trend-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.trend-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--neon), #9bcf00);
}

/* ===== 表格/列表 ===== */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.table tr:hover td {
  background: var(--surface-2);
}
/* 窄屏: 宽表格横向滚动而非撑破布局 (#6) */
@media (max-width: 768px) {
  .table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ===== 博主卡片列表 ===== */
.creator-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.creator-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.creator-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .creator-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-grid.cols-2 { grid-template-columns: 1fr; }
}

.creator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.creator-card:hover {
  border-color: var(--neon);
  transform: translateY(-2px);
}
.card-saved-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--neon);
  box-shadow: 0 0 0 2px rgba(200, 255, 0, 0.22);
}

/* hover 操作层 */
.card-hover-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 14px 12px;
  background: linear-gradient(
    to top,
    rgba(20, 20, 26, 0.96) 30%,
    rgba(20, 20, 26, 0.72) 70%,
    transparent
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.creator-card:hover .card-hover-actions,
.creator-card:focus-within .card-hover-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 全局弹层 */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--neon); }
.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.modal-open { overflow: hidden; }

/* 列数切换按钮 */
.layout-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.layout-switch button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  border-left: 1px solid var(--border);
}
.layout-switch button:first-child { border-left: none; }
.layout-switch button:hover { color: var(--text); }
.layout-switch button.active {
  background: var(--neon);
  color: #0a0a0a;
  font-weight: 600;
}

/* 快筛工具条 */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.quick-filters .filter-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.quick-filters .filter-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.qf-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.qf-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.qf-chip.active {
  background: var(--neon);
  border-color: var(--neon);
  color: #0a0a0a;
  font-weight: 600;
}
.filter-counter {
  margin-left: auto;
  font-size: 12px;
}

/* 内联复选框 */
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
}
.checkbox-inline input[type="checkbox"] {
  accent-color: var(--neon);
  min-width: 16px;
}

/* 无限滚动触发器 */
.load-more-trigger {
  grid-column: 1 / -1;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.load-more-trigger.error {
  color: var(--danger);
}
.load-more-trigger .retry {
  color: var(--neon);
  cursor: pointer;
  margin-left: 8px;
  text-decoration: underline;
}

/* 视频条目(频道详情 / 视频搜索共用) */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.video-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.video-item:hover {
  border-color: var(--neon);
  text-decoration: none;
}
.video-thumb {
  width: 140px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}
.video-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.video-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.video-stats {
  font-size: 11px;
  color: var(--muted);
}
.creator-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.creator-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-3);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.creator-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creator-meta {
  color: var(--muted);
  font-size: 12px;
}
.creator-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.creator-stats .k {
  color: var(--muted);
  margin-right: 4px;
}
.creator-desc {
  font-size: 12px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}
.creator-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 92, 255, 0.2), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(200, 255, 0, 0.15), transparent 40%),
    var(--bg);
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-card .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 18px;
  font-weight: 700;
}
.login-card .brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 16px var(--neon);
}
.login-card .hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
  text-align: center;
}
.login-card .field,
.login-card input {
  width: 100%;
}

/* ===== 提示消息 ===== */
.messages {
  margin-bottom: 16px;
}
.messages .msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.messages .msg.success {
  border-color: rgba(41, 227, 157, 0.4);
  background: rgba(41, 227, 157, 0.08);
  color: var(--success);
}
.messages .msg.error {
  border-color: rgba(255, 77, 109, 0.4);
  background: rgba(255, 77, 109, 0.08);
  color: var(--danger);
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
}
.pagination a,
.pagination span.current {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.pagination span.current {
  background: var(--neon);
  color: #0a0a0a;
  border-color: var(--neon);
}
.pagination a:hover {
  border-color: var(--neon);
  color: var(--neon);
  text-decoration: none;
}

/* ===== 工具类 ===== */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--muted); }
.text-dim { color: var(--text-dim); }
.text-neon { color: var(--neon); }
.text-right { text-align: right; }
.hidden { display: none; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}
.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
}
.checkbox-group label:has(input:checked) {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(200, 255, 0, 0.08);
}
.checkbox-group input[type="checkbox"] {
  accent-color: var(--neon);
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.htmx-indicator {
  opacity: 0;
  transition: opacity 0.2s;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}
.toast-stack {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-item {
  min-width: 180px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.toast-item.error {
  border-color: rgba(255, 77, 109, 0.4);
  color: #ffd7df;
}

/* ===== 全站 flash 消息 toast (新增; 不改动上方在线搜索页原有 .toast-* 行为) ===== */
.toast-stack--global {
  z-index: 1300;
}
.toast-item--anim {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toast-in 0.28s cubic-bezier(0.21, 1.02, 0.73, 1) both;
}
.toast-item--anim.toast-leaving {
  animation: toast-out 0.26s ease-in forwards;
}
.toast-item__msg {
  flex: 1;
  line-height: 1.5;
}
.toast-item__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.toast-item__close:hover {
  color: var(--text);
}
.toast-stack--global .toast-item.success {
  border-color: rgba(41, 227, 157, 0.45);
  color: #b8f5dd;
}
.toast-stack--global .toast-item.warning {
  border-color: rgba(251, 191, 36, 0.45);
  color: #ffe6a3;
}
.toast-stack--global .toast-item.info {
  border-color: var(--border-strong);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast-item--anim,
  .toast-item--anim.toast-leaving {
    animation: none;
  }
}
.online-results-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(28, 28, 36, 0.7);
  color: var(--text-dim);
}
.online-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(200, 255, 0, 0.28);
  border-top-color: var(--neon);
  animation: online-spin 0.8s linear infinite;
}
[data-online-loading][hidden] {
  display: none !important;
}
[data-search-submit].is-loading {
  pointer-events: none;
  opacity: 0.92;
}
@keyframes online-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 社交平台模块 */
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
@media (max-width: 720px) {
  .social-grid {
    grid-template-columns: 1fr;
  }
}
.social-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-label {
  flex: 0 0 96px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.social-row .input {
  flex: 1;
  min-width: 0;
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.social-item {
  padding: 6px 0;
  background: transparent;
}
.social-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}
.social-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.social-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
}
.social-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}
.social-url {
  color: var(--neon);
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
  word-break: break-all;
}
.social-item-link {
  display: grid;
  grid-template-columns: minmax(100px, auto) 1fr;
  align-items: center;
  gap: 2px;
}
.social-item-edit .input {
  margin-top: 0;
}
.social-item-edit {
  display: grid;
  grid-template-columns: minmax(100px, auto) 1fr;
  align-items: center;
  gap: 2px;
}
.social-item-edit .input {
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.meta-view-list {
  display: flex;
  flex-direction: column;
}
.meta-view-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px 0;
}
.meta-view-label {
  color: var(--muted);
  font-size: 12px;
  padding-top: 2px;
}
.meta-view-value {
  min-width: 0;
}
/* 频道详情侧栏：联系方式块与表单 .field 一致(标签在上,见 channel_detail) */
.channel-contact-block .email-present {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
}
.channel-contact-block .meta-view-source {
  margin: 0;
  line-height: 1.45;
}
.social-edit-form {
  margin-top: 8px;
}
[data-social-view][hidden],
[data-social-edit-form][hidden] {
  display: none !important;
}
[data-meta-view][hidden],
[data-meta-edit-form][hidden] {
  display: none !important;
}
[data-email-view][hidden],
[data-email-edit-form][hidden] {
  display: none !important;
}
.email-present {
  padding: 10px 12px;
  border: 1px solid rgba(41, 227, 157, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(41, 227, 157, 0.08);
  color: var(--success);
  font-weight: 600;
  word-break: break-all;
}
.email-missing {
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  background: rgba(28, 28, 36, 0.6);
}
.social-url:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (max-width: 720px) {
  .social-item-link,
  .social-item-edit {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .social-item-head {
    min-width: 0;
  }
}

/* 状态徽标 status-pill (统一; 原散落在 发现/IG/历史/监控 各模板的内联 <style>) */
.status-pill { display:inline-flex; align-items:center; gap:5px; padding:2px 10px;
  border-radius:999px; font-size:12px; font-weight:500; border:1px solid var(--border); background:var(--surface-3); }
.status-pill .spinner-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:currentColor; }
.status-pill.s-pending { color:var(--muted); }
.status-pill.s-processing { color:#fbbf24; border-color:rgba(251,191,36,.4); }
.status-pill.s-success { color:#34d399; border-color:rgba(52,211,153,.4); }
.status-pill.s-warning { color:#fbbf24; border-color:rgba(251,191,36,.4); }
.status-pill.s-failed { color:var(--danger); border-color:rgba(255,77,109,.4); }
.status-pill.s-processing .spinner-dot { animation:pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
