/* === main.css === */
/**
 * Converge v2.0 — Main Stylesheet
 * Affiliate & Ad-Tracking Dashboard · Navy+Electric Blue · Inter system font
 * Design language: trust (navy), data clarity (tabular numbers), profit focus (emerald)
 */

/* ═══════════════════════════════════════
   CSS Variables — Converge Affiliate Palette
   ═══════════════════════════════════════ */

:root {
    /* Brand — Navy authority + Electric Blue action */

    /* Surfaces — Cool slate for data contrast */

    /* Financial data — explicit profit/loss colors */

    /* Spacing → 统一 --space-* (design-tokens.css 单一源, 2026-09-02): xs=1 sm=2 md=4 lg=6 xl=8 2xl=12 */

    /* Typography — system font stack (zero latency, native rendering) */

    /* Modular type scale (1.25 ratio — minor third) */

    /* Keep old tokens for backward compatibility */

    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;

    /* Shadows */

    /* Transitions */
}

/* ═══════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Inter', var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
}

/* ── Financial data alignment ── */
.stat-card .value, td.numeric, [data-type="currency"], [data-type="percentage"] {
    font-variant-numeric: tabular-nums;
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-light); }

/* ── Headings: responsive fluid scale ── */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-4);
}
h1 { font-size: clamp(1.5rem, 3vw, var(--text-4xl)); letter-spacing: var(--tracking-tight); }
h2 { font-size: clamp(1.25rem, 2.5vw, var(--text-3xl)); }
h3 { font-size: clamp(1.125rem, 2vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* ── Text measure: optimal line length for readability (60-75 chars) ── */
p, .prose, .page-description {
    max-width: 72ch;
}

/* ── Code: inline + block ── */
code, kbd, samp {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-bg-alt);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
}
pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: var(--line-height-relaxed);
    background: var(--color-sidebar);
    color: var(--color-sidebar-text);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
    max-width: 100%;
}
pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: inherit;
}

/* ── Small / caption ── */
small, .text-small, .caption {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    line-height: var(--line-height-normal);
}

/* ── Strong / emphasis hierarchy ── */
strong { font-weight: var(--font-weight-semibold); }
.text-profit { color: var(--color-profit); font-weight: var(--font-weight-semibold); }
.text-loss   { color: var(--color-loss); font-weight: var(--font-weight-semibold); }

/* ═══════════════════════════════════════
   Sidebar — Dark & Professional
   ═══════════════════════════════════════ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    color: var(--color-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════
   Content
   ═══════════════════════════════════════ */
.page-title {
    font-size: var(--font-size-2xl); color: var(--color-text);
    font-weight: 700; margin-bottom: var(--space-1); letter-spacing: -0.01em;
}

.page-description { color: var(--color-text-secondary); font-size: var(--font-size-base); }

/* ═══════════════════════════════════════
   Cards
   ═══════════════════════════════════════ */






/* Stat Card — Dashboard KPI */

.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.stat-card-label {
    font-size: var(--font-size-xs); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--color-text-muted); margin-bottom: var(--space-1);
}

.stat-card-value {
    font-size:var(--text-3xl); font-weight: 700; color: var(--color-text);
    letter-spacing: -0.02em; line-height: 1.2;
}

.stat-card-change {
    font-size: var(--font-size-xs); margin-top: var(--space-1);
    display: flex; align-items: center; gap:var(--space-1);
}

.stat-card-change.up { color: var(--color-success); }
.stat-card-change.down { color: var(--color-error); }

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* ═══════════════════════════════════════
   Buttons
   ═══════════════════════════════════════ */



/* ═══════════════════════════════════════
   Tables
   ═══════════════════════════════════════ */

.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--color-border); }

.table { width: 100%; border-collapse: collapse; background: var(--color-white); }

.table thead { background: var(--color-bg-alt); }

.table th {
    padding: var(--space-2-5) var(--space-4); text-align: left;
    font-weight: 600; font-size: var(--font-size-xs);
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--color-text-secondary); border-bottom: 2px solid var(--color-border);
}

.table td {
    padding: var(--space-2-5) var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
}

.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--color-bg); }
.table tbody tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════
   Forms
   ═══════════════════════════════════════ */



.form-control {
    width: 100%; padding:var(--space-2) var(--space-3);
    font-size: var(--font-size-sm); font-family: var(--font-family);
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: var(--color-white); color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none; border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-control::placeholder { color: var(--color-text-muted); }

select.form-control { cursor: pointer; }

/* ═══════════════════════════════════════
   Badges
   ═══════════════════════════════════════ */



/* ═══════════════════════════════════════
   Alerts & Notifications
   ═══════════════════════════════════════ */

.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md); margin-bottom: var(--space-4);
    font-size: var(--font-size-sm); border: 1px solid transparent;
}

.alert-success { background: var(--color-success-bg); border-color: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--color-warning-bg); border-color: var(--warning-soft); color: var(--warning); }
.alert-error   { background: var(--color-error-bg); border-color: var(--danger-soft); color: var(--danger); }
.alert-info    { background: var(--color-info-bg); border-color: var(--info-soft); color: var(--accent-emphasis); }

/* ═══════════════════════════════════════
   Utility
   ═══════════════════════════════════════ */

.text-muted  { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error   { color: var(--color-error); }
.text-info    { color: var(--color-info); }

.flex-between { display: flex; justify-content: space-between; align-items: center; }


/* ═══════════════════════════════════════
   Health Check Indicator (new: /health)
   ═══════════════════════════════════════ */

.health-dot.ok { background: var(--color-success); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.health-dot.degraded { background: var(--color-warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.health-dot.down { background: var(--color-error); box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }

/* ═══════════════════════════════════════
   Responsive
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 200ms ease; }
    .sidebar.open { transform: translateX(0); }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* ═══ 响应式显隐切换: 桌面表格 ⇄ 移动卡片 ═══
   多页(offers/campaigns/visitors/billing/networks/settings/traffic-sources/landing-pages)
   的HTML已含 .desktop-only 表格 + .mobile-only 卡片, 此前缺全局开关导致手机端两者同显+宽表溢出。 */
.mobile-only { display: none; }
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only  { display: block !important; }
}

/* === dock-layout.css === */
/* ═══ Activity Bar + 可折叠侧面板 ═══
   VS Code 风格: 56px Dock → 220px Panel (toggle)
   Ctrl+B 全局快捷 · localStorage 持久化 · aria-expanded
   参考: orchestra#920 · ALF Design Group 2026 UX 指南 */

/* ── Activity Bar (56px 固定) ── */
nav.activity-bar {
    position: fixed !important; top: 0 !important; left: 0 !important; bottom: 0 !important;
    width: 64px !important; min-width: 64px !important;
    display: flex !important; flex-direction: column !important; align-items: center !important;
    gap: var(--space-0-5);
    padding:var(--space-3) 0;
    background: #0A1628 !important;
    z-index: 101 !important;
    overflow-y: auto;
}
.activity-bar-brand {
    width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
    color: var(--accent); margin-bottom: var(--space-1); flex-shrink: 0;
}
.activity-bar-item {
    width: 64px !important; height: 64px !important; display: flex !important; align-items: center !important; justify-content: center !important;
    background: none !important; border: none !important; border-left: 3px solid transparent !important;
    color: #ffffff !important; cursor: pointer !important; font-size: 22px !important;
    transition: all .15s; position: relative; border-radius: var(--radius-sm);
}
.activity-bar-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.activity-bar-item.active { color: var(--accent); border-left-color: var(--accent); }
.activity-bar-icon { display: flex; align-items: center; justify-content: center; }
.activity-bar-spacer { flex: 1; }

/* App main — wrapper for topbar + content */

/* Sidebar panel — 旧 dock 侧面板已废弃（.sidebar-panel/.sidebar-tree-* 零消费，见 .sidebar-panel-group） */
/* Logo */
.activity-logo {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-bottom:var(--space-4); border-radius: 10px;
    transition: background 0.15s;
}
.activity-logo:hover { background: rgba(255,255,255,0.08); }
.activity-logo img { width: 28px; height: 28px; }

/* Dock 按钮 */
.activity-buttons {
    flex: 1; display: flex; flex-direction: column; gap: var(--space-0-5);
    width: 100%; padding: 0 var(--space-1-5);
}
.dock-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 0; border: none; border-radius: var(--radius-md);
    background: transparent; color: rgba(255,255,255,0.6);
    cursor: pointer; font-size:var(--text-xs); font-family: inherit;
    transition: all 0.12s ease; width: 100%;
    position: relative;
}
.dock-btn::before {
    content: ''; position: absolute; left: -6px; top: 6px; bottom: 6px;
    width: 2px; border-radius: 0 2px 2px 0;
    background: transparent; transition: background 0.12s;
}
.dock-btn:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.06); }
.dock-btn.active {
    color: var(--surface-raised); background: rgba(37,99,235,0.3); font-weight: 600;
}
.dock-btn.active::before { background: var(--accent-emphasis); }
.dock-btn-icon { font-size:var(--text-xl); line-height: 1; }
.dock-btn-label { white-space: nowrap; font-weight: 500; }

