/* SoldX Admin Panel — v3.0 Professional Design System */

/* ========== CSS Variables & Theme ========== */
:root {
  /* Surface & Background */
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --bg-hover: #f0f2f5;
  --bg-input: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-sidebar: #ffffff;
  --bg-sidebar-hover: #f0f2f5;
  --bg-sidebar-active: #eef0ff;

  /* Border & Dividers */
  --border: #e2e5ea;
  --border-light: #eef0f4;
  --border-focus: #6366f1;

  /* Text */
  --text: #1a1d26;
  --text-secondary: #5a6070;
  --text-muted: #8b92a5;
  --text-sidebar: #5a6070;
  --text-sidebar-active: #4f46e5;   /* 原 #6366f1 压在选中底上仅 3.94，不达 AA；加深到 5.55 */

  /* Primary Palette */
  --primary: #6366f1;
  --primary-hover: #5558e6;
  --primary-subtle: rgba(99,102,241,0.07);
  --primary-ring: rgba(99,102,241,0.2);
  --primary-light: #eef0ff;

  /* Semantic Colors */
  --success: #22c55e;
  --success-subtle: rgba(34,197,94,0.08);
  --warning: #f59e0b;
  --warning-subtle: rgba(245,158,11,0.08);
  --danger: #ef4444;
  --danger-subtle: rgba(239,68,68,0.08);
  --info: #3b82f6;
  --info-subtle: rgba(59,130,246,0.08);

  /* 语义色压在自己 subtle 浅底上的深色文字变体。
     原色是给图标和边框用的，当文字用一律不达标：
     成功 2.12 / 危险 3.39 / 信息 3.36。基座对警告已是这么处理的，这里补齐其余三色。 */
  --success-text: #15803d;
  --warning-text: #b45309;
  --danger-text:  #b91c1c;
  --info-text:    #1d4ed8;

  /* Shape */
  /* 预览机身色：与 C 端默认模板 tw7 的页面底色一致，
     这样 iframe 从空到有的那一下不会闪白 */
  --phone-bg: #0a0831;
  --phone-hint: #6f6c95;
  --phone-body: #17171c;
  --phone-edge: #3a3a44;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.1);

  /* Transition */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Sidebar width */
  --sidebar-w: 248px;
}

/* ========== Reset ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  /* 只用系统字体：不依赖任何外部字体服务，也就没有被墙或 CDN 慢导致的白屏 */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; height: auto; }

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

/* --- Sidebar (Light) --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
  transition: transform var(--transition-slow);
  overflow: hidden;
}
.sidebar-header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-header img { height: 28px; width: auto; }
.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.sidebar-header p { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.nav-section { margin-bottom: 20px; }
.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 12px;
  margin-bottom: 4px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius);
  transition: background var(--transition-fast);
}
.nav-section-title:hover { background: var(--hover, rgba(255,255,255,0.04)); }
.nav-section.collapsed .nav-item { display: none; }

/* AIS-NAV-SEARCH-001 (2026-06-02): 侧栏菜单快捷搜索 (中文子串 + 首字母拼音) */
.nav-search { padding: 4px 12px 6px; flex-shrink: 0; }
.nav-search-box {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  background: var(--hover, rgba(127,127,127,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast);
}
.nav-search-box:focus-within { border-color: var(--primary); }
.nav-search-box svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.5; color: var(--text-muted); }
.nav-search-input {
  flex: 1; min-width: 0;
  border: none; background: transparent; outline: none;
  font-size: 13px; color: var(--text); padding: 0;
}
.nav-search-input::placeholder { color: var(--text-muted); }

/* AIS-NAV-MINI (2026-05-20): sidebar 整体折叠成 mini icon 列 */
:root { --sidebar-w-mini: 64px; }
/* 桌面默认隐藏 menu-toggle，hidden 态时显示用于还原 */
#menu-toggle { display: none; } /* mini 模式空间不够 */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  margin-bottom: 1px;
}
.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); }
.nav-item:hover svg { color: var(--text-secondary); }
.nav-item.active svg { color: var(--primary); }

/* --- Merchant Portal sidebar classes --- */
.sidebar-brand { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.sidebar-logo { display: flex; align-items: center; }
.sidebar-logo .icon { display: flex; }
.sidebar-logo svg { width: 28px; height: 28px; color: var(--primary); }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); margin-top: auto; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 4px; }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

/* --- Main Content --- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  /* AIS-STICKY-FIX (2026-05-29): height:100vh + overflow-y:auto 让 .main 成为真正的滚动容器,
   * 否则 min-height:100vh 时窗口滚动、.main 不滚动, 内部 position:sticky(topbar/筛选栏) 全部失效 */
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* --- Topbar --- */
.topbar {
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
/* 汉堡键：只在窄屏出现（宽屏侧栏常驻，不需要它） */
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-right: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text-secondary); font-size: 16px; cursor: pointer;
}
.menu-toggle:active { transform: scale(.96); }
/* 抽屉遮罩：默认不存在，侧栏拉出来时才盖住内容 */
.sidebar-backdrop { display: none; }
body.nav-open .sidebar-backdrop {
  display: block; position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 18, 28, .45);
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Content */
/* AIS-PAGE-WIDTH (2026-05-20): 方案 A 分类宽度系统
 * 全局唯一注入点 (app.js:539) 已加 page-$ {state.page} class，
 * 不需要改 85 个 render 函数 — CSS 按 page id 决定 max-width。
 * 设计原则:
 *   data (默认): 1600px 居中 — 数据/列表/dashboard 页
 *   form: 960px 居中 — 表单 / 设置类
 *   full: 100% — 装修预览等需要全屏的特殊页
 *   小屏 (<1700px) 自动 100%，不锁，避免更挤
 */
:root {
  --page-max-data: 1600px;
  --page-max-form: 960px;
}
.content {
  padding: 24px;
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: var(--page-max-data);
  margin: 0 auto;
  box-sizing: border-box;
}
/* 小屏自动放开 */
@media (max-width: 1700px) {
  .content { max-width: 100%; }
}

/* ========== Cards ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }

/* ========== Tables ========== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 10px 16px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tr { transition: background var(--transition-fast); }
tr:hover td { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }

/* AIS-ORD-STICKYCOL (2026-06-12): 订单/草稿订单列表横向滚动时固定订单号列与操作列。
   pin-l: 左固定(left:0) | pin-l2: 左固定第二列 | pin-r: 右固定 | pin-edge: 左固定区最外列(投影)
   AIS-ORD-STICKYCOL-FIX (2026-06-12): pin-l2 偏移与勾选列渲染宽必须同值——此前 left:64 但勾选列实宽~40, 缝隙里漏出客户列内容。现勾选列定宽 40(12+16+12, border-box)且 pin-l2 left:40 同源; 固定列 nowrap 防折行。
   注意: 带勾选列的表勾选 th/td 用 pin-l { position: sticky; left: 0; z-index: 2; background: var(--bg-card); }

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-subtle); color: var(--success-text); }
.badge-warning { background: var(--warning-subtle); color: var(--warning-text); }
.badge-danger { background: var(--danger-subtle); color: var(--danger-text); }
.badge-info { background: var(--info-subtle); color: var(--info-text); }
.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-muted { background: rgba(139,146,165,0.1); color: var(--text-muted); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.5;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(99,102,241,0.2);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(99,102,241,0.25); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ========== Forms ========== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Universal input styling — works with class="input" and class="form-input" */
.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 1.5;
  outline: none;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  background: var(--bg-card);
}
.input::placeholder { color: var(--text-muted); }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b92a5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
textarea.input { resize: vertical; min-height: 80px; }

