/* 全站细节统一层（工作台）：最后加载。Anthropic 风格（保留 Ember 橙为唯一强调色）：
   暖米底 + 暖灰细边线、几乎无阴影、标题衬线、圆角收紧、去装饰光晕。
   规格：按钮/输入 38px·圆角 8，小按钮 32px·圆角 8，卡片 12，弹窗 14；动效 150ms（反馈）/ 240ms（入场）。
   顶栏 48px 控件组、AI 对话输入区小控件、投流页（自带 sph 样式）的尺寸不在此列；颜色令牌对全站生效。 */

/* ---------- 令牌：覆盖 nova.css 的浅/深两套（html[...] 提高优先级） ---------- */
html[data-theme="light"] {
  --bg: #F4F2EC; --body-bg: #F4F2EC; --sidebar: #F4F2EC;
  --card: #FBFAF7; --strip: #FBFAF7; --surface: #FBFAF7; --drawer-bg: #FBFAF7;
  --elevated: #EEEBE3; --soft: #EEEBE3; --surface-soft: #F1EEE7; --surface-2: #F1EEE7;
  --line: #E3DED3; --border: #E3DED3; --sep: #EBE7DE; --line-strong: #CFC9BC;
  --t1: #1F1E1B; --t2: #6B675E; --t3: #9C978C; --t-status: #8A857B;
  --hover-bg: rgba(31, 30, 27, .045); --input-bg: #FDFCFA;
  --hero-grad: var(--card);
  --card-shadow: 0 1px 2px rgba(31, 30, 27, .04);
  --cover-shadow: 0 2px 8px rgba(31, 30, 27, .14);
  --shadow-sm: 0 1px 2px rgba(31, 30, 27, .04); --shadow-soft: 0 1px 3px rgba(31, 30, 27, .06);
  --shadow-lg: 0 12px 32px rgba(31, 30, 27, .12);
  --overlay: rgba(20, 19, 17, .36);
  --toast-bg: #1F1E1B; --toast-text: #F4F2EC;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
}
html[data-theme="dark"] {
  --bg: #1C1B19; --body-bg: #1C1B19; --sidebar: #1A1917;
  --card: #262522; --strip: #22211E; --surface: #22211E; --drawer-bg: #22211E;
  --elevated: #2E2D29; --soft: #2E2D29; --surface-soft: #242320; --surface-2: #2A2925;
  --line: #3A3833; --border: #3A3833; --sep: #302F2B; --line-strong: #4C4943;
  --t1: #ECE9E1; --t2: #A39E93; --t3: #7D786E; --t-status: #8C877C;
  --amber: #E3B04F; --cyan: #6FB7CF; --green: #5BC48A; --danger: #F06B78;
  --amber-soft: rgba(227, 176, 79, .14); --cyan-soft: rgba(111, 183, 207, .14); --green-soft: rgba(91, 196, 138, .13);
  --hover-bg: rgba(236, 233, 225, .05); --input-bg: #201F1C;
  --hero-grad: var(--card);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --cover-shadow: 0 2px 10px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25); --shadow-soft: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
  --overlay: rgba(10, 9, 8, .55);
  --document-bg: #262522; --document-text: #ECE9E1;
  --toast-bg: #ECE9E1; --toast-text: #1F1E1B;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
}

/* 设置页：分类页签和现有配置，规则只作用于本页。 */
#view-settings { gap: 24px; min-width: 0; }
#view-settings [hidden] { display: none !important; }
#view-settings .settings-page-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
#view-settings .settings-page-head h1 { margin:0; font-size:30px; }
#view-settings .settings-summary { display:flex; align-items:center; flex-wrap:wrap; gap:4px; padding:4px; border:1px solid var(--line); border-radius:8px; background:var(--card); }
#view-settings .settings-summary-item { display:inline-flex; align-items:center; gap:8px; min-height:32px; border:0; border-radius:6px; padding:5px 10px; background:transparent; color:var(--t2); font:400 13px var(--font-cjk); cursor:pointer; }
#view-settings .settings-summary-item::before { content:''; width:7px; height:7px; flex:none; border-radius:50%; background:var(--t3); }
#view-settings [data-tone="success"] { color:var(--green); }
#view-settings [data-tone="warning"] { color:var(--amber); }
#view-settings .settings-summary-item[data-tone="success"]::before { background:var(--green); }
#view-settings .settings-summary-item[data-tone="warning"]::before { background:var(--amber); }
#view-settings .settings-tabs { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:5px; width:max-content; max-width:100%; border:1px solid var(--line); border-radius:12px; background:var(--card); }
#view-settings .settings-tabs button { min-height:38px; padding:8px 18px; border:0; border-radius:8px; background:transparent; color:var(--t2); font:500 15px var(--font-serif); cursor:pointer; }
#view-settings [data-settings-panel] { display:grid; gap:24px; min-width:0; }
#view-settings.ui-view-enter { animation:none !important; }
#view-settings [data-settings-panel]:not([hidden]) { animation:settings-content-in .24s ease both; }
@keyframes settings-content-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion:reduce) { #view-settings [data-settings-panel]:not([hidden]) { animation:none; } }
#view-settings input[type="checkbox"] { accent-color:var(--orange); width:18px; height:18px; flex:0 0 18px; }
#view-settings .settings-section { padding:22px 24px; min-width:0; }
#view-settings .settings-section :is(h2,h3) { margin:0; font:700 18px var(--font-serif); color:var(--t1); }
#view-settings .settings-section h3 { font-size:16px; }
#view-settings .panel-title { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:0 0 16px; }
#view-settings .panel-title p { margin:6px 0 0; color:var(--t2); font-size:14px; line-height:1.7; }
#view-settings .settings-field-row { display:grid; grid-template-columns:minmax(120px,.65fr) minmax(0,1.6fr) auto; align-items:center; gap:16px; min-height:74px; padding:16px 0; border-top:1px solid var(--line); font-size:14px; }
#view-settings .settings-field-row > :first-child { font-weight:500; }
#view-settings .settings-field-row strong { font-weight:500; overflow-wrap:anywhere; }
#view-settings .settings-field-row p { font-weight:400; margin:6px 0 0; font-size:13px; color:var(--t2); }
#view-settings #homeViewSettingRow .settings-field-row { grid-template-columns:minmax(0,1fr) minmax(180px,240px); }
#view-settings #homeViewSettingRow .ui-select { width:100%; min-width:0; }
#view-settings .settings-section-footer { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; padding-top:16px; margin-top:6px; border-top:1px solid var(--line); }
#view-settings #accountSettings .settings-section-footer { justify-content:flex-start; }
#view-settings .settings-footnote { color:var(--t2); font-size:13px; line-height:1.8; margin:12px 0 0; overflow-wrap:anywhere; }
#view-settings .settings-save-feedback { font:400 13px var(--font-cjk); color:var(--green); }
#view-settings .settings-save-feedback.is-error { color:var(--danger); }
#view-settings .settings-current-provider { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:16px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin-bottom:16px; }
#view-settings .ai-provider-current { margin-top:10px; padding:0; background:transparent; border:0; border-radius:0; box-shadow:none; }
#view-settings .ai-provider-current > div { display:grid; gap:5px; }
#view-settings .ai-provider-current :is(strong,span) { overflow-wrap:anywhere; }
#view-settings .ai-provider-item { background:transparent; padding:16px 0; border:0; border-bottom:1px solid var(--line); box-shadow:none; border-radius:0; display:flex; align-items:center; flex-wrap:wrap; gap:16px; }
#view-settings .ai-provider-item:last-child { border-bottom:0; }
#view-settings .ai-provider-main { min-width:0; flex:1 1 360px; }
#view-settings .ai-provider-main :is(p,small,em) { overflow-wrap:anywhere; white-space:normal; }
#view-settings .ai-provider-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
#view-settings .wechat-admin-summary { display:grid; gap:7px; margin-bottom:20px; }
#view-settings .wechat-admin-actions { flex-wrap:wrap; justify-content:flex-start; }
#view-settings .wechat-restart-status { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px 20px; margin-top:16px; font-size:14px; color:var(--t2); }
#view-settings .wechat-restart-status small { grid-column:1/-1; font-size:13px; overflow-wrap:anywhere; }
#view-settings .wechat-bind-code { overflow-wrap:anywhere; }
#view-settings .settings-subsection { border-top:1px solid var(--line); padding-top:20px; margin-top:24px; }
#view-settings .settings-toggle-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; font-size:14px; margin-top:14px; }
#view-settings .settings-toggle-row input { flex:none; }
#view-settings .wecom-target-list { max-height:none; padding:0; border:0; background:transparent; gap:0; overflow:visible; }
#view-settings .wecom-target-option { border:0; border-bottom:1px solid var(--line); padding:14px 0; border-radius:0; background:transparent; }
#view-settings .wecom-target-option small { font-size:12px; }
#view-settings .wecom-target-option strong { font-size:14px; }
#view-settings #webWecomMonitorStatus { font-size:13px; line-height:1.8; overflow-wrap:anywhere; }
#view-settings .wecom-settings-preview { min-height:120px; max-height:400px; white-space:pre-wrap; overflow-wrap:anywhere; background:var(--input-bg); color:var(--t1); font:400 14px/1.8 var(--font-cjk); border-color:var(--line); }
#view-settings .settings-failure-detail { font-size:13px; color:var(--t2); margin-top:10px; }
#view-settings .settings-failure-detail summary { cursor:pointer; }
#view-settings .settings-failure-detail p { overflow-wrap:anywhere; white-space:pre-wrap; }
#view-settings .settings-read-status { font-size:14px; color:var(--t2); line-height:1.7; overflow-wrap:anywhere; }
#view-settings .settings-read-status:empty { display:none; }
#view-settings .settings-read-status:not(:empty) { margin-bottom:16px; display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
#view-settings .settings-read-status.is-error { color:var(--danger); }
#view-settings .settings-dirty-mark { color:var(--amber); background:color-mix(in srgb,var(--amber) 10%,transparent); }
#view-settings .member-search-row { display:flex; align-items:center; gap:12px; margin:14px 0 4px; }
#view-settings #memberSearch { width:min(100%, 360px); }
#view-settings .user-management-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px 12px; padding:10px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; }
#view-settings .member-identity { min-width:0; }
#view-settings .member-name { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; overflow-wrap:anywhere; }
#view-settings .member-login-lock { color:var(--amber); background:color-mix(in srgb,var(--amber) 10%,transparent); }
#view-settings .user-management-row small { display:block; margin-top:4px; font-size:13px; overflow-wrap:anywhere; }
#view-settings .member-edit[hidden], #view-settings .member-pager[hidden] { display:none; }
#view-settings .member-edit { display:grid; grid-column:1/-1; grid-template-columns:minmax(100px,130px) minmax(90px,110px) minmax(0,1fr); gap:8px; align-items:center; padding:2px 0 4px; }
#view-settings .user-management-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
#view-settings .member-edit > .user-management-actions:only-child { grid-column:1/-1; }
#view-settings .member-edit .ui-select { min-width:0; width:100%; }
#view-settings .member-pager { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:8px; padding-top:12px; }
#view-settings #memberPageSummary { color:var(--t2); font-size:13px; margin-right:auto; }
@media(max-width:760px) {
  #view-settings .member-edit { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #view-settings .member-edit > .user-management-actions { grid-column:1/-1; }
}
#view-settings #registrationOpenToggle { margin-right:8px; }
#view-settings .guest-permission-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 24px; max-width:none; }
#view-settings .guest-permission-row { border:0; border-radius:0; border-bottom:1px solid var(--line); background:transparent; padding:16px 0; min-width:0; }
#view-settings .guest-permission-row small { font-size:13px; line-height:1.6; }
#view-settings :is(.settings-mapping-head,.mapping-row) { display:grid; grid-template-columns:minmax(160px,1fr) minmax(160px,1fr) minmax(90px,.6fr) auto; align-items:center; gap:16px; padding:15px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; font-size:14px; }
#view-settings .settings-mapping-head { color:var(--t2); font-size:13px; }
#view-settings .mapping-row > :is(span,strong) { overflow-wrap:anywhere; font-weight:400; }
#view-settings .settings-services-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 32px; }
#view-settings .service-line { padding:16px 0; font-size:14px; gap:12px; border-bottom:1px solid var(--line); }
#view-settings .service-line b { font-weight:500; color:var(--t2); white-space:normal; }
#view-settings .service-line b[data-tone="success"] { color:var(--green); }
#view-settings .service-line b[data-tone="warning"] { color:var(--amber); }
@media (max-width:1100px) {
  #view-settings .settings-tabs button { padding-inline:14px; }
  #view-settings .wechat-restart-status { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  #view-settings .settings-section { padding:16px; }
  #view-settings .settings-field-row { grid-template-columns:1fr; }
  #view-settings .guest-permission-grid, #view-settings .settings-services-list { grid-template-columns:1fr; }
}

/* ---------- 去装饰：背景光晕、渐变底 ---------- */
body { background: var(--body-bg) !important; }
.ambient, .ambient-a, .ambient-b { display: none !important; }

/* 背景光晕（.ambient）超出视口导致桌面出现横向滚动条：横向裁切但不建立滚动容器。
   不用 hidden 兜底——hidden 会让 body 成为第二个滚动容器（曾导致 iOS 滑动卡住）。 */
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }

/* ---------- 标题衬线 ---------- */
/* 字体分工：标题（页标题、区块/卡片标题、弹窗标题、首图视频标题）用宋体；
   数字、正文、列表条目、按钮一律黑体。 */
.brand strong,.topbar h1,main :is(h1, h2, h3),#view-library h4,#view-settings h4,#aiChatTitle,.sidebar .nav-item,:is(.copywriter-tabs, #copywriterTabs, #aiSectionTabs, .title-category-tabs) > button,.sph-native-host .sph-native-tab,.sph-native-host .metric-label,#view-dashboard #leaderboard .video-meta > strong,#view-library .lib-card-title,#view-capture .local-queue-main > strong,#view-aichat .aichat-conv-item > strong,.sph-side-tool,#detail-body .detail-group > h4,#detail-body .detail-tabs button,.drawer h2,.modal header h2,.modal h2,#view-dashboard .metric-card .metric-label,#view-dashboard #heroTitle,.sph-native-host :is(h1, h2),.sph-native-host h3,.sph-action-confirm h2{
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  letter-spacing: 0;
}
.topbar h1 { font-size: 30px; }