/* Quick Create ＋ */
.activity-quick {
    position: relative; margin:var(--space-2) 0;
}
.quick-create-trigger {
    width: 40px; height: 40px; border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 10px; background: transparent; color: rgba(255,255,255,0.5);
    font-size:var(--text-xl); cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.quick-create-trigger:hover {
    border-color: var(--accent-emphasis); color: var(--surface-raised); background: #2563EB;
}
.quick-create-dropdown {
    position: absolute; left: calc(100% + 8px); bottom: 0;
    background: var(--surface-raised); border: 1px solid var(--border-default); border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    min-width: 200px; z-index: 999; padding: var(--space-1-5) 0;
}
.quick-create-dropdown[hidden] { display: none; }
.quick-create-item {
    display: flex; align-items: center; gap: var(--space-2-5);
    padding: 9px var(--space-4); text-decoration: none;
    color: var(--content-primary); font-size:var(--text-sm);
}
.quick-create-item:hover { background: var(--surface-overlay); }

/* Footer */
.activity-footer {
    display: flex; flex-direction: column; align-items: center; gap: var(--space-1-5);
    margin-top: auto;
}
.activity-health { cursor: pointer; }
.health-dot.ok   { background: #22C55E; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.health-dot.warn { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.4); animation: pulse 2s infinite; }
.health-dot.error{ background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.4); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.activity-version {
    font-size: 9px; color: rgba(255,255,255,0.50); font-weight: 500;
}

/* ════════════════════════════════════
   ── 侧面板 (230px, 从 dock 右侧滑入) ──
   可读性方案: 浅色背景 + 高对比文字 (VS Code/GitHub 验证)
   旧方案 #111C2E + rgba(255,255,255,0.75) → 用户反馈"看不清"
   新方案 实体色文字 + 14px 字号 + 图标全不透明
   ════════════════════════════════════ */
/* Old dock panel — deprecated, kept for backward compat */
.side-panel {
    display: none;
}
.panel-section[hidden] { display: none; }
.panel-section { display: flex; flex-direction: column; height: 100%; }


.panel-nav {
    flex: 1; padding: var(--space-1-5) 0; overflow-y: auto;
}

.panel-link {
    display: flex; align-items: center; gap:var(--space-3);
    margin: 0 var(--space-2); padding: 9px var(--space-3); border-radius: var(--radius-md);
    color: var(--content-secondary, #374151); font-size:var(--text-sm); font-weight: 500;
    text-decoration: none;
    transition: all 0.12s ease;
}
.panel-link:hover {
    background: rgba(0,0,0,0.05); color: var(--content-primary, #111827);
}
.panel-link[aria-current="page"] {
    background: rgba(37,99,235,0.10); color: #1D4ED8; font-weight: 600;
}
.panel-link-icon { font-size:var(--text-base); width: 22px; text-align: center; flex-shrink: 0; }
.panel-link[aria-current="page"] .panel-link-icon { opacity: 1; }

/* ── 主内容区 ── */

/* ── Navbar ── */
.navbar-dock { display: flex; align-items: center; gap: var(--space-4); }

/* ── Global Search ── */
.search-input:focus {
    border-color: var(--accent-emphasis); background: var(--surface-raised);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.search-input::placeholder { color: var(--border-strong); }
.search-results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--surface-raised); border: 1px solid var(--border-default); border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12);
    max-height: 320px; overflow-y: auto; z-index: 998;
}
.search-result-item:hover { background: var(--surface-overlay); }
.search-empty { padding:var(--space-4); text-align: center; color: var(--border-strong); font-size:var(--text-sm); }

/* ── 隐藏旧 tab 栏 ── */
.dock-tabs { display: none; }

/* ── 响应式 ── */
@media (max-width: 768px) {
    .activity-bar { flex: 0 0 52px; width: 52px; }
    .activity-bar-item { width: 52px; height: 52px; font-size: var(--text-xl); }
}

/* === intent-ui.css === */
/* ═══ P1 Intent UI Components — PRD R1-R5 ═══ */
/* Task Shell (首页卡片壳) + Task Workbench (任务工作台) */

/* ── Task Shell: 首页容器 ── */
.task-shell {
    padding: var(--space-8) var(--space-12);
    max-width: 960px;
    margin: 0 auto;
}

.task-shell-header {
    margin-bottom: var(--space-8);
    text-align: center;
}

.task-shell-greeting {
    font-size:var(--text-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-1);
}

.task-shell-subtitle {
    font-size:var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.task-shell-hint {
    text-align: center;
    font-size:var(--text-xs);
    color: var(--color-text-secondary);
    margin-top: var(--space-6);
}

.task-shell-skill {
    text-align: center;
    font-size:var(--text-xs);
    color: var(--color-text-disabled);
    margin-top: var(--space-2);
}

.task-shell--empty {
    display: flex;
    justify-content: center;
    padding: var(--space-16) var(--space-6);
}

/* ── Task Cards Grid ── */
.task-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

/* ── Individual Task Card ── */
.task-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--color-surface-card, var(--surface-raised));
    border: 1px solid var(--color-border-default, #E5E7EB);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.task-card:hover {
    border-color: var(--color-brand-primary, #2563EB);
    box-shadow: 0 4px 16px rgba(37,99,235,0.08);
    transform: translateY(-1px);
}

.task-card--primary {
    border-color: var(--color-brand-primary, #2563EB);
    border-width: 2px;
    background: linear-gradient(135deg, rgba(37,99,235,0.03), rgba(37,99,235,0.01));
}

.task-card--L3 {
    border-left: 3px solid var(--color-feedback-success, #22C55E);
}

.task-card--L2 {
    border-left: 3px solid var(--color-feedback-warning, #F59E0B);
}

.task-card--L1 {
    border-left: 3px solid var(--color-feedback-info, #3B82F6);
}

.task-card-icon {
    font-size:var(--text-3xl);
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-page, #F9FAFB);
    border-radius: 10px;
}

.task-card-body {
    flex: 1;
    min-width: 0;
}

.task-card-label {
    display: block;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
}

.task-card-desc {
    display: block;
    font-size:var(--text-xs);
    color: var(--color-text-secondary);
    margin-top:var(--space-1);
}

.task-card-confidence {
    display: inline-block;
    font-size:var(--text-xs);
    font-weight: 600;
    padding: var(--space-0-5) var(--space-1-5);
    border-radius: var(--radius-sm);
    margin-top:var(--space-1);
}

.confidence-green { background: var(--success-soft); color: var(--success); }
.confidence-yellow { background: var(--warning-soft); color: var(--warning); }
.confidence-gray { background: var(--bg-overlay); color: var(--text-secondary); }

.task-card-arrow {
    font-size:var(--text-lg);
    color: var(--color-text-disabled);
    flex-shrink: 0;
    align-self: center;
    transition: transform 0.2s;
}

.task-card:hover .task-card-arrow {
    transform: translateX(4px);
    color: var(--color-brand-primary);
}

/* ── Correction Button ── */
.task-card-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(0,0,0,0.05);
    color: var(--color-text-disabled);
    font-size:var(--text-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.task-card:hover .task-card-dismiss {
    opacity: 1;
}

.task-card-dismiss:hover {
    background: rgba(239,68,68,0.1);
    color: var(--color-feedback-error);
}

/* ═══ Task Workbench ═══ */

.task-workbench {
    padding: var(--space-6);
    max-width: 960px;
    margin: 0 auto;
}

.task-workbench-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.task-status {
    padding: var(--space-0-5) var(--space-2-5);
    border-radius: var(--radius-lg);
    font-size:var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.task-status--healthy { background: var(--success-soft); color: var(--success); }
.task-status--paused { background: var(--warning-soft); color: var(--warning); }
.task-status--archived { background: var(--bg-overlay); color: var(--text-secondary); }
.task-status--unknown { background: var(--bg-overlay); color: var(--text-secondary); }

.task-workbench-title {
    margin: 0;
    font-size:var(--text-xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

/* ── Workbench Grid ── */
.task-workbench-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* ── Workbench Panel ── */
.tw-panel {
    background: var(--color-surface-card, var(--surface-raised));
    border: 1px solid var(--color-border-default, #E5E7EB);
    border-radius: 10px;
    padding: var(--space-4);
}

.tw-panel-title {
    font-size:var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tw-panel-desc {
    font-size:var(--text-sm);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2);
}

/* ── Metric ── */
.tw-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-1) 0;
    border-bottom: 1px solid var(--color-border-default);
}

.tw-metric:last-child { border-bottom: none; }

.tw-metric-label {
    font-size:var(--text-xs);
    color: var(--color-text-secondary);
}

.tw-metric-value {
    font-size:var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ── Evidence Chain ── */
.tw-evidence-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    font-size:var(--text-sm);
}

.tw-evidence-cause { color: var(--color-text-secondary); }
.tw-evidence-arrow { color: var(--color-brand-primary); font-weight: 700; }
.tw-evidence-effect { color: var(--color-text-primary); flex: 1; }

/* ── Checkpoints ── */
.tw-checkpoint {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    font-size:var(--text-sm);
}

.tw-checkpoint-icon { font-size:var(--text-sm); }
.tw-checkpoint-label { color: var(--color-text-primary); flex: 1; }
.tw-checkpoint-note { color: var(--color-text-secondary); font-size:var(--text-xs); }

/* ── Risks ── */
.tw-risk {
    padding: var(--space-2);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-1);
    font-size:var(--text-sm);
}

.risk--high { background: var(--danger-soft); border-left: 3px solid var(--danger); }
.risk--medium { background: var(--warning-soft); border-left: 3px solid var(--warning); }
.risk--low { background: var(--bg-overlay); border-left: 3px solid var(--text-tertiary); }

.tw-risk-desc {
    display: block;
    color: var(--color-text-primary);
    font-weight: 500;
}

.tw-risk-mitigation {
    display: block;
    color: var(--color-text-secondary);
    font-size:var(--text-xs);
    margin-top: var(--space-0-5);
}

/* ── Deliverables ── */
.tw-deliverables {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    background: var(--color-surface-card, var(--surface-raised));
    border: 1px solid var(--color-border-default, #E5E7EB);
    border-radius: 10px;
}

.tw-deliverable {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    background: var(--color-surface-page, #F9FAFB);
    text-decoration: none;
    color: var(--color-text-primary);
    font-size:var(--text-sm);
    transition: background 0.15s;
}

.tw-deliverable:hover { background: var(--accent-soft); }

.tw-deliverable-name { font-weight: 500; }

/* ── Progress Bar ── */
.tw-progress {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
}

.tw-progress-bar {
    height: 6px;
    background: var(--color-brand-primary, #2563EB);
    border-radius: 3px;
    transition: width 0.5s ease;
    flex: 1;
}

.tw-progress-label {
    font-size:var(--text-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .task-shell { padding: var(--space-4); }
    .task-cards { grid-template-columns: 1fr; }
    .task-workbench-grid { grid-template-columns: 1fr; }
    .tw-deliverables { flex-direction: column; align-items: stretch; }
}

/* === skeleton.css === */
/**
 * P0 UX Enhancement — Skeleton Loading Screens
 *
 * Usage: add .skeleton class to any container during data loading.
 * Replace with real content when data arrives.
 *
 * Pattern: replicating campaign-stats.css:173-182 shimmer animation.
 * Variables: references both tokens.css and main.css (with fallbacks).
 */

/* ═══ Shimmer Animation ═══ */
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══ Base Skeleton ═══ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-border-light, #F1F5F9) 25%,
        var(--color-border, #E2E8F0) 50%,
        var(--color-border-light, #F1F5F9) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
    pointer-events: none;
    user-select: none;
    border-radius: var(--radius-sm, 6px);
}

/* ═══ Text Placeholders ═══ */
.skeleton-text {
    height: 14px;
    margin-bottom: var(--space-2, 8px);
    width: 100%;
}

.skeleton-text:last-child { width: 60%; }

.skeleton-text--sm  { width: 40%; }
.skeleton-text--lg  { height: 22px; width: 70%; }
.skeleton-text--full { width: 100%; }

/* ═══ Card Placeholder ═══ */
.skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg, 12px);
}

/* ═══ Stat Card Placeholder ═══ */
.skeleton-stat {
    height: 96px;
    border-radius: var(--radius-lg, 12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2, 8px);
    padding: var(--space-6, 24px);
}

.skeleton-stat::before,
.skeleton-stat::after {
    content: '';
    display: block;
    border-radius: var(--radius-sm, 6px);
}

.skeleton-stat::before {
    /* Label line */
    height: 12px;
    width: 50%;
    background: var(--color-border, #E2E8F0);
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-stat::after {
    /* Value line */
    height: 28px;
    width: 75%;
    background: var(--color-border, #E2E8F0);
    animation: skeleton-shimmer 1.2s ease-in-out infinite 0.15s;
}

/* ═══ Table Placeholder ═══ */
.skeleton-table {
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
}

.skeleton-table-header {
    display: flex;
    gap: var(--space-4, 16px);
    padding: var(--space-2-5) var(--space-4, 16px);
    background: var(--color-bg-alt, #F8FAFC);
}

.skeleton-table-row {
    display: flex;
    gap: var(--space-4, 16px);
    padding:var(--space-3) var(--space-4, 16px);
    border-bottom: 1px solid var(--color-border-light, #F1F5F9);
}

.skeleton-table-row:last-child { border-bottom: none; }

.skeleton-table-cell {
    height: 14px;
    flex: 1;
    background: var(--color-border, #E2E8F0);
    border-radius: var(--radius-sm, 6px);
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-table-cell--xs { flex: 0.5; }
.skeleton-table-cell--sm { flex: 0.7; }
.skeleton-table-cell--lg { flex: 1.5; }
.skeleton-table-cell--xl { flex: 2; }

/* ═══ Avatar / Circle Placeholder ═══ */
.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full, 9999px);
}

.skeleton-avatar--sm { width: 28px; height: 28px; }
.skeleton-avatar--lg { width: 56px; height: 56px; }

/* ═══ Accessibility: reduced motion ═══ */
@media (prefers-reduced-motion: reduce) {
    .skeleton,
    .skeleton::before,
    .skeleton::after,
    .skeleton-table-cell {
        animation: none;
        background: var(--color-border-light, #F1F5F9);
    }
}

/* === toast.css === */
/**
 * P0 UX Enhancement — Toast Notification System
 *
 * Fixed-position notification toasts for action feedback.
 * Four types: success (green), error (red), warning (amber), info (blue).
 *
 * Variables: tokens.css with main.css fallbacks.
 */

/* ═══ Container ═══ */
.toast-container {
    position: fixed;
    top: var(--space-6, 24px);
    right: var(--space-6, 24px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 8px);
    pointer-events: none;
    max-width: 380px;
    width: auto;
}

/* ═══ Single Toast ═══ */
.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2, 8px);
    padding:var(--space-3) var(--space-4, 16px);
    background: var(--color-surface-card, var(--surface-raised));
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    border-left: 4px solid var(--color-border, #E5E7EB);
    pointer-events: auto;
    animation: toast-slide-in 0.25s ease-out;
    font-size: var(--font-size-sm, 14px);
    color: var(--color-text-primary, var(--content-primary, #111827));
    line-height: 1.5;
    min-width: 280px;
}

/* ═══ Type Colors ═══ */
.toast--success { border-left-color: var(--color-success, #10B981); }
.toast--error   { border-left-color: var(--color-error, #EF4444); }
.toast--warning { border-left-color: var(--color-warning, #F59E0B); }
.toast--info    { border-left-color: var(--color-primary, #1E3A5F); }

/* ═══ Internal Layout ═══ */
.toast-icon {
    flex-shrink: 0;
    font-size:var(--text-base);
    line-height: 1.5;
}

.toast--success .toast-icon { color: var(--color-success, #10B981); }
.toast--error   .toast-icon { color: var(--color-error, #EF4444); }
.toast--warning .toast-icon { color: var(--color-warning, #F59E0B); }
.toast--info    .toast-icon { color: var(--color-primary, #1E3A5F); }

.toast-msg {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size:var(--text-lg);
    line-height: 1;
    color: var(--color-text-muted, #94A3B8);
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm, 6px);
    transition: color 0.15s, background 0.15s;
}

.toast-close:hover {
    color: var(--color-text, #0F172A);
    background: var(--color-bg-alt, #F8FAFC);
}

/* ═══ Enter/Exit Animation ═══ */
@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.toast--leaving {
    animation: toast-slide-out 0.2s ease-in forwards;
}

@keyframes toast-slide-out {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ═══ Responsive: Mobile = full-width bottom ═══ */
@media (max-width: 640px) {
    .toast-container {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        max-width: none;
        padding: var(--space-2, 8px);
    }

    .toast {
        min-width: 0;
        border-radius: var(--radius-md, 8px);
        animation: toast-slide-up 0.25s ease-out;
    }

    .toast--leaving {
        animation: toast-slide-down 0.2s ease-in forwards;
    }
}

@keyframes toast-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes toast-slide-down {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
}

/* ═══ Accessibility ═══ */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }
    .toast--leaving {
        animation: none;
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════
   Converge App Shell (extracted from index.latte + main.latte)
   Traditional sidebar + topbar layout
   依赖: design-tokens.css
   ═══════════════════════════════════════════ */

/* ── 全局重置 ── */
*,::before,::after{box-sizing:border-box}
html{-webkit-font-smoothing:antialiased}
body{margin:0;font-family:var(--font-sans);font-size:var(--text-sm);background:var(--bg-base);color:var(--text-secondary);line-height:1.5}

/* ── App Shell ── */
.app-shell{display:flex;flex-wrap:wrap;min-height:100vh}
.app-main{flex:1;min-width:0;display:flex;flex-direction:column}
/* DS 布局: 侧边栏为 flex 兄弟 (240/64px), 内容区零额外 margin — 覆盖 layout-core 遗留 64px rail 规则 */
.app-shell .app-main{margin-left:0;width:auto}
/* ── 顶部横幅 (trial/quota) 自持类: flex-basis:100% 全宽占行 (app-shell 是 row flex) ── */
.quota-banner{flex-basis:100%;display:flex;align-items:center;gap:var(--space-1);margin-bottom:var(--space-5);padding:var(--space-3);padding-left:var(--space-4);border-radius:var(--radius-md);background:var(--warning-soft);color:var(--text-secondary);font-size:var(--text-xs)}
.quota-banner-icon{font-size:var(--text-lg)}
.quota-banner .cp-progress{flex:1;min-width:0}
.trial-banner{flex-basis:100%;background:linear-gradient(135deg,var(--accent),color-mix(in srgb,var(--accent),var(--pure-black) 15%));color:var(--text-inverse);padding:0;font-size:14px;position:sticky;top:0;z-index:50}
.trial-banner-expired{background:linear-gradient(135deg,var(--danger),color-mix(in srgb,var(--danger),var(--pure-black) 20%))}
.trial-banner-inner{display:flex;align-items:center;justify-content:center;gap:var(--space-3);padding:var(--space-2-5) var(--space-6);max-width:1200px;margin:0 auto}
.trial-icon{font-size:18px}
.trial-text{font-size:var(--text-sm);opacity:0.92}
.trial-text strong{font-weight:700;opacity:1}
.trial-upgrade-btn{display:inline-block;padding:var(--space-1-5) var(--space-4);background:rgba(255,255,255,.2);color:var(--text-inverse);border-radius:var(--radius-full);font-size:var(--text-xs);font-weight:600;text-decoration:none;white-space:nowrap;transition:background .15s;border:1px solid rgba(255,255,255,.3)}
.trial-upgrade-btn:hover{background:rgba(255,255,255,.35)}
.trial-upgrade-btn-urgent{background:var(--inverse-surface);color:var(--danger);font-weight:700;border:none}
.trial-upgrade-btn-urgent:hover{background:color-mix(in srgb,var(--inverse-surface),var(--pure-black) 4%)}
.trial-dismiss{background:none;border:none;color:rgba(255,255,255,.6);cursor:pointer;font-size:var(--text-lg);padding:var(--space-1) var(--space-2)}
.trial-dismiss:hover{color:var(--text-inverse)}

/* ── 侧边栏 (Stitch 深色主题 — 所有 hex 均为 dark theme token) ── */
.sidebar-brand-row{display:flex;align-items:center;justify-content:space-between;padding:var(--space-3) var(--space-4)}
.sidebar-search-btn{background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.1);border-radius:var(--radius-sm);padding:3px var(--space-2);cursor:pointer;display:flex;align-items:center;gap:var(--space-1);transition:all .15s}
.sidebar-search-btn:hover{background:rgba(255,255,255,0.1);border-color:rgba(255,255,255,0.15)}
.sidebar-search-hint{font-family:var(--font-mono);font-size:10px;color:rgba(255,255,255,0.3);letter-spacing:0.05em}
.sidebar-section-icon{font-size:var(--text-lg);vertical-align:middle;margin-right:var(--space-1);opacity:0.6}
.sidebar-shortcut{font-family:var(--font-mono);font-size:9px;color:rgba(255,255,255,0.2);margin-left:auto;padding:1px var(--space-1);border-radius:3px;background:rgba(255,255,255,0.05);display:none}
.sidebar-link:hover .sidebar-shortcut{display:inline-block}
/* token */ .sidebar-role-badge{display:inline-block;padding:var(--space-0-5) var(--space-2);border-radius:4px;font-size:9px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;background:rgba(99,102,241,0.15);color:#a5b4fc;margin-bottom:var(--space-1)}
#mobile-sidebar-toggle{display:none}
@media(max-width:768px){
  #mobile-sidebar-toggle{display:block;position:fixed;top:8px;left:8px;z-index:200;background:var(--bg-card);border:1px solid var(--border-default);border-radius:var(--radius-sm);padding:var(--space-1-5) var(--space-2-5);font-size:18px;cursor:pointer;color:var(--text-primary)}
  #app-sidebar{position:fixed!important;left:calc(-1 * var(--sidebar-width));transition:left var(--motion-normal);z-index:150}
  #app-sidebar.mobile-open{left:0;box-shadow:4px 0 24px rgba(0,0,0,0.5)}
  .st-grid-4,.st-grid-3,[style*="grid-template-columns:repeat(5"]{grid-template-columns:repeat(2,1fr)!important}
  /* Responsive: 2-col grids → stacked on mobile */
  [style*="grid-template-columns:1fr 1fr"]{grid-template-columns:1fr!important}
  [style*="flex-wrap:nowrap"]{flex-wrap:wrap!important}
  /* B2: Topbar wraps at tablet */
  .app-topbar{flex-wrap:wrap;height:auto;gap:var(--space-2);padding:var(--space-2) var(--space-4)}
  .topbar-right{gap:var(--space-1-5)}
}
@media(max-width:480px){
  .app-topbar{padding:var(--space-1-5) var(--space-3)}
  .topbar-right{flex-wrap:wrap;justify-content:flex-end}
  .st-grid-4,.st-grid-3,[style*="grid-template-columns:repeat(5"]{grid-template-columns:1fr!important}
  .st-kpi-value{font-size:1.5rem}
}

.brand-dot{width:10px;height:10px;border-radius:50%;background:var(--accent);box-shadow:var(--shadow-glow);flex-shrink:0}
.brand-text{font-weight:700;font-size:var(--text-base);color:var(--text-primary);white-space:nowrap;letter-spacing:-0.3px}

/* ── 导航链接 ── */
/* #66: nav 内容 ~2040px 仅显示 ~734px, 下方菜单项 (auto-rules/bot-monitor/TSA/LTV) 无提示不可发现
   → 常驻细滚动条 (Firefox thin + WebKit 5px), 提示可滚动 */
.sidebar-nav{
flex:1;
padding:var(--space-3) 0;
display:flex;
flex-direction:column;
gap:var(--space-0-5);
overflow-y:auto;
scrollbar-width:thin;scrollbar-color:var(--border-default) transparent}
.sidebar-nav::-webkit-scrollbar{width:5px}
.sidebar-nav::-webkit-scrollbar-thumb{background:var(--border-default);border-radius:4px}
.sidebar-nav::-webkit-scrollbar-thumb:hover{background:var(--border-strong)}
.sidebar-link{
  display:flex;align-items:center;gap:var(--space-2-5);height:40px;padding:0 var(--space-5);
  color:var(--text-secondary);text-decoration:none;font-size:var(--text-sm);
  white-space:nowrap;transition:all var(--motion-fast);
  border-left:2px solid transparent;position:relative;
}
.sidebar-link:hover{background:var(--bg-overlay);color:var(--text-primary)}
.sidebar-link.active{background:var(--accent-soft);color:var(--accent);border-left-color:var(--accent);font-weight:500}
.sidebar-link-icon{width:20px;text-align:center;flex-shrink:0;font-size:var(--text-lg);display:flex;align-items:center;justify-content:center}
.sidebar-link-icon svg{width:20px;height:20px;flex-shrink:0}
.sidebar-link-label{overflow:hidden;text-overflow:ellipsis}
.sidebar-badge{margin-left:auto;font-size:10px;padding:1px var(--space-1-5);border-radius:var(--radius-full);background:var(--accent-soft);color:var(--accent)}


/* ── DS Sidebar v3: #app-sidebar 容器 + 分组折叠 + mini 模式 ── */
#app-sidebar{
  display:flex;flex-direction:column;
  width:var(--sidebar-width);height:100vh;flex-shrink:0;
  position:sticky;top:0;z-index:100;
  background:var(--bg-raised);
  border-right:1px solid var(--border-default);
  transition:width var(--motion-fast);
  overflow-x:hidden;overflow-y:hidden;
}
.sidebar-header{
gap: var(--space-2);

  display:flex;align-items:center;justify-content:space-between;
  min-height:56px;padding:0 var(--space-4);border-bottom:1px solid var(--border-default);
}
.sidebar-brand{
gap:var(--space-2-5);
height:56px;
padding:0 var(--space-5);
border-bottom:1px solid var(--border-default);
text-decoration:none;
display:flex;align-items:center}
.sidebar-toggle{
  display:flex;align-items:center;justify-content:center;
  width:28px;height:28px;border:1px solid var(--border-default);
  border-radius:var(--radius-sm);background:transparent;color:var(--text-tertiary);
  cursor:pointer;font-size:var(--text-xs);line-height:1;transition:all var(--motion-fast);
}
.sidebar-toggle:hover{border-color:var(--border-strong);color:var(--text-primary)}
/* L1 面板 = 固定分组头 (div, 不折叠不导航): 粗体分组标题; 面板间分隔线在组级 */
.sidebar-panel-group{display:flex;flex-direction:column;position:relative}
.sidebar-panel-group + .sidebar-panel-group{margin-top:var(--space-3-5)}
.sidebar-panel-group + .sidebar-panel-group::before{content:'';position:absolute;top:-8px;left:20px;right:20px;height:1px;background:var(--border-default)}
.panel-header .sidebar-link-icon{font-size:var(--text-base);color:var(--text-secondary)}
/* 层级缩进: 分组头 20px · L2 菜单项 36px */
.sidebar-nav .sidebar-link{padding-left:var(--space-9)}
/* ── P0 手风琴: 展开态分组头可点击折叠该组 L2 ── */
#app-sidebar .panel-header{cursor:pointer}
#app-sidebar .panel-header:hover{background:var(--bg-overlay)}
#app-sidebar .panel-header:focus-visible{outline:2px solid var(--accent-emphasis);outline-offset:-2px}
.panel-chevron{
  margin-left:auto;width:8px;height:8px;flex-shrink:0;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(45deg);transition:transform var(--motion-fast);
  color:var(--text-tertiary);
}
.sidebar-panel-group[data-group-collapsed="true"] > .sidebar-link{display:none}
.sidebar-panel-group[data-group-collapsed="true"] .panel-chevron{transform:rotate(-45deg)}
#app-sidebar[data-collapsed="true"] .panel-chevron{display:none}
.sidebar-footer{
text-align: center;
border-top:1px solid var(--border-default);
font-size:var(--text-xs);
color:var(--text-tertiary);
display:flex;flex-direction:column;gap:var(--space-1);padding:var(--space-3) 0}
.sidebar-avatar{
  display:flex;align-items:center;justify-content:center;
  width:28px;height:28px;border-radius:50%;flex-shrink:0;
  background:var(--accent-soft);color:var(--accent);font-size:var(--text-xs);font-weight:700;
}
.sidebar-user-name{overflow:hidden;text-overflow:ellipsis}
.sidebar-logout{color:var(--text-tertiary);font-size:var(--text-xs)}

/* mini 收起模式: 仅分组头图标, 文字/分隔线/L2 全隐藏 */
#app-sidebar[data-collapsed="true"]{width:var(--sidebar-collapsed-width)}
#app-sidebar[data-collapsed="true"] .sidebar-header{flex-direction:column;gap:var(--space-2);padding:var(--space-3) 0}
#app-sidebar[data-collapsed="true"] .sidebar-link{justify-content:center;padding:0;margin:0 var(--space-2)}
#app-sidebar[data-collapsed="true"] .sidebar-panel-group{margin-top:0}
#app-sidebar[data-collapsed="true"] .sidebar-panel-group::before{display:none}
#app-sidebar[data-collapsed="true"] .sidebar-panel-group > .sidebar-link{display:none}
#app-sidebar[data-collapsed="true"] .panel-header{justify-content:center;padding:0}
#app-sidebar[data-collapsed="true"] .sidebar-link-label{display:none}

/* 收起态: 分组头图标可点击, 弹出二级菜单 (pop) */
.sidebar-panel-pop{display:none}
#app-sidebar[data-collapsed="true"] .panel-header{cursor:pointer}
#app-sidebar[data-collapsed="true"] .panel-header:hover{background:var(--bg-overlay)}
#app-sidebar[data-collapsed="true"] .panel-header:focus-visible{outline:2px solid var(--accent-emphasis);outline-offset:-2px}
#app-sidebar[data-collapsed="true"] .sidebar-panel-pop.open{
  display:flex;flex-direction:column;position:fixed;left:var(--sidebar-collapsed-width);z-index:300;
  min-width:220px;max-height:calc(100vh - 24px);overflow-y:auto;
  padding:var(--space-1-5);background:var(--bg-raised);
  border:1px solid var(--border-default);border-radius:var(--radius-md);
  box-shadow:var(--shadow-lg);
}
.sidebar-panel-pop .panel-pop-title{
  display:flex;align-items:center;gap:var(--space-2-5);height:36px;padding:0 var(--space-3);
  font-weight:700;font-size:var(--text-xs);color:var(--text-tertiary);
  text-transform:uppercase;letter-spacing:.04em;user-select:none;
}
.sidebar-panel-pop .sidebar-link{
  display:flex;align-items:center;gap:var(--space-2-5);height:36px;padding:0 var(--space-3);
  border-radius:var(--radius-sm);color:var(--text-secondary);
  font-size:var(--text-sm);text-decoration:none;white-space:nowrap;
}
.sidebar-panel-pop .sidebar-link:hover{background:var(--bg-overlay);color:var(--text-primary)}
.sidebar-panel-pop .sidebar-link.active{color:var(--accent-emphasis);background:var(--accent-soft)}
/* 覆盖收起态全局规则: pop 内链接恢复左对齐布局 + 显示文字 */
#app-sidebar[data-collapsed="true"] .sidebar-panel-pop .sidebar-link{justify-content:flex-start;padding:0 var(--space-3);margin:0}
#app-sidebar[data-collapsed="true"] .sidebar-panel-pop .sidebar-link-label{display:inline}

/* ── 顶部栏 ── */
.app-topbar{
  display:flex;align-items:center;justify-content:space-between;
  height:56px;padding:0 var(--space-6);background:var(--bg-raised);
  border-bottom:1px solid var(--border-default);position:sticky;top:0;z-index:200;
}
.topbar-left,.topbar-right{display:flex;align-items:center;gap:var(--space-3)}

/* 顶栏下拉菜单 (G51 批 6: ds-dropdown → 原生 div[data-controller=dropdown]) — 移出文档流 + 基础外观 */
.topbar-dropdown-wrap>.user-dropdown-menu,.topbar-dropdown-wrap>.tz-dropdown-menu{
  position:absolute;top:calc(100% + 6px);right:0;z-index:310;
  background:var(--bg-raised);border:1px solid var(--border-default);
  border-radius:var(--radius-md);box-shadow:var(--shadow-lg);
}
.topbar-page-title{font-size:var(--text-sm);font-weight:600;color:var(--text-primary)}
.theme-toggle-btn{background:none;border:none;cursor:pointer;font-size:var(--text-lg);padding:0;line-height:1}
.topbar-btn-icon{
  display:flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:var(--radius-md);border:none;
  background:transparent;color:var(--text-secondary);cursor:pointer;
  transition:all var(--motion-fast);
}
.topbar-btn-icon:hover{background:var(--bg-overlay);color:var(--text-primary)}
.topbar-select{
  height:32px;max-width:220px;padding:0 var(--space-7) 0 var(--space-2-5);
  border:1px solid var(--border-default);border-radius:var(--radius-sm);
  background:var(--bg-raised);color:var(--text-secondary);
  font-size:var(--text-xs);cursor:pointer;outline:none;
  transition:border-color var(--motion-fast);
}
.topbar-select:hover{border-color:var(--border-strong);color:var(--text-primary)}
.topbar-select:focus-visible{border-color:var(--border-strong);box-shadow:0 0 0 2px var(--accent-soft)}
.user-dropdown-menu{min-width:180px}
.tz-dropdown-menu{min-width:var(--dropdown-min-width)}
.user-dropdown-head{border-bottom:1px solid var(--border-default);color:var(--text-tertiary)}
.user-dropdown-foot{border-top:1px solid var(--border-default);color:var(--danger)}

/* ── 角色按钮 ── */
.topbar-btn-role{
  display:flex;align-items:center;gap:var(--space-1-5);height:28px;padding:0 var(--space-2-5);
  border:1px solid var(--accent-soft);border-radius:var(--radius-sm);
  background:var(--accent-soft);color:var(--accent);
  font-size:var(--text-xs);font-weight:500;cursor:pointer;
  transition:all var(--motion-fast);
}
.topbar-btn-role:hover{border-color:var(--accent)}
.topbar-role-dot{width:8px;height:8px;border-radius:50%}

/* ── 下拉菜单 ── */
.topbar-dropdown-wrap{position:relative}
.topbar-dropdown{
  position:absolute;top:calc(100% + 6px);left:0;min-width:180px;padding:var(--space-1);
  background:var(--bg-overlay);border:1px solid var(--border-strong);
  border-radius:var(--radius-md);box-shadow:var(--shadow-lg);z-index:200;
}
.topbar-dropdown.right{left:auto;right:0}
.topbar-dropdown-item{
  display:flex;align-items:center;gap:var(--space-2);width:100%;padding:7px var(--space-3);
  border:none;border-radius:var(--radius-sm);background:transparent;
  color:var(--text-secondary);font-size:var(--text-xs);cursor:pointer;
  transition:all var(--motion-fast);font-family:var(--font-sans);
  text-decoration:none;
}
.topbar-dropdown-item:hover{background:var(--accent-soft);color:var(--text-primary)}
.topbar-dropdown-item.active{color:var(--accent);font-weight:500}
.topbar-dropdown-item.text-danger{color:var(--danger)}
.topbar-dropdown-item.text-danger:hover{background:var(--danger-soft)}
.topbar-dropdown-header{padding:7px var(--space-3) var(--space-2);font-size:var(--text-xs);color:var(--text-tertiary);border-bottom:1px solid var(--border-default);margin-bottom:var(--space-1)}
.topbar-dropdown-divider{border:none;border-top:1px solid var(--border-default);margin:var(--space-1) 0}

/* ── 用户头像 ── */
.topbar-btn-avatar{
  display:flex;align-items:center;justify-content:center;
  width:32px;height:32px;border-radius:50%;border:1px solid var(--border-default);
  background:var(--bg-overlay);cursor:pointer;padding:0;overflow:hidden;
  transition:all var(--motion-fast);
}
.topbar-btn-avatar:hover{border-color:var(--accent);box-shadow:var(--shadow-glow)}
.avatar-img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.avatar-placeholder{font-size:var(--text-sm);font-weight:600;color:var(--accent)}

/* ── 内容区 ── */
.app-content > * {max-width:1280px;margin:0 auto;width:100%}
.app-shell-body{max-width:1400px}
.page-permissions .card + .card{margin-top:var(--space-4,16px)}

/* ── 标题区统一 (P1 PageHeader 规范: 20px/700 + 20px 底距) ── */
.app-content h1,
.app-content .page-header h1{
  font-size:var(--text-xl,20px);font-weight:700;
  color:var(--text-primary);line-height:1.3;
  margin:0 0 var(--space-5,20px);
}
/* 行内并排标题 (flex 行首, 容器自带间距): 零 margin */
.app-content .header h1,
.app-content .page-header h1,
.app-content .st-header h1,
.app-content h1.cs-name,
.app-content h1.analysis-title{margin:0}
/* ── App Shell 组件类 ── */
.ai-query-row{max-width:800px}
.app-shell-tab{border-bottom:2px solid;margin-bottom:-var(--space-0-5)}
.tab-panel{min-height:0}
.spa-frame{min-height:200px}
.detail-panel{height:240px}
/* ── design-health 组件类 ── */
.score-ring{font-size:var(--space-10);font-weight:900;height:140px;width:140px}
.chart-bar{border-radius:var(--radius-sm) var(--space-1) 0 0;min-width:12px}
.score-grid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.chart-count{bottom:-18px}
/* ── billing 组件类 ── */
.billing-usage-fill{height:100%;border-radius:3px;transition:width var(--motion-slow)}
.billing-plan-card{background:var(--bg-card);border-style:solid;border-width:1px;border-radius:var(--radius-lg);padding:var(--space-5);position:relative}
.billing-plan-current{border-width:2px}
.billing-plan-cta{display:block;text-align:center;padding:var(--space-2);border-radius:var(--radius-md);font-size:var(--text-sm);font-weight:var(--font-semibold);text-decoration:none}
/* ── postback-urls 测试结果框 ── */
.test-result-box{padding:var(--space-3,12px);border-radius:var(--radius-md);font-size:var(--text-xs);margin-bottom:var(--space-3,12px)}
.test-url-wrap{min-width:280px}
/* ── redirect-analyzer 国家多选 ── */
.geo-list{max-height:120px}

/* ── 404 ── */
.page-404{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:400px;gap:var(--space-4,16px);text-align:center}
.page-404-icon{font-size:64px;opacity:0.3}


/* ── 时间筛选器 (main.latte) ── */
.topbar-time-filter { position: relative; }
.topbar-btn-filter {
  display: flex; align-items: center; gap: var(--space-1-5);
  height: 32px; padding: 0 var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-base); color: var(--text-secondary);
  font-size: var(--text-xs); cursor: pointer;
  transition: all var(--motion-fast);
}
.topbar-btn-filter:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* ── 用户菜单 (main.latte) ── */
.topbar-user { position: relative; }

/* ── Dashboard 独立链接 ── */
.sidebar-section-spacer { height: 8px; }

/* ── 侧边栏分组 (details/summary 原生手风琴) ── */
.sidebar-group-details { margin-top: var(--space-1-5); }
.sidebar-group-details > summary {
  list-style: none; /* hide default triangle */
  padding: var(--space-3) var(--space-5) var(--space-1);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-tertiary);
  cursor: pointer; user-select: none;
  border-left: 3px solid transparent;
  transition: all var(--motion-fast);
  outline: none;
}
.sidebar-group-details > summary::-webkit-details-marker { display: none; }
.sidebar-group-details > summary:hover { color: var(--text-secondary); }
.sidebar-group-details[open] > summary {
  color: var(--accent);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}

/* ── 二级菜单层级缩进 (v6.2: 缩进统一由 .sidebar-nav 层级规则控制) ── */
.sidebar-group {
  margin-left: 0; padding-left: 0;
  border-left: none;
}
.sidebar-group .sidebar-link {
  padding-left: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-secondary);
}
.sidebar-group .sidebar-link:hover { color: var(--text-primary); }
.sidebar-group .sidebar-link.active { color: var(--accent); font-weight: 500; }

/* ── 搜索框 ── */
.global-search {
width: 280px;
margin-right: auto;
 position: relative; display: flex; align-items: center; }
@media (max-width: 768px) {
.global-search { width: 160px; }
}

.search-input {
font-family: inherit;

  width: 320px; max-width: 100%; height: 36px; padding: 0 var(--space-10) 0 var(--space-9);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-base); color: var(--text-primary);
  font-size: var(--text-sm); outline: none;
  transition: border-color var(--motion-fast);
}
.search-input:focus { border-color: var(--accent); }
/* Mobile (390px+): search goes full-width to prevent overflow */
@media (max-width: 480px) {
  .search-input { width: 100%; }
  .global-search { width: 100%; }
}
.search-icon {
top: 50%;
transform: translateY(-50%);
color: var(--content-tertiary);
 position: absolute; left: 12px; font-size: 14px; opacity: 0.5; pointer-events: none; }
.search-shortcut-hint {
  position: absolute; right: 10px; font-size: 10px; padding: 1px 5px;
  background: var(--bg-overlay); border: 1px solid var(--border-default);
  border-radius: 3px; color: var(--text-tertiary); font-family: var(--font-mono);
}
.search-results-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  z-index: 999; max-height: 320px; overflow-y: auto;
}
.search-result-item {
  display: block; padding: var(--space-2) var(--space-3); font-size: var(--text-sm);
  color: var(--text-primary); text-decoration: none;
  transition: background var(--motion-fast);
}
.search-result-item:hover { background: var(--accent-soft); }

/* ── 导航栏日期 ── */
.navbar-date { font-size: var(--text-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.navbar-tz { font-size: var(--text-xs); color: var(--accent); font-weight: 500; border: 1px solid var(--border-default); padding: var(--space-0-5) var(--space-2); border-radius: var(--radius-sm); white-space: nowrap; }
.lang-switch-btn { font-size: var(--text-xs); color: var(--accent); font-weight: 500; border: 1px solid var(--border-default); padding: var(--space-0-5) var(--space-2); border-radius: var(--radius-sm); text-decoration: none; white-space: nowrap; }
.lang-switch-btn:hover { background: var(--accent-soft); }
.tz-dropdown { position: absolute; top: 100%; right: 0; margin-top: var(--space-1); background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 120px; z-index: 999; padding: var(--space-1) 0; }
.tz-item { display: block; padding: var(--space-1-5) var(--space-3-5); font-size: var(--text-xs); text-decoration: none; color: var(--text-secondary); transition: background 0.1s; }
.tz-item:hover { background: var(--accent-soft); color: var(--accent); }

/* ── Turbo Drive 进度条 — SPA 导航指示 ── */
.turbo-progress-bar {
  position: fixed; top: 0; left: 0; z-index: 99999;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 240, 168, 0.5);
  transition: width 0.3s ease;
}
/* Content area transition */
.app-content {
flex:1;
padding:var(--space-6);
overflow:auto;
background:var(--bg-base);
min-width:0;

  transition: opacity 0.15s ease;
}
.turbo-loading .app-content {
  opacity: 0.5;
}
/* Permanent elements stay sharp during navigation */
[data-turbo-permanent] {
  opacity: 1 !important;
}

/* ── 微动效 (P0) ── */
.kpi-card, .panel-link, .sidebar-link, .insight-item, .dropdown-item {
  transition: all 0.15s ease;
}
.sidebar-link, .panel-link {
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

/* ── 响应式 ── */
@media (max-width:768px){
  .app-content{padding:var(--space-4,16px)}
  .topbar-page-title{display:none}
  .topbar-btn-filter span { display: none; }
}
/* ═══════════════════════════════════════════
   Converge Dashboard Page Styles (extracted from pages/dashboard.latte)
   依赖: design-tokens.css, grid.css
   ═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   一、原子工具类 (Atomic CSS)
   注: .flex 由 app-bundle.css 提供
   ═══════════════════════════════════════════ */

/* ── 布局 ── */
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-baseline { align-items: baseline; }
.min-w-0 { min-width: 0; }

/* ── 间距 ── */
.mb-6 { margin-bottom: var(--space-6); }
.m-0 { margin: 0; }

/* ── 排版 ── */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 颜色 (基于 Design Tokens) ── */
.text-primary   { color: var(--text-primary); }

/* ═══════════════════════════════════════════
   微动效增强 (P0)
   ═══════════════════════════════════════════ */
.kpi-card, .insight-item, .dropdown-item, .panel-link {
  transition: all 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════
   二、页面根容器
   ═══════════════════════════════════════════ */
.dashboard-root {
  display: flex; flex-direction: column;
}

/* ═══════════════════════════════════════════
   三、角色切换按钮
   ═══════════════════════════════════════════ */
.role-btn {
  padding: var(--space-1-5) var(--space-3-5); border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-primary); cursor: pointer;
  transition: all var(--motion-fast); font-family: inherit;
}
.role-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 240, 168, 0.15);
}
.role-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.role-admin   { background: var(--accent); box-shadow: 0 0 6px rgba(0, 240, 168, 0.4); }
.role-manager { background: var(--warning); }
.role-buyer   { background: var(--info); }

/* ── 下拉菜单 (通用) ── */
.dropdown-menu {
  position: absolute; top: calc(100% + 6px);
  min-width: 200px; padding: var(--space-1); z-index: 200;
  background: var(--color-surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.dropdown-menu.right { right: 0; left: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: var(--space-2);
  width: 100%; padding: var(--space-2) var(--space-3); border: none;
  border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary);
  font-size: 0.75rem; cursor: pointer; font-family: inherit;
  transition: all var(--motion-fast);
}
.dropdown-item:hover {
  background: var(--accent-soft); color: var(--text-primary);
}
.dropdown-item.active { color: var(--accent); font-weight: 500; }

/* ═══════════════════════════════════════════
   四、KPI 卡片 (4 列 Grid)
   ═══════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
.kpi-card {
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  transition: all var(--motion-fast);
  position: relative; overflow: hidden;
}
.kpi-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.kpi-icon { font-size: 18px; line-height: 1; }
.kpi-value {
  font-size: 1.75rem; font-weight: 700; color: var(--text-primary);
  line-height: 1.2; font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}
.kpi-change {
  font-size: 0.875rem; font-weight: 600;
  display: flex; align-items: center; gap: var(--space-0-5);
}

/* ═══════════════════════════════════════════
   五、主网格 (图表 2fr + AI 面板 1fr)
   ═══════════════════════════════════════════ */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-4); align-items: start;
}


/* ── 图例 ── */
.legend-item {
  display: flex; align-items: center; gap: var(--space-1-5);
  font-size: 0.75rem; color: var(--text-tertiary);
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── ECharts 容器 ── */
.chart-container { width: 100%; height: 340px; }
.chart-empty {
  height: 340px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-3);
  color: var(--text-tertiary); font-size: 0.875rem;
}
.empty-icon { font-size: var(--text-4xl); opacity: 0.4; }

/* ═══════════════════════════════════════════
   六、AI 洞察面板 (磨砂玻璃)
   ═══════════════════════════════════════════ */
.glass {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border-default);
  position: relative; overflow: hidden;
}
html.dark .glass {
  background: rgba(17, 24, 32, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
}
/* 左上角装饰发光 */
.glass::before {
  content: '';
  position: absolute; top: -40px; left: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 168, 0.05), transparent 70%);
  pointer-events: none;
}

/* AI 脉冲指示灯 */
.ai-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0, 240, 168, 0.4);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.6); }
}

/* 旋转动画 (刷新按钮) */
.animate-spin { animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 洞察列表 ── */
.insight-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--space-3);
}
.insight-item {
  display: flex; gap: var(--space-2-5); padding: var(--space-2-5) var(--space-3-5);
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--motion-fast);
}
.insight-item:hover {
  background: var(--accent-soft);
  border-color: rgba(0, 240, 168, 0.15);
}
.insight-bullet {
  width: 4px; min-width: 4px; height: 4px; margin-top: 7px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px rgba(0, 240, 168, 0.3);
}



/* ═══════════════════════════════════════════
   九、响应式 (Mobile-first for boss on phone)
   ═══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .kpi-grid  { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .kpi-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .kpi-card   { padding: var(--space-3); }
  .kpi-value  { font-size: 1.25rem; }
  .chart-container { height: 240px; }
  .insight-list { gap: var(--space-2); }
  .insight-item { padding: var(--space-2) var(--space-2-5); }
}
/* ── 手机端 (≤480px): 单列布局 · 全宽 · 零溢出 ── */
/* 断点参考: 480px (手机) / 768px (平板) / 1024px (桌面) */
@media (max-width: 480px) {
  .dashboard-root { padding: var(--space-3); }
  .kpi-grid  { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .kpi-card   { padding: var(--space-3) var(--space-3-5); flex-direction: row; align-items: center; gap: var(--space-2-5); }
  .kpi-value  { font-size: 1.3rem; }
  .kpi-icon   { font-size: var(--text-xl); }
  .chart-container { height: 200px; }
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1rem; }
  .role-btn { font-size: 0.75rem; padding: var(--space-1) var(--space-2); }
  .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .main-grid { gap: var(--space-3); }
  /* B1: Multi-column grid utilities → single column at 390px */
  .gtc-2, .gtc-3, .gtc-4, .gtc-5, .gtc-6,
  .grid-2, .grid-cols-2,
  .sub-grid-2, .wiz-grid-2, .wiz-review-grid { grid-template-columns: minmax(0, 1fr) !important; }
  /* B1: Container padding reduction for narrow viewports */
  .container, .container-sm, .container-max { padding-left: var(--space-4); padding-right: var(--space-4); }
}

/* ═══════════════════════════════════════════
   P0 inline style elimination utilities
   ═══════════════════════════════════════════ */
.hidden { display: none !important; }
.text-right { text-align: right; }
.mt-6 { margin-top: var(--space-6); }
.mt-0 { margin-top: 0; }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.p-2 { padding: var(--space-2); }


/* ── Table full-width + font-size helper ── */
.table-data {
  width: 100%; border-collapse: collapse; font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════
   十、复用卡片 & 表格 (从 dashboard.css 合并)
   注: .sidebar-link 已移除—定义权归 app-shell.css
   ═══════════════════════════════════════════ */

/* ── 通用卡片 ── */
.dash-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  transition: box-shadow .2s;
}
.dash-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,.06); }

/* ── 统计卡 (icon + value + label 纵向) ── */
.stat-card .stat-icon { font-size: 28px; line-height: 1; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--content-primary); line-height: 1.1; }
.stat-card .stat-label { font-size: var(--text-xs); color: var(--content-tertiary); margin-top: var(--space-0-5); }

/* ── 数据表格 ── */
.data-table {
  width: 100%; border-collapse: collapse;
}
.data-table thead th {
  text-align: left; padding: var(--space-3) var(--space-4);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--content-tertiary);
  background: var(--surface-overlay);
  border-bottom: 1px solid var(--border-default);
}
.data-table tbody td {
  padding: var(--space-3-5) var(--space-4); font-size: 14px; color: var(--content-secondary);
  border-bottom: 1px solid var(--border-subtle, rgba(0,0,0,.04));
}
.data-table tbody tr:hover td { background: var(--surface-overlay); }
.data-table tbody tr:last-child td { border-bottom: none; }


/* ── Metric Card (StatCard 组件 KPI 指标卡) ── */
.metric-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.metric-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.metric-card__body { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.metric-card__main { min-width: 0; }
.metric-card__label { font-size: var(--text-sm); font-weight: 500; color: var(--content-secondary); margin: 0 0 var(--space-1); }
.metric-card__value { font-size: var(--text-2xl); font-weight: 700; color: var(--content-primary); margin: 0 0 var(--space-1); line-height: 1.2; }
.metric-card__trend { font-size: var(--text-xs); font-weight: 500; margin: 0; }
.metric-card__trend--up { color: var(--success); }
.metric-card__trend--down { color: var(--danger); }
.metric-card__icon { flex: none; display: flex; align-items: center; justify-content: center; padding: var(--space-3); border-radius: var(--radius-full); background: var(--accent-soft); font-size: var(--text-xl); }
.metric-card__subtitle { font-size: var(--text-xs); color: var(--text-tertiary); margin: var(--space-1) 0 0; }
.metric-card__drill { float: right; font-size: var(--text-xs); color: var(--text-secondary); opacity: 0; transition: opacity .15s ease; }
.metric-card:hover .metric-card__drill { opacity: .7; }
.metric-card--alert { border-left: 3px solid var(--border-default); }
.metric-card--alert--ok { border-left-color: var(--success); }
.metric-card--alert--warn { border-left-color: var(--warning); }
.metric-card--alert--crit { border-left-color: var(--danger); }
.metric-card__alert-value--ok { color: var(--success); }
.metric-card__alert-value--warn { color: var(--warning); }
.metric-card__alert-value--crit { color: var(--danger); }
.metric-card__alert-value--idle { color: var(--text-tertiary); }
.metric-card__alert-desc { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-1); }

/* ── Section Card (LP 变体缩略卡) ── */
.section-card { cursor: pointer; }
.section-card--active { border-color: var(--accent); }

/* ── Pipeline Progress (CopyPipeline 步骤进度) ── */
.pipeline-progress { align-items: center; }
.pipeline-step {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--content-tertiary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--surface-overlay);
}
.pipeline-step.active { color: var(--content-inverse); background: var(--accent); }
.pipeline-step.done   { color: var(--success); background: var(--success-soft); }



/* ═══════════════════════════════════════════
   十一、Subscription 页面 (提取自 subscription.latte)
   ═══════════════════════════════════════════ */
.sub-card { background: var(--surface-raised); border-radius: 10px; border: 1px solid var(--border-default); padding: var(--space-5); }
.sub-card-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: var(--space-4); }
.sub-title { font-size: var(--text-base); font-weight: 700; color: var(--content-primary); margin: 0 0 var(--space-4); }
.sub-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .5px; color: var(--content-tertiary); }
.sub-plan-name { font-size: var(--text-2xl); font-weight: 700; color: var(--content-primary); margin: var(--space-1) 0; }
.sub-price { font-size: var(--text-2xl); font-weight: 800; color: var(--accent-emphasis); }
.sub-price-sm { font-size: 14px; }
.sub-price-period { font-size: var(--text-sm); color: var(--content-tertiary); font-weight: 400; }
.sub-details { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); }
.sub-row { display: flex; justify-content: space-between; }
.sub-value { color: var(--content-primary); font-weight: 600; }
.sub-text { color: var(--content-secondary); }
.sub-usage-track { height: 10px; background: var(--surface-overlay); border-radius: 5px; overflow: hidden; }
.sub-usage-fill { height: 100%; border-radius: 5px; transition: width .3s; }
.sub-usage-warn { font-size: var(--text-xs); color: var(--warning); margin: var(--space-1-5) 0 0 0; }
.sub-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-bottom: var(--space-5); }
.sub-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); text-align: center; }
.sub-plan { padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--surface-raised); }
.sub-plan.current { border-color: var(--accent-emphasis); background: var(--accent-soft); }
.sub-plan-price { font-size: var(--text-xl); font-weight: 800; color: var(--accent-emphasis); margin-bottom: var(--space-2); }
.sub-plan-name-sm { font-weight: 700; font-size: var(--text-base); color: var(--content-primary); margin-bottom: var(--space-1); }
.sub-plan-features { font-size: 11px; color: var(--content-secondary); line-height: 1.6; }
.sub-badge-current { margin-top: var(--space-2); padding: var(--space-1) var(--space-2-5); background: var(--accent-emphasis); color: var(--content-inverse); border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-block; }
.sub-upgrade-link { margin-top: var(--space-2); display: inline-block; font-size: var(--text-xs); color: var(--accent-emphasis); }
.sub-btn-full { width: 100%; text-align: center; }
.sub-table-wrap { overflow-x: auto; }
.sub-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.sub-table thead tr { background: var(--surface-overlay); }
.sub-table th { padding: var(--space-2-5) var(--space-5); text-align: left; font-size: var(--text-xs); color: var(--content-secondary); }
.sub-table th:not(:first-child) { padding: var(--space-2-5) var(--space-3); }
.sub-table td { padding: var(--space-2) var(--space-5); font-size: var(--text-sm); color: var(--content-primary); }
.sub-table td:not(:first-child) { padding: var(--space-2) var(--space-3); }
.sub-table tbody tr { border-bottom: 1px solid var(--border-default); }
.sub-table .sub-value-cell { font-weight: 600; }
.sub-section-header { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-default); }
.sub-section-header h3 { font-size: 14px; font-weight: 600; color: var(--content-primary); margin: 0; }
.sub-card-no-pad { background: var(--surface-raised); border-radius: 10px; border: 1px solid var(--border-default); overflow: hidden; margin-bottom: var(--space-5); }
.sub-main-title { font-size: var(--text-2xl); font-weight: 700; color: var(--content-primary); margin: var(--space-1) 0; }

/* ═══════════════════════════════════════════
   十二、Setup Wizard (提取自 organisms/setup-wizard.latte)
   ═══════════════════════════════════════════ */
.wiz-root { max-width: 680px; margin: 0 auto; padding: var(--space-4); }
.wiz-form { background: var(--surface-raised); border:1px solid var(--border-default); border-radius: var(--radius-lg, 12px); padding: var(--space-6); }
.wiz-section-title { font-size: var(--text-lg); margin-bottom: var(--space-4); margin-top: 0; }
.wiz-field { margin-bottom: var(--space-4); }
.wiz-label { display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-1); color: var(--content-primary); }
.wiz-input { width: 100%; padding: var(--space-2-5) var(--space-3-5); border: 1px solid var(--border-default); border-radius: var(--radius-sm); font-size: var(--text-base); background: var(--surface-base); color: var(--content-primary); box-sizing: border-box; }
.wiz-select { width: 100%; padding: var(--space-2-5) var(--space-3-5); border: 1px solid var(--border-default); border-radius: var(--radius-sm); font-size: var(--text-base); background: var(--surface-base); color: var(--content-primary); box-sizing: border-box; }
.wiz-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-bottom: var(--space-4); }
.wiz-hint { font-size: var(--text-xs); color: var(--content-tertiary); margin-top: var(--space-1); }
.wiz-msg-success { background: var(--surface-success); color: var(--content-success); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); margin-bottom: var(--space-4); font-weight: 500; }
.wiz-msg-error { background: var(--surface-danger); color: var(--content-danger); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); margin-bottom: var(--space-4); }
.wiz-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-6); margin-bottom: var(--space-4); }
.wiz-review-label { color: var(--content-tertiary); font-size: var(--text-xs); }
.wiz-review-value { font-weight: 600; }
.wiz-preview-box { background: var(--surface-overlay); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: var(--space-3); margin-bottom: var(--space-4); text-align: center; }
.wiz-preview-label { font-size: var(--text-xs); color: var(--content-tertiary); margin-right: var(--space-2); }
.wiz-preview-link { font-size: var(--text-sm); color: var(--accent); word-break: break-all; }
.wiz-done { text-align: center; padding: var(--space-8) 0; }
.wiz-done-icon { font-size: 3rem; display: block; margin-bottom: var(--space-4); }
.wiz-done-title { font-size: var(--text-xl); margin-bottom: var(--space-2); margin-top: 0; }
.wiz-done-desc { color: var(--content-tertiary); margin-bottom: var(--space-6); }
.wiz-done-success { color: var(--content-success); font-weight: 500; margin-bottom: var(--space-6); }
.wiz-done-actions { display: flex; gap: var(--space-3); justify-content: center; }
.wiz-btn-primary { display: inline-flex; padding: var(--space-3) var(--space-8); background: var(--accent); color: var(--text-inverse); border: none; border-radius: var(--radius-sm); font-size: var(--text-base); font-weight: 600; cursor: pointer; text-decoration: none; }
.wiz-btn-secondary { display: inline-flex; padding: var(--space-2-5) var(--space-6); background: var(--surface-overlay); color: var(--content-primary); border: 1px solid var(--border-default); border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; }
.wiz-nav { display: flex; justify-content: space-between; margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.wiz-nav-btn-back { padding: var(--space-2-5) var(--space-5); background: var(--surface-overlay); color: var(--content-primary); border: 1px solid var(--border-default); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-sm); }
.wiz-nav-btn-next { padding: var(--space-2-5) var(--space-6); background: var(--accent); color: var(--text-inverse); border: none; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: var(--text-sm); }
.wiz-skip-hint { text-align: center; margin-top: var(--space-4); font-size: var(--text-xs); color: var(--content-tertiary); }
.wiz-hint-link { color: var(--accent); }

/* ═══════════════════════════════════════════
   十三、Proof 自检面板 (提取自 pages/proof.latte)
   ═══════════════════════════════════════════ */
.proof-toolbar { margin-bottom: var(--space-6); }
.proof-btn { display: inline-flex; padding: var(--space-2-5) var(--space-5); background: var(--accent); color: var(--text-inverse); border-radius: var(--radius-md); text-decoration: none; font-weight: 500; }
.proof-btn-secondary { display: inline-flex; padding: var(--space-2-5) var(--space-5); margin-left: var(--space-2); background: var(--surface-overlay); color: var(--content-primary); border-radius: var(--radius-md); text-decoration: none; }
.proof-trend-hint { margin-left: var(--space-3); color: var(--content-tertiary); font-size: var(--text-sm); }
.proof-empty { text-align: center; padding: var(--space-12) 0; }
.proof-empty-title { color: var(--content-tertiary); }
.proof-empty-desc { color: var(--content-tertiary); margin-top: var(--space-2); }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); }
.proof-card { background: var(--surface-raised); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-4); }
.proof-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.proof-badge { font-size: var(--text-sm); padding: var(--space-1) var(--space-2-5); border-radius: var(--radius-lg); font-weight: 500; }
.proof-badge-pass { background: var(--surface-success); color: var(--content-success); }
.proof-badge-fail { background: var(--surface-danger); color: var(--content-danger); }
.proof-stats { display: flex; gap: var(--space-5); font-size: var(--text-sm); color: var(--content-secondary); }
.proof-section { margin-top: var(--space-8); }
.proof-section-sm { margin-top: var(--space-6); }
.proof-section-title { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.proof-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.proof-table thead tr { text-align: left; border-bottom: 2px solid var(--border-default); }
.proof-table th { padding: var(--space-2); }
.proof-table td { padding: var(--space-2); }
.proof-table tbody tr { border-bottom: 1px solid var(--border-subtle); }
.proof-td-fail { color: var(--content-danger); }
.proof-td-muted { color: var(--content-tertiary); }

/* ═══════════════════════════════════════════
   十四、Data Table 组件 (提取自 molecules/data-table.latte)
   ═══════════════════════════════════════════ */
.dt-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border-default); border-radius: var(--radius-lg, 12px); background: var(--bg-card); }
.dt-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm, 0.875rem); }
.dt-th { padding: var(--space-3) var(--space-4); text-align: left; font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; border-bottom: 1px solid var(--border-default); background: var(--bg-raised); }
.dt-th:first-child { border-radius: var(--radius-lg, 12px) 0 0 0; }
.dt-th:last-child { border-radius: 0 var(--radius-lg, 12px) 0 0; }
.dt-th-actions { text-align: right; }
.dt-td { padding: var(--space-3) var(--space-4); color: var(--text-secondary); border-bottom: 1px solid var(--border-default); white-space: nowrap; }
.dt-td-actions { text-align: right; }
.dt-striped .dt-tr:nth-child(even) .dt-td { background: rgba(255,255,255,0.015); }
.dt-hover .dt-tr:hover .dt-td { background: var(--accent-soft); }
.dt-actions { display: flex; gap: var(--space-1); justify-content: flex-end; }
.dt-action-btn { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2-5); border-radius: var(--radius-sm); border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); font-size: var(--text-xs); cursor: pointer; transition: all var(--motion-fast); }
.dt-action-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dt-action-icon { font-size: var(--text-sm); line-height: 1; }
.dt-action-label { font-weight: 500; }
.dt-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-12) var(--space-5); text-align: center; }
.dt-empty-icon { font-size: 40px; margin-bottom: var(--space-4); opacity: 0.6; }
.dt-empty-text { color: var(--text-tertiary); font-size: var(--text-sm); }
@media (max-width: 640px) {
  .dt-table, .dt-th, .dt-td, .dt-tr { display: block; }
  .dt-th { display: none; }
  .dt-tr { border-bottom: 1px solid var(--border-default); padding: var(--space-3) 0; }
  .dt-td { display: flex; justify-content: space-between; align-items: center; padding: var(--space-1-5) var(--space-4); border: none; white-space: normal; }
  .dt-td::before { content: attr(data-label); font-weight: 600; color: var(--text-tertiary); font-size: var(--text-xs); margin-right: var(--space-3); flex-shrink: 0; }
  .dt-td-actions { justify-content: flex-start; padding-top: var(--space-2); }
  .dt-td-actions::before { content: none; }
}