/* Checkbox */
input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ========== Modals ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  animation: fadeIn var(--transition-fast);
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 92%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--transition-base);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 8px;
  position: sticky; bottom: 0; background: var(--bg-card);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ========== Grid ========== */
.grid { display: grid; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ========== Utilities ========== */
.hidden { display: none !important; }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }

/* ========== Empty State ========== */
.empty-state { padding: 48px 16px; text-align: center; }
.empty-state svg { width: 48px; height: 48px; color: var(--text-muted); margin: 0 auto 12px; opacity: 0.4; }
.empty-state h3 { font-size: 15px; margin-bottom: 4px; color: var(--text-secondary); font-weight: 600; }
.empty-state p { color: var(--text-muted); font-size: 13px; }

/* ========== Progress Bar ========== */
.progress-bar {
  width: 100%; height: 6px;
  background: var(--bg-hover); border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ========== Avatar ========== */
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

/* ========== Toast Notification System ========== */
.toast-container {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

/* Legacy compat */
.alert-bar { position: fixed; top: 16px; right: 16px; padding: 12px 20px; border-radius: var(--radius); color: white; font-size: 13px; font-weight: 500; z-index: 10001; animation: toastIn 0.3s ease; }
.alert-bar.success { background: var(--success); }
.alert-bar.error { background: var(--danger); }

/* ========== Skeleton Loading ========== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, #e8eaef 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* ========== Animations ========== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); position: fixed; top: 0; left: 0; bottom: 0; z-index: 90; transition: transform 0.25s ease; width: 260px; }
  /*
   * ★ 抽屉的开合状态挂在 <body> 上，不挂在侧栏自己身上。
   *   render() 会整块重写 #app 的 innerHTML —— 侧栏元素会被换掉，挂在它身上的 .open 随之消失。
   *   生产上取数比本地慢，点开抽屉之后那一次「取完数再画一遍」正好把它关回去：
   *   遮罩还在（body 上的类没被动），侧栏却弹回屏外。body 上的类不受重绘影响。
   */
  .sidebar.open, body.nav-open .sidebar { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.15); }
  .main { margin-left: 0; padding: 16px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  /* 用 ID 写：上面那条 #menu-toggle {display:none} 是 ID 权重，类选择器压不过它 */
  #menu-toggle { display: inline-flex; }
  /* 侧栏浮在遮罩之上 */
  .sidebar { z-index: 90; }
  /* 顶栏在手机上必须一直够得着：它是唯一能打开导航的地方 */
  .topbar { padding: 0 12px; position: sticky; top: 0; }
  .modal { width: 96%; max-width: none; margin: 8px; }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
@keyframes slideDown { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 300px; } }
#pp-rte-modal-body p { margin: 0; }
/* AIS-DEC-TABS-002 (2026-07-11): tab 分组 — 外观(版式/主题/设置) | 内容(区块/菜单/页面) { display: flex; flex: 1; }

/* --- Color input pairing --- */
input[type="color"] {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-input);
}

/* ========== Merchant Portal — Tabs ========== */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.tab { padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; transition: all var(--transition-fast); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ========== Merchant Portal — Alerts ========== */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; }
.alert-error { background: var(--danger-subtle); color: var(--danger-text); border: 1px solid rgba(239,68,68,0.2); }

/* ========== Merchant Portal — Misc ========== */
.badge-default { background: var(--bg-secondary); color: var(--text-secondary); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.empty-state .btn { margin-top: 16px; }

/* ========== Print ========== */
@media print {
  .sidebar, .topbar, .toast-container { display: none !important; }
  .main { margin-left: 0 !important; }
}

/* ==========================================================================
   XShort 扩展 —— 短剧分发特有组件
   基座是 SoldX Admin 的设计系统（同一舰队同一套心智），以下只加 aishop 没有的东西。
   ========================================================================== */

/* 集数轴：一屏看完全剧转码状态。
   就绪态刻意做淡 —— 80 集全绿等于 80 个警报，眼睛反而找不到那一格红的。 */
.epgrid { display: flex; flex-wrap: wrap; gap: 4px; }
.epcell {
  position: relative; width: 38px; height: 30px; padding: 0; cursor: pointer;
  font-size: 12px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); color: var(--text-secondary);
  transition: var(--transition-fast);
}
.epcell:hover { border-color: var(--primary); }
.epcell--ready { color: var(--text-secondary); }
.epcell--transcoding { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
/* 排队用虚线边：光靠文字颜色淡一档，和就绪态在屏幕上分不出来，
   而"这集到底有没有"正是运营最需要一眼看清的事 */
.epcell--pending { color: var(--text-muted); border-style: dashed; background: transparent; }
.epcell--failed { background: var(--danger-subtle); border-color: var(--danger); color: var(--danger); }
.epcell--on { outline: 2px solid var(--primary); outline-offset: 1px; }
.epcell__free { position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }

.eplegend { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 0; font-size: 12px; color: var(--text-muted); }
.eplg { display: inline-flex; align-items: center; gap: 4px; }
.eplg__box { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border); background: var(--bg-card); }
.eplg__box--wait { border-style: dashed; background: transparent; }
.eplg__box--bad { border-color: var(--danger); background: var(--danger-subtle); }

/* 装修器：左编辑右预览 */
.decor { display: grid; grid-template-columns: 1fr 480px; gap: 16px; align-items: start; }
/* 预览常驻屏幕右侧：左栏往下翻模板卡时预览不能跟着滚走（2026-09-22 Rock）。
   滚动容器是 .content，sticky 相对它生效；iframe 端口由 bdAlignPortal 按占位槽实时对齐 */
.decor__side { position: sticky; top: 8px; }
.phone { display: flex; justify-content: center; position: relative; }
/* 占位槽：只占位不渲染内容，真正的 iframe 由 .decportal 覆盖上来。
   底色用站点的深色而不是后台的浅灰 —— iframe 载入前那几秒是白框的话，
   看上去就是「预览坏了」，而它其实只是还在下载。 */
.phone__slot {
  position: relative; flex: none;   /* 不许被 flex 压扁：端口按它的实际矩形对齐 */
  width: 390px; height: 700px; border-radius: var(--radius-lg);
  background: var(--phone-bg); box-shadow: var(--shadow-lg);
}
.phone__slot::after {
  content: '预览加载中…';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--phone-hint); font-size: 13px;
}
/* 持久预览端口：挂在 #app 之外，fixed 覆盖到槽上（见 pages-build.js 的注释）。
   画成一台手机：机身描边 + 刘海。不是装饰 —— 它提醒使用者「这里面就是用户手机上看到的」，
   在里面的拖拽/点按都是真实操作 */
