/* ==========================================================================
   design-v6.css — 主题系统（浅色 / 深色 / 跟随系统）+ 视觉对齐
   顺序：在 app.css / design-v4 / design-v5 之后加载
   原则：只覆盖变量与少量硬编码，不改动布局结构
   ========================================================================== */

/* ---------- 1. 视觉对齐：圆角、阴影、字号、留白 ---------- */
:root{
  --radius:18px;   --radius-sm:12px;
  --ds-radius:18px; --ds-radius-sm:12px;
  --shadow:0 1px 2px rgba(16,40,72,.035);
  --shadow-lg:0 24px 60px rgba(16,40,72,.14);
  --ds-shadow:0 1px 2px rgba(16,40,72,.03);
}
.page-head{margin-bottom:24px}
.page-head h1{font-size:27px;letter-spacing:-.045em}
.content{padding:30px 34px 64px}
.topbar{background:rgba(255,255,255,.78)}
.stat-card,.panel,.lead-card,.project-card,.assign-card,.group-card,.remind-item,.agent-item{border-radius:18px}
.btn{border-radius:10px}
.btn-primary{box-shadow:0 2px 10px rgba(14,112,211,.18)}
.nav-item{border-radius:10px}

/* 主题切换菜单 */
.theme-switch{position:relative}
.theme-menu{position:absolute;right:0;top:42px;width:152px;background:var(--card);border:1px solid var(--border);
  border-radius:14px;padding:6px;box-shadow:var(--shadow-lg);z-index:60}
.theme-menu button{display:flex;width:100%;align-items:center;gap:8px;padding:9px 10px;border-radius:9px;
  font-size:13px;color:var(--text-2);background:transparent;border:0;cursor:pointer;text-align:left}
.theme-menu button:hover{background:var(--primary-light);color:var(--primary)}
.theme-menu button.active{color:var(--primary);font-weight:600}
.theme-menu .tick{margin-left:auto;font-size:12px}
.theme-menu .labels{padding:4px 10px 6px;font-size:11px;color:var(--muted)}

/* 切换时不闪 */
body,.sidebar,.topbar,.panel,.stat-card,.nav-item{transition:background-color .18s ease,color .18s ease,border-color .18s ease}