/* 侧栏字号只在展开态（>1100）生效；≤1100 侧栏收成图标栏，由 styles.css 用 font-size:0 隐藏文字。 */
@media (min-width: 1101px) {
  html body .sidebar .nav-item { font-size: 15px; font-weight: 500; }
  html body .sidebar .nav-item.active { font-weight: 600; }
  /* 侧栏按钮：三栏网格——图标贴左、文字在整个按钮正中、选中小红点贴右（左右两栏等宽，中栏才是真居中）。
     宋体字形在行框中偏下约 1px：内容整体上提 1px、图标回落 1px，使文字与图标视觉上下居中。 */
  html body .sidebar .nav-item { display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 8px; align-items: center; justify-content: normal; padding-top: 10px; padding-bottom: 12px; }
  html body .sidebar .nav-item .nav-icon { position: relative; top: 1px; justify-self: start; }
  html body .sidebar .nav-item.active::after { justify-self: end; margin: 0 2px 0 0; }
  html body .sidebar .brand strong { font-size: 21px; }
}

/* ---------- 字体排布（204）：桌面统一字阶 ----------
   12 辅助（时间/编号/角标） · 13 次要（账号/说明/小按钮） · 14 正文（表格/按钮/输入） ·
   15–16 条目标题（600） · 18 区块标题（衬线 600） · 30 页标题（衬线 600） · 数字 600–700。
   字重：正文 400，控件/表头 500，标题与关键数字 600–700；不再使用 750–850 的超粗。 */