.decportal { position: fixed; z-index: 5; display: none; }
.decportal::before {
  content: ''; position: absolute; inset: -10px; z-index: -1; pointer-events: none;
  border-radius: 40px; background: var(--phone-body);
  box-shadow: 0 12px 40px rgb(0 0 0 / .35), inset 0 0 0 2px var(--phone-edge);
}
.decportal::after {
  content: ''; position: absolute; top: 6px; left: 50%; width: 110px; height: 22px;
  transform: translateX(-50%); border-radius: 0 0 14px 14px;
  background: var(--phone-body); z-index: 2; pointer-events: none;
}
.decportal__frame {
  width: 100%; height: 100%; border: 0; border-radius: 30px;
  background: var(--phone-bg);
  /* 预览态里手指的替身是鼠标：光标提示"可拖" */
  cursor: grab;
}
.phone__slot { border-radius: 30px; }
/* 状态条在框下方，绝不盖住预览 —— 盖住就等于预览不可操作 */
.decstat {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 12px; color: var(--text-muted);
}
.decstat__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warning); flex: none;
}
.decstat--ok { color: var(--success-text); }
.decstat--ok .decstat__dot { background: var(--success); }

/* 楼层编排卡片 */
.floor { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.floor__head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border-light);
}
.floor__body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
.floor__spacer { flex: 1; }

/* 关键数字块：页面顶部的"先看这个"区 */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.kv__k { font-size: 12px; color: var(--text-muted); }
.kv__v { margin-top: 4px; font-size: 15px; font-weight: 600; color: var(--text); }
.kv__v--bad { color: var(--danger); }
.kv__note { margin-top: 2px; font-size: 12px; color: var(--text-muted); }

/* 演示环境警示条：常驻，防止有人把内存数据当正式后台录真实剧目与价格 */
.demobar {
  padding: 10px 32px; font-size: 13px;
  background: var(--warning-subtle); color: var(--warning-text);
  border-bottom: 1px solid var(--border);
}
.demobar b { color: #92400e; }   /* 比正文更深，让「不会产生真实变更」这句压得住 */

/* 未实作项：置灰但常驻可见，让人知道系统边界在哪而不是以为坏了 */
.nav-item.is-todo { opacity: .45; cursor: not-allowed; }
.nav-item__todo { margin-left: auto; font-size: 10px; color: var(--text-muted); }
.muted { color: var(--text-muted); font-size: 13px; }

/* alert 变体：aishop 基座只定义了 .alert-error，补齐其余三种。
   用途是"页面主动解释为什么"，比如内存数据、红线说明、口径定义。 */
.alert-warning { background: var(--warning-subtle); color: var(--warning-text); border: 1px solid rgba(245,158,11,0.2); }
.alert-info { background: var(--info-subtle);    color: var(--info-text);   border: 1px solid rgba(59,130,246,0.2); }
.alert-success { background: var(--success-subtle); color: var(--success-text);border: 1px solid rgba(34,197,94,0.2); }
.alert > b:first-child { display: block; margin-bottom: 4px; }
.alert .muted { color: inherit; opacity: .8; }

/* 作用域标签：标注"这一组是单站操作"。
   基座的 .nav-badge 是红底告警计数（给"3 条待处理"那种用的），
   拿来当中性标签会把"这组是单站"读成"这组出事了"。 */
.nav-scope {
  margin-left: auto;
  padding: 1px 6px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  border-radius: 9999px;
}

/* alert-danger 是 alert-error 的别名。
   基座里 badge 用 -danger、alert 用 -error，这种不一致本身就会让人写错，
   而写错的后果是静默不生效（类名不存在 CSS 不报错）。两个都认。 */
.alert-danger { background: var(--danger-subtle); color: var(--danger-text); border: 1px solid rgba(239,68,68,0.2); }

/* 登录页：未登录时是整个后台唯一可见的界面 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.login-card { width: 100%; max-width: 380px; margin: 0; }
.login-brand { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

/* 剧目库封面缩略图：竖版 3:4，与前台版位一致，看着就知道裁切对不对 */
.ct-cover {
  display: block; width: 40px; height: 56px; padding: 0;
  border-radius: var(--radius); object-fit: cover;
  border: 1px solid var(--border); background: var(--bg-secondary);
  cursor: pointer;
}
.ct-cover--none {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-muted);
  border-style: dashed;
}

/* ── 建站向导步骤条（对标 aishop 的建站向导）───────────────────────
   步骤条常驻、已完成打勾、当前高亮。它回答的是运营最常问的两个问题：
   「现在该干嘛」和「还差什么才能上线」—— 平铺一堆 tab 答不了这两问。 */
.wizbar { display: flex; align-items: flex-start; margin-bottom: 10px; }
.wizbar__line {
  flex: 1; height: 1px; margin-top: 14px;
  background: var(--border); min-width: 8px;
}
.wizstep {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 56px; padding: 0; border: 0; background: transparent; cursor: pointer;
}
.wizstep__n {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-secondary); color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
}
.wizstep__l { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.wizstep.is-done .wizstep__n {
  background: var(--success); color: #fff; border-color: transparent;
}
.wizstep.is-cur .wizstep__n {
  background: var(--primary); color: #fff; border-color: transparent;
}
.wizstep.is-cur .wizstep__l { color: var(--text); font-weight: 600; }
/* 「下一步该干嘛」单独一行常驻：进度条本身只说状态，不说行动 */
.wiznext {
  margin: 0 0 14px; padding: 7px 10px;
  border-radius: var(--radius); background: var(--bg-secondary);
  font-size: 12px; color: var(--text-muted);
}
.wiznext b { color: var(--text); }

/* 发布前检查清单 */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.checkitem {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
}
.checkitem__mark {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--danger-subtle); color: var(--danger-text); font-size: 12px;
}
.checkitem.is-ok .checkitem__mark { background: var(--success-subtle); color: var(--success-text); }
.checkitem__body { flex: 1; min-width: 0; }
.checkitem__label { font-size: 13px; color: var(--text); }
/* 后果写在状态下面：只说「未通过」的清单，运营不知道要不要管 */
.checkitem__bad { margin-top: 3px; font-size: 12px; color: var(--danger-text); line-height: 1.6; }

/* 分发表：窄列不换行，剧名吃掉剩余宽度。
   不固定的话在窄屏上「未分发」会被折成三行，一行剧目占掉四行高度。 */
.distable { table-layout: auto; }
.distable th:not(:first-child), .distable td:not(:first-child) { white-space: nowrap; width: 1%; }

/* ── 装修器楼层：拖拽、落点、被预览点选时的高亮 ─────────────── */
.floor__grip {
  cursor: grab; color: var(--text-muted); user-select: none;
  padding: 0 4px; font-size: 14px; letter-spacing: -2px;
}
.floor__grip:active { cursor: grabbing; }
.floor.is-dragging { opacity: .45; }
/* 落点用虚线描边而不是换底色：底色一换，卡片里的校验红框会看不出来 */
.floor.is-over { outline: 2px dashed var(--primary); outline-offset: 2px; }
.floor.is-hl { border-color: var(--primary); box-shadow: var(--shadow-md); }
.devtog { display: inline-flex; gap: 4px; margin-left: 8px; }