/* ---------- 2. 深色主题 ---------- */
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0F1620; --card:#182230;
  --text:#F1F5FA; --text-2:#B4C2D3; --muted:#8C9DB2; --border:#2B3748;
  --primary:#5AA6FF; --primary-d:#3F8FE0; --primary-light:#1D3552; --accent:#7BC0FF;
  --danger:#FF756C; --warning:#F0B354; --success:#3FCB9A;
  --shadow:0 1px 2px rgba(0,0,0,.32);
  --shadow-lg:0 24px 60px rgba(0,0,0,.5);
  --ds-bg:#0F1620; --ds-surface:#182230; --ds-ink:#F1F5FA; --ds-ink-2:#B4C2D3;
  --ds-muted:#8C9DB2; --ds-line:#2B3748; --ds-line-strong:#3A4A5F;
  --ds-primary:#5AA6FF; --ds-primary-soft:#1D3552;
  --ds-shadow:0 1px 2px rgba(0,0,0,.32);
  --fg-ink:#E9F0F9; --fg-muted:#9AACC0; --fg-line:#2B3748; --fg-light:#1B2B3E;
  --fg-brand:#5AA6FF; --fg-shadow:0 4px 16px rgba(0,0,0,.28);
}
html[data-theme="dark"] body{background:#0F1620;color:#F1F5FA}
html[data-theme="dark"] .login-wrap{background:radial-gradient(circle at 28% 18%,#1B2C42 0,#0F1620 58%,#0B1017 100%)}
html[data-theme="dark"] .login-card{box-shadow:0 30px 70px rgba(0,0,0,.55);border:1px solid #22303F}
html[data-theme="dark"] .sidebar{background:#141E2B;border-right-color:#2B3748}
html[data-theme="dark"] .brand{border-bottom-color:#2B3748}
html[data-theme="dark"] .topbar{background:rgba(15,22,32,.84);border-bottom-color:#2B3748}
html[data-theme="dark"] .nav-item{color:#B4C2D3}
html[data-theme="dark"] .nav-item:hover{background:#1E2C3E;color:#8CC4FF}
html[data-theme="dark"] .nav-item.active{background:#1D3552;color:#9CCBFF}
html[data-theme="dark"] .nav-item.active::after{background:#5AA6FF}
html[data-theme="dark"] .sidebar-foot{border-top-color:#2B3748}
html[data-theme="dark"] .sidebar-foot .btn-ghost{border-color:#2B3748;color:#B4C2D3}
html[data-theme="dark"] .sidebar-foot .btn-ghost:hover{background:#1E2C3E}

html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .lead-card,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .assign-card,
html[data-theme="dark"] .group-card,
html[data-theme="dark"] .remind-item,
html[data-theme="dark"] .agent-item,
html[data-theme="dark"] .ag-card,
html[data-theme="dark"] .ag-panel,
html[data-theme="dark"] .ag-entry,
html[data-theme="dark"] .metric{background:#182230;border-color:#2B3748}

html[data-theme="dark"] .btn,
html[data-theme="dark"] .pause-btn,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .filter-bar select,
html[data-theme="dark"] .assign-action select,
html[data-theme="dark"] .setting-field input,
html[data-theme="dark"] .setting-field select{background:#1B2635;border-color:#34455B;color:#E4EDF7}
html[data-theme="dark"] .btn-primary{background:#2E7BD6;border-color:#2E7BD6;color:#fff}
html[data-theme="dark"] .btn-primary:hover{background:#3A8AE8}
/* v5 用 :not() 给次级按钮写了硬编码白底，优先级高于单类，需同等权重覆盖 */
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger){background:#1B2635;border-color:#3A4C63;color:#DCE7F4}
html[data-theme="dark"] .btn:hover:not(.btn-primary):not(.btn-danger){background:#243349;border-color:#4E7FB5;color:#8CC4FF}
html[data-theme="dark"] .sidebar-foot .btn:not(.btn-primary):not(.btn-danger){background:transparent;border-color:#3A4C63}

html[data-theme="dark"] table th{background:#1C2838;color:#A9BACC;border-color:#2B3748}
html[data-theme="dark"] table td{border-color:#2B3748;color:#DCE7F4}
html[data-theme="dark"] tbody tr:hover{background:#202D3E}
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .login-card{background:#182230}
html[data-theme="dark"] .toast{background:#E8EFF8;color:#152238}

/* 浅色语义底在深色下压暗，避免刺眼 */
html[data-theme="dark"] .tag{background:#22304A;color:#A9C7E8;border-color:#33475F}
html[data-theme="dark"] .tag.green,
html[data-theme="dark"] .tag.won{background:#173328;color:#63D4A8;border-color:#245040}
html[data-theme="dark"] .tier-1{background:#3A2226;color:#FF9C94}
html[data-theme="dark"] .tier-2,
html[data-theme="dark"] .pool-chip-warn,
html[data-theme="dark"] .adjust-chip{background:#3A2E1B;color:#F0B354}
html[data-theme="dark"] .ag-confirm{background:#33291A;border-color:#5C4622}
html[data-theme="dark"] .shot-status.st-queued,
html[data-theme="dark"] .shot-status.st-image_queued,
html[data-theme="dark"] .shot-status.st-processing{background:#3A2E1B;color:#F0B354}

/* 滚动条 */
html[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#33445A}
html[data-theme="dark"] ::-webkit-scrollbar-track{background:#131C28}

/* 浅色下也统一滚动条 */
::-webkit-scrollbar-thumb{background:#D2DBE8;border-radius:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar{width:8px;height:8px}

/* 深色：审批/警示卡（原浅色黄底在深色下发灰绿，改为琥珀描边 + 提亮正文） */
html[data-theme="dark"] .ops-appr{background:rgba(201,138,43,.10);border-color:rgba(201,138,43,.5)}
html[data-theme="dark"] .ops-appr .p{color:#F3E6CB}
html[data-theme="dark"] .ops-appr .d{color:#A9B8CA}

/* 窄屏：页头标题与说明改为上下两行，避免标题被挤成两行、说明挤在右侧 */
@media(max-width:767px){
  .page-head{flex-direction:column;align-items:flex-start;gap:4px}
  .page-head p,.page-head .muted{margin-top:2px}
}

/* 深色：列表里的浅色徽标与摘要块（原浅底在深色卡片上像贴纸，文字对比也不够） */
html[data-theme="dark"] .lead-summary{background:rgba(46,123,214,.10);color:#B9C9DB;border-left-color:#3A8AE8}
html[data-theme="dark"] .status-badge,html[data-theme="dark"] .tier-badge,
html[data-theme="dark"] .role-tag,html[data-theme="dark"] .tag{background:rgba(255,255,255,.07);color:#B9C9DB}
html[data-theme="dark"] .st-following{background:rgba(5,150,105,.18);color:#4ADE9B}
html[data-theme="dark"] .st-intent{background:rgba(180,83,9,.22);color:#F0BE72}
html[data-theme="dark"] .st-quoted{background:rgba(217,74,74,.18);color:#F0928F}
html[data-theme="dark"] .st-won{background:rgba(4,120,87,.22);color:#5EDBB0}
html[data-theme="dark"] .st-lost,html[data-theme="dark"] .st-expired{background:rgba(148,163,184,.14);color:#A9B8CA}
html[data-theme="dark"] .st-new,html[data-theme="dark"] .st-pending,html[data-theme="dark"] .st-assigned{background:rgba(46,123,214,.16);color:#8FC2F5}
html[data-theme="dark"] .tier-badge.tier-1{background:rgba(217,74,74,.16);color:#F0928F}
html[data-theme="dark"] .tier-badge.tier-2{background:rgba(201,138,43,.18);color:#E7B96A}
html[data-theme="dark"] .tier-badge.tier-3{background:rgba(46,123,214,.16);color:#8FC2F5}
html[data-theme="dark"] .tier-badge.tier-4{background:rgba(255,255,255,.08);color:#A9B8CA}
html[data-theme="dark"] .plat-小红书{background:rgba(217,60,91,.16);color:#F58DA6;border-color:rgba(217,60,91,.35)}
html[data-theme="dark"] .plat-抖音{background:rgba(148,163,184,.14);color:#C6D4E4;border-color:rgba(148,163,184,.28)}

/* ---------- 深色：全站浅底容器（GEO / 推文 / 视频 / 表格 / 提醒） ---------- */
html[data-theme="dark"] .section-card,
html[data-theme="dark"] .geo-side,
html[data-theme="dark"] .gw-card,
html[data-theme="dark"] .gw-stat,
html[data-theme="dark"] .metric-wide,
html[data-theme="dark"] .quote-box,
html[data-theme="dark"] .clip-item,
html[data-theme="dark"] .video-flow,
html[data-theme="dark"] .ex-layout,
html[data-theme="dark"] .reminders>button,
html[data-theme="dark"] .quick-link,
html[data-theme="dark"] .dispatch-preview{background:var(--card);border-color:var(--border);color:var(--text)}
html[data-theme="dark"] .clip-item:hover,
html[data-theme="dark"] .quick-link:hover,
html[data-theme="dark"] .video-flow .current{background:#1F2C3D;border-color:#35506F}
html[data-theme="dark"] .soon-date{background:#1C2838;border-color:#2B3C52;color:#DCE6F2}
html[data-theme="dark"] .soon-item:hover .soon-date{background:var(--primary);border-color:var(--primary);color:#fff}

/* 表格：th 底、td 字色、行悬停都要换，否则深色卡片上是一块灰底深字 */
html[data-theme="dark"] .tbl th{background:#1B2637;color:#9FB0C4;border-bottom-color:#2B3748}
html[data-theme="dark"] .tbl td{color:#C3D1E1;border-bottom-color:#25313F}
html[data-theme="dark"] .tbl td b{color:#EAF1F9}
html[data-theme="dark"] .tbl tbody tr:hover{background:#1F2B3B}

/* ---------- 深色：语义色块（琥珀 / 红 / 绿 / 紫 / 粉） ---------- */
html[data-theme="dark"] .a-warn,
html[data-theme="dark"] .g-mid,
html[data-theme="dark"] .score-low,
html[data-theme="dark"] .ps-warn,
html[data-theme="dark"] .gw-due,
html[data-theme="dark"] .ql-star,
html[data-theme="dark"] .rank-no-0,
html[data-theme="dark"] .tag.hot,
html[data-theme="dark"] .tag.st-intent{background:rgba(201,138,43,.16);color:#E7B96A;border-color:rgba(201,138,43,.36)}
html[data-theme="dark"] .a-fail,
html[data-theme="dark"] .g-bad,
html[data-theme="dark"] .err-msg,
html[data-theme="dark"] .ql-bell,
html[data-theme="dark"] .our-lost,
html[data-theme="dark"] .soon-days.urgent{background:rgba(217,74,74,.16);color:#F0928F;border-color:rgba(217,74,74,.34)}
html[data-theme="dark"] .soon-days{background:rgba(14,140,104,.18);color:#5EDBB0}
html[data-theme="dark"] .soon-days.done{background:rgba(148,163,184,.14);color:#A9B8CA}
html[data-theme="dark"] .st-watch{background:rgba(124,58,237,.18);color:#BFA2F5}
html[data-theme="dark"] .rank-no-2{background:rgba(190,24,93,.16);color:#F08FB6}
html[data-theme="dark"] .xh-cover,
html[data-theme="dark"] .xh-cover-ph{background:#1C2838;border-color:#2B3C52;color:#8C9DB2}

/* 角色标签四色 */
html[data-theme="dark"] .role-tag.role-admin,
html[data-theme="dark"] .role-tag.role-director{background:rgba(217,74,74,.16);color:#F0928F}
html[data-theme="dark"] .role-tag.role-manager{background:rgba(201,138,43,.16);color:#E7B96A}
html[data-theme="dark"] .role-tag.role-sales{background:rgba(255,255,255,.07);color:#B9C9DB}

/* 深色：最后几个漏网的浅底（通用 .card / 批量状态 / 快捷按钮 / 危险按钮悬停） */
html[data-theme="dark"] .card,
html[data-theme="dark"] .batch-state.bs-cancelled,
html[data-theme="dark"] .batch-state.bs-failed{background:var(--card);border-color:var(--border);color:var(--text)}
html[data-theme="dark"] .batch-state.bs-failed{background:rgba(217,74,74,.14);color:#F0928F}
html[data-theme="dark"] .ex-quick-btn.act:hover{background:#1F2C3D;border-color:#35506F}
html[data-theme="dark"] .btn-danger:hover{background:#B93E3E;border-color:#B93E3E;color:#fff}

/* ---------- 能力标签（账号管理：一人可挂多个能力） ---------- */
.ab-cell{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.ab-cell .tag{font-size:11px;padding:2px 6px;white-space:nowrap}
.ab-more{opacity:.7}
.ab-edit{margin-left:2px;padding:1px 7px;font-size:11px}
.ab-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:4px;max-height:44vh;overflow-y:auto}
.ab-item{display:flex;align-items:center;gap:7px;padding:7px 9px;border:1px solid var(--border);
  border-radius:8px;cursor:pointer;font-size:13px;background:var(--card);transition:background .12s,border-color .12s}
.ab-item:hover{border-color:var(--primary)}
.ab-item.on{background:var(--ds-primary-soft,#eef4fd);border-color:var(--primary)}
.ab-item input{accent-color:var(--primary);margin:0;cursor:pointer}
.ab-name{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ab-key{font-size:10.5px;color:var(--muted);font-family:var(--fg-num,inherit)}
html[data-theme="dark"] .ab-item.on{background:rgba(46,123,214,.16)}
@media(max-width:520px){.ab-grid{grid-template-columns:1fr}}
