:root {
  color-scheme: light;
  --primary: #6d28d9;
  --primary-hover: #5b21b6;
  --primary-soft: #f1eafe;
  --accent: #db2777;
  --success: #047857;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f2f3f5;
  --ink: #111827;
  --body: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --sidebar: #15111f;
  --sidebar-text: #e9e7ee;
  --sidebar-muted: #9c96a7;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, .08);
  --shadow-lg: 0 24px 70px rgba(17, 24, 39, .18);
  --sidebar-width: 244px;
  --topbar-height: 68px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #a78bfa;
  --primary-hover: #c4b5fd;
  --primary-soft: #2e2440;
  --accent: #f472b6;
  --success: #6ee7b7;
  --success-soft: #15382f;
  --warning: #fbbf24;
  --warning-soft: #3c2b11;
  --danger: #fca5a5;
  --danger-soft: #3b1d22;
  --canvas: #111016;
  --surface: #1a1821;
  --surface-2: #201e28;
  --surface-3: #292631;
  --ink: #f5f3f7;
  --body: #d4d0da;
  --muted: #aaa4b3;
  --faint: #7e7787;
  --line: #312e39;
  --line-strong: #494451;
  --sidebar: #0c0a10;
  --sidebar-text: #f2eff5;
  --sidebar-muted: #9991a5;
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 26px 80px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--body); background: var(--canvas); font-size: 15px; line-height: 1.55; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 200; top: 8px; left: 8px; transform: translateY(-150%); padding: 10px 14px; border-radius: 8px; color: white; background: var(--primary); }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; width: var(--sidebar-width); flex-direction: column; padding: 20px 14px 16px; color: var(--sidebar-text); background: var(--sidebar); border-right: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 8px 18px; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #8b5cf6, #db2777); font-family: Georgia, serif; font-size: 23px; font-weight: 700; box-shadow: 0 7px 20px rgba(109,40,217,.35); }
.brand strong, .brand small { display: block; }
.brand strong { color: white; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; }
.brand small { margin-top: 3px; color: var(--sidebar-muted); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.primary-nav { display: grid; gap: 3px; overflow-y: auto; padding: 8px 0; scrollbar-width: thin; }
.nav-item { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; min-height: 44px; gap: 11px; width: 100%; padding: 9px 11px; border: 0; border-radius: 9px; color: var(--sidebar-muted); background: transparent; text-align: left; transition: color .18s ease, background .18s ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: var(--sidebar-text); background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(139,92,246,.25), rgba(139,92,246,.08)); box-shadow: inset 3px 0 #a78bfa; }
.nav-item.active svg { color: #c4b5fd; }
.nav-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; color: #e9d5ff; background: rgba(167,139,250,.18); font-size: 11px; text-align: center; }
.nav-count:empty { display: none; }
.sidebar-footer { display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 4px 8px; margin-top: auto; padding: 13px 12px 2px; border-top: 1px solid rgba(255,255,255,.08); color: var(--sidebar-text); font-size: 12px; }
.sidebar-footer small { grid-column: 2; color: var(--sidebar-muted); font-size: 10px; }
.live-dot, .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); }

.content-shell { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; min-height: var(--topbar-height); align-items: center; gap: 16px; padding: 10px clamp(18px, 2.4vw, 36px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); }
.breadcrumb { display: flex; min-width: 0; flex-direction: column; }
.breadcrumb small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.breadcrumb strong { overflow: hidden; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sync-status { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; color: var(--muted); font-size: 12px; }
.sync-status.loading .status-dot { background: var(--warning); animation: pulse 1s infinite alternate; }
.icon-button, .button, .text-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; text-decoration: none; transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.icon-button { width: 44px; padding: 0; border: 1px solid var(--line); color: var(--body); background: var(--surface); }
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.button { min-width: 44px; padding: 10px 15px; border: 1px solid transparent; font-weight: 650; }
.button svg { width: 18px; height: 18px; }
.button.primary { color: #fff; background: var(--primary); box-shadow: 0 5px 16px color-mix(in srgb, var(--primary) 24%, transparent); }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { color: var(--body); border-color: var(--line); background: var(--surface); }
.button.secondary:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.button.danger { color: white; background: #b91c1c; }
.button.danger:hover { background: #991b1b; }
.button.danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.button.danger-ghost:hover { background: var(--danger-soft); }
.button.small { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.text-button { min-height: 36px; padding: 4px 6px; border: 0; color: var(--primary); background: transparent; font-weight: 650; }
.text-button:hover { color: var(--primary-hover); background: var(--primary-soft); }
.mobile-only { display: none; }

main { width: min(1500px, 100%); margin: 0 auto; padding: 28px clamp(18px, 2.4vw, 36px) 64px; }
/* The fade-in keeps nothing once it ends: a transform left on the view would pin the
   save bar (position: fixed) to the bottom of the page instead of the screen. */
.view { display: none; animation: view-in .22s ease backwards; }
.view.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 2px 0 24px; }
.page-heading h1 { margin: 2px 0 4px; color: var(--ink); font-size: clamp(27px, 3vw, 38px); line-height: 1.15; letter-spacing: -.035em; }
.page-heading p:not(.eyebrow) { max-width: 720px; margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; color: var(--ink); font-size: 17px; }

.pipeline-track { overflow: hidden; height: 8px; border-radius: 99px; background: var(--surface-3); }
.pipeline-fill { height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .35s ease; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin: 5px 0; color: var(--ink); font-size: 23px; }
.toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.search-field { position: relative; display: flex; width: min(480px, 100%); align-items: center; }
.search-field svg { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-field input { width: 100%; min-height: 44px; padding: 9px 14px 9px 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); }
.search-field input::placeholder { color: var(--faint); }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { min-height: 36px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 12px; }
.filter-chip:hover, .filter-chip[aria-pressed="true"] { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 32%, var(--line)); background: var(--primary-soft); }

.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label, .field > span, fieldset legend { color: var(--ink); font-size: 13px; font-weight: 650; }
.field small { color: var(--muted); font-size: 11px; }
.field small.field-warning { color: var(--warning); font-size: 12px; line-height: 1.5; }
.field input, .field textarea, .field select, .settings-grid input, .settings-grid select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-2); transition: border-color .18s ease, box-shadow .18s ease; }
.field textarea { min-height: 136px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .settings-grid input:focus, .settings-grid select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); outline: 0; }
fieldset.field { padding: 0; border: 0; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.check-card { position: relative; display: flex; min-height: 64px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--body); background: var(--surface-2); cursor: pointer; }
.check-card:has(input:checked) { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 48%, var(--line)); background: var(--primary-soft); }
.check-card input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.check-card strong, .check-card small { display: block; }
.check-card strong { color: inherit; font-size: 13px; }
.check-card small { color: var(--muted); font-size: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; min-width: 780px; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
td { color: var(--body); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 42%, transparent); }
.table-title { display: block; max-width: 420px; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.table-subtitle { display: block; max-width: 420px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }
.status-badge, .channel-badge, .meta-pill, .version-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-badge { padding: 4px 8px; }
.status-badge[data-tone="success"] { color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, var(--line)); background: var(--success-soft); }
.status-badge[data-tone="warning"] { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 22%, var(--line)); background: var(--warning-soft); }
.status-badge[data-tone="danger"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, var(--line)); background: var(--danger-soft); }
.status-badge[data-tone="info"] { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 22%, var(--line)); background: var(--primary-soft); }

.draft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.draft-card { position: relative; display: flex; min-height: 270px; overflow: hidden; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--body); background: var(--surface); text-align: left; box-shadow: var(--shadow-sm); transition: border-color .2s ease, box-shadow .2s ease; }
.draft-card:hover { border-color: color-mix(in srgb, var(--channel-light) 35%, var(--line)); box-shadow: var(--shadow-md); }
.draft-open { display: flex; min-height: 100%; flex: 1; flex-direction: column; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.card-delete, .asset-delete { position: absolute; z-index: 3; top: 10px; right: 10px; width: 36px; min-height: 36px; color: var(--danger); background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-sm); opacity: 0; transition: opacity .18s ease, background .18s ease; }
.draft-card:hover .card-delete, .draft-card:focus-within .card-delete, .asset-card:hover .asset-delete, .asset-card:focus-within .asset-delete { opacity: 1; }
.card-delete:hover, .asset-delete:hover { color: var(--danger); background: var(--danger-soft); }
.draft-thumb { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; background: var(--surface-3); }
.card-body { display: flex; min-height: 210px; flex: 1; flex-direction: column; padding: 16px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.channel-badge { padding: 4px 8px; color: var(--channel-light); border-color: color-mix(in srgb, var(--channel-light) 25%, var(--line)); background: color-mix(in srgb, var(--channel-light) 8%, var(--surface)); }
.channel-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.draft-card h3 { display: -webkit-box; overflow: hidden; margin: 16px 0 7px; color: var(--ink); font-size: 18px; line-height: 1.35; letter-spacing: -.02em; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.draft-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; }
.card-footer small { overflow: hidden; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-open { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-size: 11px; font-weight: 700; }
.card-open svg { width: 15px; height: 15px; }
.skeleton { min-height: 270px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface-3), var(--surface), var(--surface-3)); background-size: 220% 100%; animation: shimmer 1.2s infinite linear; }
.empty-state { display: grid; min-height: 260px; place-items: center; align-content: center; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--muted); text-align: center; }
.empty-state h3 { margin: 0 0 4px; color: var(--ink); }
.empty-state p { margin: 0; }