/* 长任务转圈（入库/生成类操作）。只转圈不说话会被当成卡死，所以它旁边必须有当前步骤与已等待秒数 */
.spin {
  display: inline-block; width: 16px; height: 16px; flex: none; margin-top: 2px;
  border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
  animation: xs-spin .7s linear infinite;
}
@keyframes xs-spin { to { transform: rotate(360deg); } }

/* ── 分段选择器（对标 aishop 的 methodToggle 药丸组）────────────────
   一组互斥选项挤在一颗药丸里：单选框本身 display:none，点的是 label。
   用在支付页的「用平台的 / 用本站自己的 / 关闭」与每条通道的「开启 / 关闭」。
   为什么不用原生 radio：原生样式各浏览器不一，而这里的三态是**要一眼看清当前落在哪**
   的控件 —— 选中项必须有明显的底色与投影，不是一个小圆点。 */
.seg {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
}
.seg__opt {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; line-height: 1.2; color: var(--text-muted);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .12s, color .12s;
}
.seg__opt input { display: none; }
.seg__opt:hover { color: var(--text-secondary); }
.seg__opt.is-on { background: var(--bg-card); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg__opt.is-off { opacity: .45; cursor: not-allowed; }

/* 底部保存条 */
.savebar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.savebar__dot { width: 8px; height: 8px; border-radius: 999px; background: var(--border); }
.savebar__dot.is-on { background: var(--primary); }

/* ── 支付品牌图标宫格 ──────────────────────────────
   点的是真 logo，不是一个英文 key：这图标会出现在 C 端结账页上，
   后台选的时候就该看到用户将看到的样子。 */
.payico-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.payico-btn {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 4px 5px; background: var(--bg-card); cursor: pointer; line-height: 0;
  transition: border-color .15s, box-shadow .15s;
}
.payico-btn:hover { border-color: var(--primary-ring); }
.payico-btn.is-on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-ring); }
.payico-btn svg { width: 42px; height: auto; display: block; }
/* 本地钱包（街口 / LINE Pay）没有品牌 SVG：用同尺寸的文字片占位，保持宫格对齐 */
.payico-text {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 27px; border-radius: 4px;
  background: var(--bg-secondary); color: var(--text-secondary);
  font-size: 11px; line-height: 1;
}
/* ── 支付设置（对标 Shopify Payments：服务商列表 → 管理抽屉 → 结账页预览）──
   列表一行一条通道，状态折成一个词；改设置进抽屉、单条保存。 */