/* ═══════════════════════════════════════════
   十五、Form 组件 (提取自 molecules/form-group.latte)
   ═══════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: var(--space-1-5); margin-bottom: var(--space-4); }
.form-label {
display: block;
margin-bottom: var(--space-1);
 font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.form-required { color: var(--danger); }
.form-input, .form-select { height: 40px; padding: 0 var(--space-3); background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--text-sm); outline: none; transition: border-color var(--motion-fast); font-family: var(--font-sans); box-sizing: border-box; width: 100%; }
.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.form-input { height: auto; min-height: 80px; padding: var(--space-2-5) var(--space-3); resize: vertical; }
.form-error { font-size: var(--text-xs); color: var(--danger); margin: var(--space-0-5) 0 0 0; }
.form-hint { font-size: var(--text-xs); color: var(--content-tertiary); margin: var(--space-0-5) 0 0 0; }
/* campaign-create-form (v2 modal): 列头网格 + 动态行容器 (G23 内联 style 外置) */
.cf-grid-cols { grid-template-columns: 24px 1fr 1fr 60px 50px 36px; }
.cf-paths-min { min-height: 40px; }

/* ═══════════════════════════════════════════
   十六、KPI Sparkline (迷你 7 日趋势图)
   ═══════════════════════════════════════════ */