.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.asset-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.asset-card a { display: block; color: inherit; text-decoration: none; }
.asset-image { display: grid; width: 100%; aspect-ratio: 4 / 3; place-items: center; overflow: hidden; background: var(--surface-3); }
.asset-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.asset-card:hover .asset-image img { transform: scale(1.025); }
.asset-image svg { width: 30px; height: 30px; color: var(--faint); }
.asset-info { padding: 13px; }
.asset-info strong { display: block; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.asset-info p { display: -webkit-box; overflow: hidden; min-height: 34px; margin: 5px 0; color: var(--muted); font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.asset-meta { display: flex; justify-content: space-between; color: var(--faint); font-size: 9px; }
.channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.channel-card { padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.channel-head { display: flex; align-items: center; gap: 12px; }
.channel-logo { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: var(--channel-color, var(--primary)); background: color-mix(in srgb, var(--channel-color, var(--primary)) 10%, var(--surface)); }
.channel-logo svg { width: 22px; height: 22px; }
.channel-head div { min-width: 0; flex: 1; }
.channel-head strong, .channel-head small { display: block; }
.channel-head strong { color: var(--ink); }
.channel-head small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.channel-details { display: grid; gap: 10px; margin-top: 20px; }
.channel-detail { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; }
.channel-detail span { color: var(--muted); }
.channel-detail strong { color: var(--ink); }
.channel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.channel-actions .status-badge { margin-right: auto; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.connection-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 14%, transparent); }
.connection-state.connected { color: var(--success); }
.connection-state.connected i { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent); }
.connection-state.pending { color: var(--warning); }
.connection-state.pending i { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 14%, transparent); }

.settings-layout { display: grid; gap: 14px; padding-bottom: 120px; }
.settings-section { display: grid; grid-template-columns: 46px 1fr; gap: 16px; padding: 22px; }
.section-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.settings-section h2 { margin: 0; color: var(--ink); font-size: 18px; }
.settings-section h2 + p { margin: 3px 0 20px; color: var(--muted); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.settings-grid .field { margin: 0; }
.settings-grid .full { grid-column: 1 / -1; }
.switch-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; min-height: 58px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.switch-row.wide { margin: 0 0 18px; }
.switch-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { color: var(--ink); font-size: 12px; }
.switch-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.switch { position: relative; width: 39px; height: 22px; border-radius: 99px; background: var(--line-strong); transition: background .18s ease; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .18s ease; content: ""; }
.switch-row input:checked + .switch { background: var(--primary); }
.switch-row input:checked + .switch::after { transform: translateX(17px); }
.switch-row:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent); }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.theme-card { position: relative; display: grid; min-height: 116px; align-content: start; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); cursor: pointer; }
.theme-card input { position: absolute; opacity: 0; }
.theme-card:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); }
.theme-swatches { display: flex; gap: 4px; margin-bottom: 10px; }
.theme-swatches i { width: 18px; height: 18px; border: 2px solid var(--surface); border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--line); }
.theme-card strong { color: var(--ink); font-size: 12px; }
.theme-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
/* Style samples: the same article drawn in every style. */
.theme-samples { display: flex; gap: 6px; align-items: flex-end; margin-top: 10px; }
.theme-samples img { height: 56px; border: 1px solid var(--line); border-radius: 6px; object-fit: cover; background: var(--surface); cursor: zoom-in; }
.theme-samples img.cover { aspect-ratio: 2.35 / 1; }
.theme-samples img.card { aspect-ratio: 3 / 4; }
.theme-samples img:hover { box-shadow: 0 0 0 2px var(--primary); }
.sample-pending { display: inline-grid; place-items: center; height: 56px; padding: 0 10px; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: 10px; }
.theme-preview { display: grid; gap: 4px; margin: -4px 0 6px; }
.theme-preview .theme-samples { margin-top: 0; }
.theme-preview .theme-samples img { height: 96px; }
.check-line .theme-samples img { height: 48px; }
.theme-sample-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: -8px 0 18px; }
.image-preview { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(8, 10, 18, .84); cursor: zoom-out; }
.image-preview figure { display: grid; gap: 10px; justify-items: center; margin: 0; }
.image-preview img { max-width: min(92vw, 1400px); max-height: 82vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.image-preview figcaption { color: #fff; font-size: 13px; }
.channel-settings { display: grid; gap: 12px; }
.channel-setting { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.channel-setting-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.channel-setting-head strong { color: var(--ink); }
.channel-setting-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.channel-setting-fields .field { margin: 0; }
.version-pill { min-height: 34px; padding: 7px 11px; }
.sticky-save { position: fixed; z-index: 25; right: 24px; bottom: 20px; left: calc(var(--sidebar-width) + 24px); display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1100px; margin: auto; padding: 13px 15px 13px 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(14px); }
.sticky-save strong, .sticky-save small { display: block; }
.sticky-save strong { color: var(--ink); font-size: 14px; }
.sticky-save small { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
/* The settings save bar shows where the settings stand in colour, mark and words: in force,
   edited, saving, saved, not saved (2.0.0a41). */
.sticky-save { justify-content: flex-start; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.save-state-text { flex: 1; min-width: 0; }
.save-state-mark { display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); background: var(--surface-3); font-size: 15px; font-weight: 800; line-height: 1; }
.save-state-mark::before { content: "✓"; }
.sticky-save[data-state="dirty"] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent), var(--shadow-lg); }
.sticky-save[data-state="dirty"] .save-state-mark { color: var(--surface); background: var(--primary); }
.sticky-save[data-state="dirty"] .save-state-mark::before { content: "✎"; }
.sticky-save[data-state="saving"] .save-state-mark::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
.sticky-save[data-state="saved"] { border-color: color-mix(in srgb, var(--success) 45%, transparent); background: var(--success-soft); }
.sticky-save[data-state="saved"] .save-state-mark { color: var(--surface); background: var(--success); }
.sticky-save[data-state="saved"] strong { color: var(--success); }
.sticky-save[data-state="error"] { border-color: color-mix(in srgb, var(--danger) 50%, transparent); background: var(--danger-soft); }
.sticky-save[data-state="error"] .save-state-mark { color: var(--surface); background: var(--danger); }
.sticky-save[data-state="error"] .save-state-mark::before { content: "!"; }
.sticky-save[data-state="error"] strong { color: var(--danger); }
.sticky-save[data-state="error"] small { color: var(--body); }
.sticky-save #save-settings { flex: 0 0 auto; min-width: 104px; }
/* "已保存" is a state, not a broken button. */
.sticky-save[data-state="clean"] #save-settings:disabled, .sticky-save[data-state="saved"] #save-settings:disabled { opacity: 1; color: var(--muted); background: var(--surface-3); box-shadow: none; cursor: default; }
.sticky-save[data-state="saved"] #save-settings:disabled { color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.sticky-save[data-state="saving"] #save-settings:disabled { opacity: .75; cursor: progress; }

.timeline { display: grid; gap: 0; padding: 2px 0; }
.timeline.compact { padding: 10px 22px 18px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; min-height: 66px; padding: 12px 0; }
.timeline:not(.compact) .timeline-item { padding: 15px 18px; border-right: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.timeline:not(.compact) .timeline-item:first-child { border-top: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.timeline:not(.compact) .timeline-item:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.timeline-item:not(:last-child)::before { position: absolute; top: 35px; bottom: -10px; left: 13px; width: 1px; background: var(--line); content: ""; }
.timeline-mark { display: grid; z-index: 1; width: 27px; height: 27px; place-items: center; border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line)); border-radius: 50%; color: var(--primary); background: var(--surface); }
.timeline-mark svg { width: 13px; height: 13px; }
.timeline-copy strong, .timeline-copy small { display: block; }
.timeline-copy strong { color: var(--ink); font-size: 12px; }
.timeline-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.timeline-time { color: var(--faint); font-size: 10px; white-space: nowrap; }

.drawer-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(9,7,12,.55); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 90; inset: 0 0 0 auto; display: flex; width: min(900px, 92vw); flex-direction: column; color: var(--body); background: var(--surface); box-shadow: var(--shadow-lg); animation: drawer-in .24s ease both; }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { max-width: 720px; margin: 0; color: var(--ink); font-size: 22px; line-height: 1.28; }
.drawer-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 22px; border-bottom: 1px solid var(--line); }
.meta-pill { padding: 4px 8px; }
.drawer-versions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 22px; border-bottom: 1px solid var(--line); }
.drawer-versions > span { margin-right: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.draft-version { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-2); font: inherit; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.draft-version.active { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); background: var(--primary-soft); }
.project-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.project-status small { color: var(--muted); }
.wechat-preview { max-width: 414px; max-height: 70vh; margin: 0 auto; overflow: auto; padding: 18px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: rgba(0, 0, 0, .9); font-size: 17px; line-height: 1.6; overflow-wrap: break-word; }
.wechat-preview > h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.35; color: #111827; }
.wechat-preview > .wechat-byline { margin: 0 0 14px; color: #6b7280; font-size: 13px; }
.wechat-preview > img { display: block; width: 100%; height: auto; margin: 0 0 16px; border-radius: 8px; }
/* The WeChat draft at phone width (2.0.0a39). Its look comes inline with the draft: the
   console's own table rules must not reach into it, so the preview matches the phone. */
.wechat-phone { max-width: 414px; margin: 0 auto; padding: 20px 16px 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: rgba(0, 0, 0, .9); font-size: 17px; line-height: 1.6; overflow-wrap: break-word; }
.wechat-phone > h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.4; color: #111827; }
.wechat-phone > .wechat-byline { margin: 0 0 16px; color: #576b95; font-size: 15px; }
.wechat-phone > .wechat-cover { display: block; width: 100%; height: auto; margin: 0 0 16px; border-radius: 8px; }
.wechat-phone table, .wechat-preview table { min-width: 0; }
.wechat-phone th, .wechat-phone td, .wechat-preview th, .wechat-preview td { padding: 0; border: 0; color: inherit; background: none; font-size: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: none; text-align: inherit; vertical-align: inherit; }
.wechat-phone th, .wechat-preview th { font-weight: 700; }
.wechat-phone img, .wechat-preview img { max-width: 100%; }
.stale-pill { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 26%, var(--line)); background: var(--warning-soft); }
.tab-list { display: flex; gap: 3px; padding: 10px 22px 0; border-bottom: 1px solid var(--line); }
.tab-list button { min-height: 40px; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; }
.tab-list button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.drawer-content { flex: 1; overflow: auto; padding: 24px; }
.drawer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.article-preview { max-width: 760px; margin: 0 auto; color: var(--body); font-size: 16px; line-height: 1.75; overflow-wrap: break-word; }
.article-preview > h1 { color: var(--ink); font-size: 30px; line-height: 1.28; }
.article-preview h1, .article-preview h2, .article-preview h3, .article-preview h4 { color: var(--ink); }
.article-preview img { display: block; max-width: 100%; height: auto; margin: 20px auto; border-radius: 10px; }
.article-preview pre, .code-view { overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--body); background: var(--surface-2); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.preview-notice { display: grid; gap: 3px; margin-bottom: 22px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line)); border-radius: 10px; background: var(--primary-soft); }
.preview-notice strong { color: var(--primary); font-size: 12px; }
.preview-notice span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.x-article-preview blockquote { margin: 18px 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--primary); color: var(--muted); }
.x-article-preview li { margin: 5px 0; }
.x-article-preview .x-cover { display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; object-fit: cover; margin: 0 0 22px; border-radius: 12px; }
.x-article-preview .x-picture { margin: 18px 0; }
.x-article-preview .x-picture img { margin: 0 auto; }
.x-table { overflow-x: auto; margin: 18px 0; }
/* An article's own tables (website, X Article, the shared article preview), not the
   console's list tables. */