.pp-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px; }
.pp-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.pp-sum b { color: var(--text); font-size: 13px; }
.pp-checkout { display: grid; grid-template-columns: 56px 1fr; gap: 8px 10px; align-items: start; }
.pp-checkout__lab { font-size: 12px; color: var(--text-muted); padding-top: 5px; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pp-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px;
  border: 1px solid var(--border-light); border-radius: 999px; background: var(--bg-card);
  font-size: 12px; line-height: 1.2; color: var(--text); white-space: nowrap;
}
.pp-chip svg { width: 24px; height: auto; display: block; border-radius: 3px; }
.pp-chip .payico-text { width: 24px; height: 16px; font-size: 9px; }
.pp-chip__via { color: var(--text-muted); }
.pp-chip--test { border-style: dashed; color: var(--text-secondary); }
.pp-list { }
.pp-row {
  display: grid; grid-template-columns: 26px 44px minmax(150px, 1.1fr) minmax(170px, 1.6fr) 118px 150px auto;
  gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border-light);
}
.pp-row:first-child { border-top: 0; }
.pp-row.is-off { opacity: .62; }
.pp-row.is-dragging { opacity: .4; }
.pp-row.is-over-before { box-shadow: inset 0 3px 0 0 var(--primary); }
.pp-row.is-over-after { box-shadow: inset 0 -3px 0 0 var(--primary); }
.pp-row__grip { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); }
.pp-row__grip .pp-grab { cursor: grab; font-size: 15px; line-height: 1; user-select: none; padding: 1px 0; }
.pp-row__grip button { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 9px; line-height: 1; padding: 1px 6px; }
.pp-row__grip button:disabled { opacity: .3; cursor: default; }
.pp-row__ico { line-height: 0; }
.pp-row__ico svg { width: 40px; height: auto; display: block; border-radius: 4px; }
.pp-row__ico .payico-text { width: 40px; height: 26px; }
.pp-row__name { min-width: 0; }
.pp-row__name b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-row__name .muted { font-size: 11px; }
.pp-row__takes { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.pp-row__state { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 11px; }
.pp-row__acts { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 1100px) {
  .pp-row { grid-template-columns: 26px 44px 1fr 1fr; }
  .pp-row__takes, .pp-row__state, .pp-row__acts { grid-column: 3 / span 2; }
  .pp-row__acts { justify-content: flex-start; }
}
.pp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
@media (max-width: 1000px) { .pp-two { grid-template-columns: 1fr; } }
.pp-order { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.pp-order > span:first-child { flex: 1; }
.pp-notify { display: grid; grid-template-columns: 56px 1fr; gap: 4px 10px; font-size: 12px; align-items: baseline; }
.pp-pick { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-light); }
.pp-pick:first-child { border-top: 0; }

/* 抽屉：从右侧滑入的设置面板，一次只管一条通道 */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 18, 28, .38); z-index: 9000; display: flex; justify-content: flex-end; }
.drawer {
  width: min(660px, 96vw); height: 100%; background: var(--bg-card);
  box-shadow: -8px 0 28px rgba(0, 0, 0, .2); display: flex; flex-direction: column;
  animation: drawerIn .18s ease;
}
@keyframes drawerIn { from { transform: translateX(28px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
.drawer__head h3 { font-size: 15px; font-weight: 600; margin: 0; }
.drawer__body { flex: 1; overflow: auto; padding: 0 18px 18px; }
.drawer__foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border-light); background: var(--bg-secondary); }
.drawer__x { margin-left: auto; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 2px 6px; }
.drawer__x:hover { color: var(--text); }
.dsec { padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.dsec:last-child { border-bottom: 0; }
.dsec__t { font-size: 13px; font-weight: 600; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dsec__t .muted { font-weight: 400; font-size: 12px; }
details.dsec > summary::-webkit-details-marker { display: none; }
details.dsec > summary::before { content: '▸'; font-size: 10px; color: var(--text-muted); }
details.dsec[open] > summary::before { content: '▾'; }
.dgrid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .dgrid { grid-template-columns: 1fr; } }
.dlab { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.dlab .ok { color: var(--success-text); font-style: normal; }
.dlab .no { color: var(--danger); font-style: normal; }
.drawer .input { width: 100%; padding: 7px 9px; font-size: 13px; }
.dnote { font-size: 12px; color: var(--text-muted); margin: 6px 0 0; line-height: 1.6; }
.derr { color: var(--danger); font-size: 12px; }
.dmethods { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; align-items: center; }
.dmethods label { display: inline-flex; align-items: center; gap: 5px; }
.dfixed { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 999px; background: var(--bg-secondary); border: 1px solid var(--border-light); font-size: 12px; color: var(--text-secondary); }
.ddanger { border: 1px solid rgba(239, 68, 68, .25); border-radius: var(--radius); padding: 10px 12px; background: var(--danger-subtle); }

/* ── 审批中心（紧凑版）：一条审批一行 ─────────────── */
.apstat { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; color: var(--text-secondary); }
.apstat b { color: var(--text); }
.apbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; }
.apr { margin-bottom: 8px; padding: 8px 12px; }
.apr.is-busy { opacity: .6; }
.apr__head { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.apr__pick { width: 16px; height: 16px; margin: 0; flex: none; display: inline-block; }
.apr__target { font-size: 13px; }
.apr__sum { flex: 1; min-width: 160px; font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apr__meta { font-size: 12px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.apr__acts { display: flex; gap: 6px; flex: none; }
.apr__extra { font-size: 12px; color: var(--text-muted); margin: 4px 0 0 24px; }
.apr__block { margin: 8px 0 0; font-size: 12px; }
.apr__word { display: flex; align-items: center; gap: 8px; margin: 8px 0 0 24px; max-width: 460px; font-size: 12px; }
.apr__more { margin: 6px 0 0 24px; }
.apr__more > summary { cursor: pointer; font-size: 12px; color: var(--text-muted); }
.apr__tbl { width: 100%; margin-top: 6px; font-size: 12px; border-collapse: collapse; }
.apr__tbl td { padding: 4px 8px; border-top: 1px solid var(--border-light); vertical-align: top; }
.apr__tbl td:first-child { width: 120px; color: var(--text-muted); white-space: nowrap; }
.apr__tbl td:last-child { width: 70px; }
@media (max-width: 768px) {
  .apr__head { flex-wrap: wrap; }
  .apr__sum { white-space: normal; }
  .apr__meta { margin-left: 24px; white-space: normal; }
  .apr__acts { margin-left: 24px; }
}
/* ── 站点访问控制（照搬 aishop 访客过滤弹层的版式）── */
.ac-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .ac-grid { grid-template-columns: 1fr; } }
.ac-main { margin-bottom: 12px; }
.ac-main.is-on { border-color: var(--success); background: var(--success-subtle); }
.ac-master { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.ac-master input { transform: scale(1.2); margin-top: 4px; flex: none; }
.ac-section { margin-bottom: 12px; }
.ac-section[hidden] { display: none; }
.ac-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; }
.ac-row:hover { background: var(--bg-hover); }
.ac-row input[type=checkbox] { margin-top: 3px; width: 15px; height: 15px; flex: none; cursor: pointer; }
.ac-row > span { display: block; flex: 1; }
.ac-row__label { display: block; font-size: 13px; }
.ac-row__hint { display: block; font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
.ac-row--block { display: block; cursor: default; }
.ac-row--block:hover { background: none; }
.ac-row--block > .ac-row { padding-left: 0; }
.ac-warn { color: var(--warning-text); }
.ac-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 34px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input); cursor: text; position: relative; margin: 4px 0 6px 23px; }
.ac-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 3px; font-size: 12px; background: var(--primary-subtle); color: var(--primary); }
.ac-tag i { font-style: normal; opacity: .75; font-size: 11px; }
.ac-tag b { cursor: pointer; font-weight: 400; margin-left: 2px; }
.ac-tags--green .ac-tag { background: var(--success-subtle); color: var(--success-text); }
.ac-tags--purple .ac-tag { background: var(--info-subtle); color: var(--info-text); }
.ac-tags__search { border: none; outline: none; flex: 1; min-width: 120px; background: transparent; font-size: 12px; color: inherit; }
.ac-dd { position: absolute; top: 100%; left: 0; right: 0; max-height: 220px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); z-index: 30; box-shadow: var(--shadow-md); }
.ac-dd__opt { padding: 6px 10px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; }
.ac-dd__opt:hover { background: var(--bg-hover); }
.ac-referer { margin: 4px 0 4px 23px; padding: 8px; border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--bg-secondary); }
.ac-group { margin-bottom: 4px; }
.ac-group summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; padding: 3px 0; list-style: none; }
.ac-group summary::-webkit-details-marker { display: none; }
.ac-group summary > span:first-child { font-weight: 600; }
.ac-group summary .btn { padding: 0 8px; font-size: 11px; line-height: 20px; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0 8px; }
.ac-chip { font-size: 11px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; }
.ac-chip--on { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary); font-weight: 600; }
.ac-chip--part { border-color: var(--warning); background: var(--warning-subtle); color: var(--warning-text); }
.ac-custom { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ac-customs { display: flex; flex-wrap: wrap; gap: 4px; }
.ac-radio { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 2px solid var(--border-light); border-radius: var(--radius-lg); cursor: pointer; margin-bottom: 6px; }
.ac-radio.is-on { border-color: var(--primary); }
.ac-radio input { margin-top: 3px; flex: none; }
.ac-radio > span { flex: 1; }
.ac-radio__sub { margin-top: 6px; cursor: default; }
.ac-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ac-btn--green { background: var(--success-subtle); border-color: var(--success); color: var(--success-text); }
.ac-btn--blue { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary); }
.ac-btn--amber { background: var(--warning-subtle); border-color: var(--warning); color: var(--warning-text); }
.ac-adv { display: grid; grid-template-columns: 1fr 160px auto; gap: 10px; align-items: end; }
@media (max-width: 800px) { .ac-adv { grid-template-columns: 1fr; } }
.ac-test { margin-top: 10px; padding: 10px; border: 1px dashed var(--warning); border-radius: var(--radius); }
.ac-code { border: 1px dashed var(--info); margin-top: 12px; }
.ac-codeurl { font-size: 12px; word-break: break-all; }
.ac-stats { margin-bottom: 12px; border-left: 3px solid var(--primary); }
.ac-num--ok { color: var(--success-text); }
.ac-num--bad { color: var(--danger-text); }
.ac-log td { font-size: 12px; }
.ac-log__detail td { font-size: 11px; padding-top: 0; border-top: none; color: var(--text-secondary); }