.kpi-sparkline { margin-top: var(--space-2); opacity: 0.6; transition: opacity var(--motion-fast); }
.kpi-card:hover .kpi-sparkline { opacity: 0.9; }
@keyframes sparkDraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.kpi-sparkline polyline { stroke-dasharray: 100; animation: sparkDraw 0.8s ease-out forwards; }

/* ── Live indicator ── */
.live-indicator { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity 0.3s; margin-left: var(--space-1); vertical-align: middle; }
@keyframes kpiPulse { 0% { transform: scale(1); } 50% { transform: scale(1.04); color: var(--accent); } 100% { transform: scale(1); } }
.kpi-pulse { animation: kpiPulse 0.6s ease-out; }

/* ═══════════════════════════════════════════
   十七、拖拽排序 (SortableJS + Edit Mode)
   ═══════════════════════════════════════════ */
.kpi-grid-editing .kpi-card { cursor: grab; border: 2px dashed var(--border-strong); transition: transform 0.15s, box-shadow 0.15s; }
.kpi-grid-editing .kpi-card:active { cursor: grabbing; }
.kpi-card-ghost { opacity: 0.4; background: var(--accent-soft); border-color: var(--accent); }

/* ═══════════════════════════════════════════
   十八、Quick Tasks + Attention Items (工作台)
   ═══════════════════════════════════════════ */