@media (min-width: 761px) {

  html body #adminAccessLabel { font-size: 14px; font-weight: 600; }
  html body #adminAccessRole { font-size: 12px; }
  html body #sidebarAppVersion { font-size: 11px; }

  /* 区块标题、页签 */
  html body main :is(.section-head h2, .panel-title h3, .tool-heading h3, .setting-card h3, .settings-subhead h3) { font-size: 18px; font-weight: 700; }
  html body main :is(.copywriter-tabs, #copywriterTabs, #aiSectionTabs, .title-category-tabs, .creator-version-tabs) > button { font-size: 15px; font-weight: 500; }
  html body main :is(.copywriter-tabs, #copywriterTabs, #aiSectionTabs, .title-category-tabs, .creator-version-tabs) > button.active { font-weight: 600; }

  /* 通用控件：按钮 14 / 小按钮 13，标签 12，说明文字 13–14 */
  html body :is(.view, .modal) .button:not(.small) { font-size: 14px; }
  html body :is(.view, .modal) :is(.button.small, .compact-actions .button, .library-card-actions .button, .user-management-actions .button, .ai-provider-actions .button, .account-admin-head .button, .local-queue-head .button, #libraryPagination .button, #libraryPagination ~ div .button) { font-size: 13px; }
  html body main .chip { font-size: 12px; font-weight: 500; }
  html body main .teacher-assignment-pill { font-size: 12px; font-weight: 600; }
  html body main .ui-select-value-label { font-size: 14px; font-weight: 500; }
  html body main :is(p.muted, .settings-subhead > p, .settings-advanced-body > p, .panel-title + p, .local-transcribe-description) { font-size: 14px; line-height: 1.7; }

  /* 素材抓取 / 转写任务 */
  html body #view-capture :is(.local-queue-main > small, span > small, #localQueueSummary) { font-size: 12px; }
  html body #view-capture .local-queue-main > strong { font-size: 14px; font-weight: 600; }
  html body #view-capture summary b { font-size: 12px; }
  html body #view-capture summary span > strong { font-size: 13px; font-weight: 600; }
  html body #view-capture #localVideoDrop :is(small, em) { font-size: 13px; }
  html body #view-capture #localVideoDrop > strong { font-size: 16px; font-weight: 600; }
  html body #view-capture :is(div > p) { font-size: 14px; }
  html body #view-capture .panel-title > label.model-select { font-size: 14px; }

  html body #view-library #libraryToolbar .library-filter { font-size: 13px; }
  html body #view-library #libraryPagination > span { font-size: 13px; }

  /* 文案库子页：标题裂变 / 爆款裂变 / 手动裂变 */
  html body #view-library :is(.title-reference-row, .title-options-row, .fission-toolbar) > label { font-size: 13px; font-weight: 600; }
  html body #view-library :is(button > small, div > small) { font-size: 12px; }
  html body #view-library header > span { font-size: 12px; font-weight: 600; }

  /* AI 选片 */
  html body #view-course-selector .course-selector-project-item > small, html body #view-course-selector span > small { font-size: 12px; }
  html body #view-course-selector :is(.course-selector-project-item > em, .course-selector-live-state > em) { font-size: 12px; }
  html body #view-course-selector #courseSelectorProgressMeta :is(span, b) { font-size: 13px; }
  html body #view-course-selector span > strong { font-size: 13px; font-weight: 600; }
  html body #view-course-selector .course-selector-step-marker { font-size: 11px; font-weight: 600; }
  html body #view-course-selector #courseSelectorRetryOptions > label { font-size: 13px; font-weight: 600; }
  html body #view-course-selector #courseSelectorRetryOptions > small { font-size: 12px; }

  /* AI */
  html body #view-aichat .aichat-conv-item > strong { font-size: 14px; font-weight: 600; }
  html body #view-aichat .aichat-conv-item > small { font-size: 12px; }
  html body #view-aichat .aichat-title-edit { font-size: 13px; }

  /* 设置 */
  html body #view-settings .service-line > :is(span, b) { font-size: 13px; }
  html body #view-settings .service-line > b { font-weight: 600; }
  html body #view-settings :is(span > small, div > small, #wechatAdminSummary > small, .ai-provider-main > small, #wechatRestartStatus > small, #wechatRestartStatus > span) { font-size: 13px; }
  html body #view-settings span > strong { font-size: 14px; font-weight: 600; }
  html body #view-settings span > b { font-size: 13px; font-weight: 600; }

  /* 投流（工作台内 #sphNativeHost 与独立页 #sphDirectHost 共用 .sph-native-host；
     html body 前缀压过 @scope 内同权重旧值） */
  html body .sph-native-host .sph-native-tab { font-size: 15px; }
  html body .sph-native-host table :is(th) { font-size: 13px; font-weight: 500; }
  html body .sph-native-host table :is(td) { font-size: 14px; }
  html body .sph-native-host #orders-table th { font-size: 13px; font-weight: 500; letter-spacing: 0; }
  html body .sph-native-host #orders-table td { font-size: 14px; }
  html body .sph-native-host #orders-table td small { font-size: 12px; line-height: 1.35; }
  html body .sph-native-host :is(.group-overview-item > small, .column-menu-head small, .account-count-value small) { font-size: 12px; }
  html body .sph-native-host .plan-detail-link > strong { font-size: 14px; font-weight: 500; }
  html body .sph-native-host #orders-table .plan-cell > small { font-size: 11px; color: var(--faint); letter-spacing: 0; }
  html body .sph-native-host .plan-cell > small { font-size: 12px; }
  html body .sph-native-host td .tag, html body .sph-native-host .stop-protection-cell .tag { font-size: 12px; font-weight: 600; }
  html body .sph-native-host .op-links .plan-action { font-size: 13px; font-weight: 500; }
  html body .sph-native-host .op-links .plan-action-detail { font-weight: 600; }
  html body .sph-native-host .primary-metric > .metric-label, html body .sph-native-host .metric-label { font-size: 13px; font-weight: 500; }
  html body .sph-native-host .sync-clock-row > :is(span, strong) { font-size: 12px !important; }
  html body .sph-native-host .group-summary-item > span, html body .sph-native-host .group-manage-card > p { font-size: 13px; }
  html body .sph-native-host .group-manage-metrics > span { font-size: 12px; }
  html body .sph-native-host .toast { font-size: 13px; }
  html body .sph-native-host .primary-metric > strong { font-size: 24px; font-weight: 700; }
  html body .sph-native-host .group-summary-item > strong { font-size: 22px; font-weight: 700; }
  html body .sph-native-host summary > span, html body .sph-native-host #attention-count { font-size: 13px; font-weight: 600; }
  html body .sph-native-host .account-balance-item { font-weight: 600; }
  html body .sph-native-host .action-menu-group { font-weight: 600; }
  html body .sph-native-host .sph-range-caption { font-size: 12px; }
  html body .sph-native-host #sph-range-value { font-size: 14px; }
  html body .sph-native-host :is(.btn.sm, .sph-side-tool) { font-size: 13px; }
  html body .sph-native-host :is(#orders-summary, .orders-summary-scope, .order-page-summary) { font-size: 13px; }
  html body .sph-native-host .plan-filter-strip :is(select, input, .ui-select-trigger, .author-filter-trigger) { font-size: 14px; }
  html body .sph-native-host :is(.page-intro h1, .monitor-title-row h1) { font-size: 26px; }
}

/* 焦点态统一：细描边，不用大光圈 */
:is(input, select, textarea, .ui-select-trigger):focus-visible { outline: 2px solid color-mix(in srgb, var(--orange) 45%, transparent); outline-offset: 1px; box-shadow: none; }

@media (min-width: 761px) {
  /* 按钮 */
  :is(.view, .modal) .button:not(.small) { height: 38px; min-height: 38px; padding: 0 16px; border-radius: 8px; font-size: 13px; font-weight: 500; }
  :is(.view, .modal) .button.small { height: 32px; min-height: 32px; padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 500; }
  /* 单行输入与下拉：与按钮同高，同一行对齐（多行文本框不受影响） */
  :is(.view:not(#view-aichat):not(#view-sph-monitor), .modal) :is(input.input, select.input, .ui-select-trigger) { height: 38px; min-height: 38px; border-radius: 8px; }
  :is(.view, .modal) textarea { border-radius: 10px; }
  /* 卡片与弹窗：细边线、近乎无阴影 */
  :is(.panel, .setting-card, .leaderboard-panel, .ranking-card, .metric-card, .hero-card, .hero-pipeline-card, .tool-card, .library-card) { border-radius: 12px; box-shadow: var(--shadow-sm); }
  .modal { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .modal-backdrop { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: var(--overlay) !important; }
}

/* 视图切换入场（与投流子页同款：内容淡入并上移 8px）；投流视图内部自带动效，不重复。 */
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  @keyframes ui-view-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes ui-modal-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
  main > .view.ui-view-enter:not(#view-sph-monitor) > * { animation: ui-view-enter .24s cubic-bezier(.2, .7, .3, 1) both; }
  /* 投流视图：从其他页面切入时与其他页同款入场；位移只加在页头与内容块上，不加在页面根节点（避免影响 fixed 弹层/悬浮按钮）。 */
  main > #view-sph-monitor.ui-view-enter .sph-native-page-instance .container > :not(.sph-side-tools) { animation: ui-view-enter .24s cubic-bezier(.2, .7, .3, 1) both; }
  .modal-backdrop.open > .modal { animation: ui-modal-enter .22s cubic-bezier(.2, .7, .3, 1) both; }
}

/* ---------- 账号窗口（226）：沿用令牌与原表单，主操作紧接输入，切换模式置后 ---------- */
#adminAuthModal {
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--overlay) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
#adminAuthModal.open { display: flex; align-items: flex-start; justify-content: flex-start; padding: 24px; }
#adminAuthModal .auth-mobile-brand { display: none; }
#adminAuthModal > .auth-modal {
  flex: 0 0 auto;
  width: min(420px, 100%) !important;
  max-width: 420px !important;
  height: auto !important;
  max-height: none !important;
  margin: auto !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  color: var(--t1);
}
#adminAuthModal .auth-modal > header {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
  gap: 8px;
  min-height: 0;
  padding: 24px 24px 0 !important;
  border: 0;
  border-radius: 16px 16px 0 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#adminAuthModal header h2 { margin: 0; color: var(--t1); font: 700 20px/1.5 var(--font-serif); }
#adminAuthModal #adminAuthHint { margin: 8px 0 0; color: var(--t2); font: 400 13px/1.6 var(--font-cjk); overflow-wrap: anywhere; }
#adminAuthModal header .icon-button {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px !important;
  min-width: 44px;
  height: 44px !important;
  min-height: 44px;
  margin: -8px -8px 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--t2);
  transform: none !important;
}
#adminAuthModal header .icon-button::before { content: none; }
#adminAuthModal header .icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
#adminAuthModal header .icon-button:hover { background: var(--hover-bg); color: var(--t1); }
#adminAuthModal :is(.icon-button, .password-visibility-toggle, .auth-mode-switch):focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
#adminAuthModal .auth-form { flex: 0 0 auto; display: grid; align-content: start; gap: 16px; padding: 20px 24px 0; overflow: visible; }
#adminAuthModal .auth-form label { min-width: 0; gap: 8px; color: var(--t1); font: 500 14px/1.5 var(--font-cjk); }
#adminAuthModal .auth-form .input { width: 100%; height: 38px; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); color: var(--t1); font: 400 14px/1.5 var(--font-cjk); }
#adminAuthModal .auth-form .input:focus { border-color: var(--orange); outline: 2px solid var(--orange); outline-offset: 2px; box-shadow: none; }
#adminAuthModal #adminAuthMessage { margin: 0; color: var(--t2); font: 400 13px/1.6 var(--font-cjk); overflow-wrap: anywhere; }
#adminAuthModal #adminAuthMessage:empty { display: none; }
#adminAuthModal .auth-actions { position: static; display: flex !important; flex-direction: column; align-items: stretch; gap: 8px; padding: 20px 24px 24px !important; overflow: visible; border: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
#adminAuthModal .auth-actions .button { flex: 0 0 auto; width: 100%; min-width: 0; height: 38px; min-height: 38px; margin: 0; padding: 0 16px; border-radius: 8px; font: 500 14px/1.5 var(--font-cjk); }
#adminAuthModal .auth-actions .auth-mode-switch { border: 1px solid transparent; border-color: transparent !important; background: transparent !important; box-shadow: none; color: var(--t2) !important; }
#adminAuthModal .auth-actions .auth-mode-switch:hover { border-color: transparent !important; background: var(--hover-bg) !important; color: var(--t1) !important; }
#adminAuthModal [hidden] { display: none !important; }
@media (max-width: 760px) {
  #adminAuthModal.open { flex-direction: column; align-items: center !important; gap: 20px; padding: calc(24px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)) !important; background: var(--bg) !important; }
  #adminAuthModal .auth-mobile-brand { display: block; flex: 0 0 auto; margin: 8px 0 0; color: var(--t1); font: 700 20px/1.5 var(--font-serif); }
  #adminAuthModal.open > .auth-modal { width: min(420px, 100%) !important; max-width: 420px !important; height: auto !important; max-height: none !important; margin: 0 auto !important; border: 1px solid var(--line) !important; border-radius: 16px !important; }
  #adminAuthModal .auth-form { padding: 20px 24px 0; }
  #adminAuthModal .auth-form .input { height: 48px; min-height: 48px; font-size: 16px; }
  #adminAuthModal #adminAuthHint { font-size: 14px; }
  #adminAuthModal .password-visibility-toggle { right: 2px; width: 44px; height: 44px; border-radius: 8px; }
  #adminAuthModal .password-caps-hint { right: 46px; }
  #adminAuthModal .auth-actions .button { height: 48px; min-height: 48px; }
  #adminAuthModal .auth-actions .auth-mode-switch { height: 44px; min-height: 44px; }
}
@media (max-width: 760px) and (max-height: 560px) {
  #adminAuthModal .auth-mobile-brand { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #adminAuthModal > .auth-modal { animation: none !important; transition: none !important; }
}

/* 宋体标题里的「?」帮助角标保持黑体 */
.sph-native-host .metric-label .metric-help { font-family: var(--font-cjk) !important; font-weight: 600 !important; }

/* ---------- 下拉框统一（214）：悬停只加深边线（中性），展开时橙色细边，不再有光晕；与投流「被投作者」一致 ---------- */
html body :is(.model-select, .library-filter, .ui-select-trigger, .range-picker-toggle):hover { border-color: color-mix(in srgb, var(--t1) 22%, var(--line)); }
html body .ui-select.is-open .ui-select-trigger { border-color: color-mix(in srgb, var(--orange) 55%, var(--line)); box-shadow: none; }
@media (min-width: 761px) {
  /* 文案库「老师 / 排序」：下拉按内容宽度，不再截成「全…」 */
  html body .library-assets-panel > #libraryToolbar { grid-template-columns: max-content max-content minmax(220px, 1fr); }
  html body #libraryToolbar .library-filter { flex: 0 0 auto; width: auto; max-width: none; height: 38px; min-height: 38px; box-sizing: border-box; }
  html body #libraryToolbar .library-filter :is(.ui-select, .ui-select-trigger) { width: auto; min-width: max-content; max-width: none; }
  html body #libraryToolbar .library-filter .ui-select-value-label { overflow: visible; text-overflow: clip; white-space: nowrap; }
}

/* ---------- 文案详情：「关联视频」与「文案操作」的箭头改为描线箭头（原 ⌄ 字符基线偏下），展开带旋转与内容淡入 ---------- */
@keyframes ui-pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.detail-video-disclosure summary::after { content: ""; width: 7px; height: 7px; flex: 0 0 7px; margin: -4px 4px 0 2px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; color: var(--t2); font-size: 0; transform: rotate(45deg); transition: transform .2s ease, margin .2s ease; }
.detail-video-disclosure[open] summary::after { margin-top: 4px; transform: rotate(225deg); }
.detail-video-disclosure[open] > :not(summary) { animation: ui-pop-in .22s cubic-bezier(.2, .7, .3, 1) both; }
#detailActionsBtn { gap: 8px; }
#detailActionsBtn .button-chevron { display: inline-block; width: 7px; height: 7px; margin-top: -3px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); transition: transform .2s ease, margin .2s ease; }
#detailActionsBtn[aria-expanded="true"] .button-chevron { margin-top: 4px; transform: rotate(225deg); }
.detail-actions-list:not([hidden]) { animation: ui-pop-in .16s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .detail-video-disclosure summary::after, #detailActionsBtn .button-chevron { transition: none; }
  .detail-video-disclosure[open] > :not(summary), .detail-actions-list:not([hidden]) { animation: none; }
}

/* ---------- 文案资产卡片：元信息分组，正文使用浅底预览 ---------- */
#view-library .library-list { display: grid; gap: 12px; }
#view-library .lib-card { display: grid; gap: 10px; margin: 0; padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: none; transition: border-color .18s ease, box-shadow .18s ease; }
#view-library .lib-card:hover { border-color: var(--line-strong, color-mix(in srgb, var(--t1) 22%, var(--line))); box-shadow: var(--shadow-sm); }
#view-library .lib-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
#view-library .lib-card-title { display: -webkit-box; margin: 0; overflow: hidden; color: var(--t1); font-family: var(--font-serif); font-size: 17px; font-weight: 700; line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#view-library .lib-card-orders { display: inline-flex; flex: 0 0 auto; align-items: baseline; gap: 3px; padding: 4px 11px; border-radius: 999px; background: color-mix(in srgb, var(--orange) 10%, transparent); color: var(--orange); font-size: 12px; font-weight: 500; white-space: nowrap; }
#view-library .lib-card-orders b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
#view-library .lib-card-orders.is-legacy { background: var(--elevated); color: var(--t3); }
#view-library .lib-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--t2); font-size: 13px; line-height: 1.6; }
#view-library .lib-card-meta > span:not([hidden]) { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
#view-library .lib-card-meta > span:not([hidden]) ~ span:not([hidden])::before { content: ""; flex: 0 0 1px; height: 14px; margin-right: 7px; background: var(--line); }
#view-library .lib-card-meta > .library-teacher-meta:not([hidden]) { min-height: 0; }
#view-library .lib-card-meta b { min-width: 0; color: var(--t1); font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#view-library .lib-card .teacher-badge { gap: 6px; margin: 0; }
#view-library .lib-card .teacher-badge b { padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--elevated) 75%, var(--card)); color: var(--t1); font-size: 13px; font-weight: 600; }
#view-library .lib-card .teacher-badge small { padding: 1px 8px; border: 0; border-radius: 999px; background: var(--elevated); color: var(--t2); font-size: 12px; }
#view-library .lib-card .teacher-badge.pending b { color: var(--t1); }
#view-library .lib-card .teacher-badge.pending small { background: color-mix(in srgb, var(--amber) 14%, transparent); color: color-mix(in srgb, var(--amber) 80%, var(--t1)); }
#view-library .lib-card-preview { min-width: 0; padding: 12px 14px; border-radius: 8px; background: color-mix(in srgb, var(--card) 98%, var(--t1)); }
#view-library .lib-card .lib-card-body { display: -webkit-box; margin: 0; overflow: hidden; color: color-mix(in srgb, var(--t1) 82%, var(--card)); font-size: 14px; line-height: 1.8; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
#view-library .lib-card-actions { display: flex; align-items: center; gap: 4px; margin: 2px 0 0; padding: 0; border: 0; }
#view-library .lib-card-actions .button { gap: 6px; height: 32px; margin-right: 6px; padding: 0 12px; }
#view-library .lib-card-actions .button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#view-library .lib-card-link { height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--t2); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
#view-library .lib-card-link:hover { background: var(--hover-bg); color: var(--t1); }
#view-library .lib-card-link.is-danger { margin-left: auto; color: var(--t3); }
#view-library .lib-card-link.is-danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); }
@media (max-width: 760px) {
  #view-library .lib-card { padding: 14px; }
  #view-library .lib-card-title { font-size: 15px; }
}

/* ---------- 草稿写作（221）：左侧草稿列表 + 纸面编辑区；「对比」开关展开双栏差异 ---------- */
#view-library .draft-app { --draft-h: clamp(560px, calc(100dvh - 186px), 1400px); position: relative; display: grid; grid-template-columns: 264px minmax(0, 1fr); height: var(--draft-h); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
#view-library .draft-app svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 左栏：我的草稿 */
#view-library .draft-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--elevated) 45%, var(--card)); }
#view-library .draft-side-head { display: flex; align-items: center; gap: 8px; padding: 16px 12px 10px 18px; }
#view-library .draft-side-head h3 { margin: 0; color: var(--t1); font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
#view-library .draft-side-count { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--elevated); color: var(--t2); font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
#view-library .draft-side-head .draft-icon-btn { margin-left: auto; }
#view-library .draft-search { position: relative; display: block; margin: 0 12px 8px; }
#view-library .draft-search svg { position: absolute; top: 50%; left: 10px; width: 15px; height: 15px; color: var(--t3); transform: translateY(-50%); pointer-events: none; }
#view-library .draft-search input { width: 100%; height: 34px; min-height: 34px; margin: 0; padding: 0 10px 0 31px; border: 1px solid transparent; border-radius: 8px; background: var(--card); color: var(--t1); font: inherit; font-size: 13px; outline: none; transition: border-color .15s ease; }
#view-library .draft-search input:focus { border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); outline: none; }
#view-library .draft-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 14px; scrollbar-width: thin; }
#view-library .draft-month + .draft-month { margin-top: 8px; border-top: 1px solid var(--line); }
#view-library .draft-month-label { padding: 8px 10px; color: var(--t1); font-size: 13px; font-weight: 650; }
#view-library .draft-week-label { padding: 6px 10px 6px 22px; color: var(--t2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
#view-library .draft-list-empty { margin: 28px 0; color: var(--t3); font-size: 13px; text-align: center; }
#view-library .draft-item { display: grid; grid-template-rows: 1fr; margin: 0 0 2px; transition: grid-template-rows .22s ease, opacity .2s ease, transform .2s ease; }
#view-library .draft-item-inner { position: relative; display: flex; align-items: center; min-height: 0; overflow: hidden; border-radius: 8px; transition: background-color .15s ease; }
#view-library .draft-item-inner::before { content: ""; position: absolute; top: 9px; bottom: 9px; left: 0; width: 3px; border-radius: 3px; background: var(--orange); opacity: 0; transform: scaleY(.4); transition: opacity .2s ease, transform .2s ease; }
#view-library .draft-item:hover .draft-item-inner { background: var(--hover-bg); }
#view-library .draft-item.is-active .draft-item-inner { background: color-mix(in srgb, var(--orange) 9%, transparent); }
#view-library .draft-item.is-active .draft-item-inner::before { opacity: 1; transform: none; }
#view-library .draft-item-main { display: grid; flex: 1; gap: 3px; min-width: 0; margin: 0; padding: 9px 6px 9px 12px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
#view-library .draft-item-main strong { overflow: hidden; color: var(--t1); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#view-library .draft-item-main small { overflow: hidden; color: var(--t3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
#view-library .draft-item-del { display: grid; flex: 0 0 26px; width: 26px; height: 26px; margin-right: 6px; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--t3); opacity: 0; cursor: pointer; transition: opacity .15s ease, background-color .15s ease, color .15s ease; }
#view-library .draft-item-del svg { width: 14px; height: 14px; }
#view-library .draft-item:hover .draft-item-del, #view-library .draft-item-del:focus-visible { opacity: 1; }
#view-library .draft-item-del:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
#view-library .draft-more-items { display: block; width: calc(100% - 8px); height: 32px; margin: 8px 4px 0; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--t2); font: inherit; font-size: 13px; cursor: pointer; }

/* 主区与工具栏 */
#view-library .draft-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#view-library .draft-toolbar { display: flex; align-items: center; gap: 10px; height: 52px; flex: 0 0 52px; padding: 0 14px 0 20px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); transition: opacity .3s ease, transform .3s ease; }
#view-library .draft-icon-btn.draft-side-toggle { display: none; }
#view-library .draft-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--t3); font-size: 13px; }
#view-library .draft-crumb b { overflow: hidden; color: var(--t1); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
#view-library .draft-crumb span::after { content: "/"; margin-left: 8px; color: var(--line-strong, var(--t3)); }
#view-library .draft-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
#view-library .draft-tools[hidden] { display: none; }
#view-library .draft-icon-btn { display: inline-grid; flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--t2); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
#view-library .draft-icon-btn svg { width: 17px; height: 17px; }
#view-library .draft-icon-btn:hover { background: var(--hover-bg); color: var(--t1); }
#view-library .draft-icon-btn[aria-pressed="true"], #view-library .draft-icon-btn[aria-expanded="true"] { background: var(--hover-bg); color: var(--t1); }
#view-library .draft-count { margin: 0 8px 0 4px; color: var(--t3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 保存状态：呼吸点 / 绿点 + 对勾 / 失败抖动 */
#view-library .draft-save { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 9px; border-radius: 999px; color: var(--t3); font-size: 12px; white-space: nowrap; cursor: default; }
#view-library .draft-save i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--t3); transition: background-color .2s ease; }
#view-library .draft-save[data-state="dirty"] i { background: var(--amber); }
#view-library .draft-save[data-state="saving"] i { background: var(--orange); animation: draft-breathe 1s ease-in-out infinite; }
#view-library .draft-save[data-state="saved"] i { background: var(--green); }
#view-library .draft-save[data-state="saved"] i::after { content: "✓"; position: absolute; top: 50%; left: 50%; color: var(--green); font-size: 11px; font-style: normal; font-weight: 700; line-height: 1; transform: translate(-50%, -150%); animation: draft-tick .9s ease-out both; }
#view-library .draft-save[data-state="error"] { color: var(--danger); cursor: pointer; animation: draft-shake .32s ease; }
#view-library .draft-save[data-state="error"] i { background: var(--danger); }
#view-library .draft-save[data-state="error"]:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
@keyframes draft-breathe { 50% { opacity: .35; transform: scale(.8); } }
@keyframes draft-tick { 0% { opacity: 0; transform: translate(-50%, -110%) scale(.5); } 30% { opacity: 1; transform: translate(-50%, -150%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -150%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -170%); } }
@keyframes draft-shake { 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }

/* 对比开关：胶囊滑块 */
#view-library .draft-switch { display: inline-flex; align-items: center; gap: 7px; height: 32px; margin: 0 4px; padding: 0 10px 0 7px; border: 0; border-radius: 8px; background: transparent; color: var(--t2); font: inherit; font-size: 13px; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
#view-library .draft-switch:hover { background: var(--hover-bg); color: var(--t1); }
#view-library .draft-switch-track { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--line-strong, var(--line)); transition: background-color .22s ease; }
#view-library .draft-switch-track i { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .22s cubic-bezier(.3, .7, .3, 1); }
#view-library .draft-switch[aria-checked="true"] { color: var(--t1); }
#view-library .draft-switch[aria-checked="true"] .draft-switch-track { background: var(--orange); }
#view-library .draft-switch[aria-checked="true"] .draft-switch-track i { transform: translateX(12px); }

/* ⋯ 菜单 */
#view-library .draft-more { position: relative; }
#view-library .draft-menu { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; display: grid; min-width: 188px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow-lg); transform-origin: top right; animation: draft-pop .16s ease-out both; }
#view-library .draft-menu[hidden] { display: none; }
#view-library .draft-menu button { height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--t1); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
#view-library .draft-menu button[hidden] { display: none; }
#view-library .draft-menu button:hover:not(:disabled) { background: var(--hover-bg); }
#view-library .draft-menu button:disabled { color: var(--t3); cursor: default; }
#view-library .draft-menu button.is-danger { color: var(--danger); }
#view-library .draft-menu hr { height: 1px; margin: 5px 4px; border: 0; background: var(--line); }
@keyframes draft-pop { from { opacity: 0; transform: scale(.98) translateY(-3px); } to { opacity: 1; transform: none; } }

/* 空状态 */
#view-library .draft-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px; text-align: center; animation: draft-fade-up .28s ease-out both; }
#view-library .draft-empty[hidden] { display: none; }
#view-library .draft-empty-mark { display: grid; width: 64px; height: 64px; margin-bottom: 6px; place-items: center; border-radius: 18px; background: color-mix(in srgb, var(--orange) 8%, transparent); color: var(--orange); }
#view-library .draft-empty-mark svg { width: 34px; height: 34px; stroke-width: 1.6; }
#view-library .draft-empty h3 { margin: 0; color: var(--t1); font-family: var(--font-serif); font-size: 20px; font-weight: 700; }
#view-library .draft-empty p { max-width: 360px; margin: 0 0 8px; color: var(--t2); font-size: 14px; line-height: 1.7; }

/* 写作区：纸面、标题、正文 */
#view-library .draft-stage { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 26px 0 12px; }
#view-library .draft-stage[hidden] { display: none; }
#view-library .draft-stage.draft-enter { animation: draft-fade .2s ease-out both; }
#view-library .draft-title { display: block; flex: 0 0 auto; width: min(720px, calc(100% - 64px)); height: auto; min-height: 0; max-height: 30vh; margin: 0 auto 14px; padding: 4px 0 8px; overflow: hidden; resize: none; white-space: pre-wrap; overflow-wrap: anywhere; field-sizing: content; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; color: var(--t1); font-family: var(--font-serif); font-size: 28px; font-weight: 700; line-height: 1.35; outline: none; box-shadow: none; transition: border-color .2s ease, width .3s ease; }
#view-library .draft-title::placeholder { color: color-mix(in srgb, var(--t3) 70%, transparent); }
#view-library .draft-title:focus { border-bottom-color: var(--line); outline: none; box-shadow: none; }
#view-library .draft-columns { position: relative; display: grid; flex: 1; grid-template-columns: minmax(0, 1fr); min-height: 0; }
#view-library .draft-app[data-compare="true"] .draft-columns { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); padding: 0 16px; }
#view-library .draft-app[data-compare="true"] .draft-title { width: calc(100% - 64px); }
#view-library .draft-paper { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#view-library .draft-app[data-compare="false"] .draft-paper.is-ref, #view-library .draft-app[data-compare="false"] .draft-swap { display: none; }
#view-library .draft-paper-head { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 0 6px 8px; color: var(--t3); font-size: 12px; }
#view-library .draft-app[data-compare="true"] .draft-paper-head { display: flex; }
#view-library .draft-paper.is-editing .draft-paper-head [data-manual-role-label] { color: var(--orange); font-weight: 600; }
#view-library .draft-paper-count { font-variant-numeric: tabular-nums; }
#view-library .draft-paper-body { position: relative; display: grid; flex: 1; min-height: 0; }
#view-library .draft-surface { grid-area: 1 / 1; display: block; box-sizing: border-box; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 4px max(32px, calc((100% - 720px) / 2)) 40vh; overflow-x: hidden; overflow-y: auto; border: 0; border-radius: 0; background: transparent; color: var(--t1); font-family: var(--font-cjk, inherit); font-size: 16px; font-weight: 400; line-height: 1.9; letter-spacing: .01em; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; scrollbar-width: thin; }
#view-library .draft-surface[hidden] { display: none; }
#view-library textarea.draft-surface { position: relative; z-index: 1; height: 100%; min-height: 0; resize: none; outline: none; box-shadow: none; caret-color: var(--orange); }
#view-library textarea.draft-surface:focus, #view-library textarea.draft-surface:focus-visible { outline: none; box-shadow: none; }
#view-library textarea.draft-surface::placeholder { color: color-mix(in srgb, var(--t3) 70%, transparent); }
#view-library textarea.draft-surface::selection { background: color-mix(in srgb, var(--orange) 22%, transparent); }
#view-library .draft-surface.revised-highlight { z-index: 0; color: transparent; pointer-events: none; overflow-y: scroll; }
#view-library .draft-surface.revised-highlight::after { content: "\200b"; }
#view-library .draft-app[data-compare="true"] .draft-surface { padding: 18px 22px 30vh; border-radius: 10px; }
#view-library .draft-app[data-compare="true"] textarea.draft-surface { overflow-y: scroll; }
#view-library .draft-app[data-compare="true"] .draft-paper.is-editing .draft-paper-body { border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
#view-library .draft-app[data-compare="true"] .draft-paper.is-ref .draft-paper-body { border-radius: 10px; background: color-mix(in srgb, var(--elevated) 50%, var(--card)); }
#view-library .draft-paper.is-ref .draft-surface.source { color: color-mix(in srgb, var(--t1) 78%, var(--card)); font-size: 15px; outline: none; }
#view-library .draft-app[data-compare="true"] .draft-paper.is-ref { animation: draft-slide-in .26s cubic-bezier(.2, .7, .3, 1) both; }
#view-library .draft-app[data-compare="true"] .draft-paper.is-editing { animation: draft-settle .26s cubic-bezier(.2, .7, .3, 1) both; }
#view-library .draft-swap { display: grid; width: 32px; height: 32px; margin: 0; padding: 0; place-items: center; align-self: center; justify-self: center; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--t2); cursor: pointer; transition: border-color .15s ease, color .15s ease; }
#view-library .draft-swap svg { width: 16px; height: 16px; transition: transform .3s ease; }
#view-library .draft-swap:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
#view-library .draft-swap:disabled { opacity: .4; cursor: default; }
#view-library .draft-columns.is-swapping .draft-swap svg { transform: rotate(180deg); }
#view-library .draft-columns.is-swapping .draft-paper { animation: draft-fade .22s ease-out both; }

/* 差异：柔和浅底 + 下划线 */
#view-library .manual-diff-insert { border-radius: 2px; background: color-mix(in srgb, var(--green) 10%, transparent); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--green) 55%, transparent); color: transparent; text-decoration: none; }
#view-library .manual-diff-delete { border-radius: 2px; background: color-mix(in srgb, var(--danger) 9%, transparent); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--danger) 50%, transparent); color: inherit; text-decoration: none; }
#view-library .manual-source-selection { border-radius: 2px; background: color-mix(in srgb, var(--orange) 18%, transparent); }
#view-library .manual-caret-marker { display: inline-block; width: 2px; height: 1.3em; margin: 0 -1px; vertical-align: text-bottom; border-radius: 1px; background: var(--orange); animation: draft-caret 1.1s steps(1) infinite; }
@keyframes draft-caret { 50% { opacity: .15; } }
#view-library .draft-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 22px 0; color: var(--t3); font-size: 12px; }
#view-library .draft-legend[hidden] { display: none; }
#view-library .draft-legend > span:not(#manualRewriteStats)::before { content: ""; display: inline-block; width: 16px; height: 8px; margin-right: 6px; border-radius: 2px; vertical-align: middle; }
#view-library .draft-legend .is-insert::before { background: color-mix(in srgb, var(--green) 14%, transparent); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--green) 55%, transparent); }
#view-library .draft-legend .is-delete::before { background: color-mix(in srgb, var(--danger) 12%, transparent); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--danger) 50%, transparent); }
#view-library .draft-legend .is-caret::before { width: 2px !important; height: 13px !important; background: var(--orange); }
#view-library #manualRewriteStats { margin-left: auto; color: var(--t2); }

/* 粘贴对比稿 */
#view-library .draft-ref-paste { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; padding: 18px; animation: draft-pop .18s ease-out both; }
#view-library .draft-ref-paste[hidden] { display: none; }
#view-library .draft-ref-paste strong { color: var(--t1); font-size: 14px; font-weight: 600; }
#view-library .draft-ref-paste textarea { flex: 1; min-height: 160px; resize: none; font-size: 14px; line-height: 1.8; }
#view-library .draft-ref-paste .button { align-self: flex-start; }

/* 入场与列表动效 */
@keyframes draft-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draft-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes draft-slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes draft-settle { from { opacity: .6; } to { opacity: 1; } }
@keyframes draft-item-in { from { grid-template-rows: 0fr; opacity: 0; transform: translateY(-4px); } to { grid-template-rows: 1fr; opacity: 1; transform: none; } }
#view-library [data-copywriter-pane="manual"].active .draft-app { animation: draft-fade-up .24s cubic-bezier(.2, .7, .3, 1) both; }
#view-library .draft-list.is-stagger .draft-item { animation: draft-fade-up .22s ease-out both; animation-delay: calc(var(--i, 0) * 20ms); }
#view-library .draft-item.is-new { animation: draft-item-in .28s cubic-bezier(.2, .7, .3, 1) both; }
#view-library .draft-item.is-leaving { grid-template-rows: 0fr; opacity: 0; transform: translateX(-10px); pointer-events: none; }

/* 专注模式：只留纸面，工具栏在鼠标静止 2 秒后淡出 */
body.manual-rewrite-focus-mode { overflow: hidden; }
body.manual-rewrite-focus-mode :is(.sidebar, .topbar, .copywriter-head, .theme-toggle) { display: none !important; }
body.manual-rewrite-focus-mode #view-library .draft-app { position: fixed; z-index: 150; inset: 0; height: 100dvh; grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; animation: draft-fade .3s ease-out both; }
body.manual-rewrite-focus-mode #view-library .draft-side, body.manual-rewrite-focus-mode #view-library .draft-side-scrim { display: none; }
body.manual-rewrite-focus-mode #view-library .draft-toolbar { border-bottom-color: transparent; }
body.manual-rewrite-focus-mode #view-library .draft-app.is-idle .draft-toolbar { opacity: 0; transform: translateY(-6px); }
body.manual-rewrite-focus-mode #view-library .draft-stage { padding-top: 40px; }
body.manual-rewrite-focus-mode .toast { z-index: 1010; }

/* 窄屏：草稿列表收为抽屉 */
@media (max-width: 1100px) {
  #view-library .draft-app { grid-template-columns: minmax(0, 1fr); }
  #view-library .draft-side { position: absolute; z-index: 40; top: 0; bottom: 0; left: 0; width: min(300px, 86%); border-right: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-lg); transform: translateX(-102%); transition: transform .26s cubic-bezier(.2, .7, .3, 1); }
  #view-library .draft-app[data-side-open="true"] .draft-side { transform: none; }
  #view-library .draft-side-scrim { position: absolute; z-index: 35; inset: 0; background: var(--overlay); animation: draft-fade .2s ease-out both; }
  #view-library .draft-side-scrim[hidden] { display: none; }
  #view-library .draft-icon-btn.draft-side-toggle { display: inline-grid; margin-left: -8px; }
  #view-library .draft-app[data-compare="true"] .draft-columns { grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); padding: 0 10px; }
}
@media (max-width: 760px) {
  #view-library .draft-app { --draft-h: calc(100dvh - 150px); }
  #view-library .draft-toolbar { padding: 0 8px 0 14px; }
  #view-library .draft-crumb span, #view-library .draft-count { display: none; }
  #view-library .draft-title { width: calc(100% - 36px); font-size: 22px; }
  #view-library .draft-surface { padding: 4px 18px 40vh; font-size: 16px; }
  #view-library .draft-app[data-compare="true"] .draft-columns { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 36px minmax(0, 1fr); padding: 0 8px; }
  #view-library .draft-swap svg { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  #view-library :is(.draft-app, .draft-stage, .draft-item, .draft-paper, .draft-menu, .draft-empty, .draft-ref-paste, .draft-side, .draft-side-scrim, .draft-save, .draft-save i, .draft-save i::after, .manual-caret-marker), #view-library .draft-list.is-stagger .draft-item { animation: none !important; transition: none !important; }
}

/* 标题裂变：沿用现行纸面、衬线标题和中性控件，不另起视觉主题。 */
#view-library .title-reference-row, #view-library .title-source-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
#view-library .title-mode-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--elevated); }
#view-library .title-mode-switch .button { margin: 0; }
/* 仅修复此处 ghost 选中态的覆盖；不改公共按钮规则。 */
html body #view-library [data-copywriter-pane="titles"] .title-mode-switch .button.is-active:not(:disabled) { color: var(--t1) !important; border: 1px solid var(--line) !important; background: var(--card) !important; box-shadow: var(--shadow-sm) !important; font-weight: 700; }
#view-library #titleSingleSourceLabel { flex: 1 1 280px; min-width: 0; }
#view-library .title-clause-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; }
#view-library #titleSinglePreview { margin: 12px 0; }
#view-library .title-clause { min-width: 0; padding: 12px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 8px; }
#view-library .title-clause > .title-clause-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--t2); font: 400 12px/1.5 var(--font-cjk); }
#view-library .title-clause-label em { color: var(--orange); font: 700 16px/1 var(--font-cjk); }
#view-library .title-clause > strong { display: block; color: var(--t1); font: 600 16px/1.65 var(--font-serif); overflow-wrap: anywhere; }
#view-library .title-clause-option { display: block; width: 100%; min-height: 88px; margin: 0; appearance: none; text-align: left; cursor: pointer; transition: border-color .15s; }
#view-library .title-clause-option:not(:disabled):hover { border-color: var(--line-strong); }
#view-library .title-clause-option[aria-pressed="true"] { border-color: var(--t2); }
#view-library .title-clause-option[aria-pressed="true"] > strong { font-weight: 700; }
#view-library .title-clause-option:focus-visible, #view-library .title-blend-option:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
#view-library .title-clause-option:disabled { cursor: not-allowed; opacity: .5; }
#view-library .title-combination { display: grid; gap: 14px; margin: 14px 0; }
#view-library #titleSourceSearch { flex: 1 1 240px; min-width: 0; }
#view-library .title-reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-height: 340px; overflow-y: auto; scrollbar-gutter: stable; padding: 3px; }
#view-library .title-reference-list > .empty { grid-column: 1 / -1; }
#view-library .title-reference-card { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: none; }
#view-library .title-blend-option { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px 16px; appearance: none; text-align: left; cursor: pointer; transition: border-color .15s; }
#view-library .title-blend-option > strong { color: var(--t1); font: 600 16px/1.65 var(--font-serif); overflow-wrap: anywhere; }
#view-library .title-blend-option > small { color: var(--t2); font: 400 13px/1.5 var(--font-cjk); font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-library .title-blend-option:not(:disabled):hover { border-color: var(--line-strong); }
#view-library .title-blend-option[aria-pressed="true"] { border-color: var(--t2); }
#view-library .title-blend-option[aria-pressed="true"] > strong { font-weight: 700; }
#view-library .title-blend-check { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 3px; color: transparent; font: 700 13px/1 var(--font-cjk); }
#view-library .title-blend-option[aria-pressed="true"] .title-blend-check { border-color: var(--orange); background: var(--orange); color: var(--action-text); }
#view-library .title-blend-option:disabled { cursor: not-allowed; opacity: .5; }
#view-library .title-splice-card { display: grid; align-content: start; gap: 8px; padding: 12px; }
#view-library .title-splice-card header { display: flex; justify-content: end; }
#view-library .title-splice-card header > span { color: var(--t2); font: 400 13px/1.5 var(--font-cjk); font-variant-numeric: tabular-nums; }
#view-library .title-selection-footer { display: grid; gap: 8px; min-width: 0; }
#view-library .title-selection-summary { min-width: 0; }
#view-library .title-selected-references { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; min-width: 0; }
#view-library .title-selected-references:empty { display: none; }
#view-library #titleSplicePreview, #view-library .title-summary-part { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
#view-library #titleSplicePreview { gap: 8px 20px; }
#view-library .title-selected-references > span, #view-library .title-summary-part > span { color: var(--t2); font-size: 13px; }
#view-library .title-summary-empty { color: var(--t3); }
#view-library .title-summary-chip { display: inline-flex; align-items: center; gap: 10px; max-width: min(320px, 100%); }
#view-library .title-selected-references .title-summary-chip { width: 100%; max-width: none; min-width: 0; justify-content: space-between; }
#view-library .title-summary-chip > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-library .title-summary-chip > span:last-child { flex: 0 0 auto; color: var(--t2); }
#view-library .title-source-pagination, #view-library .title-source-pagination > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#view-library .title-source-pagination { justify-content: space-between; color: var(--t2); font-size: 13px; }
#view-library .title-reference-caption { color: var(--t2); font-size: 13px; line-height: 1.65; margin: 8px 0; overflow-wrap: anywhere; }
#view-library [data-copywriter-pane="titles"] .title-result-table { width: 100%; table-layout: fixed; border-collapse: collapse; border: 0; background: transparent; }
#view-library .title-result-index-col { width: 44px; }
#view-library .title-result-actions-col { width: 180px; }
#view-library .title-result-table :is(th, td) { padding: 12px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; vertical-align: middle; }
#view-library .title-result-table th { color: var(--t2); font: 400 12px/1.5 var(--font-cjk); }
#view-library .title-result-table .title-result-index { color: var(--t2); font: 400 13px/1.5 var(--font-cjk); font-variant-numeric: tabular-nums; }
#view-library .title-result-table .title-result-text { color: var(--t1); font: 600 16px/1.65 var(--font-serif); overflow-wrap: anywhere; }
#view-library .title-result-table .title-variant-actions { display: flex; align-items: center; justify-content: end; gap: 8px; }
#view-library .title-result-table .button { flex: 0 0 auto; }
@media (max-width: 1100px) {
  #view-library .title-reference-list { grid-template-columns: minmax(0, 1fr); }
  #view-library .title-selected-references { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #view-library .title-clause-pair { grid-template-columns: minmax(0, 1fr); }
  #view-library .title-mode-switch .button, #view-library .title-summary-chip { min-height: 44px; }
}

/* 260: original leaderboard context stays distinct from returned search authors. */
.quick-video-source { display:flex; align-items:center; gap:12px; min-width:0; margin:0 0 16px; padding:12px; border:1px solid var(--line); border-radius:8px; background:var(--card); }
.quick-video-source>strong { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:600; }
.quick-video-source>.batch-transcribe-entry-author { flex:none; max-width:45%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media(max-width:480px) { .quick-video-source { flex-wrap:wrap; gap:8px; } .quick-video-source>strong { flex-basis:100%; } .quick-video-source>.batch-transcribe-entry-author { max-width:100%; } }

/* 264: account menu, shared warm surfaces and compact icon tiles. */
#aiNav[hidden]{display:none!important}
#workspaceSidebar #sidebarAccount{position:relative;padding:9px 9px 5px;border:1px solid var(--line);border-radius:16px;background:var(--card);transition:border-radius .15s ease}
#workspaceSidebar #sidebarAccount:has([aria-expanded="true"]){border-top-color:transparent;border-radius:0 0 16px 16px}
#workspaceSidebar #sidebarAccount .sidebar-app-version{display:block;margin:7px 0 0;text-align:center;font-size:10px;line-height:17px;color:var(--t3)}
#workspaceSidebar .sidebar-account-trigger:not(.is-login){grid-template-columns:38px minmax(0,1fr) 16px;min-height:62px;padding:9px 10px;gap:10px;border:1px solid var(--line);border-radius:12px;background:var(--card);box-shadow:none}
#workspaceSidebar .sidebar-account-trigger:not(.is-login):is(:hover,[aria-expanded="true"]){border-color:color-mix(in srgb,var(--orange) 55%,var(--line));background:var(--orange-soft);box-shadow:none}
#workspaceSidebar .sidebar-account-trigger:focus-visible{outline:2px solid color-mix(in srgb,var(--orange) 60%,transparent);outline-offset:2px}
#workspaceSidebar .sidebar-account-avatar{width:38px;height:38px;box-shadow:inset 0 0 0 2px var(--card);font-size:16px}
#workspaceSidebar .sidebar-account-avatar i{background:var(--green);border-color:var(--card);box-shadow:none}
#workspaceSidebar .sidebar-account-copy strong{font-size:14px;font-weight:700}
#workspaceSidebar .sidebar-account-copy small{font-size:11px;color:var(--t3)}
#workspaceSidebar .sidebar-account-chevron{transition:transform .2s cubic-bezier(.2,.8,.2,1)}
#workspaceSidebar #accountPopover{left:-1px;right:-1px;bottom:calc(100% - 1px);padding:12px 9px 10px;border:1px solid var(--line);border-bottom:0;border-radius:16px 16px 0 0;background:var(--card);box-shadow:0 -10px 32px color-mix(in srgb,var(--text) 6%,transparent);transform-origin:bottom center;max-height:calc(100dvh - 150px);overflow-y:auto;overscroll-behavior:contain}
#workspaceSidebar .account-popover-head{gap:5px;margin:0 4px 9px;padding:6px 4px 14px;border-color:var(--line)}
#workspaceSidebar .account-popover-head strong{font-family:var(--font-cjk);font-size:19px;font-weight:750;line-height:1.4}
#workspaceSidebar .account-popover-head small{font-size:12px;color:var(--t3);line-height:1.5}
#workspaceSidebar #accountPopover button{gap:12px;min-height:48px;padding:7px 8px;border-radius:10px;font-size:14px;line-height:1.4;color:var(--t2);transition:background-color .15s ease,color .15s ease}
#workspaceSidebar #accountPopover button:is(:hover,:focus-visible){color:var(--t1);background:var(--elevated)}
#workspaceSidebar #accountPopover button:focus-visible{outline:2px solid color-mix(in srgb,var(--orange) 55%,transparent);outline-offset:-2px}
#workspaceSidebar #accountPopover .account-icon-tile{display:grid;place-items:center;width:32px;height:32px;flex:0 0 32px;border-radius:10px;background:var(--elevated);color:var(--t2)}
#workspaceSidebar #accountPopover .account-menu-icon{display:block;width:18px;height:18px;flex:0 0 18px;background:currentColor;color:inherit}
#workspaceSidebar #accountPopover .account-menu-logout{position:relative;margin-top:9px;padding-top:16px;min-height:58px;border-top:1px solid var(--line);border-radius:0 0 10px 10px;color:var(--danger)}
#workspaceSidebar #accountPopover .account-menu-logout .account-icon-tile{background:color-mix(in srgb,var(--danger) 7%,var(--card));color:var(--danger)}
#workspaceSidebar #accountPopover .account-menu-logout:is(:hover,:focus-visible){background:color-mix(in srgb,var(--danger) 5%,var(--card));color:var(--danger)}
@media(min-width:761px) and (max-width:1100px){
 #workspaceSidebar #sidebarAccount{padding:4px 3px}
 #workspaceSidebar #sidebarAccount:has([aria-expanded="true"]){border-top-color:var(--line);border-radius:16px}
 #workspaceSidebar .sidebar-account-trigger:not(.is-login){display:flex;padding:5px;min-height:50px}
 #workspaceSidebar #accountPopover{position:fixed;left:86px;right:auto;bottom:20px;width:224px;border:1px solid var(--line);border-radius:16px;max-height:calc(100dvh - 40px);box-shadow:var(--card-shadow)}
}
@media(prefers-reduced-motion:reduce){#workspaceSidebar :is(#sidebarAccount,.sidebar-account-chevron,#accountPopover button){transition:none}}

/* 265: account footer shares the sidebar background; retain the inner frame. */
#workspaceSidebar #sidebarAccount{background:var(--sidebar);border-color:transparent;box-shadow:none}
#workspaceSidebar .sidebar-account-trigger:not(.is-login){background:var(--sidebar);border-color:var(--line)}
#workspaceSidebar .sidebar-account-trigger:not(.is-login):is(:hover,[aria-expanded="true"]){background:var(--sidebar);border-color:color-mix(in srgb,var(--t2) 24%,var(--line));box-shadow:none}
@media(min-width:761px) and (max-width:1100px){#workspaceSidebar #sidebarAccount:has([aria-expanded="true"]){border-color:transparent}}

/* 266: compact account menu shares the sidebar surface. */
#workspaceSidebar #accountPopover{padding:9px 9px 7px;background:var(--sidebar);border-radius:14px 14px 0 0}
#workspaceSidebar .account-popover-head{gap:3px;margin:0 4px 6px;padding:4px 4px 10px}
#workspaceSidebar .account-popover-head strong{font-size:17px;line-height:1.4}
#workspaceSidebar .account-popover-head small{font-size:11px;line-height:1.4}
#workspaceSidebar #accountPopover button{gap:10px;min-height:32px;padding:3px 8px;border-radius:8px;font-size:13px}
#workspaceSidebar #accountPopover .account-icon-tile{width:24px;height:24px;flex-basis:24px;border-radius:8px;background:color-mix(in srgb,var(--t2) 5%,var(--sidebar))}
#workspaceSidebar #accountPopover .account-menu-icon{width:14px;height:14px;flex-basis:14px}
#workspaceSidebar #accountPopover button:is(:hover,:focus-visible){background:color-mix(in srgb,var(--t2) 6%,var(--sidebar))}
#workspaceSidebar #accountPopover .account-menu-logout{margin-top:6px;padding-top:8px;padding-bottom:4px;min-height:38px;border-radius:0 0 8px 8px}
#workspaceSidebar #accountPopover .account-menu-logout .account-icon-tile{background:color-mix(in srgb,var(--danger) 7%,var(--sidebar))}
#workspaceSidebar #accountPopover .account-menu-logout:is(:hover,:focus-visible){background:color-mix(in srgb,var(--danger) 5%,var(--sidebar))}
@media(min-width:761px) and (max-width:1100px){#workspaceSidebar #accountPopover{border-radius:14px}}

/* ===== 1.0.6 素材与转写：上方新建（来源切换 + 统一模型），下方转写记录（固定列宽对齐）+ 右侧正文 / 汇总 ===== */
html body #view-capture{--mt-ok:color-mix(in srgb,var(--green,#2f8a5f) 85%,var(--t1));--mt-bad:var(--danger,#c8323c)}
html body #view-capture.active{display:flex!important;flex-direction:column;gap:16px}
html body #view-capture .mt-spacer{flex:1 1 auto}
html body #view-capture .mt-hint{margin:8px 0 0;color:var(--t3);font-size:12px;line-height:1.6}
html body #view-capture .mt-hint:empty{display:none}

/* 新建卡 */
html body #view-capture .mt-new{margin:0!important;padding:16px 20px!important;border-radius:12px!important}
html body #view-capture .mt-new-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
html body #view-capture .mt-new-head h3,html body #view-capture .mt-records-title h3{margin:0;color:var(--t1);font:600 16px/1.3 var(--font-serif,var(--font))}
html body #view-capture .mt-source-tabs,html body #view-capture .mt-reader-tabs{display:inline-flex;gap:2px;padding:3px;border-radius:9px;background:var(--elevated)}
html body #view-capture :is(.mt-source-tabs,.mt-reader-tabs) button{height:28px;padding:0 14px;border:0;border-radius:7px;background:transparent;color:var(--t2);font-size:13px;font-weight:500;cursor:pointer;transition:background-color .15s ease,color .15s ease}
html body #view-capture :is(.mt-source-tabs,.mt-reader-tabs) button:hover{color:var(--t1)}
html body #view-capture :is(.mt-source-tabs,.mt-reader-tabs) button.active{background:var(--card);color:var(--t1);box-shadow:0 1px 2px rgba(31,30,27,.08)}
html body #view-capture .mt-reader-tabs button b{margin-left:3px;color:var(--t3);font-weight:600;font-variant-numeric:tabular-nums}
html body #view-capture .mt-reader-tabs button.active b{color:var(--orange)}
html body #view-capture .mt-model{display:inline-flex!important;align-items:center;gap:8px;margin:0!important;color:var(--t3);font-size:13px;white-space:nowrap}
html body #view-capture .mt-model .ui-select{min-width:180px}
html body #view-capture .mt-source-pane{margin-top:14px}
html body #view-capture .mt-input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:stretch}
html body #view-capture .mt-input-row textarea{min-height:48px!important;height:48px;margin:0!important;resize:vertical}
html body #view-capture .mt-input-row .button{height:auto!important;min-height:48px;padding:0 20px!important;margin:0!important;white-space:nowrap}
html body #view-capture .mt-results:empty{display:none}
html body #view-capture .mt-results{margin-top:12px}
html body #view-capture .mt-new-foot{padding-top:12px;margin-top:14px;border-top:1px solid var(--sep,var(--line))}
html body #view-capture .mt-local-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center}
html body #view-capture .mt-drop{display:flex!important;flex-direction:row!important;align-items:center;justify-content:flex-start!important;gap:14px;min-height:64px!important;height:auto!important;margin:0!important;padding:12px 16px!important;border:1px dashed var(--line-strong,var(--line))!important;border-radius:10px!important;background:var(--card)!important;text-align:left!important;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}
html body #view-capture .mt-drop:hover,html body #view-capture .mt-drop.is-dragging{border-color:var(--orange)!important;background:color-mix(in srgb,var(--orange) 4%,var(--card))!important}
html body #view-capture .mt-drop .local-upload-icon{display:grid;place-items:center;flex:none;width:32px;height:32px;margin:0!important;border-radius:50%;background:var(--elevated);color:var(--t2);font-size:18px}
html body #view-capture .mt-drop-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
html body #view-capture .mt-drop-copy strong{color:var(--t1);font-size:14px;font-weight:600}
html body #view-capture .mt-drop-copy small{color:var(--t3);font-size:12px}
html body #view-capture .mt-drop em{margin:0 0 0 auto!important;color:var(--t3);font-size:12px;font-style:normal;white-space:nowrap}
html body #view-capture .mt-local-row .local-queue-actions{display:flex;gap:8px;margin:0!important}
html body #view-capture .local-transcribe-progress{margin-top:10px}

/* 记录 + 阅读区 */
html body #view-capture .mt-grid{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:16px;align-items:start}
html body #view-capture .mt-records,html body #view-capture .mt-reader{margin:0!important;padding:0!important;border-radius:12px!important;overflow:hidden}
html body #view-capture .mt-records-head{display:flex;align-items:center;gap:6px;padding:14px 18px;border-bottom:1px solid var(--sep,var(--line))}
html body #view-capture .mt-records-title{display:flex;align-items:baseline;gap:10px;min-width:0}
html body #view-capture .mt-records-title small{overflow:hidden;color:var(--t3);font-size:12px;text-overflow:ellipsis;white-space:nowrap}
html body #view-capture .mt-records-head .button.small{height:30px!important;min-height:30px!important;padding:0 10px!important;border-color:transparent!important;background:transparent!important;color:var(--t2)!important;font-size:13px!important;box-shadow:none!important}
html body #view-capture .mt-records-head .button.small:hover:not(:disabled){background:var(--hover-bg,var(--elevated))!important;color:var(--t1)!important}
html body #view-capture .mt-records-head .button.small.danger-text:not(:disabled){color:var(--mt-bad)!important}

/* 分组标题（视频任务 / 本地队列 / 按日期归档） */
html body #view-capture .mt-group-head,html body #view-capture .local-queue-section-head,html body #view-capture .local-history-group>summary{display:flex!important;align-items:center;gap:10px;min-height:40px;margin:0!important;padding:8px 18px!important;border:0!important;border-bottom:1px solid var(--sep,var(--line))!important;border-radius:0!important;background:color-mix(in srgb,var(--elevated) 40%,var(--card))!important;color:var(--t1);font-size:13px;list-style:none;cursor:default}
html body #view-capture .local-history-group>summary{cursor:pointer}
html body #view-capture .local-history-group>summary::-webkit-details-marker{display:none}
html body #view-capture .local-history-group>summary::before{content:"";flex:none;width:6px;height:6px;margin:0 2px 0 0;border-right:1.5px solid var(--t3);border-bottom:1.5px solid var(--t3);transform:rotate(-45deg);transition:transform .18s ease}
html body #view-capture .local-history-group[open]>summary::before{transform:rotate(45deg) translate(-1px,-1px)}
html body #view-capture .local-history-group>summary>span{display:flex;align-items:baseline;gap:8px;min-width:0}
html body #view-capture :is(.mt-group-head,.local-queue-section-head,.local-history-group>summary) strong{font-size:13px;font-weight:600}
html body #view-capture :is(.mt-group-head,.local-queue-section-head,.local-history-group>summary) small{overflow:hidden;color:var(--t3);font-size:12px;text-overflow:ellipsis;white-space:nowrap}
html body #view-capture .local-history-group>summary>b{flex:none;color:var(--t3);font-size:12px;font-weight:500}
html body #view-capture .mt-group-select{flex:none;margin-left:auto;padding:2px 6px;border:0;border-radius:6px;background:transparent;color:var(--orange);font-size:12px;font-weight:500;cursor:pointer}
html body #view-capture .mt-group-select:hover{background:color-mix(in srgb,var(--orange) 8%,transparent)}
html body #view-capture .local-history-group>summary>.mt-group-select+b{margin-left:0}
html body #view-capture .local-history-group>summary>span+b{margin-left:auto}
html body #view-capture :is(.local-queue-section,.local-history-group,.local-history-items,.mt-local-list,.mt-job-list,.mt-group){margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;gap:0!important}
html body #view-capture :is(.mt-local-list,.mt-job-list) .empty{margin:0!important;padding:18px!important;border:0!important;border-bottom:1px solid var(--sep,var(--line))!important;border-radius:0!important;background:transparent!important;color:var(--t3);font-size:13px;text-align:left}

/* 记录行：勾选 · 来源 · 标题 · 状态 · 操作，五列固定宽度，每行同一位置 */
html body #view-capture .mt-row{display:grid!important;grid-template-columns:16px 76px minmax(0,1fr) 172px 196px!important;grid-template-areas:none!important;align-items:center!important;column-gap:12px!important;row-gap:0!important;min-height:56px;margin:0!important;padding:8px 18px!important;border:0!important;border-bottom:1px solid var(--sep,var(--line))!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;transition:background-color .15s ease}
html body #view-capture .mt-row:hover{background:color-mix(in srgb,var(--t1) 3%,transparent)!important}
html body #view-capture .mt-row.active{background:color-mix(in srgb,var(--orange) 5%,transparent)!important;box-shadow:inset 3px 0 0 var(--orange)!important}
html body #view-capture .mt-row>*{grid-area:auto!important;min-width:0}
html body #view-capture .mt-ck{display:flex;align-items:center}
html body #view-capture .mt-ck input{width:15px;height:15px;margin:0;accent-color:var(--orange);cursor:pointer}
html body #view-capture .mt-src{display:block;width:100%;min-width:0;height:22px;padding:0 8px;box-sizing:border-box;border-radius:999px;background:var(--elevated);color:var(--t2);font-size:12px;line-height:22px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body #view-capture .mt-name{display:flex!important;flex-direction:column;align-items:flex-start!important;justify-content:center;gap:3px;width:100%;min-width:0;height:auto!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;color:inherit;font:inherit;text-align:left!important}
html body #view-capture button.mt-name{cursor:pointer}
html body #view-capture .mt-name strong{display:block;max-width:100%;overflow:hidden;color:var(--t1);font-size:14px;font-weight:600;line-height:1.4;text-overflow:ellipsis;white-space:nowrap;transition:color .15s ease}
html body #view-capture button.mt-name:hover strong{color:var(--orange)}
html body #view-capture .mt-name small{display:flex!important;align-items:center;gap:6px;max-width:100%;overflow:hidden;color:var(--t3)!important;font-size:12px!important;line-height:1.4;white-space:nowrap}
html body #view-capture .mt-name small>span:not(.mt-rank),html body #view-capture .mt-name>span:not(.mt-rank){display:none!important}
html body #view-capture .mt-rank{flex:none;height:18px;padding:0 6px;border-radius:999px;background:color-mix(in srgb,var(--orange) 10%,transparent);color:var(--orange);font-size:11px;line-height:18px}
html body #view-capture .mt-state{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
html body #view-capture .mt-chip{display:inline-block;max-width:100%;height:22px;padding:0 8px;overflow:hidden;border-radius:999px;background:var(--elevated);color:var(--t2);font-size:12px;line-height:22px;text-overflow:ellipsis;white-space:nowrap}
html body #view-capture .mt-chip.ok{background:color-mix(in srgb,var(--mt-ok) 12%,transparent);color:var(--mt-ok)}
html body #view-capture .mt-chip.bad{background:color-mix(in srgb,var(--mt-bad) 10%,transparent);color:var(--mt-bad)}
html body #view-capture .mt-chip.run{background:color-mix(in srgb,var(--orange) 10%,transparent);color:var(--orange)}
html body #view-capture .mt-bar{display:block!important;width:120px;height:4px;overflow:hidden;border-radius:9px;background:var(--elevated)}
html body #view-capture .mt-bar i{display:block;height:100%;border-radius:inherit;background:var(--orange);transition:width .3s ease}
html body #view-capture .mt-actions{display:flex!important;align-items:center;justify-content:flex-end;gap:6px;margin:0!important}
html body #view-capture .mt-actions .button.small{height:28px!important;min-height:28px!important;padding:0 10px!important;font-size:12px!important;white-space:nowrap}
html body #view-capture .mt-remove{display:grid!important;place-items:center;position:static!important;flex:none;width:28px!important;height:28px!important;margin:0!important;padding:0!important;border:0!important;border-radius:7px!important;background:transparent!important;color:var(--t3)!important;font-size:16px;line-height:1;opacity:1!important;cursor:pointer}
html body #view-capture .mt-remove:hover{background:color-mix(in srgb,var(--mt-bad) 8%,transparent)!important;color:var(--mt-bad)!important}

/* 阅读区：当前正文 / 汇总 */
html body #view-capture .mt-reader{position:sticky;top:16px;display:flex;flex-direction:column}
html body #view-capture .mt-reader-tabs{margin:12px 16px 0;align-self:flex-start}
html body #view-capture .mt-reader-pane{display:flex;flex-direction:column;gap:10px;padding:12px 16px 16px}
html body #view-capture .mt-reader-pane[hidden]{display:none}
html body #view-capture .mt-reader-title{display:flex;flex-direction:column;gap:2px;min-width:0}
html body #view-capture .mt-reader-title strong{overflow:hidden;color:var(--t1);font:600 15px/1.4 var(--font-serif,var(--font));text-overflow:ellipsis;white-space:nowrap}
html body #view-capture .mt-reader-title small{color:var(--t3);font-size:12px}
html body #view-capture .mt-reader-title small:empty{display:none}
html body #view-capture .mt-reader textarea{width:100%;min-height:360px!important;height:clamp(360px,calc(100vh - 420px),640px)!important;margin:0!important;padding:12px 14px!important;border:1px solid var(--line)!important;border-radius:10px!important;background:var(--card)!important;color:var(--t1);font-size:14px!important;line-height:1.85!important;resize:vertical}
html body #view-capture .mt-reader textarea[readonly]{background:color-mix(in srgb,var(--elevated) 30%,var(--card))!important}
html body #view-capture .mt-reader-pane .mt-hint{margin:0}
html body #view-capture .mt-reader-foot{display:flex;align-items:center;gap:8px}
html body #view-capture .mt-reader-foot .button.small{height:30px!important;min-height:30px!important;font-size:13px!important}

@media (max-width:1180px){
  html body #view-capture .mt-grid{grid-template-columns:minmax(0,1fr)}
  html body #view-capture .mt-reader{position:static}
}
@media (max-width:760px){
  html body #view-capture .mt-row{grid-template-columns:16px minmax(0,1fr) auto!important;row-gap:6px!important}
  html body #view-capture .mt-src{display:none}
  html body #view-capture .mt-state{grid-column:2 / -1}
  html body #view-capture .mt-local-row,html body #view-capture .mt-input-row{grid-template-columns:minmax(0,1fr)}
}
@media (prefers-reduced-motion:reduce){html body #view-capture :is(.mt-row,.mt-bar i,.local-history-group>summary::before,.mt-name strong){transition:none}}

/* 修正旧样式残留：正文框排在操作按钮之前；历史分组只留左侧箭头；标题用正文无衬线字体；分页「已全部加载」不占一行。 */
html body #view-capture .mt-reader-pane>textarea{order:0!important}
html body #view-capture .mt-reader-pane>.mt-reader-foot{order:1}
html body #view-capture .local-history-group>summary::after{display:none!important}
html body #view-capture .mt-name strong{font-family:var(--font)!important;letter-spacing:0}
html body #view-capture .mt-job-list .load-more:disabled{display:none!important}
html body #view-capture .mt-job-list .load-more{display:block;width:100%;height:36px;margin:0!important;border:0!important;border-bottom:1px solid var(--sep,var(--line))!important;border-radius:0!important;background:transparent!important;color:var(--t2);font-size:12px}
/* Video tasks have no selection control: align their source with the section title. */
@media(min-width:761px){
  html body #view-capture .mt-job-list .mt-row{grid-template-columns:76px minmax(0,1fr) 172px 196px!important}
  html body #view-capture .mt-job-list .mt-row>.mt-ck{display:none}
}

/* Batched parsing results only; existing task rows and source pills are unchanged. */
html body #view-capture .mt-parse-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--t2);font-size:12px}
html body #view-capture .mt-parse-tools>div{display:flex;gap:6px;flex-wrap:wrap}
html body #view-capture .mt-parse-tools:has(>span:empty):has(>div:empty){display:none}
html body #view-capture .mt-parse-tools .button.small,html body #view-capture .mt-parse-error .button.small{height:30px;min-height:30px;padding:0 10px;font-size:12px}
html body #view-capture .mt-parse-list{display:grid;gap:8px;min-width:0}
html body #view-capture .mt-parse-list.is-multi{max-height:min(640px,60vh);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:3px}
html body #view-capture .mt-parse-entry{min-width:0;display:grid;gap:6px}
html body #view-capture .mt-parse-list.is-multi .mt-parse-entry{padding:8px 0;border-top:1px solid var(--line)}
html body #view-capture .mt-parse-entry>header{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--t2);font-size:12px}
html body #view-capture .mt-parse-input{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body #view-capture .mt-parse-state{flex:none;display:inline-flex;align-items:center;gap:6px;color:var(--t3)}
html body #view-capture .mt-parse-state.success{color:var(--green)}
html body #view-capture .mt-parse-state.failed{color:var(--danger)}
html body #view-capture .mt-parse-state.running{color:var(--orange)}
html body #view-capture .mt-parse-state .spinner{width:12px;height:12px;border-width:2px}
html body #view-capture .mt-parse-error{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;font-size:13px;color:var(--danger);overflow-wrap:anywhere}
html body #view-capture .mt-parse-error>button{flex:none}
html body #view-capture .mt-parse-job-status{flex-basis:100%;margin:0;font-size:12px}
html body #view-capture .mt-parse-entry .wx-search-result{display:flex!important;flex-direction:row!important;align-items:center!important;flex-wrap:wrap;gap:10px;min-width:0;min-height:60px;padding:8px 12px;border:1px solid var(--line)!important;border-radius:8px;background:var(--card)!important;box-shadow:none!important}
html body #view-capture .mt-parse-entry .wx-search-result .wx-capture-copy{flex:1 1 220px;min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:8px;row-gap:3px}
html body #view-capture .mt-parse-entry .wx-capture-copy>strong{grid-column:1/-1;grid-row:1;max-width:100%;min-width:0;font-size:14px;line-height:1.4}
html body #view-capture .mt-parse-entry .wx-capture-copy:has(>.best-badge)>strong{grid-column:2}
html body #view-capture .mt-parse-entry .wx-capture-copy>small{grid-column:1/-1;grid-row:2;color:var(--t3);font-size:12px;line-height:1.4;overflow-wrap:anywhere}
html body #view-capture .mt-parse-entry .wx-capture-copy>.wx-search-transcript{grid-column:1/-1;margin:4px 0 0}
html body #view-capture .mt-parse-entry .compact-actions{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:8px}
html body #view-capture .mt-parse-entry .best-badge{grid-column:1;grid-row:1;align-self:center;white-space:nowrap;margin:0;padding:0 7px;border:0;border-radius:999px;background:var(--orange-soft);color:var(--orange);font-size:12px;line-height:18px}
html body #view-capture .mt-parse-entry .best-badge::before{display:none}
html body #view-capture .mt-parse-entry .compact-actions .button.small{height:30px;min-height:30px;padding:0 10px;font-size:12px}
html body #view-capture .mt-parse-entry .download-transcript{width:100%}
@media(max-width:760px){html body #view-capture .mt-parse-tools{align-items:flex-start;flex-wrap:wrap}html body #view-capture .mt-parse-entry .compact-actions{margin-left:auto}}

/* 标题裂变：参考、参数和结果分区；控件状态仍由 interaction.css 统一管理。 */
html body #view-library [data-copywriter-pane="titles"] .title-reference-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 12px; }
html body #view-library [data-copywriter-pane="titles"] .title-reference-row > .title-mode-switch { justify-self: start; max-width: 100%; }
html body #view-library [data-copywriter-pane="titles"] #titleSingleSourceLabel { width: 100%; min-width: 0; }
html body #view-library [data-copywriter-pane="titles"] .title-source-tools { display: grid; gap: 10px; }
html body #view-library [data-copywriter-pane="titles"] .title-source-toolbar,
html body #view-library [data-copywriter-pane="titles"] .title-source-search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
html body #view-library [data-copywriter-pane="titles"] .title-source-toolbar { justify-content: space-between; }
html body #view-library [data-copywriter-pane="titles"] .title-source-heading { color: var(--t1); font: 600 13px/1.5 var(--font-cjk); }
html body #view-library [data-copywriter-pane="titles"] #titleSourceSearch { flex: 1 1 240px; min-width: 0; }
html body #view-library [data-copywriter-pane="titles"] .title-reference-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 340px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--input-bg); }
html body #view-library [data-copywriter-pane="titles"] .title-reference-list[data-reference-mode="splice"] { background: var(--elevated); }
html body #view-library [data-copywriter-pane="titles"] .title-blend-option { min-height: 44px; padding: 9px 12px; gap: 10px; border-radius: 7px; }
html body #view-library [data-copywriter-pane="titles"] .title-blend-option > strong { font: 500 13px/1.55 var(--font-cjk); }
html body #view-library [data-copywriter-pane="titles"] .title-blend-option > small { font-size: 12px; }
html body #view-library [data-copywriter-pane="titles"] .title-splice-card { gap: 7px; padding: 10px; border-radius: 8px; }
html body #view-library [data-copywriter-pane="titles"] .title-splice-card header { justify-content: start; }
html body #view-library [data-copywriter-pane="titles"] .title-splice-card .title-clause-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
html body #view-library [data-copywriter-pane="titles"] .title-clause-option { min-height: 64px; padding: 8px 10px; }
html body #view-library [data-copywriter-pane="titles"] .title-clause-option > strong { font: 500 13px/1.5 var(--font-cjk); }
html body #view-library [data-copywriter-pane="titles"] .title-selection-footer { gap: 9px; }
html body #view-library [data-copywriter-pane="titles"] .title-selection-count { color: var(--t2); font-size: 13px; }
html body #view-library [data-copywriter-pane="titles"] .title-selected-references { display: flex; flex-wrap: wrap; gap: 6px; }
html body #view-library [data-copywriter-pane="titles"] .title-selected-references .title-summary-chip { width: auto; max-width: min(320px, 100%); }
html body #view-library [data-copywriter-pane="titles"] .title-fission-results { margin-top: 12px; padding: 20px 22px; }
html body #view-library [data-copywriter-pane="titles"] .title-results-head { margin: 0 0 12px; padding: 0; border: 0; }
html body #view-library [data-copywriter-pane="titles"] .title-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; margin: 0; padding: 0; list-style: none; }
html body #view-library [data-copywriter-pane="titles"] .title-result-card { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
html body #view-library [data-copywriter-pane="titles"] .title-result-number { color: var(--t3); font: 400 12px/1.5 var(--font-cjk); font-variant-numeric: tabular-nums; }
html body #view-library [data-copywriter-pane="titles"] .title-result-text { min-width: 0; color: var(--t1); font: 500 14px/1.6 var(--font-cjk); overflow-wrap: anywhere; }
html body #view-library [data-copywriter-pane="titles"] .title-variant-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 6px; }
html body #view-library [data-copywriter-pane="titles"] .title-fission-results .title-variant-list > .empty { display: grid; min-height: 112px; place-items: center; }
@media (max-width: 1100px) {
  html body #view-library [data-copywriter-pane="titles"] .title-result-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  html body #view-library [data-copywriter-pane="titles"] .title-reference-list { grid-template-columns: minmax(0, 1fr); }
  html body #view-library [data-copywriter-pane="titles"] .title-fission-results { padding: 16px; }
  html body #view-library [data-copywriter-pane="titles"] .title-result-card { grid-template-columns: 25px minmax(0, 1fr); }
  html body #view-library [data-copywriter-pane="titles"] .title-result-card .title-variant-actions { grid-column: 2; justify-content: start; }
}


#sphTeamsPanel .sph-team-fields,
#sphTeamsPanel .sph-team-columns fieldset {border:0;padding:0;margin:0;min-width:0}
#sphTeamsPanel .sph-team-help {margin:8px 0 16px}
#sphTeamsPanel .sph-team-tools {display:flex;align-items:end;gap:10px;margin-block:12px}
#sphTeamsPanel .sph-team-tools label {display:grid;gap:5px;width:min(100%,320px)}
#sphTeamsPanel .sph-team-tools button {flex:none}
#sphTeamsPanel .sph-team-columns {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-block:18px}
#sphTeamsPanel .sph-team-columns legend {margin-bottom:6px;font-weight:600}
#sphTeamsPanel .sph-team-checks {max-height:210px;overflow:auto;padding:5px 2px}
#sphTeamsPanel .sph-team-checks label {display:flex;gap:8px;align-items:start;padding:5px 0;overflow-wrap:anywhere}
#sphTeamsPanel .sph-team-preview {display:grid;justify-items:start;gap:6px;margin-top:18px}
#sphTeamsPanel .sph-team-preview p {margin:0;overflow-wrap:anywhere}
@media(max-width:760px){#sphTeamsPanel .sph-team-columns{grid-template-columns:1fr}}

/* Settings layout. Control states come from interaction.css. */
#view-settings { container:settings / inline-size; width:100%; gap:12px; }
#view-settings .settings-page-head { padding-bottom:10px; border-bottom:1px solid var(--line); gap:8px; }
#view-settings .settings-page-head h1 { font-size:27px; }
#view-settings .settings-summary { border:0; background:transparent; padding:0; }
#view-settings .settings-summary-item { width:auto; min-height:30px; padding:4px 7px; font-size:12px; }
#view-settings .settings-workspace { display:grid; grid-template-columns:145px minmax(0,1fr); gap:22px; align-items:start; min-width:0; }
#view-settings .settings-tabs { width:auto; flex-direction:column; flex-wrap:nowrap; align-items:flex-start; gap:4px; padding:4px 12px 14px 0; border:0; border-right:1px solid var(--line); border-radius:0; background:transparent; align-self:stretch; }
#view-settings :is(.settings-tabs,.settings-section-tabs) > .button { display:inline-flex; justify-content:flex-start; gap:7px; width:auto; min-height:34px; margin:0; border:0; padding:5px 8px; font:500 13px var(--font-cjk); white-space:nowrap; }
#view-settings .settings-tabs > .button .icon { width:15px; height:15px; flex:none; }
#view-settings .settings-main { min-width:0; }
#view-settings .settings-section-title { margin:1px 0 11px; font:700 23px var(--font-serif); }
#view-settings [data-settings-panel] { gap:10px; }
#view-settings .settings-section-tabs { display:flex; align-items:center; gap:3px; flex-wrap:wrap; min-width:0; }
#view-settings .settings-section-tabs > .button { min-height:30px; }
#view-settings .settings-area { min-width:0; }
#view-settings .settings-section { padding:13px 15px; }
#view-settings .settings-section :is(h2,h3) { font-size:16px; }
#view-settings .panel-title { gap:8px; margin-bottom:9px; }
#view-settings .panel-title p { margin-top:3px; font-size:13px; line-height:1.6; }
#view-settings .row-actions { display:flex; flex-wrap:wrap; width:auto; gap:6px; }
#view-settings :is(.settings-section,.settings-summary,.settings-read-status) .button {
  flex:0 0 auto; width:auto; min-height:32px; min-width:0; padding:5px 9px; font-size:13px;
}
#view-settings .settings-field-row { grid-template-columns:minmax(80px,.6fr) minmax(0,1fr) auto; gap:10px; min-height:42px; padding:7px 0; }
#view-settings #homeViewSettingRow .settings-field-row { grid-template-columns:minmax(0,1fr) auto; }
#view-settings #homeViewSettingRow .ui-select { width:auto; }
#view-settings .settings-section-footer { margin-top:6px; padding-top:8px; }
#view-settings .settings-current-provider { padding:9px 0; margin:0 0 4px; }
#view-settings .ai-provider-item { padding:9px 0; gap:8px; }
#view-settings .ai-provider-main { flex-basis:230px; }
#view-settings .settings-section .hok-settings-form { gap:7px; }
#view-settings .settings-section .hok-settings-form :is(.input,.ui-select) { width:min(100%,420px); }
#view-settings .settings-section .hok-settings-actions { flex-wrap:wrap; }
#view-settings .wechat-admin-summary { margin-bottom:11px; gap:4px; }
#view-settings .wechat-restart-status { margin-top:9px; }
#view-settings .settings-rule-detail { margin-block:8px; }
#view-settings .settings-toggle-row { margin-top:8px; gap:8px; }
#view-settings .settings-read-status:not(:empty) { margin-bottom:6px; }
#view-settings .member-search-row { margin:8px 0 3px; }
#view-settings .guest-permission-row { padding:9px 0; }
#view-settings :is(.settings-mapping-head,.mapping-row) { grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(65px,.6fr) auto; gap:10px; padding:9px 0; }
#view-settings .settings-services-list .service-line { padding:9px 0; }
#view-settings #sphTeamEdit { padding-block:5px 0; }
#view-settings #sphTeamsPanel .sph-team-tools { margin-block:8px; }
#view-settings #sphTeamsPanel :is(.sph-team-tools,.sph-team-preview) .ui-select { width:min(100%,320px); min-width:0; }
#view-settings #sphTeamsPanel .sph-team-preview .ui-select { width:min(100%,260px); }
#view-settings #sphTeamsPanel .sph-team-columns { margin-block:11px; }
#view-settings #sphTeamsPanel .sph-team-preview { margin-top:11px; }
#view-settings #sphTeamsPanel .sph-team-help { margin:5px 0 10px; }
@container settings (max-width:690px) {
  #view-settings .settings-workspace { grid-template-columns:minmax(0,1fr); gap:12px; }
  #view-settings .settings-tabs { flex-direction:row; flex-wrap:wrap; padding:0 0 7px; border-right:0; border-bottom:1px solid var(--line); }
}
@container settings (max-width:450px) {
  #view-settings .settings-section { padding:10px; }
  #view-settings :is(.guest-permission-grid,.settings-services-list) { grid-template-columns:minmax(0,1fr); }
  #view-settings .settings-field-row { grid-template-columns:minmax(0,1fr) auto; }
  #view-settings .settings-field-row > :last-child:not(.button) { overflow-wrap:anywhere; }
  #view-settings :is(.settings-mapping-head,.mapping-row) { grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:6px; font-size:12px; }
  #view-settings .mapping-row .button { padding-inline:6px; }
}
@media(pointer:coarse) {
  #view-settings :is(.settings-tabs,.settings-section-tabs,.settings-summary,.settings-section,.settings-read-status) .button { min-height:44px; }
}

/* Team roster uses the shared button and input states. */
#view-settings .sph-team-directory,
#view-settings #sphTeamEdit { margin-top:12px; padding-block:8px 0; border-top:1px solid var(--line); }
#view-settings .sph-team-bar { display:flex; justify-content:space-between; align-items:center; gap:6px 12px; flex-wrap:wrap; }
#view-settings #sphTeamList { margin:0; padding:0; list-style:none; }
#view-settings .sph-team-list-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; padding:8px 0; }
#view-settings .sph-team-list-row + .sph-team-list-row { border-top:1px solid var(--line); }
#view-settings .sph-team-list-label { display:grid; gap:2px; min-width:0; overflow-wrap:anywhere; }
#view-settings #sphTeamListEmpty { margin:6px 0; font-size:13px; }
#view-settings #sphTeamsPanel .sph-team-preview { padding-top:8px; border-top:1px solid var(--line); }

/* Use the workspace for related panels while keeping forms and actions compact. */
#view-settings .sph-team-workspace { display:grid; gap:15px; min-width:0; }
#view-settings :is(.sph-team-primary,.sph-team-policy) { min-width:0; }
#view-settings .sph-team-policy { display:grid; align-content:start; gap:8px; border-top:1px solid var(--line); padding-top:11px; }
#view-settings .sph-team-policy .account-registration-switch { width:fit-content; margin:0; }
#view-settings #sphTeamsPanel .sph-team-policy .sph-team-help { margin:0; font-size:13px; line-height:1.65; }
#view-settings #sphTeamsPanel .sph-team-policy .sph-team-preview { margin-top:3px; }
#view-settings :is(.sph-team-directory,#sphTeamEdit) { margin-top:0; padding-top:0; border-top:0; }

/* 1.0.87: settings sit in a centred column; related text and actions stay close together. */
#view-settings .settings-main { container:settings-main / inline-size; }
#view-settings .hok-settings-form { max-width:560px; }
#view-settings .settings-section .hok-settings-form :is(.input,.ui-select,.password-input-wrap) { width:100%; }
#view-settings :is(.settings-mapping-head,.mapping-row) { grid-template-columns:minmax(0,1.25fr) minmax(0,1.25fr) minmax(0,1fr) 56px; }
#view-settings .settings-mapping-head > :last-child { text-align:end; }
#view-settings .mapping-row > .button { justify-self:end; }
#view-settings #settingsPanel-general > #accountSettings { order:-1; }
#view-settings #settingsPanel-general .settings-field-row { grid-template-columns:84px minmax(0,1fr) auto; }
#view-settings #settingsPanel-general #homeViewSettingRow .settings-field-row { grid-template-columns:minmax(0,1fr) auto; }
#view-settings #settingsPanel-wechat > .settings-section,
#view-settings #settingsPanel-general > .settings-section { min-width:0; }

@container settings (width < 960px) {
  #view-settings .sph-team-workspace > .panel { background:transparent; box-shadow:none; border:0; border-radius:0; padding:0; }
  #view-settings .sph-team-workspace > .sph-team-policy { border-top:1px solid var(--line); padding-top:11px; }
}
@container settings (min-width:960px) {
  #view-settings .settings-workspace { gap:28px; }
  #view-settings .settings-page-head { padding-bottom:14px; }
  #view-settings .settings-page-head h1 { font-size:30px; }
  #view-settings .settings-section-title { margin-bottom:14px; font-size:25px; }
  #view-settings .settings-section { padding:18px 20px; }
  #view-settings .settings-tabs > .button { font-size:14px; }
  #view-settings #sphTeamsPanel { padding:0; background:transparent; border:0; box-shadow:none; }
  #view-settings #sphTeamsPanel > .panel-title { margin:2px 0 12px; }
  #view-settings .sph-team-workspace > .panel { padding:16px 18px; }
  #view-settings .sph-team-policy { border-top:1px solid var(--line); }
  #view-settings #webWecomMonitor .settings-toggle-row { width:fit-content; max-width:100%; justify-content:flex-start; }
}

/* Two related cards share a row once the content column has room. */
@container settings-main (min-width:720px) {
  #view-settings :is(#settingsPanel-general,#settingsPanel-wechat) { align-items:start; gap:16px; }
  #view-settings #settingsPanel-general { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #view-settings #settingsPanel-wechat { grid-template-columns:minmax(0,1.4fr) minmax(250px,1fr); }
  #view-settings .wechat-restart-status { grid-template-columns:minmax(0,1fr); gap:8px; margin-top:11px; }
  #view-settings #settings-wecom-targets .wecom-target-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:22px; }
  #view-settings .sph-team-workspace { grid-template-columns:minmax(0,1fr) clamp(250px,30cqw,300px); align-items:start; gap:16px; }
  #view-settings #sphTeamsPanel .sph-team-columns { gap:20px; }
  #view-settings #sphTeamsPanel .sph-team-checks { max-height:clamp(240px,34vh,390px); }
  #view-settings :is(.guest-permission-grid,.settings-services-list) { grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:24px; }
}
@container settings-main (min-width:900px) {
  #view-settings :is(.guest-permission-grid,.settings-services-list) { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@container settings-main (max-width:520px) {
  #view-settings :is(.settings-mapping-head,.mapping-row) { grid-template-columns:repeat(3,minmax(0,1fr)) 48px; gap:6px; font-size:12px; }
}

/* 1.0.89: list pages use a list + detail split; card pages fill the width in columns. States come from interaction.css. */
#view-settings .settings-pick { display:grid; gap:3px; width:100%; min-width:0; margin:0; padding:9px 11px; border:0; border-radius:8px; background:transparent; color:var(--t1); font:inherit; text-align:start; cursor:pointer; }
#view-settings .settings-pick strong { font-size:14px; font-weight:600; overflow-wrap:anywhere; }
#view-settings .settings-pick small { color:var(--t2); font-size:12px; overflow-wrap:anywhere; }
#view-settings .settings-pick[hidden] { display:none; }
#view-settings .settings-detail { display:grid; align-content:start; gap:14px; min-width:0; padding:16px 18px; border:1px solid var(--line); border-radius:10px; background:var(--card); }
#view-settings .settings-detail h3 { margin:0; font:700 18px var(--font-serif); overflow-wrap:anywhere; }
#view-settings .settings-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin:0; }
#view-settings .settings-facts > div { display:grid; align-content:start; gap:4px; min-width:0; padding:10px 12px; border-radius:8px; background:var(--input-bg); }
#view-settings .settings-facts :is(span,dt) { color:var(--t2); font-size:12px; }
#view-settings .settings-facts :is(strong,dd) { margin:0; font-size:15px; font-weight:600; overflow-wrap:anywhere; }

/* Members */
#view-settings #adminAccountTools .panel-title .account-registration-switch { margin:0; font-size:13px; color:var(--t2); }
#view-settings .member-split { display:flex; flex-direction:column; gap:8px; min-width:0; }
#view-settings #adminAccountTools > .panel-title .member-search-row { flex:0 1 340px; min-width:200px; margin:0; }
#view-settings #adminAccountTools #memberSearch { width:100%; }
#view-settings .member-split > .member-pager { order:100000; }
#view-settings #userManagementList,
#view-settings .member-list { display:contents; }
#view-settings .user-management-row { display:block; min-height:0; padding:0; border:0; }
#view-settings .member-pick .member-name { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; }
#view-settings .member-detail-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
#view-settings .member-detail-head > [data-user-action="toggle"] { margin-inline-start:auto; }
#view-settings .member-detail-hint { margin:0; color:var(--t2); font-size:13px; line-height:1.7; }
#view-settings .member-detail .member-edit { display:flex; flex-wrap:wrap; align-items:end; gap:10px; padding:0; }
#view-settings .member-detail .member-edit label { display:grid; gap:5px; width:180px; color:var(--t2); font-size:12px; }
#view-settings .member-detail .member-edit .ui-select { width:100%; }
#view-settings .member-detail .user-management-actions { display:flex; flex-wrap:wrap; gap:8px; padding-top:12px; border-top:1px solid var(--line); }
#view-settings .member-detail .user-management-actions .danger { margin-inline-start:auto; }
@container settings-main (min-width:760px) {
  #view-settings .member-split { display:grid; grid-template-columns:minmax(260px,340px) minmax(0,1fr); grid-template-rows:auto 1fr; gap:8px 20px; align-items:start; }
  #view-settings .member-list { display:grid; gap:2px; grid-column:1; grid-row:1; min-width:0; }
  #view-settings .member-split > .member-pager { grid-column:1; grid-row:2; }
  #view-settings .member-detail { grid-column:2; grid-row:1 / span 2; position:sticky; top:16px; }
}

/* Account mappings */
#view-settings .mapping-list { display:flex; flex-direction:column; gap:14px; }
#view-settings .mapping-master { display:grid; align-content:start; gap:8px; min-width:0; }
#view-settings .mapping-picks { display:grid; gap:2px; }
#view-settings .mapping-count { margin:0; color:var(--t2); font-size:12px; }
#view-settings .mapping-detail-note { margin:4px 0 0; color:var(--t2); font-size:13px; }
#view-settings .mapping-detail-note:empty { display:none; }
#view-settings .mapping-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
#view-settings .mapping-fields label { display:grid; gap:5px; min-width:0; color:var(--t2); font-size:13px; }
#view-settings .mapping-fields .input { width:100%; min-width:0; }
#view-settings .mapping-detail-actions { display:flex; flex-wrap:wrap; gap:8px; padding-top:12px; border-top:1px solid var(--line); }
#view-settings .mapping-detail-actions .danger { margin-inline-start:auto; }
@container settings-main (min-width:760px) {
  #view-settings .mapping-list { display:grid; grid-template-columns:minmax(260px,340px) minmax(0,1fr); gap:20px; align-items:start; }
  #view-settings .mapping-detail { position:sticky; top:16px; }
}

/* AI providers */
#view-settings #settings-ai-providers .settings-current-provider { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:6px 14px; margin:0 0 14px; padding:10px 0; border-block:1px solid var(--line); }
#view-settings #settings-ai-providers .settings-current-provider > div { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
#view-settings #settings-ai-providers .settings-current-provider .ai-provider-current { margin:0; }
#view-settings .ai-provider-list { display:flex; flex-direction:column; gap:14px; }
#view-settings .ai-provider-picks { display:grid; align-content:start; gap:2px; }
#view-settings .ai-provider-pick { grid-template-columns:minmax(0,1fr) auto; align-items:center; column-gap:10px; }
#view-settings .ai-provider-pick-name { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; }
#view-settings .ai-provider-pick > small { grid-column:1; }
#view-settings .ai-provider-pick > .chip { grid-column:2; grid-row:1 / span 2; }
#view-settings .ai-provider-detail-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
#view-settings .ai-provider-error { margin:0; color:var(--danger); font-size:13px; overflow-wrap:anywhere; }
#view-settings .ai-provider-detail .ai-provider-actions { padding-top:12px; border-top:1px solid var(--line); }
#view-settings .ai-provider-detail .ai-provider-actions .danger { margin-inline-start:auto; }
#view-settings #settings-ai-model { display:grid; gap:16px; align-items:start; }
#view-settings #settings-ai-model .hok-settings-form { max-width:none; }
@container settings-main (min-width:760px) {
  #view-settings .ai-provider-list { display:grid; grid-template-columns:minmax(260px,340px) minmax(0,1fr); gap:20px; align-items:start; }
}
@container settings-main (min-width:900px) {
  #view-settings #settings-ai-model { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Teams: roster | editor | isolation policy */
#view-settings .sph-team-placeholder { margin:0; padding:28px 12px; color:var(--t2); font-size:13px; text-align:center; }
#view-settings #sphTeamEdit:not([hidden]) ~ .sph-team-placeholder { display:none; }
@container settings-main (max-width:999px) {
  #view-settings .sph-team-placeholder { display:none; }
}
@container settings-main (min-width:1000px) {
  #view-settings .sph-team-primary { display:grid; grid-template-columns:minmax(240px,300px) minmax(0,1fr); gap:0 22px; align-items:stretch; }
  #view-settings .sph-team-primary > #sphTeamsOverview[hidden] { display:block !important; }
  #view-settings .sph-team-primary > #sphTeamsOverview { grid-column:1; grid-row:1; }
  #view-settings .sph-team-primary > :is(#sphTeamEdit,.sph-team-placeholder) { grid-column:2; grid-row:1; padding-inline-start:22px; border-inline-start:1px solid var(--line); }
}

/* Card pages fill the width */
#view-settings .guest-permission-row { justify-content:flex-start; }
#view-settings .guest-permission-row > input { order:-1; }
@container settings-main (min-width:900px) {
  #view-settings #webWecomMonitor { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:4px 28px; align-items:start; }
  #view-settings #webWecomMonitor > .panel-title { grid-column:1 / -1; }
  #view-settings #webWecomMonitor > .settings-toggle-row { grid-column:1; grid-row:2; }
  #view-settings #webWecomMonitor > #webWecomMonitorStatus { grid-column:1; grid-row:3; }
  #view-settings #webWecomMonitor > .settings-rule-detail { grid-column:2; grid-row:2 / span 2; margin:8px 0 0; }
  #view-settings #settings-wecom-today > .settings-section { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,300px); grid-template-rows:auto auto 1fr; gap:12px 24px; align-items:start; }
  #view-settings #settings-wecom-today .panel-title { display:contents; }
  #view-settings #settings-wecom-today .panel-title > div { grid-column:2; grid-row:1; }
  #view-settings #settings-wecom-today .panel-title > .button { grid-column:2; grid-row:2; justify-self:start; }
  #view-settings #settings-wecom-today .wecom-settings-preview { grid-column:1; grid-row:1 / span 3; margin:0; max-width:none; }
  #view-settings #settings-wecom-today .settings-section-footer { grid-column:2; grid-row:3; justify-content:flex-start; margin:0; padding-top:12px; }
}
@container settings-main (min-width:1100px) {
  #view-settings #settings-wecom-targets .wecom-target-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

/* Card titles that only repeat the selected sub-tab stay for screen readers but are not shown. */
#view-settings :is(#settings-ai-providers,#settings-wecom-targets,#settings-members-accounts,#settings-members-teams,#settings-members-permissions) > .settings-section > .panel-title h2,
#view-settings #settings-wecom-monitor > .settings-section > .panel-title {
  position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
}
#view-settings #settings-members-teams > .settings-section > .panel-title > .row-actions { margin-inline-start:auto; }

/* ICP footer: drops to the bottom of the window on short pages, stays after the content on long ones. */
main > .site-registration { position:sticky; top:100vh; }