/* ── 付费与定价（一页维护付费点 / 套餐 / 档位 / 文案）── */
.pr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .pr-grid { grid-template-columns: 1fr; } }
.pr-table th, .pr-table td { font-size: 13px; padding: 8px 12px; }
.pr-table tr.is-off td { opacity: .55; }
.pr-mode { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.pr-mode label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.pr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pr-tiers { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.pr-tiers th { font-size: 12px; font-weight: 500; color: var(--text-secondary); text-align: left; padding: 2px 4px; }
.pr-tiers td { padding: 2px 4px; }
.pr-tiers .input { width: 100%; }
.pr-texts__group { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 8px 0 4px; }
.pr-text { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.pr-text > span { display: flex; flex-direction: column; }
.pr-text i { font-style: normal; font-size: 11px; }
.pr-pending { padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.pr-pending:last-child { border-bottom: none; }

/* 试下单结果：一格一种方式一种单 */
.gwprobe { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 4px 0 2px; }
.gwprobe__cell { font-size: 11px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--border); cursor: help; }
.gwprobe__cell--ok { border-color: var(--success); background: var(--success-subtle); color: var(--success-text); }
.gwprobe__cell--bad { border-color: var(--danger); background: var(--danger-subtle); color: var(--danger-text); }
.gwprobe__cell--skip { color: var(--text-secondary); }

/* 像素管理：手风琴面板里的实例卡 + 事件药丸（对标 aishop 的编辑器） */
.px-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.px-item__head {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border-light);
}
.px-item__body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; }
.px-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; cursor: pointer; user-select: none;
}
.px-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
/* 勾选框本身不显示：药丸整体就是开关，双重视觉反而让人不确定点哪 */
.px-chip input { display: none; }

/* ── 流量分析：实时地图（Leaflet 画 SVG，颜色只能靠 class 覆盖它的默认属性） ── */
#tr-map { height: 340px; border-radius: var(--radius); background: var(--bg-sidebar); overflow: hidden; }
#tr-map .leaflet-container { background: var(--bg-sidebar); font: inherit; }
#tr-map .tr-map-country { fill: var(--bg-sidebar-hover); stroke: var(--border); stroke-width: 0.6; fill-opacity: 1; }
#tr-map .tr-map-dot { fill: var(--primary); stroke: var(--primary-light); fill-opacity: .45; stroke-width: 1.5; }
#tr-map .tr-map-dot--city { fill: var(--success); stroke: var(--success); fill-opacity: .7; }
#tr-map .leaflet-tooltip { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: 12px; }
#tr-map .leaflet-tooltip-top:before { border-top-color: var(--border); }
#tr-map .leaflet-control-zoom a { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.tr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: var(--primary-subtle); color: var(--primary); font-size: 12px; }
.tr-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; font-size: 12px; }
.tr-dd { position: absolute; top: 100%; left: 0; z-index: 30; min-width: 280px; margin-top: 4px; padding: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.tr-dd label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 13px; cursor: pointer; }
.tr-dd label:hover { background: var(--bg-hover); border-radius: 4px; }

/* 站点行「配置 ▾」下拉（09-26 体检：原来 7 个纯 emoji 按钮，只靠悬停提示认） */
.site-cfg { position: relative; display: inline-block; }
.site-cfg > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; }
/* 普通 .btn 的浅灰底来自浏览器给 <button> 的默认样式，summary 拿不到，要自己补 */
.site-cfg > summary.btn { background: var(--bg-secondary); color: var(--text); }
.site-cfg > summary::-webkit-details-marker { display: none; }
.site-cfg__menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 170px; padding: 4px;
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.site-cfg__menu a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--text); white-space: nowrap; text-decoration: none; }
.site-cfg__menu a:hover { background: var(--bg-hover); }

/* 下拉框：35 处 class="select" 原来在样式表里没有定义，全是浏览器原生样式、和输入框对不齐（09-26 体检） */
.select {
  max-width: 100%; padding: 8px 10px; background-color: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 13px; font-family: inherit; line-height: 1.5; outline: none;
}
.select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.form-label > .select { display: block; width: 100%; margin-top: 4px; }

/* 运营报表：局部图表和聚合明细，不依赖外部字体或图表库。 */
.rp-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rp-page-heading h2 { margin: 0 0 4px; font-size: 22px; }
.rp-page-heading p { margin: 0; }
.rp-filter { margin-bottom: 12px; }
.rp-filter-top, .rp-filter-bottom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.rp-filter-bottom { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.rp-filter label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.rp-filter label input.input, .rp-filter label select { width: 150px; }
.rp-filter .rp-title-filter { flex: 1; min-width: 190px; }
.rp-filter .rp-title-filter select { width: 100%; }
.rp-filter label.rp-check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; min-height: 37px; }
.rp-scope-note { margin-top: 10px; font-size: 12px; line-height: 1.7; }
.rp-site-picker { position: relative; align-self: flex-end; }
.rp-site-picker > summary { list-style: none; background: var(--bg-secondary); }
.rp-site-picker > summary::-webkit-details-marker { display: none; }
.rp-site-menu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 25; width: 330px; max-width: calc(100vw - 65px); max-height: 350px; overflow: auto; padding: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.rp-site-menu label { flex-direction: row; gap: 8px; align-items: center; padding: 7px; color: var(--text); cursor: pointer; }
.rp-site-menu label:hover { background: var(--bg-hover); }
.rp-site-menu small { display: block; color: var(--text-secondary); margin-top: 2px; }
.rp-coverage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 12px; color: var(--text-secondary); margin: 12px 0; }
.rp-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.rp-kpi .card-body { min-height: 130px; padding: 16px; }
.rp-kpi-label { font-size: 13px; color: var(--text-secondary); }
.rp-kpi strong { display: block; font-size: 25px; line-height: 1.4; margin: 5px 0; font-weight: 650; overflow-wrap: anywhere; }
.rp-kpi .muted { font-size: 12px; line-height: 1.6; }
.rp-delta { display: block; font-size: 11px; margin-top: 8px; color: var(--text-secondary); line-height: 1.7; }
.rp-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 5px 0 12px; margin-top: 10px; }
.rp-tabs button { flex: none; }
.rp-panel { margin-bottom: 14px; min-width: 0; }
.rp-panel .card-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rp-panel h3 { font-size: 15px; margin: 0 0 12px; }
.rp-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.rp-chart { display: block; width: 100%; min-height: 170px; height: auto; overflow: visible; }
.rp-gridline { stroke: var(--border-light); stroke-width: 1; }
.rp-axis { fill: var(--text-secondary); font-size: 12px; }
.rp-series { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; }
.rp-point { fill: var(--primary); }
.rp-panel details > summary { cursor: pointer; font-size: 12px; padding: 8px 0; }
.rp-money-line { margin: 8px 0; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.rp-note { margin-top: 12px; margin-bottom: 12px; font-size: 12px; line-height: 1.8; }
.rp-table-heading { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rp-table-heading > button { margin-left: auto; }
.rp-table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--border-light); border-radius: var(--radius); }
.rp-table .table { margin: 0; font-size: 12px; }
.rp-table .table th, .rp-table .table td { white-space: nowrap; }
.rp-table .table td:first-child { max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.rp-sort { color: var(--text-secondary); font-size: inherit; font-weight: 600; border: 0; padding: 0; background: transparent; cursor: pointer; }
.rp-link { background: transparent; border: 0; padding: 0; color: var(--text-sidebar-active); cursor: pointer; font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.rp-link:hover { color: var(--primary-hover); }
.rp-subtext { display: block; margin-top: 4px; color: var(--text-secondary); font-size: 11px; }
.rp-paging { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; padding: 12px 0 0; font-size: 12px; }
.rp-paging > span:first-child { margin-right: auto; }
.rp-paging .select { padding: 4px 8px; }
.rp-empty { padding: 30px 12px; text-align: center; color: var(--text-secondary); font-size: 13px; line-height: 1.8; }
.rp-funnel-row { display: grid; grid-template-columns: 85px minmax(0, 1fr) 45px 55px; align-items: center; gap: 8px; margin: 16px 0; font-size: 12px; }
.rp-bar-track { height: 10px; background: var(--bg-hover); border-radius: 6px; overflow: hidden; }
.rp-bar-track > span { display: block; background: var(--primary); height: 100%; border-radius: inherit; }
.rp-retention { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.rp-retention strong { font-size: 23px; }
.rp-hist-row { display: grid; grid-template-columns: 95px minmax(0, 1fr) 50px; align-items: center; gap: 8px; margin: 16px 0; font-size: 12px; }
.rp-quality-list, .rp-definitions { margin: 0; font-size: 13px; }
.rp-quality-list > div { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border-light); padding: 9px 0; }
.rp-quality-list dt { color: var(--text-secondary); }
.rp-quality-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.rp-warning-list { padding-left: 20px; line-height: 1.9; font-size: 13px; margin: 0; }
.rp-definitions > div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 12px; margin-bottom: 12px; line-height: 1.8; }
.rp-definitions dt { font-weight: 600; }
.rp-definitions dd { margin: 0; color: var(--text-secondary); overflow-wrap: anywhere; }
.rp-analysis-path { margin: 0; padding-left: 22px; font-size: 13px; line-height: 1.9; }
.rp-watch-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.rp-episode-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 70px 100px; gap: 10px; align-items: center; margin: 13px 0; font-size: 12px; }
.rp-episode-row small { color: var(--warning-text); }
@media (max-width: 1100px) { .rp-two { grid-template-columns: minmax(0, 1fr); } .rp-watch-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rp-kpi .card-body { padding: 12px; min-height: 135px; }
  .rp-kpi strong { font-size: 21px; }
  .rp-page-heading h2 { font-size: 20px; }
  .rp-filter-top, .rp-filter-bottom { gap: 8px; }
  .rp-filter label { flex: 1; min-width: 110px; }
  .rp-filter label input.input, .rp-filter label select { width: 100%; }
  .rp-filter .rp-check { min-width: 200px; }
  .rp-chart { min-height: 110px; }
  .rp-definitions > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rp-table-heading > button { margin-left: 0; }
  .rp-episode-row { grid-template-columns: 40px minmax(0, 1fr) 50px 75px; gap: 5px; }
}