/* ── Quick Tasks ── */
.quick-tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.quick-task-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3-5) var(--space-4); background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--radius-lg); text-decoration: none; transition: all var(--motion-fast); cursor: pointer; }
.quick-task-card:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); transform: translateY(-1px); }
.quick-task-icon { font-size: 1.4rem; flex-shrink: 0; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: var(--bg-overlay); border-radius: var(--radius-md); }
.quick-task-body { flex: 1; min-width: 0; }
.quick-task-title { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); margin-bottom: var(--space-0-5); }
.quick-task-desc { font-size: var(--text-xs); color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-task-shortcut { flex-shrink: 0; padding: var(--space-0-5) var(--space-1-5); background: var(--bg-overlay); border: 1px solid var(--border-default); border-radius: 4px; font-size: 10px; font-family: var(--font-mono); color: var(--text-tertiary); }

/* ── Attention Items ── */
.attention-section { background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.attention-heading { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin: 0 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.attention-count { font-size: 11px; padding: 1px var(--space-2); border-radius: var(--radius-full); background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.attention-list { display: flex; flex-direction: column; gap: var(--space-2); }
.attention-item:hover { background: var(--bg-overlay); }
.attention-crit { border-left-color: var(--danger); background: var(--danger-soft); }
.attention-warn { border-left-color: var(--warning); background: var(--warning-soft); }
.attention-icon { font-size: 1rem; flex-shrink: 0; }
.attention-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-0-5); }
.attention-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.attention-desc { font-size: var(--text-xs); color: var(--text-tertiary); }
.attention-action { flex-shrink: 0; font-size: var(--text-xs); color: var(--accent); font-weight: 500; white-space: nowrap; }

@media (max-width: 768px) {
  .quick-tasks { grid-template-columns: 1fr; }
}
/* ═══════════════════════════════════════════
   Precision Common — 共享 UI 组件样式
   来源: precision-analysis / funnel / tracking
   加载: 所有 Precision 页面共用此文件
   ═══════════════════════════════════════════ */

/* ── Buttons ── */
.btn-pill {
  display: inline-flex; align-items: center; gap: var(--space-2, 8px);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-full, 9999px);
  font-size: var(--text-sm); font-weight: 500;
  cursor: pointer; border: none;
  transition: transform var(--motion-fast), box-shadow var(--motion-fast);
}
.btn-pill:active { transform: scale(0.95); }
.btn-pill-primary:hover { box-shadow: 0 2px 12px var(--accent-glow); }
.btn-pill-secondary { background: var(--bg-overlay); color: var(--text-primary); border: 1px solid var(--border-default); }
.btn-pill-secondary:hover { background: var(--bg-base); }


/* ── Cards & Panels ── */
.analysis-card {
  background: var(--bg-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg, 16px); padding: var(--space-5, 24px);
}

/* ── Tables ── */
.precision-table-wrap { overflow-x: auto; }
.precision-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.precision-table thead { border-bottom: 1px solid var(--border-default); }
.precision-table th {
  padding: var(--space-2-5) var(--space-4); text-align: left; font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); white-space: nowrap;
}
.precision-table td { padding: var(--space-2-5) var(--space-4); border-bottom: 1px solid var(--border-default); vertical-align: middle; }
.precision-table tbody tr:hover { background: var(--bg-overlay); }
.precision-table tbody tr:last-child td { border-bottom: none; }
/* ── Status & ROI ── */
.status-active  { background: var(--success-soft); color: var(--success); }
.status-paused  { background: var(--warning-soft); color: var(--warning); }
.status-draft   { background: var(--bg-overlay); color: var(--text-tertiary); }
.status-paid    { background: var(--accent-soft); color: var(--accent); }