.article-preview table { width: 100%; min-width: 0; margin: 18px 0; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.article-preview .x-table table { margin: 0; }
.article-preview th, .article-preview td { padding: 7px 9px; border: 1px solid var(--line); color: inherit; font-size: inherit; letter-spacing: normal; text-transform: none; text-align: left; vertical-align: top; }
.article-preview th { background: var(--surface-2); font-weight: 700; }
.preview-empty { color: var(--muted); font-style: italic; }
.xhs-preview { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: 24px; }
.xhs-phone { overflow: hidden; height: max-content; border: 8px solid var(--ink); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-md); }
.xhs-real-cover { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.xhs-cover { display: flex; aspect-ratio: 3 / 4; flex-direction: column; justify-content: flex-end; padding: 24px; color: #1f2937; background: linear-gradient(145deg, #fdf2f8, #ede9fe); }
.xhs-cover h3 { font-size: 25px; line-height: 1.25; }
.xhs-copy { max-height: 220px; overflow: auto; padding: 14px; color: var(--body); background: var(--surface); font-size: 11px; white-space: pre-wrap; }
.card-plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.xhs-card-real, .xhs-card { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.xhs-card-real img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.xhs-card-real figcaption { padding: 8px; color: var(--muted); font-size: 9px; }
.xhs-card { min-height: 210px; padding: 16px; }
.xhs-card h3 { color: var(--ink); }

#confirm-dialog, #delete-dialog, #channel-dialog, #draft-editor-dialog { width: min(480px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; color: var(--body); background: transparent; }
#channel-dialog { width: min(820px, calc(100% - 28px)); }
#draft-editor-dialog { width: min(920px, calc(100% - 28px)); }
#confirm-dialog::backdrop, #delete-dialog::backdrop, #channel-dialog::backdrop, #draft-editor-dialog::backdrop { background: rgba(9,7,12,.62); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.dialog-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; color: var(--danger); background: var(--danger-soft); }
.dialog-card h2 { margin: 16px 0 5px; color: var(--ink); }
.dialog-card > p { margin: 0 0 18px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 0; }
.dialog-heading p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.draft-editor-card { max-height: min(90vh, 940px); overflow: auto; }
.revision-callout { display: grid; gap: 2px; margin: -2px 0 18px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line)); border-radius: 10px; background: var(--primary-soft); }
.revision-callout strong { color: var(--primary); font-size: 12px; }
.revision-callout span { color: var(--muted); font-size: 10px; }
.draft-editor-grid { display: grid; grid-template-columns: 1fr; }
.draft-editor-body { min-height: 360px; resize: vertical; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; }
.draft-editor-destinations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.draft-editor-destinations label { display: flex; gap: 9px; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.draft-editor-destinations input { width: 17px; height: 17px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--primary); }
.draft-editor-destinations strong, .draft-editor-destinations small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-editor-destinations strong { color: var(--ink); font-size: 11px; }
.draft-editor-destinations small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.draft-editor-card > .dialog-actions { position: sticky; z-index: 2; bottom: -26px; margin: 0 -26px -26px; padding: 14px 26px 22px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(12px); }
.channel-dialog-card { max-height: min(86vh, 850px); overflow: auto; }
.channel-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.channel-form-grid .full { grid-column: 1 / -1; }
.channel-form-grid textarea { min-height: 112px; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.channel-form-section { margin: 0 -4px 20px; padding: 18px 4px 2px; border-top: 1px solid var(--line); }
.channel-form-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.channel-form-section-heading > div { display: flex; gap: 11px; }
.channel-form-section-heading h3 { margin: 0; color: var(--ink); font-size: 15px; }
.channel-form-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.section-step { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line)); border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.credential-state { display: inline-flex; min-height: 28px; align-items: center; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 700; white-space: nowrap; }
.credential-state[data-state="connected"] { color: var(--success); border-color: color-mix(in srgb, var(--success) 24%, var(--line)); background: var(--success-soft); }
.credential-state[data-state="pending"] { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 24%, var(--line)); background: var(--warning-soft); }
.credential-notice { display: grid; grid-template-columns: 34px 1fr; gap: 11px; margin: -3px 0 18px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--success) 18%, var(--line)); border-radius: 11px; color: var(--success); background: color-mix(in srgb, var(--success-soft) 68%, var(--surface)); }
.credential-notice svg { width: 22px; height: 22px; margin: 2px auto 0; }
.credential-notice p { margin: 0; }
.credential-notice strong, .credential-notice span { display: block; }
.credential-notice strong { color: var(--ink); font-size: 12px; }
.credential-notice span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.secret-input-row { position: relative; display: flex; }
.secret-input-row input { padding-right: 48px; }
.secret-input-row .secret-toggle { position: absolute; top: 2px; right: 2px; width: 40px; min-height: 40px; border: 0; background: transparent; }
.secret-input-row .secret-toggle svg { width: 18px; height: 18px; }
.field input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 12%, transparent); }
.credential-summary { align-content: start; min-height: 90px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.credential-summary strong { color: var(--ink); font-size: 12px; }
.credential-remove { display: flex; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 22%, var(--line)); border-radius: 10px; background: var(--danger-soft); cursor: pointer; }
.credential-remove input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--danger); }
.credential-remove strong, .credential-remove small { display: block; }
.credential-remove strong { color: var(--danger); font-size: 12px; }
.credential-remove small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.advanced-section { padding-bottom: 0; }
.advanced-section details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.advanced-section summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 13px; color: var(--ink); cursor: pointer; list-style: none; }
.advanced-section summary::-webkit-details-marker { display: none; }
.advanced-section summary strong, .advanced-section summary small { display: block; }
.advanced-section summary strong { font-size: 12px; }
.advanced-section summary small { margin-top: 1px; color: var(--muted); font-size: 10px; font-weight: 400; }
.advanced-section summary svg { width: 17px; height: 17px; transition: transform .18s ease; }
.advanced-section details[open] summary svg { transform: rotate(180deg); }
.advanced-section details > .field { margin: 0; padding: 4px 13px 13px; }
.channel-form-switches { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 22px; color: var(--body); }
.channel-form-switches input { width: 17px; height: 17px; margin-right: 6px; accent-color: var(--primary); vertical-align: -3px; }
.channel-dialog-card > .dialog-actions { position: sticky; z-index: 2; bottom: -26px; margin: 0 -26px -26px; padding: 14px 26px 22px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(12px); }
.toast { position: fixed; z-index: 150; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lg); animation: toast-in .2s ease both; }
.mobile-scrim { position: fixed; z-index: 35; inset: 0; background: rgba(9,7,12,.55); }
.access-body { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: var(--canvas); }
.access-card { width: min(460px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); text-align: center; }
.access-card .brand-mark { margin: 0 auto 18px; }
.access-card h1 { color: var(--ink); }
.access-card code { padding: 2px 5px; border-radius: 5px; color: var(--primary); background: var(--primary-soft); }

