:root {
  /* Apple 设计语言（2026-12-02 用户要求参照 apple.com.cn 重做）：
     白/浅灰画布 #f5f5f7、苹果蓝 #0071e3、中性灰阶文字、大圆角卡片、去重阴影 */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --border: #e8e8ed;
  --border-strong: #d2d2d7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --primary: #0071e3;
  --primary-soft: #f5f9ff;
  --primary-border: #cbe4fb;
  --success: #248a3d;
  --success-soft: #e9f6ee;
  --warning: #b25000;
  --warning-soft: #fff6e8;
  --danger: #d70015;
  --danger-soft: #fdeaea;
  --purple: #6e5bd0;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.18);
  --sidebar: 228px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

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

/* ------------------------------------------------------------------ */
/* 布局                                                                */
/* ------------------------------------------------------------------ */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: rgba(251, 251, 253, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: var(--text-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 32px; height: 32px; border-radius: 10px; overflow: hidden;
  background: var(--primary); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.brand-logo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { color: var(--text-3); font-size: 11px; }

.nav { padding: 10px 8px 24px; }
.nav-group { margin-top: 12px; }
.nav-group-title {
  padding: 8px 10px 6px; color: var(--text-3); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  color: var(--text-2); font-size: 13.5px; user-select: none;
  transition: background 0.16s, color 0.16s;
}
.nav-item:hover { background: rgba(0, 0, 0, 0.045); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar-foot {
  margin-top: auto; padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3); line-height: 1.7;
}
.sidebar-foot .muted { color: var(--text-3); font-size: 11px; }
.nav-item .ico { width: 16px; text-align: center; opacity: 0.9; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; flex: 0 0 56px;
  background: rgba(251, 251, 253, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.topbar-sub { color: var(--text-3); font-size: 12px; }
.topbar-spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 980px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.pill.primary { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); }

.content { padding: 18px 20px 40px; }

/* ------------------------------------------------------------------ */
/* 通用组件                                                            */
/* ------------------------------------------------------------------ */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-head .sub { color: var(--text-3); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 14px 18px; }
.card-body.tight { padding: 10px 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: 980px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: all 0.18s;
}
.btn:hover { border-color: var(--text-3); color: var(--text); background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #0077ed; border-color: #0077ed; color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #e81123; border-color: #e81123; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn.small { height: 28px; padding: 0 12px; font-size: 12.5px; }
.btn.block { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 14px; border-radius: 980px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font-size: 13px; transition: all 0.15s; user-select: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.lg { height: 44px; font-size: 15px; padding: 0 22px; }

.input, .select, textarea.input {
  height: 34px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
textarea.input { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}
/* 数字输入框隐藏步进箭头（手机上占位且易误触） */
.input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* 手机 UA：字号 ≥16px 防 iOS 聚焦自动缩放抖动；加宽点击目标 */
@media (pointer: coarse) {
  .input, .select, textarea.input { font-size: 16px; height: 36px; }
  /* small 按钮（表格操作列）保持紧凑，不要被统一的触屏尺寸放大 */
  .btn { min-height: 34px; }
  .btn.small { height: 30px; min-height: 30px; padding: 0 10px; }
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1.5px 9px; border-radius: 980px; font-size: 11.5px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  white-space: nowrap;
}
.tag.green { background: var(--success-soft); border-color: #c8ecd7; color: #1d7a35; }
.tag.red { background: var(--danger-soft); border-color: #f6c9c9; color: #c21818; }
.tag.orange { background: var(--warning-soft); border-color: #f5dcc0; color: #a34a00; }
.tag.blue { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); }
.tag.purple { background: #f3f1fc; border-color: #ddd6fe; color: #5d4bbd; }
.tag.gray { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }

.table-wrap { overflow: auto; border-radius: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td {
  padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl th {
  background: var(--surface); color: var(--text-3);
  font-weight: 600; font-size: 12px; position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--border-strong);
}
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr.row-selected { background: var(--primary-soft); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .ellip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

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

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); 
}
.stat .k { color: var(--text-3); font-size: 12px; margin-bottom: 6px; }
.stat .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .d { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab {
  padding: 9px 14px; cursor: pointer; font-size: 13.5px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.switch {
  position: relative; width: 40px; height: 22px; border-radius: 999px;
  background: #cbd5e1; cursor: pointer; transition: background 0.18s; flex: 0 0 auto;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform 0.18s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.switch.disabled { opacity: 0.45; cursor: not-allowed; }

/* 抽屉 / 弹窗 */
.overlay {
  position: fixed; inset: 0; background: rgba(29, 29, 31, 0.4);
  z-index: 60; display: flex; animation: fade 0.16s ease;
}
.overlay.center { align-items: center; justify-content: center; }
.overlay.right { justify-content: flex-end; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.drawer {
  width: 720px; max-width: 94vw; height: 100%; background: var(--surface);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  animation: slideIn 0.2s ease;
}
.drawer.wide { width: 900px; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0.6 } to { transform: none; opacity: 1 } }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.drawer-head h2 { margin: 0; font-size: 15.5px; }
.drawer-head .sub { color: var(--text-3); font-size: 12px; }
.drawer-head-title { flex: 1 1 auto; min-width: 0; }
.drawer-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; min-width: 0; }
/* 关闭按钮：圆形图标 + hover 旋转，替换原来那枚灰扑扑的「关闭」文字按钮 */
.drawer-close {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .18s ease;
}
.drawer-close:hover { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; transform: rotate(90deg); }
.drawer-close:active { transform: rotate(90deg) scale(.92); }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-foot {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  background: var(--surface);
}

.modal {
  width: 560px; max-width: 92vw; max-height: 88vh; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: pop 0.16s ease;
}
.modal.sm { width: 420px; }
.modal.lg { width: 860px; }
@keyframes pop { from { transform: scale(0.97); opacity: 0.5 } to { transform: none; opacity: 1 } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.section { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden; }
.section-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.section-head .t { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.section-head .d { color: var(--text-3); font-size: 11.5px; }
.section-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.section-body { padding: 14px; }
.section.off { opacity: 0.72; }

.toast-host {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 18px; border-radius: 14px; font-size: 13px; box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border); animation: toastIn 0.18s ease;
}
.toast.success { border-color: #c8ecd7; background: rgba(233, 246, 238, 0.96); color: #1d7a35; }
.toast.error { border-color: #f6c9c9; background: rgba(253, 234, 234, 0.96); color: #c21818; }
.toast.warning { border-color: #f5dcc0; background: rgba(255, 246, 232, 0.96); color: #a34a00; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* 登录页 */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
  padding: 32px;
}
.auth-wrap { display: flex; gap: 56px; align-items: center; max-width: 1100px; width: 100%; }
.auth-intro { flex: 1; min-width: 0; }
.auth-intro .logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-intro h1 { margin: 0; font-size: 34px; letter-spacing: -0.02em; font-weight: 700; }
.auth-intro .kicker { color: var(--text-2); font-size: 13px; letter-spacing: 0.04em; }
.auth-intro h2 { font-size: 18px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.auth-intro p.lead { color: var(--text-2); font-size: 13.5px; margin: 0 0 20px; }
.feature { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.feature .ico {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.feature .t { font-weight: 600; font-size: 13.5px; }
.feature .d { color: var(--text-2); font-size: 12.5px; }

.auth-card {
  width: 392px; flex: 0 0 392px; background: var(--surface);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06); padding: 30px 28px;
}
.auth-card h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.01em; }
.auth-card .sub { color: var(--text-2); font-size: 13px; margin-bottom: 14px; }
.auth-trial {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
  padding: 8px 11px; border-radius: 10px; font-size: 12.5px; color: #a34a00;
  background: var(--warning-soft); border: 1px solid #f5dcc0;
}
.auth-trial .ico { font-size: 14px; flex: 0 0 auto; }
.auth-tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 11px; margin-bottom: 16px; }
.auth-tabs .tab2 {
  flex: 1; text-align: center; padding: 7px 0; border-radius: 8px;
  font-size: 13px; cursor: pointer; color: var(--text-2);
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tabs .tab2:hover { color: var(--text); }
.auth-tabs .tab2.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-submit { margin-top: 8px; }
.auth-error {
  color: #c21818; font-size: 12.5px; line-height: 1.5;
  background: var(--danger-soft, #fef2f2); border: 1px solid #fecaca;
  border-radius: 8px; padding: 8px 11px; margin-top: 12px;
}
.auth-success { text-align: center; padding: 4px 0; font-size: 13.5px; line-height: 2; color: var(--text-2); }
.auth-success .big { font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.6; }
.auth-success .hl { color: #1d7a35; font-weight: 600; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--text-3); }
.auth-link { color: var(--primary); cursor: pointer; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.hintline { font-size: 12px; color: var(--text-3); margin-top: 14px; line-height: 1.7; }
.auth-register { margin-top: 10px; }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }

/* 到期会员占位页：零接口调用，仅展示状态 */
.expired-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--topbar-h, 48px) - 40px); padding: 32px 16px; }
.expired-card {
  max-width: 460px; width: 100%; text-align: center;
  background: var(--surface); border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px; padding: 36px 28px; box-shadow: var(--shadow-sm);
}
.expired-ico { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.expired-card h2 { margin: 0 0 8px; font-size: 20px; color: #b42318; }
.expired-msg { color: var(--text-2); font-size: 13.5px; line-height: 1.8; margin: 0 0 16px; }
.expired-meta { text-align: left; background: var(--surface-2); border-radius: 8px; padding: 12px 14px; font-size: 13px; color: var(--text-2); line-height: 2; margin-bottom: 14px; }
.expired-meta .strong { color: var(--text); font-weight: 600; }
.expired-contact { color: var(--text-3); font-size: 12.5px; line-height: 1.8; margin: 0; }
.code-row .btn { flex: 0 0 auto; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--text-3); padding: 26px; justify-content: center; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #cbd5e1; border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.kv-list { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13px; }
.kv-list .k { color: var(--text-3); }
.kv-list .v { color: var(--text); }

.help { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 8px; padding: 9px 11px; line-height: 1.65; }
.help.limit-warn { color: #b42318; background: #fef2f2; border: 1px solid #fca5a5; }

.list-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 9px; margin-bottom: 8px; background: var(--surface);
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item .ttl { font-weight: 600; font-size: 13.5px; }
.list-item .sub { color: var(--text-3); font-size: 12px; }

.scroll-x { overflow-x: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--text-3); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.w120 { width: 120px; } .w160 { width: 160px; } .w200 { width: 200px; } .w260 { width: 260px; }
.flex1 { flex: 1; min-width: 0; }

/* 表单字段一律左对齐：避免受 .right 等右对齐类继承影响 */
.field { text-align: left; }
.field > label { text-align: left; display: block; }
.field .input, .field .select { text-align: left; }
/* overlay.right 是布局用的右滑抽屉，不能把 text-align 继承给内容 */
.overlay.right .drawer, .overlay.right .modal, .overlay.center .drawer, .overlay.center .modal { text-align: left; }
/* 分段标题（01 主计划 / 02 素材追投） */
.section-title { padding: 2px 0; }
/* 抽屉内的开关行 */
.section-head .right .switch { flex: 0 0 auto; }

/* 商品管理 / 素材工作台补充样式 */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
@media (max-width: 1100px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.strong { font-weight: 600; }
.thumb { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border); flex: 0 0 auto; background: var(--surface-2); }
.thumb.ph { display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--text-3); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

/* 托管计划空态：选择投放模式 */
.empty-hero { padding: 26px 10px 34px; text-align: center; }
.empty-hero h2 { font-size: 19px; font-weight: 700; margin: 0 0 6px; }
.empty-hero .hero-sub { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.empty-hero .hero-desc { font-size: 12.5px; color: var(--text-3); margin-bottom: 20px; }
.empty-hero .hero-note { margin-top: 18px; font-size: 12px; color: var(--text-3); }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; max-width: 720px; margin: 0 auto; text-align: left; }
.mode-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px 16px 18px; background: var(--surface); }
.mode-card .mode-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.mode-card .mode-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.6; min-height: 40px; }

/* 分段控件 / 迷你图表 / 账户树 */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.seg-item { padding: 5px 11px; font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; border-right: 1px solid var(--border); }
.seg-item:last-child { border-right: none; }
.seg-item:hover { color: var(--text); }
.seg-item.on { background: var(--primary); color: #fff; }
.chart-box { display: flex; align-items: flex-end; gap: 6px; height: 168px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.chart-box .bar { flex: 1; background: rgba(0, 113, 227, .5); border-radius: 4px 4px 0 0; min-height: 4px; }
.chart-box .bar.alt { background: rgba(52, 199, 89, .5); }
.chart-box .empty { width: 100%; align-self: center; }
.tree-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 4px; border-bottom: 1px dashed var(--border); font-size: 13px; }
.tree-row.child { padding-left: 22px; }
.tree-row:last-child { border-bottom: none; }

/* ------------------------------------------------------------------ */
/* 直播计划管理页：左右分栏布局                              */
/* ------------------------------------------------------------------ */
.w-full { width: 100%; }
.mb8 { margin-bottom: 8px; }
.gap8 { gap: 8px; }

.liveplan-wrap {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.lp-left {
  flex: 0 0 300px;
  width: 300px;
  max-width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}

/* 左侧面板头部：两行布局，避免标题与按钮在一行内互相挤压 */
.lp-left-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lp-head-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.lp-left-head .lp-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lp-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.lp-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
}
.lp-head-meta .tag { font-size: 11px; }
.lp-quota { color: var(--text-2); font-weight: 600; white-space: nowrap; }
.lp-quota.warn { color: #a34a00; }
.lp-quota.full { color: #dc2626; }
.lp-quota-note { color: var(--text-3); white-space: nowrap; }
.lp-left-head .lp-count { font-size: 12px; color: var(--text-3); }

.lp-left-filters {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.lp-left-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
}

.lp-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .12s ease;
}
.lp-card:hover { border-color: var(--primary-border); background: var(--primary-soft); }
.lp-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.lp-card-name { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-card-meta { display: flex; gap: 8px; font-size: 11.5px; margin-bottom: 8px; overflow: hidden; }
.lp-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.lp-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lp-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lp-head-left { min-width: 0; flex: 1 1 auto; }
.lp-head-title { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.lp-head-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12.5px; }
.lp-head-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-head-stats .stat { min-width: 90px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }

.lp-funcs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lp-func-caption { font-size: 12px; color: var(--text-3); }
.lp-func-row { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-func-btn {
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: all .12s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lp-func-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.lp-func-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary) inset;
  font-weight: 600;
}
.lp-func-dot { font-size: 8px; color: var(--success); line-height: 1; }
/* 会员未开通该功能：按钮置灰但仍可点击（点击给出明确提示，而不是静默无反应） */
.lp-func-btn.locked {
  color: var(--text-3);
  border-style: dashed;
  background: transparent;
  opacity: .72;
}
.lp-func-btn.locked:hover { border-color: var(--border-strong); color: var(--text-3); background: transparent; }
/* 「自动托管」旁的伴生入口（2026-11-24 迁入）：AI 追投分析按钮 + 开播自动检测状态条，与功能按钮同一风格 */
/* AI 按钮：基础态与其他功能按钮一致（中性描边），只有开启（active）才显示紫色高亮——
   修复「功能没开启时按钮也显示高亮选中」的问题 */
.lp-func-btn.ai-func-btn {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}
.lp-func-btn.ai-func-btn:hover { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary); }
.lp-func-btn.ai-func-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.lp-func-row .lifecycle-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border-color: var(--border-strong);
  font-size: 12.5px;
  min-height: 0;
}
.lp-func-row .lifecycle-chip .lifecycle-toggle { margin-left: 2px; }
/* 巡检条高亮选中态：与 .lp-func-btn.active 同一套（覆盖 on/off 的红绿底色，灯色点保留） */
.lp-func-row .lifecycle-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
  font-weight: 600;
}
/* 巡检关闭态：虚线置灰，与功能按钮「未开通」风格一致 */
.lp-func-row .lifecycle-chip.lc-disabled { border-style: dashed; opacity: .72; }
/* 普通会员未开放（下播自动清理）：锁定态 */
.lp-func-row .lifecycle-chip.locked {
  color: var(--text-3);
  border-style: dashed;
  background: transparent;
  opacity: .72;
}

.lp-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.lp-overview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.lp-ov-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lp-ov-title { font-size: 14px; font-weight: 700; margin: 0; }
.lp-ov-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.lp-ov-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.lp-ov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }

/* 数据总览分组（账户今日总览 / 计划今日数据） */
.lp-ov-group { margin-bottom: 18px; }
.lp-ov-group-title { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.lp-ov-group:last-child { margin-bottom: 0; }

/* 数据总览 6 张彩色指标卡 */
.lp-ov-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 0; }
/* 双口径口径标签（2026-11-24）：整体=含追投 / 基础=不含追投 */
.ov-scope-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
/* 数据总览 6 张指标卡：Apple 风格中性灰底大圆角，颜色只保留语义小点 */
.lp-ov-caption { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.ov-scope-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 980px; white-space: nowrap; }
.ov-scope-tag.overall { color: #a34a00; background: var(--warning-soft); border: 1px solid #f5dcc0; }
.ov-scope-tag.base { color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-border); }
.metric-card { padding: 14px 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.metric-label { font-size: 12.5px; color: var(--text-2); }
.metric-value { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.metric-yellow { border-top: 3px solid #f5b400; }
.metric-green { border-top: 3px solid var(--success); }
.metric-cyan { border-top: 3px solid #00a5cf; }
.metric-blue { border-top: 3px solid var(--primary); }
.metric-lightblue { border-top: 3px solid #41a8ee; }
.metric-pink { border-top: 3px solid #e8547c; }

/* 详情 Tab 栏 */
.lp-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lp-detail-tabs { display: flex; border-bottom: 1px solid var(--border); }
.lp-detail-tab { padding: 12px 18px; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; }
/* 相邻表头之间的竖向分割线（active 时不遮挡高亮下划线） */
.lp-detail-tab + .lp-detail-tab { border-left: 1px solid var(--border); }
.lp-detail-tab:hover { color: var(--text); }
.lp-detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.lp-detail-body { padding: 16px 18px; }
.lp-detail-body .lp-overview { border: none; padding: 0; }

/* 小时走势图卡片（数据总览「消耗与成交走势」页签） */
.trend-cards { display: flex; flex-direction: column; gap: 12px; }
.trend-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.trend-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.trend-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.trend-card-cap { font-size: 11px; color: var(--text-3); }
.trend-note { font-size: 11px; color: var(--text-3); margin-top: 10px; }
.trend-svg text { user-select: none; }
.trend-chart-wrap { position: relative; }
.trend-tip { position: absolute; transform: translate(-50%, -135%); background: rgba(29, 29, 31, 0.92); color: #fff; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 5; box-shadow: var(--shadow-sm); }

/* 趋势图 */
.lp-trend { margin-top: 6px; }
.lp-trend-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.lp-trend-title { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.lp-trend-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.lp-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-cost { background: var(--primary); }
.dot-gmv { background: var(--success); }
.dot-roi { background: var(--warning); }
.lp-trend-svg { width: 100%; height: 170px; display: block; }
.lp-grid { fill: none; stroke: var(--border); stroke-width: 1; }
.lp-axis { font-size: 9px; fill: var(--text-3); }
.lp-bar { opacity: 0.85; }
.lp-bar-cost { fill: var(--primary); }
.lp-bar-gmv { fill: var(--success); }
.lp-roi-line { fill: none; stroke: var(--warning); stroke-width: 2; }
.lp-roi-dot { fill: var(--warning); }
.lp-trend-x { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); padding: 4px 0 0; overflow: hidden; }
.lp-trend-x span { flex: 1 1 0; text-align: center; white-space: nowrap; }

/* 主计划调价抽屉 */
.ra-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.ra-tab { padding: 8px 16px; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; }
.ra-tab:hover { color: var(--text); }
.ra-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.ra-block { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.ra-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.ra-block-title { font-size: 14px; font-weight: 600; }
.ra-block-desc { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.65; }
.ra-block-body { padding: 0 16px 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.ra-sub-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ra-reco { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.ra-reco .link { cursor: pointer; }

/* 滑块：卡片式、进度填充、可点刻度、数值徽章，拖动时不再整页重绘 */
.slider-field {
  padding: 12px 14px 11px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); min-width: 0;
}
.slider-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.slider-value { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.slider-track { position: relative; height: 24px; display: flex; align-items: center; }
.slider-rail { position: absolute; left: 0; right: 0; height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.slider-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #41a8ee, #0071e3); transition: width .08s linear; }
.slider-track input[type="range"] { position: relative; z-index: 2; width: 100%; height: 24px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; outline: none; cursor: pointer; }
.slider-track input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px;
  border-radius: 50%; background: #fff; border: 3px solid var(--primary);
  box-shadow: 0 2px 6px rgba(0, 113, 227, .3);
  transition: transform .12s ease, box-shadow .12s ease;
}
.slider-track input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); box-shadow: 0 3px 10px rgba(0, 113, 227, .38); }
.slider-track input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.05); }
.slider-track input[type="range"]::-moz-range-track { height: 6px; background: transparent; }
.slider-track input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); box-shadow: 0 2px 6px rgba(0, 113, 227, .3); cursor: pointer; }
.slider-ticks { display: flex; justify-content: space-between; margin-top: 3px; }
.slider-tick { font-size: 10.5px; color: var(--text-3); cursor: pointer; padding: 2px 5px; border-radius: 5px; user-select: none; }
.slider-tick:hover { color: var(--primary); background: var(--primary-soft); }
.slider-note { font-size: 11.5px; color: var(--text-2); margin-top: 8px; line-height: 1.55; }

/* 主计划调价：范围说明（明确本页只管主计划 ROI） */
.ra-scope { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; margin-bottom: 12px; background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 10px; font-size: 12.5px; color: var(--primary); line-height: 1.65; }
.ra-scope-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; margin-top: 6px; }

/* 主计划调价：运行状态（开启后立刻可见，不再「一点反应也没有」） */
.ra-status { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 14px 16px; margin-bottom: 12px; min-width: 0; }
.ra-status-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.ra-status-head .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-status-head .link { cursor: pointer; flex: 0 0 auto; }
.ra-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.ra-status-dot.on { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .16); }
.ra-status-dot.off { background: #ff3b30; box-shadow: 0 0 0 3px rgba(255, 59, 48, .14); }
.ra-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 12px 0 10px; }
.ra-status-grid > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ra-status-grid span { font-size: 12px; color: var(--text-3); }
.ra-status-grid strong { font-size: 14.5px; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.ra-status-line { font-size: 13px; color: var(--text-2); line-height: 1.7; overflow-wrap: anywhere; }
.ra-status-line b, .ra-status-line strong { color: var(--text); font-weight: 600; }
.ra-hourly-title { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 10px; }
.ra-status-warn { margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; color: #a34a00; font-size: 12.5px; line-height: 1.7; overflow-wrap: anywhere; }
/* 小时流速行：主行 + 分行（较上小时成交 / 调价后带来收益） */
.ra-hourly-rows { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.ra-hourly-row { font-size: 13px; line-height: 1.7; color: var(--text); background: var(--surface, #fff); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 0 10px 10px 0; padding: 8px 14px 8px 12px; overflow-wrap: anywhere; }
.ra-hourly-main b { font-weight: 700; margin-right: 4px; font-size: 13.5px; }
.ra-hourly-main .ra-v { font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 1px; }
.ra-hourly-main .ra-k { color: var(--text-2); }
.ra-hourly-main .ra-dim { color: var(--text-3); }
.ra-hourly-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; padding-left: 2.8em; }
.ra-hourly-sub .ra-up, .ra-hourly-main .ra-up { color: #d70015; font-weight: 600; }
.ra-hourly-sub .ra-down, .ra-hourly-main .ra-down { color: #248a3d; font-weight: 600; }
.ra-hourly-row.is-empty { color: var(--text-3); border-left-color: var(--border); background: transparent; }
@media (max-width: 480px) { .ra-status-grid { grid-template-columns: minmax(0, 1fr); } .ra-status-head { flex-wrap: wrap; } }

/* 数据总览：追投状态条（level 由后端 buildRuntimeBanner 决定） */
.runtime-banner { border: 1px solid var(--border); border-left: 4px solid var(--text-3); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.runtime-banner[hidden] { display: none; }
.runtime-banner .rb-main { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.runtime-banner .rb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); margin-top: 5px; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(134, 134, 139, .18); }
.runtime-banner .rb-text { min-width: 0; flex: 1 1 auto; }
/* 场次时间（开播/下播 HH:MM）：显示在状态标题左边，只在开播/下播边沿变化 */
.runtime-banner .rb-title-row { display: flex; align-items: baseline; gap: 7px; min-width: 0; flex-wrap: wrap; }
.runtime-banner .rb-session { font-size: 12px; font-weight: 600; color: var(--text-2); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.runtime-banner .rb-session[hidden] { display: none; }
.runtime-banner .rb-title { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.45; }
.runtime-banner .rb-detail { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-top: 3px; }
.runtime-banner .rb-next { font-size: 11.5px; color: var(--text-2); margin-left: 18px; opacity: .92; }
.runtime-banner.level-ok { background: #f0fdf4; border-color: #bbf7d0; border-left-color: #248a3d; }
.runtime-banner.level-ok .rb-dot { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .18); }
.runtime-banner.level-ok .rb-title { color: #1d7a35; }
.runtime-banner.level-warn { background: #fffbeb; border-color: #fde68a; border-left-color: #d97706; }
.runtime-banner.level-warn .rb-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.runtime-banner.level-warn .rb-title { color: #a34a00; }
.runtime-banner.level-danger { background: #fef2f2; border-color: #fecaca; border-left-color: #dc2626; }
.runtime-banner.level-danger .rb-dot { background: #ff3b30; box-shadow: 0 0 0 3px rgba(255, 59, 48, .16); }
.runtime-banner.level-danger .rb-title { color: #c21818; }
.runtime-banner.level-idle { background: #f8fafc; border-color: #e2e8f0; border-left-color: #94a3b8; }
.runtime-banner.level-idle .rb-dot { background: #94a3b8; }
.runtime-banner.level-idle .rb-title { color: #475569; }

/* 自动托管抽屉：自动巡检状态 + 清空按钮 */
.lifecycle-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.lifecycle-chip .lifecycle-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.lifecycle-chip.on { background: #f0fdf4; border-color: #bbf7d0; color: #1d7a35; }
.lifecycle-chip.on .lifecycle-dot { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .16); }
.lifecycle-chip.off { background: #fef2f2; border-color: #fecaca; color: #c21818; }
.lifecycle-chip.off .lifecycle-dot { background: #ff3b30; box-shadow: 0 0 0 3px rgba(255, 59, 48, .14); }
.lifecycle-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lifecycle-toggle { border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 999px; font-size: 10.5px; padding: 1px 6px; cursor: pointer; opacity: .85; flex: 0 0 auto; }
.lifecycle-toggle:hover { opacity: 1; }
.lifecycle-toggle.off { border-style: dashed; opacity: .55; }
.clear-paused-btn { white-space: nowrap; }
.clear-paused-btn:disabled { opacity: .55; cursor: not-allowed; }

/* 折叠面板 */
.collapse { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.collapse-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.collapse-head:hover { color: var(--primary); }
.collapse-arrow { font-size: 10px; }
.collapse-body { padding: 10px 0 2px; }
.collapse-content { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.collapse-content p { margin: 0 0 8px; }

/* 真实直播状态指示灯：直播中=绿灯 / 未开播=红灯 */
.live-chip { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 600; }
/* 直播状态左侧的场次时间：无时间时由前端 hidden 掉整个 span */
.live-chip .lc-session { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.live-chip .lc-session:empty { display: none; }
.live-chip .live-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.live-chip.on { color: #1d7a35; }
.live-chip.on .live-dot { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18); }
.live-chip.off { color: #c21818; }
.live-chip.off .live-dot { background: #ff3b30; box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.16); }
/* 直播状态未知（检测不可用/未检测）：灰灯中性色，绝不显示成「未开播」 */
.live-chip.unknown { color: var(--text-3); font-weight: 500; }
.live-chip.unknown .live-dot { background: var(--text-3); box-shadow: none; opacity: .55; }

/* 移动端汉堡菜单按钮（默认隐藏，小屏显示） */
.menu-btn {
  display: none; flex: 0 0 auto;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 32px; height: 32px; font-size: 17px; line-height: 1; cursor: pointer;
  color: var(--text); align-items: center; justify-content: center;
}
.sidebar-mask { display: none; }

/* ------------------------------------------------------------------ */
/* 移动端 / 手机 UA：统一分行排版，不再靠左右滑动看内容                  */
/* ------------------------------------------------------------------ */
/* ================= AI 追投分析助手 ================= */
.ai-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--primary-border); background: var(--primary-soft); border-radius: 14px; }
.ai-entry-info { min-width: 0; }
.ai-entry-title { font-size: 13px; font-weight: 700; color: var(--primary); }
.ai-entry-desc { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.ai-head-btn { border: 1px solid var(--primary-border); background: var(--surface); color: var(--primary); font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 980px; cursor: pointer; white-space: nowrap; }
.ai-head-btn:hover { background: var(--primary-soft); }

.ai-chat { display: flex; flex-direction: column; gap: 12px; min-height: 60vh; }
.ai-settings { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.ai-settings-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--surface-2); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); }
.ai-scope { font-size: 11.5px; font-weight: 400; color: var(--primary); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-settings-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; transition: opacity .2s; }
.ai-field { display: flex; flex-direction: column; gap: 6px; }
.ai-field label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 10px; }
.ai-hint { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.ai-msgs { flex: 1; min-height: 260px; max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.ai-msg { max-width: 92%; border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.65; }
.ai-msg.user { align-self: flex-end; background: var(--primary-soft); border: 1px solid var(--primary-border); }
.ai-msg.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.ai-msg-role { font-size: 11px; font-weight: 700; color: var(--text-3); margin-bottom: 4px; }
.ai-msg-text { white-space: pre-wrap; word-break: break-word; }
.ai-sug { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.ai-sug-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.ai-conf { color: var(--primary); font-weight: 500; }
.ai-sug-row { display: grid; grid-template-columns: 1.1fr .8fr 1.4fr; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
.ai-sug-path { font-family: monospace; color: var(--text-2); }
.ai-sug-change { color: #c2410c; font-weight: 600; }
.ai-sug-reason { color: var(--text-3); }
/* AI 一键应用：标红字段 + 提示条 */
.ai-applied { border-color: #ff3b30 !important; background: #fef2f2 !important; color: #c21818 !important; font-weight: 700 !important; box-shadow: 0 0 0 2px rgba(239,68,68,.18); }
.ai-applied-field > label { color: #c21818 !important; font-weight: 700 !important; }
.ai-applied-field > .hint { color: #dc2626 !important; }
.ai-applied-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #fca5a5; background: #fef2f2; border-radius: 8px; }
.ai-applied-title { font-size: 13px; font-weight: 700; color: #c21818; }
.ai-applied-desc { font-size: 11.5px; color: #7f1d1d; flex: 1; min-width: 200px; }
.ai-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-quick-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 11.5px; padding: 5px 9px; border-radius: 14px; cursor: pointer; }
.ai-quick-btn:hover { border-color: var(--primary-border); color: var(--primary); }
.ai-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.ai-input { width: 100%; resize: vertical; font-size: 13px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-family: inherit; }
.ai-foot-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-auto-sel { width: auto; min-width: 110px; padding: 6px 8px; font-size: 12px; }
/* 自动分析按钮：未开启=默认灰边，已开启=绿色实底，一眼可辨 */
.ai-auto-btn { font-weight: 500; }
.ai-auto-btn.on { background: var(--success-soft, #dcfce7); border-color: #86efac; color: #1d7a35; }
.ai-auto-btn.on:hover { background: #bbf7d0; border-color: #4ade80; }

@media (max-width: 900px) {
  /* 登录页：桌面双栏在窄屏会把介绍区挤成竖排单字，改为单列、表单优先可见 */
  .auth-page { padding: 18px 14px; align-items: flex-start; }
  .auth-wrap { flex-direction: column; align-items: stretch; gap: 16px; max-width: 100%; }
  .auth-intro { flex: 0 0 auto; width: 100%; }
  .auth-intro .logo-row { margin-bottom: 10px; }
  .auth-intro h1 { font-size: 22px; }
  .auth-intro h2 { font-size: 15px; margin: 12px 0 6px; }
  .auth-intro p.lead { margin-bottom: 8px; }
  .auth-intro .feature { display: none; }
  .auth-card { width: 100%; flex: 0 0 auto; box-sizing: border-box; padding: 20px 16px; }

  /* 整页禁止横向拖动：超宽内容只允许在下面这些设计好的横滑行内部滚动。
     用 clip 而不是 hidden，避免创建滚动容器导致 topbar / 详情 Tab 的 sticky 失效。 */
  html, body { font-size: 13px; max-width: 100%; overflow-x: clip; }
  .app-shell { max-width: 100%; overflow-x: clip; }
  .menu-btn { display: inline-flex; }

  /* 侧栏抽屉 */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: 232px; height: 100vh;
    transform: translateX(-100%); transition: transform 0.22s ease;
    box-shadow: 0 0 30px rgba(15, 23, 42, 0.25);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask {
    display: block; position: fixed; inset: 0; z-index: 190;
    background: rgba(15, 23, 42, 0.4); opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .brand { padding: 10px 12px; }
  .nav { padding: 6px 6px 16px; }
  .nav-group { margin-top: 6px; }
  .nav-item { padding: 8px 10px; font-size: 13px; }
  .main { width: 100%; }

  /* 顶栏：分行显示，账号信息完整可见，绝不裁切 */
  .topbar {
    height: auto; min-height: 48px; flex: 0 0 auto;
    padding: 7px 10px; gap: 8px; flex-wrap: wrap; overflow: visible;
  }
  .topbar-title { font-size: 14px; white-space: normal; }
  .topbar .pill {
    font-size: 11px; padding: 3px 8px; flex: 0 0 auto;
    white-space: normal; word-break: break-word; max-width: 100%;
  }
  .topbar-spacer { min-width: 8px; }
  .hide-sm { display: none; }

  .content { padding: 8px 10px 24px; }
  .card + .card { margin-top: 8px; }
  .card, .card-body { min-width: 0; max-width: 100%; }
  .card-head { padding: 10px 12px; }
  /* 卡片头窄屏折行：标题独占一行（2026-11-24 修复——右侧按钮组多时标题被挤成一字一行竖排） */
  .card-head { flex-wrap: wrap; gap: 8px; }
  .card-head > div:first-child { flex: 1 1 100%; min-width: 0; }
  .card-head h3 { font-size: 14px; white-space: normal; word-break: keep-all; }
  .card-head .right { margin-left: 0; flex-wrap: wrap; min-width: 0; }
  .card-head .right .refresh-stamp { display: none; }
  .card-body { padding: 10px 12px; }
  .card-body { padding: 10px 12px; }
  .stat { padding: 8px 10px; min-width: 0; }
  /* 账号信息键值列表：长内容换行，不裁切 */
  .kv-list { grid-template-columns: 88px minmax(0, 1fr); }
  .kv-list .k, .kv-list .v { min-width: 0; overflow-wrap: anywhere; }

  /* 横向滑动条：统一细滚动条 + 惯性滚动 */
  .lp-left-list, .lp-head-stats, .lp-func-row, .lp-detail-tabs,
  .lp-ov-metrics, .stat-grid, .table-wrap, .lp-detail-body {
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .lp-left-list::-webkit-scrollbar, .lp-head-stats::-webkit-scrollbar,
  .lp-func-row::-webkit-scrollbar, .lp-detail-tabs::-webkit-scrollbar,
  .lp-ov-metrics::-webkit-scrollbar, .stat-grid::-webkit-scrollbar { height: 4px; }
  .lp-left-list::-webkit-scrollbar-thumb, .lp-head-stats::-webkit-scrollbar-thumb,
  .lp-func-row::-webkit-scrollbar-thumb, .lp-detail-tabs::-webkit-scrollbar-thumb,
  .lp-ov-metrics::-webkit-scrollbar-thumb, .stat-grid::-webkit-scrollbar-thumb {
    background: var(--border-strong); border-radius: 999px;
  }

  /* 直播计划：左列不再整屏纵向铺开，压成一条横向计划卡片
     关键：基础样式是 align-items:flex-start，改成纵向排列后若不覆盖，
     右侧栏会按「内容最宽」撑开（横滑行里的表格/按钮有 500~800px），
     层层传到 html，整页就能被横向拖出大片空白。必须改为 stretch。 */
  .liveplan-wrap {
    flex-direction: column; align-items: stretch; gap: 8px;
    width: 100%; max-width: 100%; min-width: 0;
  }
  .lp-right { width: 100%; max-width: 100%; min-width: 0; }
  .lp-head, .lp-funcs, .lp-detail, .lp-detail-body, .lp-tab-inner, .lp-ov-group, .lp-ov-data, .runtime-banner {
    min-width: 0; max-width: 100%;
  }
  .lp-left {
    flex: 0 0 auto; width: 100%; max-width: 100%;
    position: static; max-height: none;
  }
  .lp-left-head { padding: 8px 12px; }
  .lp-left-head .lp-title { font-size: 14px; }
  .lp-left-filters { flex-direction: row; align-items: center; gap: 6px; padding: 8px 12px; }
  .lp-left-filters > div { flex: 1 1 0; min-width: 0; margin-bottom: 0 !important; }
  .lp-left-filters .row { gap: 6px; }
  .lp-left-filters .row select:last-child { display: none; }
  /* 计划卡片：两列自动分行，不需要左右滑，账号信息完整显示 */
  .lp-left-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px; padding: 8px; overflow: visible;
  }
  .lp-card { width: 100%; min-width: 0; margin-bottom: 0; padding: 8px 10px; }
  .lp-card-name { font-size: 12.5px; margin-bottom: 2px; white-space: normal; word-break: break-word; }
  .lp-card-meta { flex-wrap: wrap; margin-bottom: 4px; font-size: 11px; overflow: visible; gap: 2px 6px; }
  .lp-card-meta > span { white-space: normal; overflow: visible; min-width: 0; word-break: break-word; }
  /* 长计划 ID 在窄卡片里占一行、信息价值低，隐藏以压低卡片高度 */
  .lp-card-meta > span.mono { display: none; }
  .lp-card-tags { flex-wrap: wrap; overflow: visible; }
  .lp-card-tags .tag { font-size: 10.5px; white-space: nowrap; }
.lp-card-switch { margin-left: auto; display: flex; align-items: center; }
.lp-card-switch .switch { transform: scale(0.85); cursor: pointer; }

  /* 右侧头部：标题一行 + 数据列分行（3 个一行，不横滑） */
  .lp-head { flex-direction: column; flex-wrap: nowrap; gap: 8px; padding: 10px 12px; }
  .lp-head-title { font-size: 15px; margin-bottom: 4px; }
  .lp-head-meta { gap: 6px; font-size: 11.5px; flex-wrap: wrap; }
  /* 2026-11-24 三改：原 3 列等分把「直播状态」挤得只剩 1/3 宽，
     「下播 01:45 未开播」被截成「下播 01:45 未:」。改为直播状态独占
     整行、预算与出价ROI 共用第二行（各 1/2 宽），编辑态仍占满整行。 */
  .lp-head-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; overflow: visible; }
  .lp-head-stats .stat { min-width: 0; padding: 5px 8px; }
  .lp-head-stats .stat.lp-live-stat { grid-column: 1 / -1; }
  /* 编辑态（预算/出价ROI）：正在编辑的卡片占满整行；输入框固定宽度 + ✓/✕ 紧随
     其后、整组居中——2026-11-24 二改：上一版把输入框拉满整行导致 ✓✕ 被甩到
     右侧角落、中间大片空白，观感很差；固定宽度整组居中才像正常的行内编辑。 */
  .lp-head-stats .stat:has(.v.editable-stat.editing) { grid-column: 1 / -1; }
  .lp-head-stats .stat .v.editable-stat.editing { justify-content: center; flex-wrap: nowrap; gap: 6px; }
  .lp-head-stats .stat .v.editable-stat.editing input {
    flex: 0 1 150px; width: 150px !important; min-width: 90px; max-width: 46vw;
    font-size: 16px !important; height: 36px; padding: 2px 10px !important;
    text-align: center; -webkit-appearance: none; appearance: none;
  }
  .lp-head-stats .stat .v.editable-stat.editing .mini-ok,
  .lp-head-stats .stat .v.editable-stat.editing .mini-cancel {
    font-size: 17px; padding: 5px 10px; border: 1px solid var(--border-strong);
    border-radius: 8px; background: var(--surface);
  }
  .lp-head-stats .stat .v.editable-stat.editing .mini-ok { color: var(--success); border-color: #bbf7d0; background: #f0fdf4; }
  .lp-head-stats .stat .v.editable-stat.editing .mini-cancel { color: var(--text-3); }
  /* 非编辑态：值 + 「✎ 修改」同行排紧，按钮窄屏收紧 */
  .lp-head-stats .stat.stat-editable .v.editable-stat { flex-wrap: nowrap; justify-content: flex-start; gap: 5px; }
  .lp-head-stats .stat .es-edit { font-size: 11px; padding: 2px 7px; }
  .lp-head-stats .stat .k { font-size: 10.5px; margin-bottom: 2px; }
  .lp-head-stats .stat .v { font-size: 14px; }
  .lp-head-stats .live-chip { font-size: 13px; gap: 5px; }
  .stat-grid .stat .v { font-size: 16px; }

  /* 功能按钮：两列分行，5 个按钮各占一格，最后一个占整行 */
  .lp-funcs { padding: 8px 12px; gap: 6px; }
  .lp-func-caption { display: none; }
  .lp-func-row {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px; overflow: visible;
  }
  .lp-func-btn { width: 100%; min-width: 0; padding: 8px 8px; font-size: 12px; text-align: center; justify-content: center; }
  .lp-func-row .lp-func-btn:last-child { grid-column: span 2; }
  /* 巡检状态条在窄屏占满一行：文案单行省略，不再逐字折行 */
  .lp-func-row .lifecycle-chip { grid-column: 1 / -1; min-width: 0; justify-content: center; }
  .lp-func-row .lifecycle-chip .lifecycle-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

  /* 详情 Tab：两列分行 + 吸顶（top 跟随顶栏实际高度） */
  /* clip 不创建滚动容器，Tab 吸顶仍相对视口；同时兜住表格外溢 */
  .lp-detail { overflow-x: clip; overflow-y: visible; }
  .lp-detail-body { overflow-x: auto; }
  .lp-detail-tabs {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible; position: sticky; top: var(--topbar-h, 48px); z-index: 9;
    background: var(--surface);
  }
  .lp-detail-tab { min-width: 0; padding: 9px 8px; font-size: 12.5px; white-space: normal; text-align: center; }
  .lp-detail-body { padding: 10px 12px; min-width: 0; }

  /* 指标卡 / 统计格：两列分行，数值完整显示 */
  .lp-ov-metrics {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px; overflow: visible;
  }
  .lp-ov-metrics > * { min-width: 0; }
  .metric-card { padding: 9px 11px; gap: 3px; min-width: 0; }
  .metric-label { font-size: 11.5px; }
  .metric-value { font-size: 17px; word-break: break-all; }
  .lp-ov-group { margin-bottom: 10px; }
  .lp-ov-group-title { margin-bottom: 6px; font-size: 12.5px; flex-wrap: wrap; }
  .stat-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px; overflow: visible;
  }
  .stat-grid > * { min-width: 0; }

  /* 表格横向滚动，表头不折行 */
  .table-wrap { overflow-x: auto; max-width: 100%; }
  .table-wrap table { min-width: 560px; }
  .tbl th, .tbl td { white-space: nowrap; }

  /* 通用网格/表单 */
  .grid2, .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .row.gap8 { gap: 6px; }
  .btn, button { touch-action: manipulation; }

  /* 抽屉 / 弹窗占满宽度，内容不再被挤成窄条 */
  .drawer, .drawer.wide { width: 100vw; max-width: 100vw; }
  .drawer-head { padding: 10px 12px; flex-wrap: wrap; align-items: center; }
  /* 第一行：标题 + 圆形关闭；第二行：巡检状态 + 清空按钮，不再让 ✕ 掉到最下面 */
  .drawer-head-title { flex: 1 1 auto; order: 0; min-width: 0; }
  .drawer-close { order: 1; margin-left: auto; }
  .drawer-head-actions { flex: 1 1 100%; order: 2; justify-content: flex-start; gap: 6px; }
  /* 巡检条（2026-11-24）：窄屏下固定单行省略——此处的旧「允许折行」规则会覆盖
     上方 func-row 的 nowrap+ellipsis，导致文案换行把按钮行撑高，已删。 */
  .lifecycle-chip { max-width: 100%; }
  .runtime-banner { padding: 9px 10px; }
  .runtime-banner .rb-next { margin-left: 0; }
  .slider-field { padding: 10px 10px 8px; }
  .ra-scope { font-size: 11.5px; }
  .drawer-body { padding: 10px 12px; overflow-x: hidden; }
  .drawer-foot { padding: 8px 12px; flex-wrap: wrap; }
  .modal, .modal.sm, .modal.lg { width: 96vw; max-width: 96vw; max-height: 92vh; }
  .modal-body { padding: 12px; overflow-x: hidden; }
}

/* ---------------- 管理后台 ---------------- */
.admin-head { margin-bottom: 14px; }
.admin-head h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.01em; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.admin-tab { padding: 9px 16px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.admin-tab:hover { color: var(--primary); }
.admin-body .card { margin-bottom: 12px; }
.admin-tip { font-size: 12.5px; color: var(--text-2); line-height: 1.7; padding: 9px 11px; background: var(--surface-2); border-radius: 10px; margin-bottom: 10px; }
/* 功能权限/条数行：原先是 flex + 无 min-width，中文在窄列里被压成一字一行（竖排）。
   改成三列网格并强制单行省略，宽度不够时才用省略号而不是逐字换行。 */
.admin-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 4px 24px; }
.admin-feature-row {
  display: grid;
  grid-template-columns: minmax(9em, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid #f0f1f3;
  font-size: 13px;
  line-height: 1.5;
}
.admin-feature-row > span:first-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-feature-row > span:nth-child(2) { white-space: nowrap; color: #98a2b3; font-size: 11.5px; }
.admin-feature-row .switch { flex: none; justify-self: end; }
.admin-feature-row .input { width: 92px; justify-self: end; text-align: right; }
.admin-prompt { width: 100%; min-height: 320px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; resize: vertical; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .admin-features { grid-template-columns: 1fr; }
  .admin-tab { padding: 9px 12px; }
  .admin-prompt { min-height: 260px; }
}

@media (max-width: 520px) {
  .content { padding: 6px 8px 20px; }
  .lp-left-list { gap: 6px; padding: 6px; }
  .lp-card { padding: 7px 8px; }
  .metric-card { padding: 8px 10px; }
  .lp-ov-metrics, .stat-grid { gap: 6px; }
  .topbar .pill { font-size: 10.5px; padding: 3px 7px; }
  .grid2, .grid3 { gap: 6px; }
  /* 窄屏下双列表单/滑块改单列，避免文字被挤成竖排 */
  .grid-2 { grid-template-columns: 1fr; }
  /* AI 分析：入口与建议行在窄屏改为纵向，避免文字被挤成竖排 */
  .ai-entry { flex-direction: column; align-items: stretch; }
  .ai-entry .btn { width: 100%; }
  .ai-sug-row { grid-template-columns: 1fr; gap: 2px; }
  .ai-msgs { max-height: 46vh; }
  .ai-head-btn { padding: 4px 7px; font-size: 11px; }
}




/* 可编辑指标（主计划预算 / 出价ROI）：点数值进入编辑，保存需二次确认 */
/* 可编辑指标：铅笔按钮 + 虚线下划线，保证第一眼看出「这里能改」 */
.stat.stat-editable .v.editable-stat {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 1px 6px; margin-left: -6px; border-radius: 6px;
  border-bottom: 1px dashed var(--border-strong);
}
.stat.stat-editable .v.editable-stat:hover { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-soft); }
.stat .v.editable-stat.editing { display: inline-flex; align-items: center; gap: 4px; border-bottom: none; background: transparent; }
.stat .es-edit {
  font-size: 11px; padding: 1px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--primary-border); background: var(--primary-soft); color: var(--primary);
  line-height: 1.5; white-space: nowrap;
}
.stat .es-edit:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.stat .es-edit[disabled] { cursor: not-allowed; opacity: .8; border-color: var(--border-strong); background: #f1f3f6; color: var(--text-2); }
.stat.locked { opacity: .85; }
.stat.locked .v.editable-stat { cursor: not-allowed; border-bottom-color: transparent; }
.mini-ok, .mini-cancel { border: none; background: transparent; cursor: pointer; font-size: 13px; padding: 0 2px; line-height: 1; }
.mini-ok { color: var(--success); }
.mini-cancel { color: var(--text-3); }
.mini-ok:hover { color: #1d7a35; }
.mini-cancel:hover { color: var(--danger); }

/* 自定义确认/输入弹窗（替代系统 confirm/prompt） */
.modal.dialog { width: min(420px, calc(100vw - 32px)); }
.dialog-body { display: flex; flex-direction: column; gap: 12px; }
.dialog-msg { font-size: 13.5px; color: var(--text); line-height: 1.7; }
.dialog-rows {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.dialog-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px; align-items: baseline;
  padding: 8px 12px; font-size: 13px; background: var(--surface);
}
.dialog-row .k { color: var(--text-3); font-size: 12px; }
.dialog-row .v { color: var(--text); font-weight: 600; word-break: break-all; }
.dialog-row.hl { background: var(--primary-soft); }
.dialog-row.hl .v { color: var(--primary); }
.dialog-warn {
  font-size: 12px; line-height: 1.6; color: var(--warning);
  background: var(--warning-soft); border: 1px solid #fde68a;
  border-radius: 8px; padding: 8px 10px;
}
.modal.dialog .modal-foot { gap: 8px; }
.modal.dialog .modal-foot .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.modal.dialog .modal-foot .btn.danger:hover { background: #c21818; border-color: #c21818; }

.dialog-msg { white-space: pre-line; }

/* 头部三个指标卡片：保证「✎ 修改」不会被挤到第二行（仅桌面生效；
   2026-11-24 修复：原先无媒体查询包裹、写在移动端块之后，把移动端的
   min-width:0 覆盖回 108/132px，导致窄屏下预算/出价ROI 编辑框互相叠压） */
@media (min-width: 901px) {
  .lp-head-stats .stat { min-width: 108px; }
  .lp-head-stats .stat.stat-editable { min-width: 132px; }
  .lp-head-stats .stat .v { white-space: nowrap; }
}

/* 空态只剩单张托管卡片时不要撑成两列 */
.mode-grid.single { grid-template-columns: minmax(0, 420px); justify-content: center; }

/* 手动刷新按钮 + 上次刷新时间 */
.refresh-wrap { display: inline-flex; align-items: center; gap: 8px; }
.refresh-stamp { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* 表格单元格内的「数字 + 小铅笔」编辑入口 */
.cell-edit { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.cell-edit-val { white-space: nowrap; }
.cell-edit-btn {
  border: 0; background: transparent; cursor: pointer; padding: 0 2px;
  font-size: 12px; line-height: 1; color: var(--text-3); opacity: 0; transition: opacity .12s;
}
tr:hover .cell-edit-btn, .cell-edit-btn:focus-visible { opacity: 1; }
.cell-edit-btn:hover { color: var(--brand, #0071e3); }

/* 窄面板里的图标式刷新按钮：只留 ⟳，时间戳走悬浮提示 */
.refresh-wrap.compact { gap: 0; }
.refresh-icon { padding: 2px 7px !important; font-size: 14px !important; line-height: 1.2; }
/* 标题优先保证可见，按钮不被压缩 */
.lp-head-top .lp-title { flex: 1 1 auto; min-width: 0; }
.lp-head-actions { flex: 0 0 auto; }