/* ── 表内联 style → class 收尾 (任务 #272) ── */
.tb-row-line tbody tr { border-bottom: 1px solid var(--border-default); }
.st-log-table thead tr { border-bottom: 2px solid var(--dash-border); }
.st-log-table tbody tr { border-bottom: 1px solid var(--dash-border); }
.st-log-table .st-log-ok   { color: var(--dash-success); }
.st-log-table .st-log-fail { color: var(--dash-danger); }
.st-log-table .st-log-dim  { color: var(--dash-text-tertiary); }
.st-log-table .st-col-err  { max-width: 120px; }
.st-align-end { align-self: flex-end; }
.roi-up   { color: var(--success); font-weight: 600; }
.roi-down { color: var(--danger); font-weight: 600; }
.roi-flat { color: var(--text-tertiary); }

/* ── Filter Controls ── */
.filter-select {
  padding: var(--space-1-5) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm); background: var(--bg-raised); color: var(--text-primary); cursor: pointer;
}
.filter-select:focus { border-color: var(--accent); outline: none; }
.filter-input {
  padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm); background: var(--bg-raised); color: var(--text-primary);
}
.filter-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }

/* ── State Overlays (loading / error / empty) ── */
.state-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-12, 48px); text-align: center; color: var(--text-secondary);
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border-default);
  border-top-color: var(--accent); border-radius: 50%;
  animation: precision-spin 0.8s linear infinite; margin-bottom: var(--space-4);
}
@keyframes precision-spin { to { transform: rotate(360deg); } }
.error-message { color: var(--danger); font-weight: 600; }

/* ── Anomaly Tags ── */
.anomaly-tag {
  font-size: var(--text-xs); font-weight: 600; padding: var(--space-0-5) var(--space-2); border-radius: var(--radius-full);
  display: inline-flex; align-items: center; gap: var(--space-1);
}
.anomaly-tag.warning { background: var(--warning-soft); color: var(--warning); }
.anomaly-tag.error   { background: var(--danger-soft); color: var(--danger); }

/* ── Animations ── */
@keyframes precision-draw-line { to { stroke-dashoffset: 0; } }
.sparkline-path { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: precision-draw-line 2s ease forwards; }
/* ═══════════════════════════════════════════
   Stitch Theme — Converge 导航重构方案 v1.0
   令牌值已迁至 design-tokens.css (令牌统一单一源, 2026-09-13)
   ═══════════════════════════════════════════ */

/* ═══ Base (背景/文字色仅暗黑模式; 亮色模式交由 design-tokens body 规则) ═══ */
body{font-family:var(--dash-font-sans);font-size:var(--dash-text-body)}
html.dark body{background:var(--dash-bg);color:var(--dash-text-secondary)}

/* ═══ Dashboard components ═══ */
.st-dash{padding:var(--dash-2xl) var(--dash-3xl);max-width:1280px;margin:0 auto}

/* KPI card */
.st-kpi{background:var(--dash-surface);border:1px solid var(--dash-border);border-radius:var(--dash-radius-md);padding:var(--dash-xl)}
.st-kpi:hover{border-color:var(--dash-border-strong)}
.st-kpi-label{font-size:var(--dash-text-label-sm);color:var(--dash-text-tertiary);font-weight:500;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:var(--dash-sm)}
.st-kpi-value{font-size:var(--dash-text-display);font-weight:700;color:var(--dash-text-primary);line-height:1.1;font-variant-numeric:tabular-nums;margin-bottom:var(--dash-sm)}
.st-kpi-trend{font-size:var(--dash-text-body-sm);font-weight:500;display:flex;align-items:center;gap:var(--dash-xs)}
.st-kpi-trend.up{color:var(--dash-success)}.st-kpi-trend.down{color:var(--dash-danger)}