@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .7; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes pulse { to { opacity: .45; } }

@media (max-width: 1180px) {
  .draft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .channel-setting-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .content-shell { margin-left: 0; }
  .mobile-only { display: inline-flex; }
  .sticky-save { left: 18px; right: 18px; }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-options { grid-template-columns: 1fr; }
  .xhs-preview { grid-template-columns: 1fr; }
  .xhs-phone { max-width: 390px; }
}

@media (max-width: 680px) {
  :root { --topbar-height: 60px; }
  .topbar { padding: 8px 12px; }
  .sync-status, #refresh-button span { display: none; }
  main { padding: 20px 12px 88px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .page-heading h1 { font-size: 28px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .filter-chip { flex: 0 0 auto; }
  .draft-grid, .asset-grid, .channel-grid { grid-template-columns: 1fr; }
  .draft-card { min-height: 240px; }
  .check-grid, .settings-grid, .channel-setting-fields { grid-template-columns: 1fr; }
  .settings-grid .full { grid-column: auto; }
  .settings-section { grid-template-columns: 1fr; padding: 17px; }
  .section-icon { width: 38px; height: 38px; }
  .sticky-save { bottom: 10px; gap: 12px; padding: 10px 11px 10px 13px; }
  .sticky-save small { display: none; }
  .sticky-save[data-state="saved"] small, .sticky-save[data-state="error"] small { display: block; }
  .sticky-save #save-settings { min-width: 0; }
  .drawer { width: 100%; }
  .drawer-header, .drawer-content { padding-right: 15px; padding-left: 15px; }
  .drawer-actions { justify-content: stretch; padding: 10px 15px; }
  .drawer-actions .button { flex: 1; }
  .card-delete, .asset-delete { opacity: 1; }
  #channel-dialog { width: calc(100% - 16px); }
  #draft-editor-dialog { width: calc(100% - 16px); }
  .channel-dialog-card { max-height: 92vh; padding: 18px; }
  .draft-editor-card { max-height: 94vh; padding: 18px; }
  .draft-editor-card > .dialog-actions { bottom: -18px; margin: 0 -18px -18px; padding: 12px 18px 18px; }
  .draft-editor-destinations { grid-template-columns: 1fr; }
  .draft-editor-body { min-height: 300px; }
  .channel-dialog-card > .dialog-actions { bottom: -18px; margin: 0 -18px -18px; padding: 12px 18px 18px; }
  .channel-actions { flex-wrap: wrap; }
  .channel-actions .button { min-height: 44px; }
  .channel-actions .status-badge { width: 100%; margin-right: 0; }
  .channel-form-grid { grid-template-columns: 1fr; }
  .channel-form-grid .full { grid-column: auto; }
  .channel-form-section-heading { align-items: flex-start; }
  .credential-notice { grid-template-columns: 28px 1fr; }
  .card-plan { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 30px 1fr; }
  .timeline-time { grid-column: 2; }
}

@media (max-width: 400px) {
  .top-actions { gap: 5px; }
  .breadcrumb small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Password login shares the control-center theme and supports narrow screens. */
.login-form { margin-top: 26px; text-align: left; }
.login-form .field { margin-bottom: 18px; }
.login-form input:not([type="checkbox"]) { width: 100%; min-height: 46px; font-size: 16px; }
.login-form .button { width: 100%; min-height: 46px; margin-top: 22px; }
.login-remember { display: flex; align-items: center; gap: 9px; color: var(--body); font-size: 14px; }
.login-remember input { width: 17px; height: 17px; accent-color: var(--primary); }
.login-intro, .login-note { color: var(--muted); }
.login-note { margin: 24px 0 0; font-size: 13px; }
.login-error { color: #b91c1c; font-size: 14px; }
@media (max-width: 480px) { .access-card { padding: 26px 22px; } }

/* AI 执行器 (executors) page — ES module page, shares the console tokens. */
.executor-alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.executor-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--body); background: var(--surface); font-size: 13px; }
.executor-alert-text { flex: 1 1 220px; min-width: 0; }
.executor-alert-action { margin-left: auto; flex: 0 0 auto; }
.executor-alert svg { flex: 0 0 auto; width: 18px; height: 18px; }
.executor-alert[data-level="danger"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, var(--line)); background: var(--danger-soft); }
.executor-alert[data-level="warning"] { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 26%, var(--line)); background: var(--warning-soft); }
.executor-alert[data-level="info"] { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 22%, var(--line)); background: var(--primary-soft); }
/* A notice on the draft page carries its own next steps. */
.todo-alert { flex-wrap: wrap; }
.todo-alert > span:not(.todo-actions) { flex: 1 1 260px; min-width: 0; }
.todo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.executor-section { margin-bottom: 16px; }
.executor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.executor-card { display: flex; min-width: 0; flex-direction: column; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.executor-card .channel-head > div { min-width: 0; flex: 1; }
.executor-card .channel-head strong, .executor-card .channel-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.executor-card .channel-head small { color: var(--muted); font-size: 11px; }
.executor-card .channel-detail strong { max-width: 62%; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.executor-card .channel-actions { flex-wrap: wrap; justify-content: flex-start; margin-top: auto; }
.executor-card-wide { grid-column: span 2; }
.executor-card-add { align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 180px; border-style: dashed; background: var(--surface-2); box-shadow: none; }
.executor-card-add strong { color: var(--ink); }
.executor-card-add p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.executor-subtitle { margin: 16px 0 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.executor-note { margin: 12px 0 0; padding: 9px 11px; border-radius: 9px; color: var(--warning); background: var(--warning-soft); font-size: 12px; }
.executor-warning { margin: 14px 0; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--line)); border-radius: 10px; color: var(--warning); background: var(--warning-soft); font-size: 12px; }
.executor-footnote { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.client-list { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.client-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }
.client-list small, .muted { color: var(--muted); font-size: 11px; }
.key-list li { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: center; }
.key-list li small { overflow-wrap: anywhere; }
@media (max-width: 640px) { .key-list li { grid-template-columns: 1fr auto; } .key-list li small { grid-column: 1 / -1; grid-row: 2; } }
.budget-line { display: grid; gap: 7px; margin: 18px 0 6px; color: var(--muted); font-size: 12px; }
.provider-list { display: grid; gap: 10px; margin: 12px 0 14px; }
.provider-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.provider-main strong, .provider-main small { display: block; }
.provider-main small { color: var(--muted); font-size: 11px; }
.provider-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.provider-meta { display: grid; min-width: 0; gap: 3px; color: var(--body); font-size: 11px; }
.provider-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-meta span[data-tone="success"] { color: var(--success); }
.provider-meta span[data-tone="danger"] { color: var(--danger); }
.provider-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.executor-panel { margin-bottom: 16px; }
.executor-panel-body { padding: 18px 22px 22px; }
.executor-panel .panel-heading h2 { margin: 0; color: var(--ink); font-size: 18px; }
.executor-panel .panel-heading small { color: var(--muted); }
.routing-table table { min-width: 1080px; }
.routing-table select, .routing-table input { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface-2); font-size: 12px; }
.routing-table select[data-route="primary"] { min-width: 170px; }
.routing-table select[data-route^="fallback"] { min-width: 124px; }
.routing-table select[data-route="provider_id"] { min-width: 160px; }
.routing-table input[data-route="model"] { min-width: 150px; }
.routing-table input[type="number"] { width: 64px; }
.routing-table td:last-child { display: flex; gap: 6px; }
.routing-table select:disabled, .routing-table input:disabled { opacity: .45; }
.executor-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.executor-settings > section { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.executor-settings .field { margin-bottom: 12px; }
.switch-row.compact { min-height: 40px; padding: 4px 8px; border: 0; background: transparent; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--body); background: var(--surface); font-size: 12px; cursor: pointer; }
.check-chip:has(input:checked) { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: var(--primary-soft); }
.check-chip input, .field .check-chip input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; border: 0; accent-color: var(--primary); }
.usage-stats { margin-bottom: 14px; }
#stage-runs td:nth-child(n+4):nth-child(-n+8), #stage-runs th { white-space: nowrap; }
#executor-dialog { width: min(640px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; color: var(--body); background: transparent; }
#executor-dialog::backdrop { background: rgba(9,7,12,.62); backdrop-filter: blur(3px); }
.executor-dialog-card { max-height: min(88vh, 900px); overflow: auto; }
.provider-dialog .field.full, .provider-dialog .check-chip.full { grid-column: 1 / -1; }
.login-methods { display: grid; gap: 10px; margin-bottom: 18px; }
.login-method { display: grid; gap: 4px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--body); background: var(--surface-2); text-align: left; }
.login-method:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: var(--primary-soft); }
.login-method strong { color: var(--ink); }
.login-method small { color: var(--muted); font-size: 12px; }
.login-steps { margin: 0 0 12px; padding-left: 20px; }
.login-steps li { margin-bottom: 6px; }
.login-steps a { color: var(--primary); overflow-wrap: anywhere; }
.device-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 10px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line)); border-radius: 14px; background: var(--primary-soft); }
.device-code code { color: var(--ink); font: 700 clamp(26px, 6vw, 38px)/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.device-code.token code { font-size: 13px; letter-spacing: 0; overflow-wrap: anywhere; }
.login-countdown { margin: 0; color: var(--muted); font-size: 12px; }
.login-wait { display: flex; align-items: center; gap: 12px; margin: 10px 0 18px; color: var(--muted); }
.spinner { width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
.login-result { margin: 6px 0 18px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; }
.login-result p { margin: 5px 0 0; }
.login-result[data-tone="success"] { color: var(--success); border-color: color-mix(in srgb, var(--success) 26%, var(--line)); background: var(--success-soft); }
.login-result[data-tone="danger"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, var(--line)); background: var(--danger-soft); }
.login-result .code-view { margin-top: 10px; max-height: 180px; overflow: auto; color: var(--body); font-size: 11px; }
.price-table { display: grid; gap: 6px; }
.price-row { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 6px; }
.price-row input { min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface-2); font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .executor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .executor-card-wide { grid-column: 1 / -1; }
  .executor-settings { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .executor-grid { grid-template-columns: 1fr; }
  .executor-card-wide { grid-column: auto; }
  .provider-row { grid-template-columns: 1fr; }
  .provider-actions { justify-content: flex-start; }
  .executor-panel-body { padding: 14px; }
  #executor-dialog { width: calc(100% - 16px); }
  .executor-dialog-card { max-height: 92vh; padding: 18px; }
  .price-row { grid-template-columns: 1fr 1fr; }
  .device-code { flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------------------- Studio (M1) */
#studio-dialog { width: min(760px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; color: var(--body); background: transparent; }
#studio-dialog::backdrop { background: rgba(9,7,12,.62); backdrop-filter: blur(3px); }
.studio-dialog-card { max-height: min(88vh, 960px); overflow: auto; }
.studio-dialog-card h2 { margin-top: 0; }
.studio-dialog-card .table-wrap { overflow-x: auto; max-width: 100%; }
.studio-dialog-card table { width: 100%; }
.studio-dialog-card td { vertical-align: top; word-break: break-word; }
.studio-heading { align-items: flex-start; }
.studio-heading .text-button { margin-bottom: 8px; }
.studio-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.studio-project-list { display: grid; gap: 10px; }
.studio-project { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--body); text-align: left; cursor: pointer; }
.studio-project:hover { border-color: var(--primary); }
.studio-project-main { display: grid; gap: 4px; min-width: 0; }
.studio-project-main strong { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-project-main small, .studio-project-meta small { color: var(--muted); }
.studio-project-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.studio-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 16px; }
.studio-step { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--body); text-align: left; cursor: pointer; }
.studio-step:hover { border-color: var(--primary); }
.studio-step span { display: grid; gap: 2px; min-width: 0; }
.studio-step small { color: var(--muted); }
.studio-step .studio-step-index { display: inline-grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 12px; }
.studio-step[data-tone="success"] .studio-step-index { background: var(--success, #16a34a); border-color: transparent; color: #fff; }
.studio-step[data-tone="warning"] .studio-step-index { background: var(--warning, #d97706); border-color: transparent; color: #fff; }
.studio-step[data-tone="danger"] .studio-step-index { background: var(--danger, #dc2626); border-color: transparent; color: #fff; }
.studio-step[data-tone="info"] .studio-step-index { border-color: var(--primary); color: var(--primary); }
.studio-plan-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.studio-group { margin-bottom: 16px; }
.studio-group .panel-heading { padding: 16px 18px 0; }
.visual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px 18px 18px; }
.visual-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.visual-card.is-final { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); }
.visual-media { display: flex; gap: 10px; align-items: flex-start; }
.visual-image, .visual-placeholder { width: 100%; min-width: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); object-fit: contain; }
.visual-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.visual-body { display: grid; gap: 6px; min-width: 0; }
.visual-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.visual-title strong { color: var(--ink); }
.visual-purpose { margin: 0; color: var(--body); font-size: 13px; }
.visual-labels { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.visual-labels li { padding: 2px 8px; border: 1px dashed var(--line); border-radius: 6px; font-size: 12px; color: var(--ink); background: var(--surface); }
.visual-note { margin: 0; font-size: 12px; color: var(--muted); }
.visual-note[data-tone="warning"] { color: var(--warning); }
.visual-note[data-tone="danger"] { color: var(--danger); }
.studio-form { display: grid; gap: 12px; }
.studio-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.studio-form textarea { font-family: inherit; }
.check-line { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.check-line input { width: auto; }
.studio-prompt, .studio-draft-body { white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 12px; line-height: 1.6; }
.studio-draft { padding: 0 18px 18px; }
.studio-draft-body { font-family: inherit; font-size: 14px; }
.studio-cards { display: grid; gap: 8px; padding-left: 18px; }
.studio-cards li small { margin-left: 6px; color: var(--muted); }
.research-checks { display: grid; gap: 8px; margin: 12px 0 16px; }
.studio-actions .button { white-space: nowrap; }
.page-heading > .studio-actions { flex-shrink: 0; }
.research-check { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.research-findings { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.research-claims { display: grid; gap: 10px; padding-left: 22px; }
.research-claims > li { line-height: 1.6; }
.research-claims .status-badge { margin-right: 4px; }
.studio-history { display: grid; gap: 8px; padding-left: 18px; }
@media (max-width: 640px) {
  .studio-project { flex-direction: column; align-items: flex-start; }
  .visual-grid { grid-template-columns: 1fr; padding: 12px; }
  .visual-media { flex-direction: column; }
}
.emdash-publish { display: grid; gap: 4px; margin-bottom: 14px; }
.emdash-notes { display: grid; gap: 6px; margin: 0; }
.emdash-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.emdash-notes span { color: var(--muted); font-size: 11px; line-height: 1.6; }
.emdash-notes a { color: var(--primary); word-break: break-all; }
.article-preview .emdash-excerpt { color: var(--muted); }
.article-preview .emdash-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------- 2.0.0a32 console layout */
.nav-item.nav-secondary { margin-top: 14px; min-height: 38px; color: color-mix(in srgb, var(--sidebar-muted) 80%, transparent); font-size: 13px; }
.nav-item.nav-secondary::before { position: absolute; left: 11px; right: 11px; margin-top: -26px; border-top: 1px solid rgba(255,255,255,.08); content: ""; }
.nav-item { position: relative; }
.top-actions .button.primary.small { min-height: 40px; }
.section-tabs { display: flex; gap: 4px; margin: -6px 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.section-tabs::-webkit-scrollbar { display: none; }
.section-tabs button, .article-tab { flex-shrink: 0; min-height: 42px; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: none; font-weight: 700; }
.section-tabs button:hover, .article-tab:hover { color: var(--ink); }
.section-tabs button[aria-selected="true"], .article-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.subpanel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.subpanel-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; }
.home-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.home-stat { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: var(--surface); text-align: left; }
.home-stat strong { color: var(--ink); font-size: 22px; line-height: 1.2; }
.home-stat span { font-size: 12px; }
.home-stat:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.home-stat[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.home-stat[aria-pressed="true"] strong { color: var(--primary); }
.channel-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.channel-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--body); background: var(--surface-2); font-size: 11px; white-space: nowrap; }
.channel-chip small { color: var(--muted); font-size: 10px; }
.channel-chip[data-tone="success"] small { color: var(--success); }
.channel-chip[data-tone="warning"] small { color: var(--warning); }
.channel-chip[data-tone="danger"] { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.channel-chip[data-tone="danger"] small { color: var(--danger); }
.channel-chip[data-tone="info"] small { color: var(--primary); }
.studio-project-main { gap: 6px; }
[data-view-panel="projects"][data-mode="article"] #home-executor-alerts { display: none !important; }
.article-heading { display: grid; gap: 6px; min-width: 0; }
.article-heading h1 { margin: 0; }
.article-heading .text-button { justify-self: start; margin-bottom: 2px; }
.article-status .project-status small { font-size: 13px; }
.article-tabs { display: flex; gap: 4px; margin: -8px 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 18px; align-items: start; }
.review-main, .review-side { display: grid; gap: 16px; min-width: 0; }
.review-main > .studio-group { margin-bottom: 0; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
.review-card-head h2 { margin: 0; color: var(--ink); font-size: 16px; }
.review-card-body { display: grid; gap: 10px; padding: 12px 16px 16px; }
.review-card .field { margin-bottom: 0; }
.review-card textarea { min-height: 96px; }
.change-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.image-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.image-tile { position: relative; display: grid; gap: 4px; align-content: start; padding: 6px; border: 1px solid var(--line); border-radius: 10px; color: var(--body); background: var(--surface-2); text-align: left; }
.image-tile:hover { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent); }
.image-tile img, .image-tile-empty { width: 100%; aspect-ratio: 1; border-radius: 7px; object-fit: cover; background: var(--surface); }
.image-tile-empty { display: grid; place-items: center; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 11px; }
.image-tile-label { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.image-tile .status-badge { position: absolute; top: 10px; left: 10px; }
.channel-rows { display: grid; gap: 10px; }
.channel-row { display: flex; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.channel-row-thumb { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 8px; object-fit: cover; }
.channel-row-main { display: grid; gap: 4px; min-width: 0; flex: 1; }
.channel-row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.channel-row-head strong { color: var(--ink); font-size: 13px; }
.channel-row-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.channel-row-note a { color: var(--primary); }
.channel-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.channel-row-actions .check-line { margin-right: 4px; font-size: 12px; }
.process-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.process-head p { margin: 0; }
.advanced-toggle { min-width: 260px; border: 1px solid var(--line); background: var(--surface); }
.process-subhead { margin: 16px 0 0; color: var(--ink); font-size: 14px; }
.studio-group details { margin: 10px 0; }
.studio-group details > summary { color: var(--primary); font-size: 13px; font-weight: 650; cursor: pointer; }
.publish-record { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 3px 0; }
.publish-record a { color: var(--primary); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; min-height: 36px; align-items: center; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.segmented input:checked + span { color: var(--primary); background: var(--surface); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.studio-dialog-card .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.more-options { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.more-options summary { padding: 10px 12px; color: var(--ink); font-size: 13px; font-weight: 650; cursor: pointer; }
.more-options .studio-form-row { padding: 0 12px; }
.regenerate-preview { display: block; max-width: 100%; max-height: 260px; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 10px; cursor: zoom-in; }
.visual-image[data-zoom], .xhs-card-real img[data-zoom] { cursor: zoom-in; }
@media (max-width: 1180px) {
  /* One column: what to do first (channels, the change box), then the reading. */
  .review-layout { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .review-main, .review-side { display: contents; }
  .review-layout [data-order] { min-width: 0; }
  .review-layout [data-order="channels"] { order: 1; }
  .review-layout [data-order="change"] { order: 2; }
  .review-layout [data-order="article"] { order: 3; }
  .review-layout [data-order="xhs"] { order: 4; }
  .review-layout [data-order="pictures"] { order: 5; }
  .review-layout [data-order="history"] { order: 6; }
  .home-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subpanel-heading { align-items: flex-start; flex-direction: column; }
  #new-project-button span { display: none; }
  .studio-dialog-card .check-grid { grid-template-columns: 1fr; }
  .advanced-toggle { min-width: 0; width: 100%; }
}
.channel-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--warning-soft); color: var(--warning); font-size: 12px; line-height: 1.5; }

/* 教程 (2.0.0a41): an index of short guides and one page per guide. The figures are drawn
   with the console's own tokens, so they follow the theme and fit a phone. */
:root { --chat-bg: #ededed; --chat-head: #f7f7f7; --chat-me: #95ec69; --chat-bot: #ffffff; --chat-ink: #191919; --term-bg: #0f1117; --term-ink: #e5e7eb; }
:root[data-theme="dark"] { --chat-bg: #111111; --chat-head: #1e1e1e; --chat-me: #3eb575; --chat-bot: #2c2c2c; --chat-ink: #e8e8e8; --term-bg: #07080c; }
.guide-index-tools { margin-bottom: 20px; }
.guide-reading > .page-heading { display: none; }
.guide-group { margin-bottom: 28px; }
.guide-group-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.guide-group-icon { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.guide-group-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.guide-group-head h2 { margin: 0; color: var(--ink); font-size: 16px; }
.guide-group-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.guide-card { display: flex; flex-direction: column; gap: 6px; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--body); background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.guide-card:hover, .guide-card:focus-visible { border-color: var(--primary); transform: translateY(-1px); }
.guide-card strong { color: var(--ink); font-size: 14px; line-height: 1.45; }
.guide-card span { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.guide-card small { margin-top: auto; padding-top: 4px; color: var(--faint); font-size: 11px; }

.guide-article { max-width: 800px; color: var(--body); font-size: 14.5px; line-height: 1.75; }
.guide-back { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 13px; text-decoration: none; }
.guide-back:hover { color: var(--primary); }
.guide-article h1 { margin: 2px 0 8px; color: var(--ink); font-size: clamp(22px, 3vw, 28px); line-height: 1.3; letter-spacing: -.02em; }
.guide-lead { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.guide-minutes { display: inline-block; margin-left: 10px; padding: 1px 8px; border-radius: 999px; color: var(--muted); background: var(--surface-3); font-size: 11.5px; vertical-align: 1px; }
.guide-article h2 { margin: 28px 0 10px; color: var(--ink); font-size: 18px; line-height: 1.4; }
.guide-article p { margin: 0 0 12px; }
.guide-article code { padding: 1px 5px; border-radius: 5px; color: var(--ink); background: var(--surface-3); font-size: .88em; overflow-wrap: anywhere; }
.guide-article a:not(.button):not(.guide-card) { color: var(--primary); }
.guide-steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: guide-step; }
.guide-steps li { position: relative; padding: 0 0 12px 36px; counter-increment: guide-step; }
.guide-steps li::before { content: counter(guide-step); position: absolute; top: 2px; left: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--surface); background: var(--primary); font-size: 12px; font-weight: 750; line-height: 1; }
.guide-list { margin: 0 0 16px; padding-left: 20px; }
.guide-list li { margin-bottom: 6px; }
.guide-tip { margin: 14px 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 10px; background: var(--primary-soft); }
.guide-tip[data-tone="warning"] { border-left-color: var(--warning); background: var(--warning-soft); }
.guide-tip[data-tone="success"] { border-left-color: var(--success); background: var(--success-soft); }
.guide-tip > strong { display: block; color: var(--ink); font-size: 13px; }
.guide-tip p { margin: 2px 0 0; font-size: 13.5px; }
.guide-table-wrap { margin: 0 0 18px; }
.guide-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 13px; line-height: 1.55; }
.guide-table[data-cols="4"] { min-width: 600px; }
.guide-table th, .guide-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); color: var(--body); font-size: 13px; text-align: left; vertical-align: top; }
.guide-table th { color: var(--muted); background: var(--surface-2); font-size: 12px; font-weight: 650; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.guide-table tr:last-child td { border-bottom: 0; }
.guide-go { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.guide-go a { text-decoration: none; }
.guide-related { margin-top: 34px; padding-top: 6px; border-top: 1px solid var(--line); }
.guide-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 26px 0 40px; font-size: 13px; }
.guide-pager a { color: var(--primary); text-decoration: none; }

.guide-figure { margin: 18px 0 24px; }
.guide-figure-body { container-type: inline-size; display: flex; justify-content: center; padding: 22px 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: radial-gradient(circle at 15% 0%, var(--primary-soft), transparent 60%), var(--surface-2); line-height: 1.5; }
.guide-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 12.5px; text-align: center; }
/* A WeChat conversation */
.guide-chat { width: min(100%, 360px); overflow: hidden; border-radius: 16px; color: var(--chat-ink); background: var(--chat-bg); box-shadow: var(--shadow-md); font-size: 13.5px; }
.guide-chat-head { padding: 10px 14px; background: var(--chat-head); font-size: 13px; font-weight: 650; text-align: center; }
.guide-msg { display: flex; gap: 8px; align-items: flex-start; padding: 7px 12px; }
.guide-msg.me { justify-content: flex-end; }
.guide-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: #fff; background: linear-gradient(135deg, #8b5cf6, #db2777); font-size: 14px; font-weight: 800; }
.guide-bubble { max-width: 82%; padding: 8px 11px; border-radius: 6px; background: var(--chat-bot); overflow-wrap: anywhere; }
.guide-msg.me .guide-bubble { color: #111; background: var(--chat-me); }
/* A console card or form */
.guide-mock { width: min(100%, 440px); padding: 15px 16px; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--body); background: var(--surface); box-shadow: var(--shadow-md); font-size: 13px; }
.guide-mock-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.guide-mock-head strong { display: block; color: var(--ink); font-size: 14.5px; }
.guide-mock-head small { display: block; color: var(--muted); font-size: 11.5px; }
.guide-mock-rows { display: grid; gap: 6px; margin: 0 0 12px; }
.guide-mock-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.guide-mock-rows dt { color: var(--muted); }
.guide-mock-rows dd { margin: 0; color: var(--ink); text-align: right; }
.guide-mock-note { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.guide-mock-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.guide-btn { position: relative; display: inline-flex; align-items: center; min-height: 32px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--body); background: var(--surface); font-size: 12px; font-weight: 650; }
.guide-btn.primary { border-color: transparent; color: #fff; background: var(--primary); }
.guide-btn.danger-ghost { color: var(--danger); }
.guide-form { display: grid; gap: 9px; margin-bottom: 12px; }
.guide-field { position: relative; display: grid; gap: 4px; }
.guide-field > span { color: var(--ink); font-size: 12px; font-weight: 650; }
.guide-field em { margin-left: 6px; color: var(--danger); font-size: 10.5px; font-style: normal; font-weight: 650; }
.guide-input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface-2); font-size: 12.5px; overflow-wrap: anywhere; }
.guide-input.empty { color: var(--faint); }
/* The thing to press: a numbered marker and a ring */
.guide-btn[data-step], .guide-field[data-step] .guide-input { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.guide-btn[data-step]::after, .guide-field[data-step]::after { content: attr(data-step); position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 18px; height: 18px; border: 2px solid var(--surface); border-radius: 50%; color: #fff; background: var(--accent); font-size: 10px; font-weight: 800; line-height: 1; }
.guide-field[data-step]::after { top: 18px; right: -9px; }
/* Where to click */
.guide-path { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.guide-path li { padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); background: var(--surface); font-size: 12.5px; font-weight: 650; }
.guide-path li:not(:last-child)::after { content: "›"; margin-left: 12px; color: var(--faint); }
.guide-path li:last-child { border-color: transparent; color: #fff; background: var(--primary); }
/* Steps from left to right */
.guide-flow { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; }
.guide-flow li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.guide-flow-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--surface); background: var(--primary); font-size: 11px; font-weight: 800; }
.guide-flow strong { color: var(--ink); font-size: 13px; }
.guide-flow small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
/* Steps wrap into even rows, never one left over */
@container (max-width: 720px) { .guide-flow-long { grid-template-columns: repeat(var(--half), minmax(0, 1fr)); } }
@container (max-width: 440px) { .guide-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* A terminal */
.guide-term { width: min(100%, 600px); margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: 12px; color: var(--term-ink); background: var(--term-bg); box-shadow: var(--shadow-md); font: 12.5px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-prompt { color: #34d399; font-weight: 700; }
.guide-out { color: #9ca3af; }
/* The settings save bar, drawn in place */
.guide-savebars { display: grid; gap: 10px; width: min(100%, 560px); }
.sticky-save.guide-savebar { position: static; max-width: none; margin: 0; box-shadow: var(--shadow-md); backdrop-filter: none; }
.guide-btn-static { pointer-events: none; }
.guide-btn-static[data-muted] { color: var(--muted); background: var(--surface-3); box-shadow: none; }
.sticky-save.guide-savebar[data-state="saved"] .guide-btn-static { color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
@media (max-width: 680px) {
  .guide-figure-body { padding: 16px 10px; }
  .guide-cards { grid-template-columns: 1fr; }
  .guide-table th { white-space: normal; }
  .sticky-save.guide-savebar small { display: block; }
}

/* Phones (2.0.0a43): drafts are reviewed where most readers read them. A channel preview
   fills the screen at the phone's own width (the WeChat draft and the Xiaohongshu note
   edge to edge, as their readers see them) under a short header, with the actions at the
   bottom; the shared article reads at that width too. Fields use 16px text so iOS does
   not zoom in while a change request is typed. */
.review-card { scroll-margin-top: calc(var(--topbar-height) + 12px); }
.studio-dialog-card .sheet-head { margin-bottom: 6px; }
.sheet-note { margin: 0 0 14px; font-size: 13px; }
.studio-dialog-card .sheet-body + .dialog-actions { margin-top: 16px; }
@media (max-width: 680px) {
  .field input, .field textarea, .field select, .settings-grid input, .settings-grid select, .search-field input { font-size: 16px; }
  .review-layout [data-order="article"] { margin: 0 -12px; border-right: 0; border-left: 0; border-radius: 0; }
  .review-layout [data-order="article"] .panel-heading { padding: 16px 16px 0; }
  .review-layout [data-order="article"] .studio-draft { padding: 0 16px 20px; }
  .article-preview > h1 { font-size: 24px; }
  .xhs-copy { max-height: none; padding: 14px 16px; font-size: 15px; line-height: 1.65; }
  .drawer-header { padding-top: 12px; padding-bottom: 10px; }
  .drawer-header h2 { display: -webkit-box; overflow: hidden; font-size: 17px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .drawer-meta, .drawer-versions { flex-wrap: nowrap; overflow-x: auto; padding: 7px 15px; scrollbar-width: none; }
  .drawer-meta > *, .drawer-versions > * { flex: 0 0 auto; }
  .tab-list { padding: 2px 15px 0; }
  .drawer-content { padding-top: 18px; overscroll-behavior: contain; }
  .drawer-content[data-preview="phone"] { padding: 0; background: #fff; }
  .drawer-content[data-preview="phone"] .wechat-phone { max-width: none; border: 0; border-radius: 0; }
  .drawer-content[data-preview="phone"] .xhs-phone { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  .drawer-content[data-preview="phone"] .xhs-preview { gap: 0; background: var(--surface); }
  .drawer-content[data-preview="phone"] .xhs-preview > section:last-child { padding: 16px 15px 20px; }
  .drawer-actions .button { flex: 1 1 auto; padding-right: 10px; padding-left: 10px; white-space: nowrap; }
  #studio-dialog.sheet { width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  #studio-dialog.sheet #studio-dialog-body { height: 100%; }
  #studio-dialog.sheet .studio-dialog-card { display: flex; height: 100%; max-height: none; flex-direction: column; overflow: hidden; padding: 0; border: 0; border-radius: 0; }
  #studio-dialog.sheet .sheet-head { margin: 0; padding: 12px 15px 4px; }
  #studio-dialog.sheet .sheet-head h2 { font-size: 17px; }
  #studio-dialog.sheet .sheet-note { margin: 0; padding: 0 15px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
  #studio-dialog.sheet .sheet-body { flex: 1; overflow: auto; overscroll-behavior: contain; background: #fff; }
  #studio-dialog.sheet .wechat-preview { max-width: none; max-height: none; overflow: visible; padding: 20px 16px 28px; border: 0; border-radius: 0; }
  #studio-dialog.sheet .dialog-actions { margin: 0; padding: 10px 15px; border-top: 1px solid var(--line); }
  #studio-dialog.sheet .dialog-actions .button { flex: 1; white-space: nowrap; }
  /* 发布记录 and an article's 发布 tab: one card per row instead of a wide table. */
  .stack-table table { min-width: 0; }
  .stack-table thead { display: none; }
  .stack-table tbody { display: block; }
  .stack-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { display: block; padding: 0; border: 0; }
  .stack-table td:first-child, .stack-table td:last-child { flex: 1 0 100%; }
  .stack-table .table-title, .stack-table .table-subtitle { max-width: none; white-space: normal; }
  .stack-table .table-actions { flex-wrap: wrap; justify-content: flex-start; }
  .stack-table .table-actions:empty { display: none; }
}

/* Opportunity Radar dedicated view & dialog */
.radar-page-heading { align-items: flex-end; }
.radar-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.radar-stats-grid .stat-card-btn { width: 100%; text-align: left; font: inherit; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.radar-stats-grid .stat-card-btn:hover { border-color: color-mix(in srgb, var(--primary) 42%, var(--line)); background: var(--surface-2); }
.radar-stats-grid .stat-card-btn.is-active { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }
.radar-loading { padding: 36px 20px; text-align: center; }

.radar-active-batch { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.radar-active-batch-info { flex: 1 1 360px; min-width: 0; }
.radar-active-summary { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--body); }
.radar-active-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.radar-batches-panel { margin-bottom: 16px; overflow: hidden; }
.radar-batch-title-btn { min-height: auto; padding: 0; text-align: left; font-size: 14px; }
.radar-batch-summary { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; font-size: 12px; line-height: 1.45; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.radar-filter-panel { padding: 16px 18px; margin-bottom: 16px; display: grid; gap: 12px; }
.radar-filter-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.radar-page-search { flex: 1 1 300px; width: auto; }
.radar-seg-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.radar-filter-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.radar-date-presets { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.radar-date-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.radar-date-range label { font-weight: 600; color: var(--body); }
.radar-date-range input[type="date"], .radar-select-field select { min-height: 36px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-2); font-size: 13px; }
.radar-select-field select { max-width: 240px; }

.radar-table-panel { overflow: hidden; }
.radar-table-wrap { overflow: auto; max-inline-size: 100%; container-type: inline-size; }
.radar-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; --label-1: "日期 / 来源"; --label-2: "机会项目"; --label-3: "形态"; --label-4: "状态"; --label-5: "拆解后稿件与链接"; --label-6: "操作"; }
.radar-table thead { position: sticky; inset-block-start: 0; z-index: 2; }
.radar-table thead th { padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; white-space: nowrap; }
.radar-table tbody th, .radar-table tbody td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; background: var(--surface); }
.radar-table tbody tr:last-child th, .radar-table tbody tr:last-child td { border-bottom: 0; }
.radar-table tbody tr:hover th, .radar-table tbody tr:hover td { background: var(--surface-2); }
.radar-table tbody tr.is-covered th, .radar-table tbody tr.is-covered td { background: color-mix(in srgb, var(--success-soft) 28%, var(--surface)); }
.radar-table tbody tr.is-selected th, .radar-table tbody tr.is-selected td { background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }

.radar-col-date { width: 148px; }
.radar-col-type { width: 132px; }
.radar-col-status { width: 92px; white-space: nowrap; }
.radar-col-links { width: 280px; }
.radar-col-actions { width: 132px; white-space: nowrap; }

.radar-date-cell { display: grid; gap: 5px; justify-items: start; }
.radar-date-cell strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.radar-date-chip, .radar-source-chip, .radar-mini-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; line-height: 1.4; border: 1px solid var(--line); white-space: nowrap; }
.radar-date-chip { background: var(--surface-2); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.radar-source-chip { background: color-mix(in srgb, var(--primary-soft) 65%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 26%, var(--line)); color: var(--primary); font-weight: 600; }
.radar-mini-tag { background: var(--surface-2); color: var(--muted); }
.radar-batch-link { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-align: left; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-batch-link:hover { color: var(--primary); }

.radar-item-cell { display: grid; gap: 6px; min-width: 240px; font-weight: 400; }
.radar-item-title { font-size: 14.5px; line-height: 1.4; color: var(--ink); }
.radar-item-title strong { font-weight: 700; }
.radar-cell-desc { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.radar-cell-links { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.radar-cell-links a { color: var(--primary); text-decoration: none; }
.radar-cell-links a:hover { text-decoration: underline; }
.radar-type-cell { display: grid; gap: 5px; justify-items: start; }

.radar-match-list { display: grid; gap: 8px; }
.radar-match-entry { display: grid; gap: 4px; }
.radar-match-primary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.radar-project-link { color: var(--primary); font-weight: 600; font-size: 13px; text-decoration: none; line-height: 1.4; }
.radar-project-link:hover { text-decoration: underline; }
.radar-pub-links { display: flex; flex-wrap: wrap; gap: 5px; }
.radar-pub-link { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--success); background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 28%, var(--line)); text-decoration: none; }
.radar-pub-link:hover { filter: brightness(.96); text-decoration: underline; }

.radar-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-load-more { margin-top: 16px; display: flex; justify-content: center; }
.radar-result-foot { margin: 12px 4px 0; font-size: 12.5px; }
.radar-empty { padding: 48px 20px; }
.radar-raw-pre { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13px; line-height: 1.6; max-height: 420px; overflow: auto; color: var(--body); }

.radar-batches-table { --label-1: "日期"; --label-2: "日报标题与要点"; --label-3: "来源"; --label-4: "条目统计"; --label-5: "导入时间"; --label-6: "操作"; }

@container (width < 760px) {
  .radar-table, .radar-table thead, .radar-table tbody, .radar-table tr, .radar-table th, .radar-table td { display: block; width: auto; white-space: normal; }
  .radar-table thead { display: none; }
  .radar-table tbody tr { margin: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
  .radar-table tbody th, .radar-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .radar-table tbody tr td:last-child { border-bottom: 0; }
  .radar-table tbody td::before { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
  .radar-table tbody td:nth-child(1)::before { content: var(--label-1); }
  .radar-table tbody td:nth-child(3)::before { content: var(--label-3); }
  .radar-table tbody td:nth-child(4)::before { content: var(--label-4); }
  .radar-table tbody td:nth-child(5)::before { content: var(--label-5); }
  .radar-table tbody td:nth-child(6)::before { content: var(--label-6); }
  .radar-item-cell { min-width: 0; }
  .radar-batch-link { max-width: 100%; }
}

#radar-dialog { width: min(960px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; color: var(--body); background: transparent; }
#radar-dialog::backdrop { background: rgba(9,7,12,.62); backdrop-filter: blur(3px); }
.radar-dialog-card { max-height: min(90vh, 980px); overflow: auto; display: grid; gap: 14px; }
.radar-dialog-card h2 { margin-top: 0; }
.radar-dialog-card .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.radar-import-box { padding: 14px; border: 1px dashed var(--line-strong, var(--line)); border-radius: 12px; background: var(--surface-2); }
.radar-import-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.radar-import-head small { display: block; color: var(--muted); margin-top: 2px; }
.radar-file-btn { cursor: pointer; }
.radar-history-bar { margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; border: 1px solid var(--line); }
.radar-history-bar[data-tone="success"] { border-color: color-mix(in srgb, #16a34a 35%, var(--line)); background: color-mix(in srgb, #16a34a 8%, var(--surface)); }
.radar-history-bar[data-tone="warning"] { border-color: color-mix(in srgb, #d97706 45%, var(--line)); background: color-mix(in srgb, #d97706 10%, var(--surface)); }
.radar-history-bar[data-tone="info"] { background: var(--surface-2); color: var(--muted); }
.radar-list { display: grid; gap: 12px; }
.radar-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: grid; gap: 8px; }
.radar-card.is-covered { border-style: dashed; background: color-mix(in srgb, var(--success-soft) 24%, var(--surface)); }
.radar-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.radar-card-title { min-width: 0; flex: 1; }
.radar-card-title h3 { margin: 6px 0 0; font-size: 15px; line-height: 1.4; color: var(--ink); }
.radar-card-cta { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-tagline { font-weight: 400; color: var(--muted); }
.radar-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.radar-archetype-chip, .radar-kind-chip, .radar-tag, .radar-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 1.4; border: 1px solid var(--line); }
.radar-archetype-chip { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.radar-kind-chip { border-color: color-mix(in srgb, #d97706 40%, var(--line)); color: var(--warning); background: var(--warning-soft); }
.radar-highlights { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-pill { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); color: var(--ink); font-weight: 500; }
.radar-desc, .radar-comment, .radar-risk { margin: 0; font-size: 13px; line-height: 1.55; }
.radar-risk { color: var(--muted); }
.radar-match-note { padding: 10px 12px; border-radius: 8px; font-size: 12.5px; display: grid; gap: 6px; background: color-mix(in srgb, var(--success-soft) 65%, var(--surface)); border: 1px solid color-mix(in srgb, var(--success) 28%, var(--line)); }
.radar-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
.radar-links { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.radar-plan-subject { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.radar-strategy-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.radar-archetype-field { flex: 1 1 260px; margin: 0; }
.radar-ai-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.radar-ai-banner { padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; border: 1px solid var(--line); }
.radar-ai-banner[data-tone="success"] { border-color: color-mix(in srgb, #16a34a 40%, var(--line)); background: color-mix(in srgb, #16a34a 9%, var(--surface)); }
.radar-ai-banner[data-tone="info"] { background: var(--surface-2); }
.radar-seed-details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.radar-seed-details summary { cursor: pointer; font-weight: 500; }
.radar-seed-pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 12.5px; line-height: 1.55; color: var(--muted); max-height: 220px; overflow: auto; }
.radar-title-options { display: grid; gap: 8px; }
.radar-title-option { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; line-height: 1.45; transition: border-color .15s, background .15s; }
.radar-title-option:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.radar-title-option.is-selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); box-shadow: inset 0 0 0 1px var(--primary); }
.radar-title-badge { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.radar-title-option.is-selected .radar-title-badge { background: var(--primary); color: #fff; }
.radar-title-text { flex: 1; font-size: 14px; font-weight: 500; }
@media (max-width: 720px) {
  .radar-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #radar-dialog { width: calc(100% - 16px); }
  .radar-dialog-card { padding: 16px; max-height: 92vh; }
  .radar-dialog-card .check-grid { grid-template-columns: 1fr; }
  .radar-card-head { flex-direction: column; }
}

/* Multi-reference URL inputs & summary list */
.ref-urls-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ref-urls-head span { color: var(--ink); font-size: 13px; font-weight: 650; }
.ref-url-list { display: grid; gap: 8px; }
.ref-url-row { display: flex; align-items: center; gap: 8px; }
.ref-url-row input { flex: 1 1 auto; min-width: 0; }
.ref-url-remove { flex: 0 0 auto; width: 40px; min-height: 40px; }
.ref-summary-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.ref-summary-list a { color: var(--primary); text-decoration: none; }
.ref-summary-list a:hover { text-decoration: underline; }

/* Polished preview accents for X Article and EmDash callouts */
.x-article-preview blockquote, .article-preview blockquote { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--accent, #2563eb); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--accent, #2563eb) 7%, var(--surface)); color: var(--ink); }
.x-article-preview hr { margin: 22px 0; border: 0; border-top: 1px solid var(--line); }
.x-article-preview h3 { margin: 22px 0 10px; font-size: 18px; color: var(--ink); }
.x-article-preview code { padding: 1px 5px; border-radius: 4px; background: var(--surface-muted, rgba(148,163,184,.16)); font-size: .9em; }