/* 后台性能与体验（2026-10-19）：骨架屏给出结构感，避免只有一行「加载中」被误读为卡死 */
.adm-skel{height:14px;border-radius:6px;margin:10px 0;background:linear-gradient(90deg,var(--bg-secondary,#eef0f3) 25%,var(--border,#dfe3e8) 50%,var(--bg-secondary,#eef0f3) 75%);background-size:200% 100%;animation:adm-skel-pulse 1.2s ease-in-out infinite}
.adm-skel--title{width:38%;height:20px}.adm-skel--short{width:62%}
@keyframes adm-skel-pulse{0%{background-position:200% 0}100%{background-position:-200% 0}}
@media (prefers-reduced-motion: reduce){.adm-skel{animation:none}}
/* 表格可读性：表头吸顶于滚动容器内，长表不用先滚回顶部对列 */
.table-wrap{scrollbar-gutter:stable}
.table-wrap thead th{position:sticky;top:0;background:var(--bg,#fff);z-index:1}

/* 转化漏斗：筛选在上，一张横向漏斗，付费墙两步、分站表和日趋势分开 */
.jf-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.jf-kpis .rp-kpi .card-body { min-height: 118px; }
.jf-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 4px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--bg-card);
  font-size: 10px; line-height: 1; cursor: help; font-weight: 700; vertical-align: 1px;
}
.jf-funnel { display: flex; align-items: flex-end; gap: 0; overflow-x: auto; padding: 4px 0 8px; }
.jf-step { flex: 1 0 92px; min-width: 92px; display: flex; flex-direction: column; gap: 6px; }
.jf-step__top { display: flex; align-items: center; font-size: 13px; font-weight: 650; min-height: 22px; }
.jf-step__count { font-size: 22px; font-weight: 720; letter-spacing: -0.03em; line-height: 1.1; }
.jf-step__cost { min-height: 16px; font-size: 11px; line-height: 1.35; color: var(--text-secondary); }
.jf-money { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 12px; }
.jf-money .rp-kpi strong { word-break: break-word; }
.jf-miss { color: var(--text-secondary); font-weight: 500; font-size: 12px; }
.jf-fresh, .jf-sync { margin: 0 0 10px; font-size: 12px; line-height: 1.55; color: var(--text-muted); }
.jf-fresh--stale { color: var(--text-secondary); }
.jf-sync-details { display: inline; }
.jf-sync-details summary {
  cursor: pointer; color: var(--text-secondary); font-weight: 500;
  list-style: disclosure-closed; display: inline;
}
.jf-sync-details[open] summary { list-style: disclosure-open; }
.jf-sync-sites { margin: 6px 0 0; font-size: 12px; line-height: 1.55; color: var(--text-muted); word-break: break-word; }
.jf-step__track { height: 64px; display: flex; align-items: flex-end; background: var(--bg-secondary); border-radius: 8px; overflow: hidden; }
.jf-step__track > span { display: block; width: 100%; background: var(--primary); border-radius: 6px 6px 0 0; }
.jf-step__meta { min-height: 32px; font-size: 11px; line-height: 1.45; color: var(--text-muted); }
.jf-bridge { flex: 0 0 58px; min-width: 58px; text-align: center; font-size: 11px; line-height: 1.35; color: var(--text-muted); padding-bottom: 36px; }
.jf-bridge b { display: block; color: var(--text); font-size: 12px; }
.jf-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; }
.jf-phase { min-width: 0; }
.jf-note { margin: 8px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.jf-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 8px; font-size: 12px; }
.jf-legend i { display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: middle; }
@media (max-width: 980px) {
  .jf-kpis, .jf-money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jf-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .jf-kpis, .jf-money { grid-template-columns: minmax(0, 1fr); }
  .jf-money .rp-kpi strong { font-size: 18px; }
}

/* ── 订单详情（#order/<id>） ───────────────────────── */
.od-page { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.od-page .card { border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 8px rgba(16,24,40,.05); overflow: hidden; }
.od-back a { color: var(--text-secondary); font-size: 13px; }
.od-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 18px 20px;
  background: linear-gradient(135deg, var(--primary-light), var(--bg-card) 60%); }
.od-head-main { min-width: 0; flex: 1; }
.od-head-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 18px; font-weight: 600; color: var(--text); }
.od-head-id .od-mono { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.od-head-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 24px; margin-top: 14px; }
.od-head-meta span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.od-head-meta b { font-size: 15px; font-weight: 600; color: var(--text); }
.od-head-actions { display: flex; gap: 8px; }
.od-card .card-header { display: flex; align-items: baseline; gap: 10px; }
.od-sub { font-size: 12px; font-weight: 400; }
.od-group + .od-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.od-group h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text-secondary); letter-spacing: .02em; }
.od-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; }
@media (max-width: 1200px) { .od-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .od-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .od-grid { grid-template-columns: minmax(0, 1fr); } }
.od-kv { min-width: 0; }
.od-k { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.od-v { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; color: var(--text); }
.od-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.od-empty { color: var(--text-muted); opacity: .6; }
.od-copy { flex: none; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 1.4; }
.od-copy:hover { background: var(--bg-hover); color: var(--primary); }
.od-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.od-col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1000px) { .od-cols { grid-template-columns: minmax(0, 1fr); } }
.od-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.od-tl-item { position: relative; padding: 0 0 16px 24px; }
.od-tl-item::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.od-tl-item:last-child::before { display: none; }
.od-tl-dot { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.od-tl-item.is-bad .od-tl-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-subtle); }
.od-tl-body { min-width: 0; }
.od-tl-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.od-tl-top b { font-size: 14px; color: var(--text); }
.od-tl-time { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.od-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.od-tag { display: inline-flex; gap: 4px; align-items: center; max-width: 100%; padding: 2px 8px; border-radius: 999px; background: var(--bg-secondary); border: 1px solid var(--border-light); font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-tag i { font-style: normal; color: var(--text-muted); }
.od-raw { margin-top: 6px; font-size: 12px; }
.od-raw summary { cursor: pointer; color: var(--primary); }
.od-raw > div { margin-top: 6px; padding: 8px 10px; background: var(--bg-secondary); border-radius: 8px; overflow-wrap: anywhere; }
.od-flush { padding: 0; }
.od-table th { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.od-table td { vertical-align: top; }
.od-linked { list-style: none; margin: 0; padding: 0; }
.od-linked li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.od-linked li:last-child { border-bottom: 0; }
.od-empty-box { text-align: center; padding: 22px 12px; color: var(--text-secondary); font-size: 13px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.od-empty-ico { font-size: 26px; opacity: .7; }
.od-pager { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border-light); }
.od-pager:empty { display: none; }

/* ---------- 用户管理（pages-users.js，2026-10-30） ---------- */
.eu-filters { margin-bottom: 16px; }
.eu-filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.eu-search { min-width: 220px; flex: 1 1 220px; }
.eu-table td { vertical-align: top; font-size: 13px; }
.eu-table .nowrap, .eu-tl-ts { white-space: nowrap; }
.eu-pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.eu-detail-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.eu-card { margin-bottom: 16px; }
.eu-kv-v { font-size: 15px; word-break: break-all; }
.eu-progress { width: 96px; height: 6px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.eu-progress span { display: block; height: 100%; background: var(--primary); }
.eu-attempt { font-size: 12px; margin-bottom: 2px; }
.eu-pos { color: var(--success-text); }
.eu-neg { color: var(--danger-text); }
.eu-timeline { list-style: none; margin: 0; padding: 8px 20px 16px; }
.eu-timeline li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.eu-timeline .eu-tl-ts { color: var(--text-muted); min-width: 120px; }
.eu-mono { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; word-break: break-all; }
.eu-num { text-align: right; font-variant-numeric: tabular-nums; }

/* 订单详情「支付失败」横幅（2026-10-31）：只用设计 tokens */
.od-fail { background: var(--danger-subtle); border: 1px solid var(--danger); border-left-width: 4px; border-radius: var(--radius); color: var(--danger-text); padding: 14px 18px; margin-bottom: 16px; }
.od-fail--past { background: var(--warning-subtle); border-color: var(--warning); color: var(--warning-text); }
.od-fail__title { font-size: 16px; font-weight: 800; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--danger); }
.od-fail--past .od-fail__title { color: var(--warning-text); }
.od-fail__why { font-size: 15px; font-weight: 700; margin-top: 6px; color: var(--danger); line-height: 1.45; }
.od-fail--past .od-fail__why { color: var(--warning-text); }
.od-fail__status { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--danger-text); }
.od-fail--past .od-fail__status { color: var(--warning-text); }
.od-fail__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 13px; }
.od-fail__raw { margin-top: 6px; font-size: 12px; word-break: break-all; }
.od-fail__raw .od-channel-msg { font-size: 14px; font-weight: 700; }
.od-channel-msg--ok { color: var(--success-text); font-weight: 700; }
.od-channel-msg--bad { color: var(--danger); font-weight: 700; }
.od-fail__why.od-channel-msg--ok { color: var(--success-text); }
.od-fail__why.od-channel-msg--bad { color: var(--danger); }
/* 非成功/非失败语义的说明仍跟横幅危险色，避免冲淡真正失败提示 */
.od-fail__why.od-channel-msg:not(.od-channel-msg--ok):not(.od-channel-msg--bad) { color: var(--danger); }
.od-fail__miss { margin-top: 6px; font-size: 12px; font-style: italic; }
.od-fail details { margin-top: 8px; font-size: 12px; }
.od-fail-miss { color: var(--warning-text); font-size: 12px; }
.od-tl-item.is-bad .od-tl-top b { color: var(--danger); font-weight: 700; }
.od-tl-item.is-bad .od-tl-body { border-left: 2px solid var(--danger-subtle); padding-left: 6px; }

/* 成单步骤 + 判定（2026-11-07） */
.od-verdict { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.od-verdict__kind { font-weight: 800; font-size: 15px; }
.od-verdict__why { margin-top: 4px; }
.od-verdict__ev { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.od-verdict--ok { border-color: var(--success); background: var(--success-subtle); color: var(--success-text); }
.od-verdict--bad { border-color: var(--danger); background: var(--danger-subtle); color: var(--danger-text); }
.od-verdict--warn { border-color: var(--warning); background: var(--warning-subtle); color: var(--warning-text); }
.od-verdict--info { border-color: var(--info); background: var(--info-subtle); color: var(--info-text); }
.od-steps { list-style: none; margin: 0; padding: 0; }
.od-step { display: grid; grid-template-columns: 84px 1fr; column-gap: 10px; padding: 5px 0 5px 10px; border-left: 3px solid var(--border-light); font-size: 13px; }
.od-step__t { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.od-step__d { grid-column: 2; color: var(--text-muted); font-size: 12px; word-break: break-all; }
.od-step--ok { border-left-color: var(--success); }
.od-step--bad { border-left-color: var(--danger); }
.od-step--bad .od-step__l { color: var(--danger-text); font-weight: 700; }
.od-step--warn { border-left-color: var(--warning); }

/* 剧目库：书的章节面板（2026-11-15）。窄屏上下叠放 —— 470px 的侧栏在手机上会把列表挤没 */
.ct-split--book { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .ct-split--book { grid-template-columns: minmax(0, 1fr); } .ct-split--book > .card:last-child { order: -1; } }
.ct-chtable td, .ct-chtable th { padding: 6px 8px; font-size: 13px; }
.ct-chprev { padding: 8px 10px; background: var(--bg-secondary); border-radius: var(--radius); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