/* Action card */
.st-action{background:var(--dash-surface);border:1px solid var(--dash-border);border-radius:var(--dash-radius-md);padding:var(--dash-xl);display:flex;flex-direction:column;gap:var(--dash-md);transition:all 0.15s}
.st-action:hover{border-color:var(--dash-border-strong);box-shadow:var(--dash-shadow-card)}
.st-action-icon{font-size:var(--text-2xl);line-height:1}
.st-action-title{font-size:var(--dash-text-body-lg);font-weight:600;color:var(--dash-text-primary);display:flex;align-items:center;gap:var(--dash-sm)}
.st-action-desc{font-size:var(--dash-text-body-sm);color:var(--dash-text-secondary);line-height:1.5;flex:1}
.st-action-btn{display:inline-flex;align-items:center;gap:var(--dash-sm);padding:var(--dash-sm) var(--dash-lg);border-radius:var(--dash-radius-sm);font-size:var(--dash-text-label-sm);font-weight:600;text-decoration:none;cursor:pointer;border:none;transition:all 0.15s;margin-top:auto}
/* token */ .st-btn-primary:hover{background:var(--dash-primary);color:var(--dash-on-primary);text-decoration:none}
/* token */ .st-btn-danger{background:var(--dash-danger-soft);color:var(--dash-danger)}.st-btn-danger:hover{background:var(--dash-danger);color:#fff;text-decoration:none}
/* token */ .st-btn-purple{background:rgba(99,102,241,0.12);color:#a5b4fc}.st-btn-purple:hover{background:#6366f1;color:#fff;text-decoration:none}
.st-btn-ghost{background:var(--dash-surface-high);color:var(--dash-text-secondary)}.st-btn-ghost:hover{background:var(--dash-surface-highest);color:var(--dash-text-primary);text-decoration:none}

/* Badge */
.st-badge{display:inline-flex;align-items:center;padding:var(--space-0-5) var(--space-2);border-radius:var(--dash-radius-full);font-size:var(--dash-text-label-sm);font-weight:600;gap:var(--dash-xs)}
.st-badge-danger{background:var(--dash-danger-soft);color:var(--dash-danger)}
.st-badge-success{background:var(--dash-success-soft);color:var(--dash-success)}
.st-badge-warning{background:var(--dash-warning-soft);color:var(--dash-warning)}

/* Insight card */
.st-insight{padding:var(--dash-lg);border-radius:var(--dash-radius-md);display:flex;flex-direction:column;gap:var(--dash-sm);background:var(--dash-surface);border:1px solid var(--dash-border)}
.st-insight-warn{border-color:var(--dash-warning);background:var(--dash-warning-soft)}
.st-insight-danger{border-color:var(--dash-danger);background:var(--dash-danger-soft)}
.st-insight-success{border-color:var(--dash-success);background:var(--dash-success-soft)}
.st-insight-header{display:flex;align-items:center;gap:var(--dash-sm);font-size:var(--dash-text-body-lg);font-weight:600;color:var(--dash-text-primary)}
.st-insight-body{font-size:var(--dash-text-body-sm);color:var(--dash-text-secondary);line-height:1.5}
.st-insight-link{font-size:var(--dash-text-body-sm);font-weight:600;color:var(--dash-primary);text-decoration:none}.st-insight-link:hover{text-decoration:underline}

/* Full card */
.st-card{background:var(--dash-surface);border:1px solid var(--dash-border);border-radius:var(--dash-radius-md);padding:var(--dash-xl)}

/* Input / Form */
.st-input:focus{outline:none;border-color:var(--dash-primary);box-shadow:0 0 0 2px rgba(99,102,241,0.2)}

/* Status indicator */
.st-status{display:inline-flex;align-items:center;gap:var(--dash-sm);padding:var(--dash-xs) var(--dash-md);border-radius:var(--dash-radius-full);font-size:var(--dash-text-label-sm);font-weight:500}
.st-status-ok{background:var(--dash-success-soft);color:var(--dash-success)}
.st-status-dot{width:6px;height:6px;border-radius:50%;display:inline-block}

/* Grid helpers */
.st-grid{display:grid;gap:var(--dash-lg)}.st-grid-4{grid-template-columns:repeat(4,1fr)}.st-grid-3{grid-template-columns:repeat(3,1fr)}.st-grid-2{grid-template-columns:2fr 1fr}

/* Responsive */
@media(max-width:1024px){.st-grid-4{grid-template-columns:repeat(2,1fr)}.st-grid-3{grid-template-columns:repeat(2,1fr)}.st-grid-2{grid-template-columns:1fr}}
@media(max-width:640px){.st-grid-4,.st-grid-3{grid-template-columns:1fr}.st-dash{padding:var(--dash-lg)}}

/* ── Deployment Guide (Step 5 Next Steps) ── */
.wiz-deploy-guide { text-align: left; background: var(--surface-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-5); margin: var(--space-5) 0; }
.wiz-deploy-title { font-size: var(--text-sm); font-weight: 600; color: var(--content-primary); margin: 0 0 var(--space-4) 0; display: flex; align-items: center; gap: var(--space-2); }
.wiz-deploy-steps { display: flex; flex-direction: column; gap: var(--space-3); }
.wiz-deploy-step { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-overlay); transition: background var(--motion-fast); text-decoration: none; color: inherit; }
.wiz-deploy-step:hover { background: var(--surface-raised); }
.wiz-deploy-step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--text-inverse); display: flex; align-items: center; justify-content: center; font-size: var(--text-xs); font-weight: 700; flex-shrink: 0; }
.wiz-deploy-step-body { flex: 1; min-width: 0; }
.wiz-deploy-step-label { font-size: var(--text-sm); font-weight: 500; color: var(--content-primary); }
.wiz-deploy-step-desc { font-size: var(--text-xs); color: var(--content-tertiary); margin-top: var(--space-0-5); }
.wiz-deploy-step-arrow { color: var(--content-tertiary); font-size: var(--text-sm); flex-shrink: 0; margin-top: var(--space-1); }
.wiz-done-actions .wiz-btn-ghost { display: inline-flex; padding: var(--space-2-5) var(--space-4); background: transparent; color: var(--content-tertiary); border: none; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; font-size: var(--text-sm); }
.wiz-done-actions .wiz-btn-ghost:hover { color: var(--content-secondary); }

/* ═══ Campaigns Table — Row Color Coding (P0-1: data-density UX) ═══ */
.cp-tr { border-left: 3px solid transparent; transition: border-color 0.15s, background 0.1s; }
.cp-tr--profit { border-left-color: var(--success); }
.cp-tr--danger { border-left-color: var(--danger); }
.cp-tr--neutral { border-left-color: var(--border-default); }
.cp-tr--paused { border-left-color: var(--text-tertiary); opacity: 0.65; }
.cp-tr:hover { border-left-width: 4px; }

/* ═══ Inline Edit (P0-3: double-click to edit) ═══ */
.inline-edit-input {
  width: 100%; padding: 3px var(--space-1-5); border: 2px solid var(--accent);
  border-radius: var(--radius-sm); font-size: inherit; font-family: inherit;
  background: var(--bg-card); color: var(--text-primary);
  outline: none; box-shadow: 0 0 0 2px var(--accent-soft);
}
.inline-edit-input--error { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
.cell-editable { cursor: text; border-radius: 3px; transition: background 0.1s; }
.cell-editable:hover { background: var(--bg-overlay); }
@keyframes inline-save-flash { 0% { background: var(--success-soft); } 100% { background: transparent; } }
.inline-save-flash { animation: inline-save-flash 0.6s ease-out; }

/* ═══ Batch Operations Bar (P0-3) ═══ */
.batch-bar {
  display: none; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4); margin-bottom: var(--space-3);
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius-md); font-size: var(--text-xs);
  animation: batch-bar-in 0.2s ease;
}
@keyframes batch-bar-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.batch-bar--visible { display: flex; }

/* ═══ Button Success Micro-Feedback (green flash + checkmark) ═══ */
@keyframes btn-success-flash {
  0%   { background: var(--success); border-color: var(--success); color: #fff; }
  60%  { background: var(--success); border-color: var(--success); color: #fff; }
  100% { background: ""; border-color: ""; color: ""; }
}
.btn-success-flash { animation: btn-success-flash 1.2s ease-out; }
.btn-success-flash::after { content: " ✓"; font-weight: 700; }
@keyframes check-pop { 0% { transform: scale(0); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.check-pop { display: inline-block; animation: check-pop .3s ease-out; }

/* ═══════════════════════════════════════════
   Phase 2 — CSS Token Migration (2026-08-10)
   Plan: reduce 357 hex + 2466 inline → 60%+
   ═══════════════════════════════════════════ */

/* ── Shared form elements (replaces repeated inline styles in ~25 templates) ── */
.st-input {
font-family:var(--dash-font-sans);

  width: 100%; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  font-size: var(--text-sm); background: var(--bg-raised); color: var(--text-primary);
  transition: border-color var(--motion-fast);
}
.st-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 var(--focus-ring-width) var(--accent-glow);
}
.st-input::placeholder { color: var(--text-tertiary); }

.st-label {
  font-size: 11px; font-weight: var(--font-semibold); text-transform: uppercase;
  display: block; margin-bottom: var(--space-1); color: var(--text-secondary);
  letter-spacing: .025em;
}

.st-select {
  width: 100%; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  font-size: var(--text-sm); background: var(--bg-raised); color: var(--text-primary);
  cursor: pointer; transition: border-color var(--motion-fast);
}
.st-select:focus { outline: none; border-color: var(--accent); }

/* ── Action buttons ── */
.btn-save {
  padding: var(--space-1-5) var(--space-4); font-size: var(--text-xs);
  background: var(--accent); color: var(--text-inverse); border: none;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: var(--font-semibold);
  transition: background var(--motion-fast);
}
.btn-save:hover { background: var(--accent-hover); }

.btn-delete {
  padding: var(--space-1-5) var(--space-4); font-size: var(--text-xs);
  background: var(--danger); color: var(--text-inverse); border: none;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: var(--font-semibold);
  transition: background var(--motion-fast);
}
.btn-delete:hover { background: var(--danger); }

/* ── Status badges ── */
.status-badge {
  display: inline-block; padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--font-medium);
}
.status-badge--active  { background: var(--success-soft); color: var(--success); }
.status-badge--paused  { background: var(--warning-soft); color: var(--warning); }
.status-badge--error   { background: var(--danger-soft);  color: var(--danger); }
.status-badge--default { background: var(--bg-overlay);   color: var(--text-tertiary); }

/* ── Message / alert banners ── */
.msg-banner {
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  font-size: var(--text-xs); margin-bottom: var(--space-3);
  border: 1px solid transparent;
}
.msg-banner--success { background: var(--success-soft); border-color: var(--success-soft); color: var(--success); }
.msg-banner--warning { background: var(--warning-soft); border-color: var(--warning-soft); color: var(--warning); }
.msg-banner--error   { background: var(--danger-soft);  border-color: var(--danger-soft);  color: var(--danger); }
.msg-banner--info    { background: var(--info-soft);    border-color: var(--info-soft);    color: var(--accent); }

/* ── Form containers ── */
.form-container {
  padding: var(--space-4); border-radius: var(--radius-md); margin-bottom: var(--space-3);
  background: var(--bg-overlay); border: 1px solid var(--border-default);
}

.form-extend {
  padding: var(--space-3); border-top: 1px solid var(--border-default);
  border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--bg-overlay);
}

/* ── Section titles ── */
.section-title {
  font-size: var(--text-lg); font-weight: var(--font-semibold);
  color: var(--text-primary); margin: 0 0 var(--space-4);
}
.subsection-title {
  font-size: var(--text-sm); font-weight: var(--font-semibold);
  color: var(--text-secondary); margin: var(--space-4) 0 var(--space-2);
}

/* ── Tab navigation ── */
.tab-item {
  padding: var(--space-2-5) var(--space-5); font-size: var(--text-base); font-weight: var(--font-semibold);
  cursor: pointer; border: none; background: none; color: var(--text-tertiary);
  transition: color var(--motion-fast), border-color var(--motion-fast);
}
.tab-item:hover   { color: var(--text-primary); }
.tab-item.active  { color: var(--accent); border-bottom: 2px solid var(--accent); }

/* ── Campaign detail tabs ── */
.detail-tab {
  padding: var(--space-2) var(--space-4); font-size: var(--text-xs);
  font-weight: var(--font-semibold); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -var(--space-0-5); cursor: pointer;
  color: var(--text-tertiary); transition: color var(--motion-fast), border-color var(--motion-fast);
}
.detail-tab:hover  { color: var(--text-primary); }
.detail-tab.active { border-bottom-color: var(--accent); color: var(--accent); }

/* ── Attention items (dashboard + admin-panel) ── */
.attention-item {
display: flex;
align-items: center;
gap: var(--space-2-5);
padding: var(--space-2-5) var(--space-3-5);
border-radius: var(--radius-md);
text-decoration: none;
border-left: 3px solid transparent;

  transition: background var(--motion-fast);
}
.attention-item:hover { background: var(--bg-overlay); }

/* ── Attention card 三色优先级 (P1-5: 🔴紧急/🟡待审/🔵建议) ── */
.attention-card {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  transition: background var(--motion-fast);
}
.attention-card--alert {
  background: var(--danger-soft);
  border-left-color: var(--danger);
}
.attention-card--warning {
  background: var(--warning-soft);
  border-left-color: var(--warning);
}
.attention-card--info {
  background: var(--suggestion-soft);
  border-left-color: var(--suggestion);
}

/* ── Clickable card (onboarding step cards) ── */
.clickable-card {
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.clickable-card:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ── Step badge (numbered onboarding circles) ── */
.step-badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--text-inverse);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: var(--font-bold);
  flex-shrink: 0;
}

/* ── Stat cards (ClickHouse analytics) ── */
.stat-card {
background: var(--color-white);
border-radius: var(--radius-lg);
border: 1px solid var(--color-border-light);
box-shadow: var(--shadow-sm);
transition: transform var(--transition), box-shadow var(--transition);
display: flex;
align-items: flex-start;
gap: var(--space-4);
 padding: var(--space-3); text-align: center; }

/* ── Dashed border button (Add B-Site pattern) ── */
.btn-dashed {
  padding: var(--space-1-5) var(--space-3);
  background: var(--bg-overlay); color: var(--text-primary);
  border: 1px dashed var(--border-default); border-radius: var(--radius-md);
  font-size: var(--text-xs); cursor: pointer; width: 100%;
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.btn-dashed:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ── Inline row delete button (table row ✕) ── */
.btn-row-delete {
  padding: var(--space-1-5) var(--space-2);
  background: var(--danger-soft); color: var(--danger);
  border: none; border-radius: var(--radius-md);
  cursor: pointer; font-size: var(--text-xs);
  line-height: 1;
}
.btn-row-delete:hover { background: var(--danger); color: var(--text-inverse); }

/* ═══ Tokenized overrides — fix hardcoded hex in existing classes ═══ */
/* (Same specificity as originals; cascade order makes these win) */

.health-dot    {
margin-right:var(--space-1);
display: block;
width: 10px;
height: 10px;
border-radius: var(--radius-full);
transition: background 0.3s;
 background: var(--text-tertiary); }
.health-dot.ok { background: var(--success); }

.btn-pill-primary        {
background: var(--accent);
 color: var(--text-inverse); }
.st-btn-primary          {
background:var(--dash-primary-container);
 color: var(--text-inverse); }

/* keyframes redefinition — replaces hardcoded #fff */
@keyframes btn-success-flash {
  0%   { background: var(--success); border-color: var(--success); color: var(--text-inverse); }
  60%  { background: var(--success); border-color: var(--success); color: var(--text-inverse); }
  100% { background: ""; border-color: ""; color: ""; }
}

/* ═══ Tokenized overrides — Phase 2b (remaining hex fixes) ═══ */

/* ── Button hover states (missed in Phase 2a) ── */
.quick-create-trigger:hover { background: var(--accent); }

/* ── Panel header (already = light --text-tertiary value; now theme-aware) ── */
.panel-header {
text-transform: uppercase;
letter-spacing: 1px;
/* WCAG AA 4.56:1 on #F0F2F5 (12px bold = large text, needs 3:1 → passes) */
    flex-shrink: 0;
display:flex;
align-items:center;
gap:var(--space-2-5);
height:40px;
padding:0 var(--space-5);
font-weight:700;
font-size:var(--text-base);
cursor:default;
user-select:none;
white-space:nowrap;
 color: var(--text-tertiary); }

/* ── Confidence badge & deliverable status (success-soft green pattern) ── */
.tw-evidence-confidence {
font-size:var(--text-xs);
padding: var(--space-0-5) var(--space-1-5);
border-radius: var(--radius-sm);
font-weight: 600;
 background: var(--success-soft); color: var(--success); }
.tw-deliverable-status  {
font-size:var(--text-xs);
padding: 1px var(--space-1-5);
border-radius: var(--radius-sm);
 background: var(--success-soft); color: var(--success); }

/* ── Stitch theme button hover text (was hardcoded #fff) ── */
.st-btn-purple:hover { color: var(--text-inverse); }
.st-btn-danger:hover { color: var(--text-inverse); }

/* NOTE: Activity bar / sidebar panel hex (#0A1628, #252525, #CCC, #858585) at lines 664-828
   intentionally not tokenized — these are always-dark overlay sections where theme tokens
   would map to incorrect values in light mode. The Stitch theme --dash-* tokens could work
   but would change the visual appearance (colors differ ~5-10%). Deferred to Phase 3. */

/* ═══ Migrated from design-tokens.css (classes, not tokens) ═══ */

/* Glass cards — frosted KPI panels */
.glass-kpi {
  background: rgba(255,255,255,0.45); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,0.04);
}
html.dark .glass-kpi { background: rgba(17,24,32,0.55); border-color: rgba(255,255,255,0.06); }

/* ROI Heatmap — color-coded performance indicators */
.roi-red    { color: #dc2626 !important; font-weight: 700; }
.roi-orange { color: #ea580c !important; font-weight: 600; }
.roi-yellow { color: #ca8a04 !important; }
.roi-green  { color: #16a34a !important; font-weight: 600; }
.roi-rocket { color: #059669 !important; font-weight: 700; }

/* ROI Heatmap — brighter for dark backgrounds */
html.dark .roi-red    { color: #f87171 !important; }
html.dark .roi-orange { color: #fb923c !important; }
html.dark .roi-yellow { color: #facc15 !important; }
html.dark .roi-green  { color: #4ade80 !important; }

/* ═══ Confirm Dialog (P0-10) — global confirm modal ═══ */
/* JS: public/build/js/global/confirm-dialog.js · 挂载: _layout.latte */

.cf-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.cf-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3001;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: var(--space-6);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: cf-pop-in var(--motion-fast) ease-out;
}

.cf-icon {
  font-size: var(--text-lg);
  line-height: 1;
  margin-bottom: var(--space-3);
}

.cf-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.cf-msg {
  margin: 0 0 var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-tertiary);
}

.cf-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.cf-btn {
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast);
}

.cf-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cf-btn-cancel {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-primary);
}

.cf-btn-cancel:hover { background: var(--bg-overlay); }

.cf-btn-ok {
  background: var(--accent);
  color: var(--text-inverse);
}

.cf-btn-ok:hover { opacity: 0.9; }

.cf-dialog.cf-danger .cf-btn-ok { background: var(--danger); }

@keyframes cf-pop-in {
  from { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-dialog { animation: none; }
}

/* ═══ P1-10: 响应式断点 (1280px / 1024px) ═══
   原拟入 layout-core.css, 因该文件含用户 WIP 迁移至此 */
/* ≤1280px 小桌面: 六列 KPI 降三列 */
@media (max-width: 1280px) {
  .gtc-6 { grid-template-columns: repeat(3, 1fr); }
}
/* ≤1024px 窄屏: KPI 降两列, 任务中心 F-Pattern 转单列 */
@media (max-width: 1024px) {
  .gtc-6 { grid-template-columns: repeat(2, 1fr); }
  .health-command-grid { grid-template-columns: 1fr; }
}

/* ═══ P1-11: 本地备注系统 (molecules/notes.latte) ═══ */
.notes-panel {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-default);
}
.notes-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.notes-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}
.notes-local-hint {
  font-size: 10px;
  color: var(--text-tertiary);
}
.notes-compose {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}
.notes-input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-primary);
  resize: vertical;
  min-height: 52px;
  font-family: var(--font-sans);
}
.notes-input:focus {
  outline: none;
  border-color: var(--accent);
}
.notes-save-btn {
  padding: 0 var(--space-4);
  background: var(--accent);
  color: var(--text-inverse);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--motion-fast);
}
.notes-save-btn:hover { opacity: 0.9; }
.notes-save-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.notes-warn {
  margin-top: var(--space-2);
  font-size: 11px;
  color: var(--warning);
}
.notes-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.notes-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.notes-item-text {
  flex: 1;
  font-size: var(--text-xs);
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
}
.notes-item-meta {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  padding-top: var(--space-0-5);
}
.notes-del-btn {
  background: none;
  border: none;
  padding: var(--space-0-5) var(--space-1);
  font-size: 11px;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--motion-fast);
}
.notes-del-btn:hover { color: var(--danger); }
.notes-empty {
  margin-top: var(--space-3);
  padding: var(--space-3);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
html.dark .roi-rocket { color: #34d399 !important; }

/* ═══ P2-7 列宽拖拽记忆 ═══ */
th.col-resizable { position: relative; }
.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 1;
  user-select: none;
}
.col-resize-handle:hover,
.col-resize-handle:active {
  background: var(--accent);
  opacity: 0.35;
}
/* P1-2 列模板 chips */
.tpl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-sm);
}
.tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-0-5);
  padding: var(--space-0-5) var(--space-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}
.tpl-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tpl-chip-btn,
.tpl-chip-x {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 11px;
  color: inherit;
  cursor: pointer;
}
.tpl-chip-x {
  color: var(--text-tertiary);
  line-height: 1;
}
.tpl-chip-x:hover {
  color: var(--danger);
}
.tpl-save {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-sm);
}
.tpl-name {
  flex: 1;
  min-width: 0;
  padding: 3px var(--space-1-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 11px;
}
/* P1-3 折叠详情行 */
.row-expand {
  border: 0;
  background: transparent;
  padding: 0 var(--space-1) 0 0;
  color: var(--text-tertiary);
  font-size: 10px;
  cursor: pointer;
  transition: transform 150ms ease;
}
.row-expand:hover,
.row-expand:focus-visible {
  color: var(--accent);
  outline-offset: 2px;
}
.row-expand--open {
  transform: rotate(90deg);
}
.row-detail > td {
  padding: 0;
}
.row-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-2) var(--space-4);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-overlay);
  border-top: 1px solid var(--border);
}
.row-detail-item {
  min-width: 0;
}
.row-detail-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.row-detail-value {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
  .row-expand {
    transition: none;
  }
}

/* ── P2-3 全局错误日志入口 (左下角 FAB + 弹窗) ── */
.error-log-fab {
  position: fixed;
  left: 80px; /* 64px 图标栏 + 16px 间距 */
  bottom: 16px;
  z-index: var(--z-tooltip);
}
/* #66: 展开态侧栏 240px 时, left:80px (按 64px 收起态设计) 会压住 sidebar-footer 的
   logout/TSA 链接 (z=600 盖 z=100) → 展开时右移到侧栏右侧 16px 外; 弹窗同步。
   移动端 (≤480px) 侧栏隐藏, 维持 16px 由下方 media query 决定 — 此处仅 ≥481px 生效 */
@media (min-width: 481px) {
  #app-sidebar[data-collapsed="false"] ~ .error-log-fab { left: 256px; }
  #app-sidebar[data-collapsed="false"] ~ .error-log-fab .error-log-panel { left: 256px; }
}
.error-log-fab-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--motion-fast) ease;
}
.error-log-fab-btn:hover {
  transform: translateY(-2px);
}
.error-log-fab-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}
.error-log-panel {
  position: fixed;
  left: 80px;
  bottom: 68px;
  width: min(340px, calc(100vw - 96px));
  max-height: min(420px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.error-log-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}
.error-log-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.error-log-close {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.error-log-close:hover {
  color: var(--text-primary);
  background: var(--bg-overlay);
}
.error-log-panel-body {
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 120px;
}
.error-log-state {
  padding: var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.error-log-retry {
  align-self: center;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-size: var(--text-xs);
  cursor: pointer;
  min-height: 32px;
}
.error-log-row {
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-overlay);
}
.error-log-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-0-5);
}
.error-log-time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.error-log-badge {
  font-size: 10px;
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  font-weight: var(--weight-medium);
}
.error-log-badge--fatal {
  color: var(--danger);
  background: var(--danger-soft);
}
.error-log-badge--caught {
  color: var(--warning);
  background: var(--warning-soft);
}
.error-log-badge--batch {
  color: var(--info);
  background: var(--info-soft);
}
.error-log-badge--default {
  color: var(--text-secondary);
  background: var(--bg-raised);
}
.error-log-msg {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.error-log-link {
  display: inline-block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--accent);
  text-decoration: none;
}
.error-log-link:hover {
  color: var(--accent-hover);
}
.error-log-viewall {
  display: block;
  padding: var(--space-3) var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--border-subtle);
  min-height: 32px;
}
.error-log-viewall:hover {
  color: var(--accent-hover);
  background: var(--bg-overlay);
}
@media (max-width: 480px) {
  .error-log-fab,
  .error-log-panel {
    left: 16px; /* 移动端图标栏隐藏 */
  }
}
@media (prefers-reduced-motion: reduce) {
  .error-log-fab-btn {
    transition: none;
  }
}

/* ── 管理面板功能网格 (G23 内联样式迁移) ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ── SVG 图标基线 (Icon::svg 包裹 .icon icon-{name}) ── */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Drawer 侧滑面板 (Molecules/Drawer.php, 复用 .ts-drawer 定位范式独立类) ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--text-primary) 40%, transparent);
  z-index: 1000;
  display: none;
}
.drawer-overlay.drawer-open {
  display: block;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  background: var(--surface-raised, var(--bg-card));
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  display: none;
  flex-direction: column;
  animation: drawer-in 0.22s ease-out;
}
.drawer-overlay.drawer-open .drawer {
  display: flex;
}
@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-6);
}
.drawer-footer {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-default);
}

/* ═══ Molecule: Tooltip (CSS-only, data-cp-tooltip) ═══ */
.cp-tooltip {
  position: relative;
  display: inline-flex;
  cursor: help;
}
.cp-tooltip::after {
  content: attr(data-cp-tooltip);
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1-5) var(--space-3);
  background: var(--text-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 50;
}
.cp-tooltip:hover::after,
.cp-tooltip:focus-visible::after {
  opacity: 1;
}

/* ═══ Molecule: Progress (native <progress>) ═══ */
.cp-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cp-progress-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.cp-progress-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--border-default);
  overflow: hidden;
}
.cp-progress-bar::-webkit-progress-bar {
  background: var(--border-default);
  border-radius: var(--radius-sm);
}
.cp-progress-bar::-webkit-progress-value {
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: width 0.2s ease;
}
.cp-progress-bar::-moz-progress-bar {
  background: var(--accent);
  border-radius: var(--radius-sm);
}

/* ═══ Molecule: Timeline (independent of click-lookup .timeline) ═══ */
.cp-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.cp-timeline-item {
  position: relative;
  padding-left: calc(var(--space-4) + var(--space-2));
  padding-bottom: var(--space-2);
  border-left: 2px solid var(--border-default);
}
.cp-timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.cp-timeline-time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.cp-timeline-title {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
}
.cp-timeline-desc {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ═══ Molecule: Avatar (deterministic color + size variants) ═══ */
.cp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  line-height: 1;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--text-inverse);
  background: var(--avatar-blue);
}
.cp-avatar--sm { width: 28px; height: 28px; font-size: 0.75rem; }
.cp-avatar--md { width: 36px; height: 36px; font-size: 0.875rem; }
.cp-avatar--lg { width: 48px; height: 48px; font-size: 1rem; }
.cp-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.cp-avatar[data-cp-avatar-color="blue"]    { background: var(--avatar-blue); }
.cp-avatar[data-cp-avatar-color="green"]   { background: var(--avatar-green); }
.cp-avatar[data-cp-avatar-color="pink"]    { background: var(--avatar-pink); }
.cp-avatar[data-cp-avatar-color="amber"]   { background: var(--avatar-amber); }
.cp-avatar[data-cp-avatar-color="red"]     { background: var(--avatar-red); }
.cp-avatar[data-cp-avatar-color="violet"]  { background: var(--avatar-violet); }
.cp-avatar[data-cp-avatar-color="magenta"] { background: var(--avatar-magenta); }
.cp-avatar[data-cp-avatar-color="cyan"]    { background: var(--avatar-cyan); }

/* ═══ Molecule: Tabs (复用 shared/tabs_controller, data-controller="tabs") ═══ */
.cp-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.cp-tabs-nav {
  display: flex;
  gap: var(--space-0-5);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
}
.cp-tab {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  padding: var(--space-2) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--motion-fast);
  font-family: var(--font-sans);
}
.cp-tab:hover {
  color: var(--text-primary);
}
.cp-tab.active {
  background: var(--accent);
  color: var(--text-inverse);
}

/* ═══ Molecule: Dropdown (复用 shared/dropdown_controller, data-controller="dropdown") ═══ */
.cp-dropdown {
  position: relative;
  display: inline-block;
}
.cp-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  padding: var(--space-2) var(--space-3-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--motion-fast);
}
.cp-dropdown-trigger:hover {
  background: var(--bg-overlay);
}
.cp-dropdown-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 60;
}
.cp-dropdown--right .cp-dropdown-panel {
  left: auto;
  right: 0;
}
.cp-dropdown-item a,
.cp-dropdown-item button {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-align: left;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.cp-dropdown-item a:hover,
.cp-dropdown-item button:hover {
  background: var(--bg-overlay);
}

/* ═══ Atom: Toggle (.switch 轨道/滑块, 从 ui-components.css 上移至全局 app-core.css) ═══ */
.switch {
  appearance: none;
  width: 2.5rem;
  height: 1.4rem;
  border-radius: var(--radius-full);
  background: var(--border-default);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.switch:checked { background: var(--accent-emphasis); }
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.4rem - 4px);
  height: calc(1.4rem - 4px);
  border-radius: 50%;
  background: var(--surface-raised);
  transition: transform var(--transition);
}
.switch:checked::after { transform: translateX(calc(2.5rem - 1.4rem)); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch-error { outline: 2px solid var(--danger); outline-offset: 1px; }
