/* ============================================================================
 * refinements.css - v202 2026-05-30 精装修一站式补丁
 * ----------------------------------------------------------------------------
 * 加载顺序: tokens -> base -> standalone -> v5-theme -> refinements
 * 设计原则:
 *   1. 走 :where() 把所有选择器特异性归零, 避免与 v5-theme 5600+ 处 !important 打架
 *   2. 颗粒化覆盖: 仅做"补全", 不重写既有外观
 *   3. !important 仅用于覆盖 v5-theme 中已有的 !important（无法通过特异性胜出）
 *      ——这些位置已标注 "QA:" 注释，不可移除
 *
 * 覆盖任务清单 (来自 23 todo / 16 实做):
 *   L3  首屏 panel 智能折叠 helpers
 *   L4  数字等距 tnum
 *   L5  scrollbar 风格统一 (细 + 浅 + 圆角 + dark 适配)
 *   M1  按钮按下统一 :active scale
 *   M2  skeleton helpers (统一类名 .sk-line / .sk-card / .sk-circle)
 *   M3  移动端 touch-target >= 44pt 兜底
 *   M5  page transition 过场基础类
 *   V2  暗模式扫描修复 (card 边线 / 输入框背景 / 占位字颜色)
 *   V3  :focus-visible 全局统一 ring (键盘可达性)
 *   X2  Cmd+K command palette floating entry
 *   X3  Breadcrumb / 返回栈基础样式
 *   X6  Error retry button
 *   M4  Pull-to-refresh 提示条
 * ========================================================================== */


/* ===== L4 数字等距 tnum ===== */
:where(.num,
       .stat-value, .stat-card-value, .sv3-hero-stat-value,
       .meta-time, .badge-count, .nav-micro-heart-count,
       [data-tnum], .tabular-nums,
       .calendar-time, .calendar-date-num, .calendar-week-num,
       .timeline-axis-label, .day-axis-hour,
       .quota-num, .pricing-num, .ticker-num) {
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
}


/* ===== L5 scrollbar 风格统一 ===== */
:where(html) {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.32) transparent;
}
:where(html[data-theme="dark"]) {
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}
:where(*)::-webkit-scrollbar { width: 6px; height: 6px; }
:where(*)::-webkit-scrollbar-track { background: transparent; }
:where(*)::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.28);
  border-radius: 6px;
}
:where(*)::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.55); }
:where(html[data-theme="dark"] *)::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); }
:where(html[data-theme="dark"] *)::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.48); }


/* ===== V3 :focus-visible 全局统一 ring ===== */
:where(a, button, input, select, textarea, summary,
       [tabindex]:not([tabindex="-1"]),
       [role="button"], [role="link"], [role="tab"],
       [role="menuitem"], [role="option"], [role="checkbox"], [role="radio"]):focus-visible {
  outline: 2px solid var(--brand, #2563eb);
  outline-offset: 2px;
  border-radius: 6px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand, #2563eb) 16%, transparent);
  transition: outline-offset 0.12s ease, box-shadow 0.12s ease;
}
:where(html[data-theme="dark"]) :where(a, button, input, select, textarea,
       [tabindex]:not([tabindex="-1"]),
       [role="button"], [role="link"], [role="tab"]):focus-visible {
  outline-color: color-mix(in srgb, var(--brand, #2563eb) 80%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand, #2563eb) 24%, transparent);
}
:where(input, select, textarea):focus-visible { outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) {
  :where(*):focus-visible { transition: none; }
}


/* ===== M1 按钮按下统一 :active scale ===== */
:where(button, [role="button"], a.btn, .btn, .button, .ui-btn,
       .nav-settings-row, .mobile-nav-item, .sv3-hero-btn,
       .mobile-primary-sheet-button):not(:disabled):not([aria-disabled="true"]):not(.is-loading):active {
  transform: scale(0.97);
  transition: transform 0.06s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1));
}
:where(button, [role="button"], a.btn, .btn, .button, .ui-btn) {
  transition: transform 0.18s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1));
}
@media (prefers-reduced-motion: reduce) {
  :where(button, [role="button"], a.btn, .btn):active { transform: none; }
}


/* ===== M3 移动端 touch-target >= 44pt ===== */
:where(.app-shell.mobile-shell) :where(button, a, [role="button"], [role="link"],
       input[type="checkbox"], input[type="radio"], select,
       .mobile-nav-item, .sv3-hero-btn, .icon-btn, .chip, .tag, .pill):not(.mobile-nav-center-action) {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}
:where(.app-shell.mobile-shell) :where(.icon-btn, .chevron-btn, .close-btn, [data-action="dismiss"]) {
  position: relative;
}
:where(.app-shell.mobile-shell) :where(.icon-btn, .chevron-btn, .close-btn, [data-action="dismiss"])::before {
  content: "";
  position: absolute;
  inset: 50% 50% 50% 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

/* QA: mobile quick action buttons must remain finger-friendly even when older button rules override height. */
html body .app-shell.mobile-shell :where(.mobile-action-row, .split-actions) > :where(button, .ghost-button, .action-button),
html body .app-shell.mobile-shell :where(.mobile-feature-card, .mobile-preview-card, .mobile-pending-composer-cta) :where(button, .ghost-button, .action-button),
html body .app-shell.mobile-shell :where(.mobile-action-row, .split-actions) > button.ghost-button,
html body .app-shell.mobile-shell :where(.mobile-feature-card, .mobile-preview-card, .mobile-pending-composer-cta) button.ghost-button {
  min-height: 40px !important;
  min-width: 44px !important;
  touch-action: manipulation;
}

/* QA: settings menu theme options should remain comfortable click targets. */
html body .app-shell:not(.mobile-shell) .nav-settings-menu .nav-settings-theme-segmented > button,
html body .app-shell:not(.mobile-shell) .nav-settings-menu .nav-settings-theme-segmented > * {
  min-height: 36px !important;
  padding-block: 7px !important;
}

/* QA: expanded assistant quick prompts should wrap as normal pills, not vertical text.
   宽高对齐上排普通 chip（base.css:50708 min-height 32px、宽度随内容），
   不再用 min-width:88px 撑宽 / 34px 拔高，否则展开后比上排明显大一圈。 */
html body .app-shell:not(.mobile-shell) .assistant-chips-more-panel > .assistant-chip {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 32px !important;
  height: auto !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}


/* ===== M2 Skeleton helpers ===== */
@keyframes refSkeletonShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
:where(.sk-line, .sk-card, .sk-circle, .sk-text, .sk-avatar) {
  background: linear-gradient(90deg,
    rgba(226, 232, 240, 0.42) 0%,
    rgba(226, 232, 240, 0.82) 50%,
    rgba(226, 232, 240, 0.42) 100%);
  background-size: 200% 100%;
  animation: refSkeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: block;
}
:where(.sk-line)       { height: 12px; margin: 6px 0; }
:where(.sk-text)       { height: 14px; margin: 8px 0; width: 80%; }
:where(.sk-card)       { height: 120px; border-radius: 16px; margin-bottom: 12px; }
:where(.sk-circle)     { width: 36px; height: 36px; border-radius: 50%; }
:where(.sk-avatar)     { width: 48px; height: 48px; border-radius: 12px; }

:where(html[data-theme="dark"]) :where(.sk-line, .sk-card, .sk-circle, .sk-text, .sk-avatar) {
  background: linear-gradient(90deg,
    rgba(30, 41, 59, 0.42) 0%,
    rgba(51, 65, 85, 0.62) 50%,
    rgba(30, 41, 59, 0.42) 100%);
  background-size: 200% 100%;
}
@media (prefers-reduced-motion: reduce) {
  :where(.sk-line, .sk-card, .sk-circle, .sk-text, .sk-avatar) { animation: none; }
}


/* ===== M5 Page transition 过场 ===== */
:where(.xq-page-enter) {
  opacity: 0;
  transform: translateX(12px);
}
:where(.xq-page-enter-active) {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.24s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1)),
              transform 0.32s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1));
}
:where(.xq-page-leave-active) {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.16s ease-in, transform 0.16s ease-in;
}
@media (prefers-reduced-motion: reduce) {
  :where(.xq-page-enter, .xq-page-enter-active, .xq-page-leave-active) {
    transform: none;
    transition: opacity 0.12s linear;
  }
}


/* ===== L3 Panel 智能折叠 helpers ===== */
:where(.xq-collapsible) {
  transition: max-height 0.32s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1)),
              opacity 0.24s ease;
  overflow: hidden;
}
:where(.xq-collapsible[data-collapsed="true"]) > :where(.xq-collapsible-body) {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
:where(.xq-collapsible) > :where(.xq-collapsible-body) {
  max-height: 5000px;
  opacity: 1;
  transition: inherit;
}
:where(.xq-collapsible-toggle) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: var(--text-sub, #475569);
  border: 0;
  background: transparent;
  padding: 4px 8px;
  border-radius: 8px;
}
:where(.xq-collapsible-toggle:hover) {
  background: var(--bg-soft, #f2f6fb);
  color: var(--text-main, #0f172a);
}
:where(.xq-collapsible-toggle svg) {
  width: 14px;
  height: 14px;
  transition: transform 0.24s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1));
}
:where(.xq-collapsible[data-collapsed="true"]) :where(.xq-collapsible-toggle svg) {
  transform: rotate(-90deg);
}


/* ===== V2 暗模式不一致扫描修 ===== */
:where(html[data-theme="dark"]) :where(input::placeholder, textarea::placeholder) {
  color: rgb(148, 163, 184);
  opacity: 0.72;
}
:where(html[data-theme="dark"]) :where(.stat-card, .panel-card, .info-card, .v5-card) {
  border-color: rgba(148, 163, 184, 0.18);
}
:where(html[data-theme="dark"]) :where(.toast.is-error) {
  background: rgba(127, 29, 29, 0.46);
  color: rgb(254, 226, 226);
}
:where(html[data-theme="dark"]) :where(.toast.is-success) {
  background: rgba(20, 83, 45, 0.46);
  color: rgb(220, 252, 231);
}
:where(html[data-theme="dark"]) :where(.divider, hr) {
  border-color: rgba(148, 163, 184, 0.14);
}
:where(html[data-theme="dark"]) :where(button.ghost:hover, .nav-settings-row:hover) {
  background: rgba(37, 99, 235, 0.12);
}


/* ===== X3 Breadcrumb / 返回栈基础样式 ===== */
:where(.xq-breadcrumb) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-sub, #475569);
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--bg-soft, #f2f6fb);
  border: 1px solid var(--line, #e2e8f0);
  margin: 8px 0;
}
:where(.xq-breadcrumb-item) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
:where(.xq-breadcrumb-item.is-link) {
  cursor: pointer;
  color: var(--brand, #2563eb);
}
:where(.xq-breadcrumb-item.is-link:hover) { text-decoration: underline; }
:where(.xq-breadcrumb-sep) { opacity: 0.4; }
:where(html[data-theme="dark"]) :where(.xq-breadcrumb-sep) { opacity: 0.65; }
:where(.xq-back-btn) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  background: var(--bg-card, #ffffff);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main, #0f172a);
}
:where(.xq-back-btn:hover) { background: var(--bg-soft, #f2f6fb); }


/* ===== X6 Error retry button ===== */
:where(.xq-error-retry) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--brand, #2563eb);
  background: color-mix(in srgb, var(--brand, #2563eb) 8%, transparent);
  color: var(--brand, #2563eb);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  transition: background 0.16s ease;
}
:where(.xq-error-retry:hover) {
  background: color-mix(in srgb, var(--brand, #2563eb) 16%, transparent);
}


/* ===== M4 Pull-to-refresh 提示条 ===== */
:where(.xq-ptr-indicator) {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  padding: 8px 14px;
  border-radius: 0 0 14px 14px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-top: 0;
  font-size: 12.5px;
  color: var(--text-sub, #475569);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 1000;
  transition: transform 0.24s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1));
  pointer-events: none;
}
:where(.xq-ptr-indicator.is-visible) { transform: translate(-50%, 0); }
:where(.xq-ptr-indicator.is-loading) { color: var(--brand, #2563eb); }
:where(.xq-ptr-spinner) {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: refPtrSpin 0.8s linear infinite;
}
@keyframes refPtrSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  :where(.xq-ptr-spinner) { animation: none; }
}


/* ===== X2 Command palette floating entry ===== */
:where(.xq-cmdk-fab) {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 1100;
  height: 36px;
  padding: 0 10px 0 12px;
  border-radius: 18px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-sub, #475569);
  font-size: 12.5px;
  transition: transform 0.16s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1)),
              box-shadow 0.16s ease;
}
:where(.xq-cmdk-fab:hover) {
  transform: translateY(-1px);
  color: var(--brand, #2563eb);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}
:where(.xq-cmdk-fab kbd) {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-soft, #f2f6fb);
  border: 1px solid var(--line, #e2e8f0);
  color: var(--text-main, #0f172a);
}
:where(html[data-theme="dark"]) :where(.xq-cmdk-fab) {
  background: rgba(15, 23, 42, 0.86);
  color: rgb(203, 213, 225);
}
:where(html[data-theme="dark"]) :where(.xq-cmdk-fab kbd) {
  background: rgba(30, 41, 59, 0.86);
  color: rgb(226, 232, 240);
  border-color: rgba(148, 163, 184, 0.2);
}
/* 桌面端 cmdk fab 放右下角更上一些避开 feedback FAB */
@media (min-width: 768px) {
  :where(.xq-cmdk-fab) { bottom: 18px; right: 78px; }
}


/* ===== X7 onboarding 重看入口 fab ===== */
:where(.xq-onboarding-replay) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  background: var(--bg-soft, #f2f6fb);
  color: var(--text-main, #0f172a);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.16s ease;
}
:where(.xq-onboarding-replay:hover) {
  background: color-mix(in srgb, var(--brand, #2563eb) 12%, var(--bg-soft, #f2f6fb));
  color: var(--brand, #2563eb);
}

/* ============================================================================
 * M6 移动端弹窗滚动兜底
 * ----------------------------------------------------------------------------
 * 窄视口下弹窗内容可能超出屏幕高度，确保 modal/dialog 容器可滚动，
 * 避免表单字段被截断无法操作。
 * ============================================================================ */
/* 2026-08-06 fix: 原选择器含裸 [role="dialog"]，会误伤那些自身就是全屏定位容器
   （position:fixed; inset:0）的浮层——它们把 role="dialog" 挂在 backdrop 上，
   真正的卡片是子元素。被 90dvh 截断后底部 10% 不可见且不接收点击，
   引导浮层的「下一步/跳过」按钮就落到该死区里，被 z-index:900 的
   .mobile-bottom-nav 抢走命中（patch_29 工作台引导手机端按钮点不动的根因）。
   这里排除已知的全屏 overlay，仅对真正的居中弹窗做滚动兜底。 */
@media (max-width: 860px) {
  :where(.modal-card, [role="dialog"], .dialog-panel):not(.xqj-tour-overlay):not(.xqj-spot-overlay) {
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* ============================================================================
 * 2026-05-29 收信箱已读/未读视觉区分（Bug2 修复）
 * ============================================================================ */
:where(.command-card--unread) {
  border-left: 3px solid var(--color-accent, #1e40af);
  background: color-mix(in srgb, var(--color-accent, #1e40af) 4%, var(--color-bg, #fff));
}
:where(.unread-dot) {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent, #1e40af);
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ============================================================================
 * 2026-05-29 收信箱分类筛选过渡动画（体验5 修复）
 * ============================================================================ */
:where(.mailbox-feed, .command-list) {
  transition: opacity 200ms ease;
}
:where(.mailbox-feed-item, .command-card) {
  transition: transform 200ms ease, opacity 200ms ease;
}

/* ============================================================================
 * 2026-05-29 月视图标题截断 — 移动端点击弹出 tooltip（体验4 修复）
 * ============================================================================ */
@media (max-width: 860px) {
  /* 月视图事件条目：截断 + 触摸指示 */
  :where(.month-entry) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }
  :where(.month-entry:active) {
    background: color-mix(in srgb, var(--event-color, var(--brand, #2563eb)) 8%, transparent);
  }

  /* 移动端 tooltip 弹层 */
  :where(.month-mobile-tooltip) {
    position: fixed;
    z-index: 10000;
    background: var(--color-bg-elevated, #ffffff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    max-width: 260px;
    min-width: 180px;
    pointer-events: auto;
    animation: monthMobileTooltipIn 0.18s var(--ease-ios, cubic-bezier(0.32, 0.72, 0, 1));
    user-select: none;
    -webkit-user-select: none;
  }
  @keyframes monthMobileTooltipIn {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  :where(.month-mobile-tooltip .tooltip-color-bar) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 12px 12px 0 0;
    background: var(--tooltip-accent, var(--color-accent, #1e40af));
  }

  :where(.month-mobile-tooltip .tooltip-title) {
    display: block;
    font-weight: 640;
    font-size: 14.5px;
    margin: 2px 0 8px;
    color: var(--color-text-primary, #111827);
    line-height: 1.40;
    white-space: normal;
    word-break: break-word;
  }

  :where(.month-mobile-tooltip .tooltip-meta) {
    display: block;
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
    line-height: 1.55;
    margin-bottom: 10px;
  }

  :where(.month-mobile-tooltip .tooltip-actions) {
    display: flex;
    gap: 8px;
  }

  :where(.month-mobile-tooltip .tooltip-btn-detail) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: var(--tooltip-accent, var(--color-accent, #1e40af));
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    flex: 1;
    transition: filter 0.14s ease;
  }
  :where(.month-mobile-tooltip .tooltip-btn-detail:active) {
    filter: brightness(0.88);
  }

  :where(.month-mobile-tooltip .tooltip-btn-close) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: transparent;
    color: var(--color-text-secondary, #6b7280);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.14s ease;
  }
  :where(.month-mobile-tooltip .tooltip-btn-close:active) {
    background: var(--bg-soft, #f2f6fb);
  }

  /* 暗模式适配 */
  :where(html[data-theme="dark"]) :where(.month-mobile-tooltip) {
    background: var(--color-bg-elevated, #1e293b);
    border-color: var(--color-border, #334155);
  }
  :where(html[data-theme="dark"]) :where(.month-mobile-tooltip .tooltip-title) {
    color: rgb(226, 232, 240);
  }
  :where(html[data-theme="dark"]) :where(.month-mobile-tooltip .tooltip-meta) {
    color: rgb(148, 163, 184);
  }
  :where(html[data-theme="dark"]) :where(.month-mobile-tooltip .tooltip-btn-close) {
    border-color: rgba(148, 163, 184, 0.22);
    color: rgb(148, 163, 184);
  }
  :where(html[data-theme="dark"]) :where(.month-mobile-tooltip .tooltip-btn-close:active) {
    background: rgba(37, 99, 235, 0.12);
  }
}

/* ============================================================================
 * 2026-05-29 拖拽 drop indicator 预览线（Bug9 修复）
 * ============================================================================ */
:where(.drag-drop-indicator) {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent, #1e40af);
  border-radius: 2px;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 0 6px rgba(30, 64, 175, 0.3);
  transition: top 80ms ease;
}
:where(.drag-drop-indicator::before) {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent, #1e40af);
}

/* ============================================================================
 * 2026-05-29 移动端日历卡片堆叠布局（体验3 修复）
 * ----------------------------------------------------------------------------
 * 窄屏下日/周视图事件卡片从多列并排改为单列堆叠，每屏 1-2 个完整卡片，
 * 横版布局（时间左 + 信息右），标题可换行不截断，月视图色块预览不变。
 * ============================================================================ */
@media (max-width: 860px) {
  /* 2026-05-29 体验3：移动端卡片堆叠布局增强 — 降低信息密度 */
  :where(.day-view-events.mobile-stacked,
         .week-view-events.mobile-stacked) {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  :where(.day-view-events.mobile-stacked .timeline-group,
         .week-view-events.mobile-stacked .timeline-group) {
    margin-bottom: 10px;
  }
  :where(.day-view-events.mobile-stacked .timeline-group-events,
         .week-view-events.mobile-stacked .timeline-group-events) {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  :where(.day-view-events.mobile-stacked .event-card,
         .week-view-events.mobile-stacked .event-card) {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px;
    margin-bottom: 0; /* gap handles spacing */
    font-size: 14px;
    border-radius: 10px;
    background: var(--color-bg-elevated, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, box-shadow 0.2s ease, transform 0.2s ease;
    /* 卡片堆叠阴影效果 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }
  :where(.day-view-events.mobile-stacked .event-card:active,
         .week-view-events.mobile-stacked .event-card:active) {
    transform: scale(0.985);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }
  :where(.day-view-events.mobile-stacked .event-card:hover,
         .day-view-events.mobile-stacked .event-card:active,
         .week-view-events.mobile-stacked .event-card:hover,
         .week-view-events.mobile-stacked .event-card:active) {
    background: color-mix(in srgb, var(--event-color, #1e40af) 6%, var(--color-bg-elevated, #fff));
  }

  :where(.day-view-events.mobile-stacked .event-time,
         .week-view-events.mobile-stacked .event-time) {
    flex-shrink: 0;
    width: 52px;
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
    text-align: center;
    padding-top: 2px;
    line-height: 1.4;
  }

  :where(.day-view-events.mobile-stacked .event-detail,
         .week-view-events.mobile-stacked .event-detail) {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  :where(.day-view-events.mobile-stacked .event-title,
         .week-view-events.mobile-stacked .event-title) {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.35;
    color: var(--color-text-primary, #111827);
  }

  :where(.day-view-events.mobile-stacked .event-meta,
         .week-view-events.mobile-stacked .event-meta) {
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    line-height: 1.4;
  }

  :where(.day-view-events.mobile-stacked .event-meta .badge,
         .week-view-events.mobile-stacked .event-meta .badge) {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--event-color, #1e40af) 10%, transparent);
    color: var(--event-color, #1e40af);
    white-space: nowrap;
  }

  :where(.day-view-events.mobile-stacked .event-location,
         .week-view-events.mobile-stacked .event-location) {
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
    line-height: 1.4;
  }

  :where(.day-view-events.mobile-stacked .event-footer,
         .week-view-events.mobile-stacked .event-footer) {
    font-size: 11px;
    color: var(--color-text-secondary, #6b7280);
    margin-top: 2px;
    line-height: 1.4;
  }

  :where(.day-view-events.mobile-stacked .event-comment-chip,
         .week-view-events.mobile-stacked .event-comment-chip) {
    font-size: 11px;
    display: inline-block;
    margin-top: 4px;
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid var(--comment-color, var(--event-color, #1e40af));
    color: var(--comment-color, var(--event-color, #1e40af));
    background: transparent;
    cursor: pointer;
  }

  /* 暗模式适配 */
  :where(html[data-theme="dark"])
    :where(.day-view-events.mobile-stacked .event-card,
           .week-view-events.mobile-stacked .event-card) {
    background: var(--color-bg-elevated, #1e293b);
    border-color: var(--color-border, #334155);
  }
  :where(html[data-theme="dark"])
    :where(.day-view-events.mobile-stacked .event-time,
           .week-view-events.mobile-stacked .event-time) {
    color: rgb(148, 163, 184);
  }
  :where(html[data-theme="dark"])
    :where(.day-view-events.mobile-stacked .event-title,
           .week-view-events.mobile-stacked .event-title) {
    color: rgb(226, 232, 240);
  }
}

/* comment */
.mailbox-feed-item {
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mailbox-feed-item.entering {
  opacity: 0;
  transform: translateY(8px);
}
.mailbox-feed-item.entered {
  opacity: 1;
  transform: translateY(0);
}
.mailbox-feed-item.leaving {
  opacity: 0;
  transform: translateY(-8px);
}

/* 收信箱「回复老板」编辑器：token 化，暗色主题下不再内联硬编码浅色白块 */
html body .app-shell .annotation-reply-composer {
  background: var(--bg-soft, rgba(255, 255, 255, 0.03));
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.18));
}
html body .app-shell .annotation-reply-composer textarea {
  border: 1px solid var(--line, rgba(148, 163, 184, 0.28));
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-card, #0f172a);
  color: var(--text-main, #0f172a);
}
html body .app-shell .annotation-reply-composer textarea:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #2563eb) 22%, transparent);
}

/* 2026-06-09: Boss/assistant smart-assistant quick prompts use one shared chip flow.
   Expanded "more" items must not render as a separate form-like panel; they join the same chip row. */
html body .app-shell .assistant-chat-panel .assistant-chips-more {
  display: contents;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more > summary.assistant-chip-more {
  list-style: none;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more > summary.assistant-chip-more::-webkit-details-marker {
  display: none;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more:not([open]) > .assistant-chips-more-panel {
  display: none;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more[open] > .assistant-chips-more-panel {
  display: contents;
  margin: 0;
  padding: 0;
  width: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more-panel > .assistant-chip {
  flex: 0 0 auto;
}

/* 2026-06-09: Align expanded assistant quick prompts to the same row grid.
   Keep the "more" children in the original chip flow, but use one clear gap for
   both rows so the second line no longer feels stuck together or offset. */
html body .app-shell .assistant-chat-panel .assistant-chips {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more {
  display: inline-block;
  flex: 0 0 auto;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more + .assistant-chips-more-panel {
  display: none;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more[open] + .assistant-chips-more-panel {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
}
html body .app-shell .assistant-chat-panel .assistant-chips-more-panel > .assistant-chip {
  flex: 0 0 auto;
  margin: 0;
}

/* 2026-06-09: Do not let older boss-only dark chip overrides diverge from assistant side. */
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .assistant-chat-panel .assistant-chip,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="assistant"] .assistant-chat-panel .assistant-chip {
  background: var(--v4-surface-3);
  border: 1px solid var(--v4-line);
  color: var(--v4-ink-2);
}
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .assistant-chat-panel .assistant-chip:hover,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="assistant"] .assistant-chat-panel .assistant-chip:hover {
  background: var(--v4-brand-soft);
  border-color: var(--v4-brand);
  color: var(--v4-brand);
}

/* 2026-07-19: 关联会议 mini 条 — 浅/深同一套「有框容器」
   之前只有 dark 补了 border/background，light 只剩文字 → 用户截图里浅色“没框”。 */
html body .app-shell .todo-linked-event-mini,
html body .app-shell :is(.detail-drawer, .modal-card, .todo-detail-modal-card) .todo-linked-event-mini,
html body .app-shell:not(.mobile-shell) .todo-list .todo-card .todo-linked-event-mini {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 16px !important;
  color: #111827 !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03) !important;
  box-sizing: border-box !important;
}
html body .app-shell .todo-linked-event-mini :is(strong, h4, h5, h6),
html body .app-shell .todo-linked-event-mini-header strong {
  color: #111827 !important;
}
html body .app-shell .todo-linked-event-mini-time,
html body .app-shell .todo-linked-event-mini-location,
html body .app-shell .todo-linked-event-mini-location span {
  color: #475569 !important;
}
html body .app-shell .todo-linked-event-mini-icon,
html body .app-shell .todo-linked-event-mini svg {
  color: #64748b !important;
  stroke: currentColor !important;
}
html body .app-shell .todo-linked-event-mini.is-empty {
  background: #f8fafc !important;
  border-style: dashed !important;
  color: #64748b !important;
}

/* 2026-06-09: Dark-mode hardening for detail/modal embedded cards.
   The todo linked-event mini card is reused inside todo detail, not only inside .todo-list .todo-card. */
html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .todo-detail-modal-card) .todo-linked-event-mini,
html[data-theme="dark"] body .app-shell .todo-linked-event-mini,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .todo-list .todo-card .todo-linked-event-mini {
  background: rgba(15, 23, 42, 0.46) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  color: var(--v4-ink-1, #f8fafc) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035) !important;
}
html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .todo-detail-modal-card) .todo-linked-event-mini :is(strong, h4, h5, h6),
html[data-theme="dark"] body .app-shell .todo-linked-event-mini :is(strong, h4, h5, h6) {
  color: var(--v4-ink-1, #f8fafc);
}
html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .todo-detail-modal-card) .todo-linked-event-mini :is(span, p, small, div),
html[data-theme="dark"] body .app-shell .todo-linked-event-mini :is(span, p, small, div) {
  color: var(--v4-ink-2, #cbd5e1);
}
html[data-theme="dark"] body .app-shell .todo-linked-event-mini.is-empty {
  background: rgba(15, 23, 42, 0.28);
  border-style: dashed;
  color: var(--v4-ink-3, #94a3b8);
}

/* Generic dark detail surfaces: prevent reused light cards from appearing as white islands in drawers/modals. */
html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .comment-modal-card, .event-modal-card) :is(.detail-group, .detail-meta, .detail-meta-item, .detail-section) {
  background-color: rgba(15, 23, 42, 0.36);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--v4-ink-1, #f8fafc);
}
html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .comment-modal-card, .event-modal-card) :is(.detail-group, .detail-meta, .detail-meta-item, .detail-section) :is(strong, h3, h4, h5, h6, label) {
  color: var(--v4-ink-1, #f8fafc);
}
html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .comment-modal-card, .event-modal-card) :is(.detail-group, .detail-meta, .detail-meta-item, .detail-section) :is(p, span, small) {
  color: var(--v4-ink-2, #cbd5e1);
}

/* 2026-06-09: Detail-modal reused widgets must inherit dark tokens even when their
   markup carries inline light fallbacks. */
html[data-theme="dark"] body .app-shell,
body[data-theme="dark"] .app-shell,
body.theme-dark .app-shell,
.app-shell[data-theme="dark"],
.app-shell.theme-dark {
  --linked-event-card-bg: rgba(15, 23, 42, 0.56);
  --linked-event-card-border: rgba(148, 163, 184, 0.22);
  --linked-event-card-fg: var(--v4-ink-1, #f8fafc);
  --linked-event-card-muted: var(--v4-ink-2, #cbd5e1);
  --event-priority-select-bg: rgba(15, 23, 42, 0.72);
  --event-priority-select-border: rgba(148, 163, 184, 0.30);
  --event-priority-select-fg: var(--v4-ink-1, #f8fafc);
}

html[data-theme="light"] body .app-shell .linked-event-mini-card,
html body .app-shell .linked-event-mini-card {
  background: var(--linked-event-card-bg, #ffffff);
  border: 1px solid var(--linked-event-card-border, #e5e7eb);
  color: var(--linked-event-card-fg, #111827);
  border-radius: 8px;
  box-sizing: border-box;
}
html[data-theme="light"] body .app-shell,
html body .app-shell {
  --linked-event-card-bg: #ffffff;
  --linked-event-card-border: #e5e7eb;
  --linked-event-card-fg: #111827;
  --linked-event-card-muted: #475569;
}

html[data-theme="dark"] body .app-shell .linked-event-mini-card,
body[data-theme="dark"] .app-shell .linked-event-mini-card,
body.theme-dark .app-shell .linked-event-mini-card,
.app-shell[data-theme="dark"] .linked-event-mini-card,
.app-shell.theme-dark .linked-event-mini-card {
  background: var(--linked-event-card-bg);
  border-color: var(--linked-event-card-border);
  color: var(--linked-event-card-fg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

html[data-theme="dark"] body .app-shell .linked-event-mini-card :is(.linked-event-mini-card-header, .linked-event-mini-card-header span, strong, h4, h5, h6),
body[data-theme="dark"] .app-shell .linked-event-mini-card :is(.linked-event-mini-card-header, .linked-event-mini-card-header span, strong, h4, h5, h6),
body.theme-dark .app-shell .linked-event-mini-card :is(.linked-event-mini-card-header, .linked-event-mini-card-header span, strong, h4, h5, h6),
.app-shell[data-theme="dark"] .linked-event-mini-card :is(.linked-event-mini-card-header, .linked-event-mini-card-header span, strong, h4, h5, h6),
.app-shell.theme-dark .linked-event-mini-card :is(.linked-event-mini-card-header, .linked-event-mini-card-header span, strong, h4, h5, h6) {
  color: var(--linked-event-card-fg);
}

html[data-theme="dark"] body .app-shell .linked-event-mini-card :is(.linked-event-mini-card-body, .linked-event-mini-card-body *, p, span, small),
body[data-theme="dark"] .app-shell .linked-event-mini-card :is(.linked-event-mini-card-body, .linked-event-mini-card-body *, p, span, small),
body.theme-dark .app-shell .linked-event-mini-card :is(.linked-event-mini-card-body, .linked-event-mini-card-body *, p, span, small),
.app-shell[data-theme="dark"] .linked-event-mini-card :is(.linked-event-mini-card-body, .linked-event-mini-card-body *, p, span, small),
.app-shell.theme-dark .linked-event-mini-card :is(.linked-event-mini-card-body, .linked-event-mini-card-body *, p, span, small) {
  color: var(--linked-event-card-muted);
}

html[data-theme="dark"] body .app-shell .linked-event-mini-card .ghost-button,
body[data-theme="dark"] .app-shell .linked-event-mini-card .ghost-button,
body.theme-dark .app-shell .linked-event-mini-card .ghost-button,
.app-shell[data-theme="dark"] .linked-event-mini-card .ghost-button,
.app-shell.theme-dark .linked-event-mini-card .ghost-button {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--v4-ink-2, #cbd5e1);
}

/* 2026-06-09: Event detail priority select dark-mode hardening.
   The priority dropdown had an older `.priority-dropdown-wrap select { background-color:#fff!important }`
   rule plus inline light background in the shared renderer, so event drawers still showed a white island. */
html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .event-modal-card, .mobile-event-detail) .priority-dropdown-wrap select,
html[data-theme="dark"] body .app-shell .priority-dropdown-wrap select[data-role="event-priority-select"],
body[data-theme="dark"] .app-shell .priority-dropdown-wrap select[data-role="event-priority-select"],
body.theme-dark .app-shell .priority-dropdown-wrap select[data-role="event-priority-select"],
.app-shell[data-theme="dark"] .priority-dropdown-wrap select[data-role="event-priority-select"],
.app-shell.theme-dark .priority-dropdown-wrap select[data-role="event-priority-select"] {
  background-color: var(--event-priority-select-bg, rgba(15, 23, 42, 0.72));
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  border-color: var(--event-priority-select-border, rgba(148, 163, 184, 0.30));
  color: var(--event-priority-select-fg, #f8fafc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045);
}

html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .event-modal-card, .mobile-event-detail) .priority-dropdown-wrap select:focus,
html[data-theme="dark"] body .app-shell .priority-dropdown-wrap select[data-role="event-priority-select"]:focus {
  border-color: rgba(96, 165, 250, 0.70);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.24), inset 0 1px 0 rgba(255,255,255,0.045);
}

html[data-theme="dark"] body .app-shell :is(.detail-drawer, .modal-card, .event-modal-card, .mobile-event-detail) .priority-dropdown-wrap label {
  color: var(--v4-ink-2, #cbd5e1);
}

/* 2026-06-09: The desktop "新增待办" form footer should be a quiet action row.
   The old top border cut through the dark panel and looked like an accidental divider. */
html body .app-shell .todo-form-actions {
  border-top: 0;
  padding-top: 0;
}

/* 2026-06-09: assistant cockpit cards are navigation controls for the left workspace. */
html body .app-shell .cockpit-item[data-action="open-cockpit-section"],
html body .app-shell .mobile-preview-item[data-action="open-cockpit-section"] {
  cursor: pointer;
  user-select: none;
}
html body .app-shell .cockpit-item[data-action="open-cockpit-section"]:active,
html body .app-shell .mobile-preview-item[data-action="open-cockpit-section"]:active {
  transform: translateY(0) scale(0.99);
}
html body .app-shell .cockpit-item[data-action="open-cockpit-section"]:focus-visible,
html body .app-shell .mobile-preview-item[data-action="open-cockpit-section"]:focus-visible {
  outline: 2px solid var(--v4-brand, #2563eb);
  outline-offset: 3px;
}

/* ─── Mobile touch target: ensure all interactive elements >= 44px ─── */
@media (max-width: 640px) {
  html body .app-shell.mobile-shell .action-button,
  html body .app-shell.mobile-shell .btn-primary,
  html body .app-shell.mobile-shell .btn-secondary,
  html body .app-shell.mobile-shell button[data-action],
  html body .app-shell.mobile-shell .cal-nav-btn,
  html body .app-shell.mobile-shell .view-toggle-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  html body .app-shell.mobile-shell .stat-card,
  html body .app-shell.mobile-shell .info-chip {
    min-height: 44px;
  }

  html body .app-shell.mobile-shell .stat-card-label,
  html body .app-shell.mobile-shell .kpi-label {
    font-size: 12px;
  }
}

/* ============================================================================
 * 2026-07-13 Visual polish pack — quiet empty home / FAB / side-stripe / tokens
 * ============================================================================ */

/* —— 空组织启动器（桌面 stats-row 替换） —— */
:where(.stats-row.is-quiet-empty) {
  display: block !important;
  margin-bottom: 18px;
}
:where(.xq-quiet-launcher) {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px 18px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--brand, #1e40af) 16%, var(--line, #e2e8f0));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand, #1e40af) 7%, var(--bg-card, #fff)) 0%, var(--bg-card, #fff) 52%),
    var(--bg-card, #fff);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
:where(.xq-quiet-launcher)::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -48px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand, #1e40af) 18%, transparent), transparent 70%);
  pointer-events: none;
}
:where(.xq-quiet-launcher-main) {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
:where(.xq-quiet-kicker) {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-soft, #64748b);
}
:where(.xq-quiet-launcher-copy h3) {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-main, #0f172a);
  font-weight: 800;
}
:where(.xq-quiet-launcher-copy p:last-child) {
  margin: 0;
  max-width: 46ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-sub, #475569);
}
:where(.xq-quiet-launcher-actions) {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* 2026-07-27：空状态启动器里主/次按钮此前不成套 —— 次级按钮沿用全局
   .ghost-button（12.5px 字号、8/14 内距、灰边框 #e5e7eb、全透明底），
   与相邻主按钮（13.5px、10/18、品牌蓝实心）四处不一致，并排看像两套设计。
   这里把它对齐为主按钮的"描边版"：同字号同内距，品牌色描边与文字、白底。 */
html body .app-shell .xq-quiet-launcher-actions > .ghost-button,
html body .app-shell:not(.mobile-shell) .xq-quiet-launcher-actions > .ghost-button {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 10px 18px !important;
  border-radius: 8px !important;
  border: 1px solid color-mix(in srgb, var(--brand, #2563eb) 42%, transparent) !important;
  background: var(--bg-card, #ffffff) !important;
  color: var(--brand, #2563eb) !important;
  box-shadow: none !important;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease !important;
}
html body .app-shell .xq-quiet-launcher-actions > .ghost-button:hover,
html body .app-shell:not(.mobile-shell) .xq-quiet-launcher-actions > .ghost-button:hover {
  border-color: var(--brand, #2563eb) !important;
  background: color-mix(in srgb, var(--brand, #2563eb) 8%, var(--bg-card, #ffffff)) !important;
  color: var(--brand, #2563eb) !important;
}
/* 暗色需单独覆盖，且必须匹配到更高特异性的既有规则：
   `html[data-theme="dark"] .app-shell:not(.mobile-shell)[data-role="boss"] .ghost-button:not(.action-button)`
   （CDP getMatchedStyles 定位）。少写 [data-role] 或 :not(.action-button) 都会被它拉回灰调。 */
html[data-theme="dark"] body .app-shell .xq-quiet-launcher-actions > .ghost-button,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .xq-quiet-launcher-actions > .ghost-button:not(.action-button),
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="assistant"] .xq-quiet-launcher-actions > .ghost-button:not(.action-button) {
  border-color: color-mix(in srgb, var(--brand, #2563eb) 55%, transparent) !important;
  background: color-mix(in srgb, var(--brand, #2563eb) 14%, var(--bg-card, #0f172a)) !important;
  color: #bfdbfe !important;
  -webkit-text-fill-color: #bfdbfe !important;
}
html[data-theme="dark"] body .app-shell .xq-quiet-launcher-actions > .ghost-button:hover,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .xq-quiet-launcher-actions > .ghost-button:not(.action-button):hover,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="assistant"] .xq-quiet-launcher-actions > .ghost-button:not(.action-button):hover {
  border-color: var(--brand, #2563eb) !important;
  background: color-mix(in srgb, var(--brand, #2563eb) 26%, var(--bg-card, #0f172a)) !important;
  color: #dbeafe !important;
  -webkit-text-fill-color: #dbeafe !important;
}
:where(.xq-quiet-launcher-meta) {
  position: relative;
  z-index: 1;
  padding-top: 12px;
  border-top: 1px solid var(--line, #e2e8f0);
  font-size: 12.5px;
  color: var(--text-soft, #64748b);
}
:where(html[data-theme="dark"]) :where(.xq-quiet-launcher) {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand, #1e40af) 14%, rgba(15, 23, 42, 0.92)) 0%, rgba(15, 23, 42, 0.88) 58%),
    rgba(15, 23, 42, 0.88);
  border-color: rgba(96, 165, 250, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
:where(html[data-theme="dark"]) :where(.xq-quiet-launcher-copy h3) { color: #f8fafc; }
:where(html[data-theme="dark"]) :where(.xq-quiet-launcher-copy p:last-child),
:where(html[data-theme="dark"]) :where(.xq-quiet-launcher-meta),
:where(html[data-theme="dark"]) :where(.xq-quiet-kicker) { color: rgba(226, 232, 240, 0.72); }
:where(html[data-theme="dark"]) :where(.xq-quiet-launcher-meta) { border-top-color: rgba(148, 163, 184, 0.16); }

:where(.v5-hero-empty-actions) {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}
:where(.mobile-today-focus-card.is-quiet-empty) {
  border-color: color-mix(in srgb, var(--brand, #1e40af) 18%, transparent);
}

/* —— 指标数字：去掉 gradient text，实色 + tnum —— */
html body .app-shell .stat-card-value,
html body .app-shell .mobile-kpi-card .kpi-value {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--text-main, #0f172a) !important;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
}
html[data-theme="dark"] body .app-shell .stat-card-value,
html[data-theme="dark"] body .app-shell .mobile-kpi-card .kpi-value {
  color: #f8fafc !important;
}

/* —— 侧色条：日程事件保留语义，其它改成顶部细 accent ——
   2026-07-17：mailbox-preview-card（老板同步）改回左侧竖条，对齐日历会议卡布局，
   但比 event-card 的 4px 更细（2px），不从这里走顶线。 */
html body .app-shell .todo-card::before,
html body .app-shell .pending-card::before,
html body .app-shell .risk-card::before,
html body .app-shell .checkable-todo::before,
html body .app-shell .due-todo::before {
  width: 100% !important;
  height: 2px !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: auto !important;
  border-radius: 0 !important;
}

/* 老板同步预览卡：左竖条（同 event-card 布局，更细） */
html body .app-shell .mailbox-preview-card,
html body .app-shell .assistant-panel .mailbox-preview-card,
html body .app-shell:not(.mobile-shell) .assistant-panel .mailbox-preview-card {
  position: relative !important;
  overflow: hidden !important;
}
html body .app-shell .mailbox-preview-card::before,
html body .app-shell .assistant-panel .mailbox-preview-card::before,
html:not([data-theme="dark"]) body .app-shell .mailbox-preview-card::before,
html[data-theme="dark"] body .app-shell .mailbox-preview-card::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 2px !important;
  height: auto !important;
  border-radius: 2px 0 0 2px !important;
  background: var(--mailbox-preview-accent, var(--brand, #1e40af)) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body .app-shell .mailbox-preview-card::before,
html[data-theme="dark"] body .app-shell .assistant-panel .mailbox-preview-card::before {
  background: var(--mailbox-preview-accent, #60a5fa) !important;
}

/* 日程 event-card：三端统一只用 ::before 画 4px 部门色竖条
 * 2026-07-17：
 * 1) 回滚「圆点 + 细顶线」→ 恢复左竖条
 * 2) 取消 border-left 再叠一层 event-color（助理 dark 双橙条、老板 dark 单条）
 * 老板/助理/移动端 light+dark 同一条路径。
 */
html:not([data-theme="dark"]) body .app-shell .event-card,
html[data-theme="dark"] body .app-shell .event-card {
  position: relative;
  /* 四边统一 1px 描边，部门色不走 border */
  border-left-width: 1px !important;
  border-left-style: solid !important;
}
html:not([data-theme="dark"]) body .app-shell .event-card {
  border-left-color: rgba(148, 163, 184, 0.14) !important;
}
html[data-theme="dark"] body .app-shell .event-card {
  border-left-color: rgba(148, 163, 184, 0.12) !important;
}
html body .app-shell .event-card::before,
html:not([data-theme="dark"]) body .app-shell .event-card::before,
html[data-theme="dark"] body .app-shell .event-card::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  width: 4px !important;
  height: auto !important;
  left: 0 !important;
  right: auto !important;
  top: 0 !important;
  bottom: 0 !important;
  border-radius: 4px 0 0 4px !important;
  background: var(--event-color, var(--brand, #1e40af)) !important;
}
/* 关掉圆点方案的 ::after accent，避免与左竖条叠两层 */
html body .app-shell .event-card::after,
html:not([data-theme="dark"]) body .app-shell .event-card::after,
html[data-theme="dark"] body .app-shell .event-card::after {
  content: none !important;
  display: none !important;
}
/* 去掉圆点 gutter 左缩，内容回到竖条旁正常起点 */
html body .app-shell .event-card > .event-card-header,
html body .app-shell .event-card > .event-card-body {
  padding-left: 0;
}
html body .app-shell .event-card .event-title,
html body .app-shell .event-card .event-card-title,
html body .app-shell .event-card .event-head,
html body .app-shell .event-card h5 {
  padding-left: 0;
}
html body .app-shell .event-card > .event-card-header h5 {
  padding-left: 0;
}
html body .app-shell .day-view-events.mobile-stacked .event-card .event-title,
html body .app-shell .week-view-events.mobile-stacked .event-card .event-title,
html body .app-shell .mobile-timeline .event-card .event-title {
  padding-left: 0;
}

/* ============================================================
   2026-07-17：今日重点 topic-item / focus-card
   - 不要顶边横色条（border-color 染四边会出横线）
   - 老板 focus-card + 助理 topic-item 同源：只靠 ::before 左竖条
   - 压过 layout-assistant 里 border-color: amber/purple 的旧规则
   ============================================================ */
html body .app-shell .assistant-panel .topic-item,
html body .app-shell .assistant-panel .focus-card,
html body .app-shell .layout-assistant .assistant-panel .topic-item,
html body .app-shell .layout-assistant .assistant-panel .focus-card,
html body .app-shell:not(.mobile-shell) .assistant-panel .topic-item,
html body .app-shell:not(.mobile-shell) .assistant-panel .focus-card,
html body .app-shell .layout-assistant .assistant-panel .topic-item[data-priority="p1"],
html body .app-shell .layout-assistant .assistant-panel .topic-item[data-priority="p2"],
html body .app-shell .layout-assistant .assistant-panel .topic-item[data-priority="p3"],
html body .app-shell .layout-assistant .assistant-panel .topic-item[data-priority="p4"],
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell) .assistant-panel .topic-item,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell) .assistant-panel .focus-card,
html:not([data-theme="dark"]) body .app-shell .layout-assistant .assistant-panel .topic-item,
html:not([data-theme="dark"]) body .app-shell .layout-assistant .assistant-panel .topic-item[data-priority="p2"],
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .assistant-panel .topic-item,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .assistant-panel .focus-card,
html[data-theme="dark"] body .app-shell .layout-assistant .assistant-panel .topic-item,
html[data-theme="dark"] body .app-shell .layout-assistant .assistant-panel .topic-item[data-priority="p2"] {
  position: relative !important;
  overflow: hidden !important;
  /* 四边中性描边；部门色不走 border */
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  border-left-width: 1px !important;
  border-left-style: solid !important;
  border-left-color: rgba(148, 163, 184, 0.14) !important;
  border-top-color: rgba(148, 163, 184, 0.14) !important;
  border-right-color: rgba(148, 163, 184, 0.14) !important;
  border-bottom-color: rgba(148, 163, 184, 0.14) !important;
}
html[data-theme="dark"] body .app-shell .assistant-panel .topic-item,
html[data-theme="dark"] body .app-shell .assistant-panel .focus-card,
html[data-theme="dark"] body .app-shell .layout-assistant .assistant-panel .topic-item,
html[data-theme="dark"] body .app-shell .layout-assistant .assistant-panel .topic-item[data-priority="p2"],
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .assistant-panel .topic-item,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .assistant-panel .focus-card {
  border-color: rgba(148, 163, 184, 0.12) !important;
  border-left-color: rgba(148, 163, 184, 0.12) !important;
  border-top-color: rgba(148, 163, 184, 0.12) !important;
  border-right-color: rgba(148, 163, 184, 0.12) !important;
  border-bottom-color: rgba(148, 163, 184, 0.12) !important;
}
/* 左竖条：老板 focus-card + 助理 topic-item 同一条 */
html body .app-shell .assistant-panel .topic-item::before,
html body .app-shell .assistant-panel .focus-card::before,
html body .app-shell .layout-assistant .assistant-panel .topic-item::before,
html body .app-shell .layout-assistant .assistant-panel .focus-card::before,
html body .app-shell:not(.mobile-shell) .assistant-panel .topic-item::before,
html body .app-shell:not(.mobile-shell) .assistant-panel .focus-card::before,
html body .app-shell:not(.mobile-shell) .focus-card::before,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell) .assistant-panel .topic-item::before,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell) .assistant-panel .focus-card::before,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .assistant-panel .topic-item::before,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .assistant-panel .focus-card::before,
html[data-theme="dark"] body .app-shell .layout-assistant .assistant-panel .topic-item::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 3px !important;
  height: auto !important;
  right: auto !important;
  border-radius: 3px 0 0 3px !important;
  background: var(--event-color, var(--brand, #1e40af)) !important;
  pointer-events: none !important;
  z-index: 1 !important;
  box-shadow: none !important;
}

/* ============================================================
   2026-07-17：待安排页紧急度 info-chip 三端同色
   根因：base.css 老板 dark 通杀
     html[data-theme="dark"] .app-shell:not(.mobile-shell)[data-role="boss"] .info-chip
   把高/中紧急彩色全部抹成灰；助理端仍走 v5 [style*=] 例外，两端不一致。
   改为语义 class，特异性能压过 boss 通杀。
   ============================================================ */
html:not([data-theme="dark"]) body .app-shell .info-chip.info-chip--urgency-high,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell)[data-role="boss"] .info-chip.info-chip--urgency-high,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell)[data-role="assistant"] .info-chip.info-chip--urgency-high {
  background: rgba(239, 68, 68, 0.10) !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
  color: #B91C1C !important;
}
html:not([data-theme="dark"]) body .app-shell .info-chip.info-chip--urgency-medium,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell)[data-role="boss"] .info-chip.info-chip--urgency-medium,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell)[data-role="assistant"] .info-chip.info-chip--urgency-medium {
  background: rgba(245, 158, 11, 0.10) !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
  color: #B45309 !important;
}
html:not([data-theme="dark"]) body .app-shell .info-chip.info-chip--urgency-low,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell)[data-role="boss"] .info-chip.info-chip--urgency-low,
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell)[data-role="assistant"] .info-chip.info-chip--urgency-low {
  background: rgba(100, 116, 139, 0.08) !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  color: #475569 !important;
}

html[data-theme="dark"] body .app-shell .info-chip.info-chip--urgency-high,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .info-chip.info-chip--urgency-high,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="assistant"] .info-chip.info-chip--urgency-high,
html[data-theme="dark"] body .app-shell.mobile-shell .info-chip.info-chip--urgency-high {
  background: rgba(127, 29, 29, 0.55) !important;
  border: 1px solid rgba(248, 113, 113, 0.45) !important;
  color: #FECACA !important;
  -webkit-text-fill-color: #FECACA !important;
}
html[data-theme="dark"] body .app-shell .info-chip.info-chip--urgency-medium,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .info-chip.info-chip--urgency-medium,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="assistant"] .info-chip.info-chip--urgency-medium,
html[data-theme="dark"] body .app-shell.mobile-shell .info-chip.info-chip--urgency-medium {
  background: rgba(120, 53, 15, 0.55) !important;
  border: 1px solid rgba(251, 191, 36, 0.45) !important;
  color: #FDE68A !important;
  -webkit-text-fill-color: #FDE68A !important;
}
html[data-theme="dark"] body .app-shell .info-chip.info-chip--urgency-low,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .info-chip.info-chip--urgency-low,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="assistant"] .info-chip.info-chip--urgency-low,
html[data-theme="dark"] body .app-shell.mobile-shell .info-chip.info-chip--urgency-low {
  background: rgba(51, 65, 85, 0.55) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  color: #E2E8F0 !important;
  -webkit-text-fill-color: #E2E8F0 !important;
}

/* —— FAB 星座：桌面隐藏常驻 Cmd+K 按钮（键盘仍可用）；反馈贴边更克制 —— */
@media (min-width: 768px) {
  :where(.xq-cmdk-fab) {
    display: none !important;
  }
}
html body #__feedback-widget-fab {
  opacity: 0.42 !important;
  width: 28px !important;
  height: 40px !important;
  box-shadow: none !important;
  filter: saturate(0.85);
}
html body #__feedback-widget-fab:hover,
html body #__feedback-widget-fab.is-expanded {
  opacity: 0.96 !important;
  filter: none;
}
html body #__feedback-widget-fab:not(.is-expanded)::before {
  opacity: 0.35 !important;
  background: rgba(255, 255, 255, 0.55) !important; /* kill repeating-stripes */
}
/* 新手启航：别压在 hero 上抢视线 */
html body .onboarding-checklist-fab,
html body .new-user-checklist {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10) !important;
}
html body .onb-resume-fab {
  animation: none !important;
  opacity: 0.72 !important;
}
html body .checklist-focus-target {
  animation: none !important;
  outline-width: 2px !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14) !important;
}

/* —— 登录：协议未勾时明确 disabled，并给提示 —— */
html[data-theme] body .auth-shot-submit.is-pending-agreement,
html[data-theme] body .auth-shot-submit.is-pending-agreement:hover {
  opacity: 1 !important;
  filter: none !important;
  cursor: not-allowed !important;
  background: color-mix(in srgb, var(--brand, #1e40af) 28%, #94a3b8) !important;
  color: rgba(255, 255, 255, 0.78) !important;
  box-shadow: none !important;
}
html[data-theme] body .auth-shot-panel:has(.auth-shot-submit.is-pending-agreement) .auth-shot-agreement {
  position: relative;
}
html[data-theme] body .auth-shot-panel:has(.auth-shot-submit.is-pending-agreement) .auth-shot-agreement::after {
  content: "请先勾选同意协议";
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--warning, #f59e0b);
  font-weight: 600;
}

/* —— 卡片 elevation 分层：canvas / raised / overlay —— */
html body .app-shell .page-header {
  box-shadow: none !important;
  border-color: transparent !important;
  background: transparent !important;
}
html body .app-shell .sidebar-section,
html body .app-shell .mailbox-summary-item {
  box-shadow: none !important;
}
html body .app-shell .event-card,
html body .app-shell .todo-card,
html body .app-shell .command-card {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 8px 18px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="dark"] body .app-shell .event-card,
html[data-theme="dark"] body .app-shell .todo-card,
html[data-theme="dark"] body .app-shell .command-card {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 22px rgba(0, 0, 0, 0.22) !important;
}

/* focus eyebrow 不再 uppercase 喊话 */
html body .app-shell .focus-eyebrow {
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  font-weight: 700 !important;
}

/* 2026-07-13 follow-up: kill leftover left rails on empty/command panels */
html body .app-shell .assistant-block .sidebar-empty-state,
html body .app-shell .assistant-subsection-mailbox .sidebar-empty-state,
html body .app-shell .empty-state,
html body .app-shell .command-list + .empty-state,
html body .app-shell .boss-command-aggregate .empty-state,
html body .app-shell .panel .empty-state {
  border-left: 0 !important;
}
html body .app-shell .assistant-block [class*="empty"]::before,
html body .app-shell .sidebar-empty-state::before {
  content: none !important;
  display: none !important;
  width: 0 !important;
}
/* override residual border-left accent rails outside event cards */
html body .app-shell .todo-card,
html body .app-shell .pending-card,
html body .app-shell .risk-card,
html body .app-shell .command-card,
html body .app-shell .mailbox-preview-card {
  border-left-width: 1px !important;
  border-left-color: var(--line, #e2e8f0) !important;
}

/* ============================================================================
 * 2026-07-13 StyleKit pass 2 — GitHub light / Linear dark / Stripe primary
 * ============================================================================ */

/* 启动器：去掉装饰光斑，走边框 surface */
:where(.xq-quiet-launcher) {
  border-radius: var(--radius-lg, 12px) !important;
  box-shadow: none !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--line) !important;
}
:where(.xq-quiet-launcher)::after { display: none !important; }
:where(html[data-theme="dark"]) :where(.xq-quiet-launcher) {
  background: var(--bg-card) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

/* 页面与壳：干净 canvas */
html body,
html body .app-shell {
  background: var(--bg-page) !important;
  color: var(--text-main);
}

/* 侧栏/顶栏：surface-1，无大阴影 */
html body .app-shell .side-nav,
html body .app-shell .assistant-workflow-nav {
  background: var(--bg-panel) !important;
  box-shadow: none !important;
}
/* 暗色侧栏：对齐 page-header 表面色（slate-900 #111827），避免比顶栏更黑 */
html[data-theme="dark"] body .app-shell .side-nav,
html[data-theme="dark"] body .app-shell .assistant-workflow-nav {
  background: rgba(17, 24, 39, 0.96) !important;
  border-right-color: rgba(148, 163, 184, 0.12) !important;
}
html body .app-shell .top-bar,
html body .app-shell .page-header {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}
html[data-theme="dark"] body .app-shell .page-header {
  background: rgba(17, 24, 39, 0.92) !important;
  border-bottom-color: rgba(148, 163, 184, 0.12) !important;
}

/* 主内容卡：surface 分层 */
html body .app-shell .panel,
html body .app-shell .assistant-block,
html body .app-shell .ai-chat-shell,
html body .app-shell .assistant-ai-panel,
html body .app-shell .mailbox-card,
html body .app-shell .digest-card {
  border-radius: var(--radius-lg, 12px) !important;
  box-shadow: none !important;
  border: 1px solid var(--line) !important;
  background: var(--bg-card) !important;
}

/* 列表卡更扁更密 */
html body .app-shell .event-card,
html body .app-shell .todo-card,
html body .app-shell .command-card,
html body .app-shell .pending-card {
  border-radius: var(--radius-md, 10px) !important;
  box-shadow: none !important;
  border: 1px solid var(--line) !important;
}
html body .app-shell .event-card:hover,
html body .app-shell .todo-card:hover,
html body .app-shell .command-card:hover {
  transform: none !important;
  border-color: var(--line-strong) !important;
  box-shadow: none !important;
}

/* 暗色 active nav：Linear 软高亮 + 左边锚 */
html[data-theme="dark"] body .side-nav .nav-item.active,
html[data-theme="dark"] body .assistant-workflow-nav .nav-item.active,
html[data-theme="dark"] body .workflow-nav-item.active {
  background: rgba(37, 99, 235, 0.14) !important;
  color: #c7d2fe !important;
  box-shadow: inset 3px 0 0 var(--brand) !important;
  border-color: transparent !important;
}
html[data-theme="dark"] body .side-nav .nav-item:not(.active):hover,
html[data-theme="dark"] body .assistant-workflow-nav .nav-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-main) !important;
}

/* chip：中性灰，不抢品牌紫 */
html body .app-shell .info-chip,
html body .app-shell .assistant-chip,
html body .app-shell .filter-chip,
html body .app-shell .quick-chip:not(.primary) {
  background: var(--bg-soft) !important;
  color: var(--text-sub) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}

/* ghost 次按钮：扁平 */
html body .app-shell .ghost-button,
html body .app-shell button.ghost-button {
  background: transparent !important;
  color: var(--text-main) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  border-radius: var(--radius-md, 10px) !important;
}
html body .app-shell .ghost-button:hover {
  background: var(--bg-soft) !important;
  transform: none !important;
}

/* Stripe primary 统一（覆盖遗留 gradient） */
html body .app-shell .action-button:not(.secondary):not(.ghost-button),
html body .app-shell .btn-primary,
html body .app-shell button.action-button.primary,
html body .app-shell .assistant-home-reference-action.primary {
  background: var(--brand) !important;
  color: var(--brand-on, #fff) !important;
  border: 1px solid color-mix(in srgb, var(--brand-strong, #1e3a8a) 65%, #000) !important;
  border-radius: var(--radius-md, 10px) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 0 rgba(27, 31, 36, 0.04),
    0 6px 14px color-mix(in srgb, var(--brand) 22%, transparent) !important;
}
html body .app-shell .action-button:not(.secondary):not(.ghost-button):hover,
html body .app-shell .btn-primary:hover {
  background: var(--brand-strong, #1e3a8a) !important;
  transform: translateY(-1px);
}
html body .app-shell .action-button:not(.secondary):not(.ghost-button):active,
html body .app-shell .btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.22) !important;
}

/* 弹层才有 elevation */
html body .app-shell .modal-card,
html body .app-shell .app-modal,
html body .app-shell .nav-settings-menu,
html body .app-shell .shortcut-overlay .shortcut-panel,
html body .flatpickr-calendar {
  box-shadow: var(--shadow-panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg, 12px) !important;
}

/* 设置页 hero：收敛营销感 */
html body .app-shell .settings-v3-wrapper .sv3-hero,
html body .app-shell .settings-v3-wrapper .sv3-section {
  border-radius: var(--radius-lg, 12px) !important;
  box-shadow: none !important;
}

/* 输入框 GitHub 化 */
html body .app-shell input:not([type="checkbox"]):not([type="radio"]),
html body .app-shell textarea,
html body .app-shell select {
  border-color: var(--line) !important;
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-sm, 8px) !important;
}
html body .app-shell input:focus,
html body .app-shell textarea:focus,
html body .app-shell select:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent) !important;
  outline: none !important;
}

/* 反馈 FAB：中性，不抢品牌 */
html body #__feedback-widget-fab {
  background: linear-gradient(135deg, #64748b, #475569) !important;
  box-shadow: none !important;
  opacity: 0.38 !important;
}
html body #__feedback-widget-fab.is-expanded,
html body #__feedback-widget-fab:hover {
  opacity: 0.92 !important;
  background: #475569 !important;
}

/* 移动底栏：干净 */
html body .app-shell.mobile-shell .mobile-nav,
html body .app-shell.mobile-shell .mobile-tabbar {
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent) !important;
  border-top: 1px solid var(--line) !important;
  box-shadow: none !important;
  backdrop-filter: blur(10px);
}

/* 减少装饰性上浮 */
@media (hover: hover) {
  html body .app-shell .stat-card:hover,
  html body .app-shell .panel:hover {
    transform: none !important;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html body .app-shell .action-button:hover,
  html body .app-shell .btn-primary:hover {
    transform: none !important;
  }
}

/* StyleKit pass2b: kill purple capsule nav (beats v5-theme v4-U rules) */
html body .app-shell:not(.mobile-shell) .side-nav .nav-item.active,
html body .app-shell:not(.mobile-shell) .assistant-workflow-nav .nav-item.active,
html body .app-shell:not(.mobile-shell) .workflow-nav-item.active {
  background: var(--brand-soft, #eff6ff) !important;
  color: var(--brand-strong, #1e3a8a) !important;
  border-color: transparent !important;
  font-weight: 600 !important;
  box-shadow: inset 3px 0 0 var(--brand, #1e40af) !important;
}
html body .app-shell:not(.mobile-shell) .side-nav .nav-item.active,
html body .app-shell:not(.mobile-shell) .side-nav .nav-item.active *,
html body .app-shell:not(.mobile-shell) .assistant-workflow-nav .nav-item.active,
html body .app-shell:not(.mobile-shell) .assistant-workflow-nav .nav-item.active * {
  color: var(--brand-strong, #1e3a8a) !important;
}
html body .app-shell:not(.mobile-shell) .side-nav .nav-item.active .nav-icon,
html body .app-shell:not(.mobile-shell) .side-nav .nav-item.active svg {
  color: var(--brand-strong, #1e3a8a) !important;
  stroke: var(--brand-strong, #1e3a8a) !important;
}
html body .app-shell:not(.mobile-shell) .side-nav .nav-item.active::before {
  display: none !important;
  content: none !important;
}
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .side-nav .nav-item.active,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .assistant-workflow-nav .nav-item.active,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .workflow-nav-item.active {
  background: rgba(37, 99, 235, 0.14) !important;
  color: #c7d2fe !important;
  box-shadow: inset 3px 0 0 var(--brand, #2563eb) !important;
}
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .side-nav .nav-item.active,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .side-nav .nav-item.active * {
  color: #c7d2fe !important;
}
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .side-nav .nav-item.active .nav-icon,
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .side-nav .nav-item.active svg {
  color: #c7d2fe !important;
  stroke: #c7d2fe !important;
}

/* 2026-07-13: hide legacy injected back bar on settings/guide */
#xq-back-btn,
.xq-back-btn { display: none !important; }

/* ──────────────────────────────────────────────────────────────
   待安排卡片重做 v2（2026-07-17）
   去掉：CSS 1/2/3 序号圆、左侧空勾选圆、堆叠过多标签
   结构：右上轻量勾选 · 标题/精简标签 | 主操作 · 时间/来源 · 状态 chip · 备注
   ────────────────────────────────────────────────────────────── */

/* 杀掉 v5 的 counter 数字徽章 + 强制左 padding */
html body .app-shell .pending-list,
html body .app-shell:not(.mobile-shell) .pending-list {
  counter-reset: none !important;
}
html body .app-shell .pending-card,
html body .app-shell:not(.mobile-shell) .pending-card,
html[data-theme="dark"] body .app-shell .pending-card,
html:not([data-theme="dark"]) body .app-shell .pending-card {
  counter-increment: none !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  position: relative !important;
  overflow: visible !important;
}
html body .app-shell .pending-card::before,
html body .app-shell:not(.mobile-shell) .pending-card::before,
html[data-theme="dark"] body .app-shell .pending-card::before,
html:not([data-theme="dark"]) body .app-shell .pending-card::before {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  border: none !important;
  background: none !important;
}
/* 左侧细 urgency 色条（替代大序号） */
html body .app-shell .pending-card::after,
html body .app-shell:not(.mobile-shell) .pending-card::after,
html[data-theme="dark"] body .app-shell .pending-card::after,
html:not([data-theme="dark"]) body .app-shell .pending-card::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  top: 12px !important;
  bottom: 12px !important;
  width: 3px !important;
  border-radius: 0 3px 3px 0 !important;
  background: rgba(148, 163, 184, 0.45) !important;
  z-index: 0 !important;
}
html body .app-shell .pending-card[data-urgency="high"]::after,
html body .app-shell .pending-card[data-urgency="urgent"]::after {
  background: linear-gradient(180deg, #f87171, #ef4444) !important;
}
html body .app-shell .pending-card[data-urgency="mid"]::after,
html body .app-shell .pending-card[data-urgency="medium"]::after {
  background: linear-gradient(180deg, #fbbf24, #f59e0b) !important;
}
html body .app-shell .pending-card[data-urgency="low"]::after {
  background: linear-gradient(180deg, #60a5fa, #3b82f6) !important;
}

html body .app-shell .pending-card,
html body .app-shell:not(.mobile-shell) .pending-card {
  display: block !important;
  text-align: left !important;
  border-radius: 14px !important;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.18)) !important;
  background: var(--bg-card, #0f172a) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: border-color 0.16s ease, background 0.16s ease !important;
}
html body .app-shell .pending-card:hover,
html body .app-shell:not(.mobile-shell) .pending-card:hover {
  transform: none !important;
  border-color: color-mix(in srgb, var(--brand, #2563eb) 35%, var(--line, rgba(148,163,184,0.2))) !important;
  box-shadow: none !important;
}
html body .app-shell .pending-card.active {
  border-color: color-mix(in srgb, var(--brand, #2563eb) 55%, transparent) !important;
  background: color-mix(in srgb, var(--brand, #2563eb) 7%, var(--bg-card, #0f172a)) !important;
}
/* 2026-07-27：选中信号不再有勾号承载，整卡高亮需要更明确 ——
   加粗品牌色边框 + 柔和外发光，浅/深色下都能一眼看出选没选。
   特异性必须与上面 :not(.mobile-shell) 的卡体基线规则对齐，否则
   border/box-shadow 会被那条基线（border:1px var(--line); box-shadow:none）盖掉。
   同时必须带 :hover / :hover:not(:active) 变体：v5-theme 里有一条
   `.event-card:hover:not(:active), .pending-card:hover:not(:active)` 的
   !important 规则，鼠标停在已选卡上时会把选中色吃回成 rgba(99,102,241,0.22)。 */
html body .app-shell .pending-card.is-bulk-selected,
html body .app-shell:not(.mobile-shell) .pending-card.is-bulk-selected,
html body .app-shell .pending-card.is-bulk-selected:hover,
html body .app-shell:not(.mobile-shell) .pending-card.is-bulk-selected:hover,
html body .app-shell:not(.mobile-shell) .pending-card.is-bulk-selected:hover:not(:active),
html:not([data-theme="dark"]) body .app-shell:not(.mobile-shell) .pending-card.is-bulk-selected:hover:not(:active) {
  border-color: var(--brand, #2563eb) !important;
  background: color-mix(in srgb, var(--brand, #2563eb) 22%, var(--bg-card, #0f172a)) !important;
  /* 2px 实心外环（用 ring 而非 border-width，避免改变盒模型导致卡片跳动）
     + 更实的落影，让"选中"在一屏多卡时一眼可辨。
     左侧 ::after 色条不动 —— 它承载紧急度语义（红高/黄中/蓝低），改成品牌色会丢信息。 */
  box-shadow: 0 0 0 2px var(--brand, #2563eb),
              0 4px 16px color-mix(in srgb, var(--brand, #2563eb) 38%, transparent) !important;
}

/* 2026-07-27：待安排卡取消右上勾选方框，改为"点整张卡即选中"，
   选中态完全由整卡高亮表达（底色 + 边框 + 左侧强调条）。
   下面这条只保留给可能残留的旧结构兜底：一律隐藏，不再占位。 */
html body .app-shell .pending-card .pending-bulk-check {
  display: none !important;
}

/* 主内容区 */
html body .app-shell .pending-card .pending-card-main {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-width: 0 !important;
  /* 2026-07-27：右上勾选方框已移除，收回原本给它预留的 28px 空隙 */
}
html body .app-shell .pending-card .pending-card-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 14px !important;
  width: 100% !important;
}
html body .app-shell .pending-card .pending-card-heading {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
html body .app-shell .pending-card .pending-card-title {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.015em !important;
  color: var(--text-main, #e5e7eb) !important;
}
html body .app-shell .pending-card .pending-card-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
}
html body .app-shell .pending-card .pending-tag {
  display: inline-flex !important;
  align-items: center !important;
  height: 22px !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  border: 1px solid #CBD5E1 !important;
  background: #F1F5F9 !important;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  opacity: 1 !important;
}
html body .app-shell .pending-card .pending-tag.is-muted {
  opacity: 1 !important;
  font-weight: 600 !important;
  background: #F8FAFC !important;
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  border-color: #E2E8F0 !important;
}
/* 浅色：语义色用深字（原先全局用暗色 pastel 字 → 浅底发虚发光） */
html body .app-shell .pending-card .pending-tag.urgency-high,
html body .app-shell .pending-card .pending-tag.urgency-urgent {
  background: #FEF2F2 !important;
  border-color: #FECACA !important;
  color: #B91C1C !important;
  -webkit-text-fill-color: #B91C1C !important;
}
html body .app-shell .pending-card .pending-tag.urgency-mid,
html body .app-shell .pending-card .pending-tag.urgency-medium {
  background: #FFF7ED !important;
  border-color: #FDBA74 !important;
  color: #9A3412 !important;
  -webkit-text-fill-color: #9A3412 !important;
}
html body .app-shell .pending-card .pending-tag.urgency-low {
  background: #EFF6FF !important;
  border-color: #BFDBFE !important;
  color: #1D4ED8 !important;
  -webkit-text-fill-color: #1D4ED8 !important;
}
/* 暗色：恢复 pastel 高亮字 */
html[data-theme="dark"] body .app-shell .pending-card .pending-tag {
  border-color: rgba(148, 163, 184, 0.28) !important;
  background: rgba(148, 163, 184, 0.10) !important;
  color: #CBD5E1 !important;
  -webkit-text-fill-color: #CBD5E1 !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-tag.is-muted {
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-tag.urgency-high,
html[data-theme="dark"] body .app-shell .pending-card .pending-tag.urgency-urgent {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(239, 68, 68, 0.38) !important;
  color: #FCA5A5 !important;
  -webkit-text-fill-color: #FCA5A5 !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-tag.urgency-mid,
html[data-theme="dark"] body .app-shell .pending-card .pending-tag.urgency-medium {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.38) !important;
  color: #FCD34D !important;
  -webkit-text-fill-color: #FCD34D !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-tag.urgency-low {
  background: rgba(59, 130, 246, 0.16) !important;
  border-color: rgba(59, 130, 246, 0.36) !important;
  color: #93C5FD !important;
  -webkit-text-fill-color: #93C5FD !important;
}

html body .app-shell .pending-card .pending-card-actions {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  gap: 8px !important;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}
html body .app-shell .pending-card .pending-schedule-btn,
html body .app-shell .pending-card [data-action="open-event-from-pending"],
html body .app-shell .pending-card-actions .pending-schedule-btn {
  min-height: 32px !important;
  height: 32px !important;
  min-width: 0 !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  font-size: 12.5px !important;
  font-weight: 650 !important;
  white-space: nowrap !important;
  background: #2563eb !important;
  color: #fff !important;
  border: 1px solid #1e40af !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  opacity: 1 !important;
}
html body .app-shell .pending-card .pending-schedule-btn:hover {
  background: #1e40af !important;
}
html body .app-shell .pending-card .pending-schedule-btn.is-disabled,
html body .app-shell .pending-card [data-action="open-event-from-pending"].is-disabled,
html body .app-shell .pending-card [data-action="open-event-from-pending"][aria-disabled="true"] {
  background: rgba(148, 163, 184, 0.1) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: var(--text-soft, #94a3b8) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

html body .app-shell .pending-card .pending-card-meta-line {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 12.5px !important;
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  line-height: 1.4 !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-card-meta-line {
  color: #CBD5E1 !important;
  -webkit-text-fill-color: #CBD5E1 !important;
}
html body .app-shell .pending-card .pending-card-meta-line > span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  color: inherit !important;
  font-size: inherit !important;
}
html body .app-shell .pending-card .pending-dot {
  width: 3px !important;
  height: 3px !important;
  border-radius: 50% !important;
  background: rgba(148, 163, 184, 0.45) !important;
  display: inline-block !important;
}

html body .app-shell .pending-card .pending-card-status-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
}
html body .app-shell .pending-card .pending-status-chip {
  display: inline-flex !important;
  align-items: center !important;
  height: 22px !important;
  padding: 0 9px !important;
  border-radius: 8px !important;
  font-size: 11.5px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  border: 1px solid transparent !important;
}
html body .app-shell .pending-card .pending-status-chip.is-missing {
  background: #FFF7ED !important;
  border-color: #FDBA74 !important;
  color: #9A3412 !important;
  -webkit-text-fill-color: #9A3412 !important;
}
html body .app-shell .pending-card .pending-status-chip.is-ok {
  background: #ECFDF5 !important;
  border-color: #6EE7B7 !important;
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-status-chip.is-missing {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.38) !important;
  color: #FCD34D !important;
  -webkit-text-fill-color: #FCD34D !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-status-chip.is-ok {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(16, 185, 129, 0.36) !important;
  color: #6EE7B7 !important;
  -webkit-text-fill-color: #6EE7B7 !important;
}
html body .app-shell .pending-card .pending-card-footnote {
  margin: 0 !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-card-footnote {
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
}
}

/* 旧结构兜底（若某处仍渲染 bulk-select-pill / 旧 header） */
html body .app-shell .pending-card .bulk-select-pill {
  display: none !important;
}

/* 列表卡行内图标：强制 stroke 线标可见（防 fill 实心 / 同色 / 0 尺寸） */
html body .app-shell .ui-glyph,
html body .app-shell svg.ui-glyph {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
  min-height: 13px !important;
  flex: 0 0 13px !important;
  display: inline-block !important;
  vertical-align: -2px;
  opacity: 1 !important;
  color: inherit !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  overflow: visible !important;
  pointer-events: none !important;
}
html body .app-shell .ui-glyph *,
html body .app-shell svg.ui-glyph * {
  fill: none !important;
  stroke: currentColor !important;
  color: inherit !important;
  opacity: 1 !important;
  vector-effect: non-scaling-stroke;
}
/* 少数实心点（tag 圆点等）需要保留 fill */
html body .app-shell .ui-glyph circle[r="1.5"],
html body .app-shell .ui-glyph circle[r="1"],
html body .app-shell svg.ui-glyph circle[r="1.5"],
html body .app-shell svg.ui-glyph circle[r="1"] {
  fill: currentColor !important;
  stroke: none !important;
}
html body .app-shell .ui-badge-with-icon,
html body .app-shell .ui-meta-line {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  color: inherit !important;
}
/* 压过 v5 `.pending-card span { color: ink-2 }`，让徽章自身色驱动图标 */
html body .app-shell:not(.mobile-shell) .pending-card .ui-badge-with-icon,
html body .app-shell .pending-card .ui-badge-with-icon {
  color: var(--v4-ink-2, var(--text-sub, #94a3b8)) !important;
}
html body .app-shell:not(.mobile-shell) .pending-card .risk-pill.ui-badge-with-icon,
html body .app-shell .pending-card .risk-pill.ui-badge-with-icon {
  /* risk-pill 自己有 high/medium/low 色，图标跟文字走 */
  color: inherit !important;
}
html body .app-shell:not(.mobile-shell) .pending-card .ui-badge-with-icon.is-missing,
html body .app-shell .pending-card .ui-badge-with-icon.is-missing {
  color: #9A3412 !important;
  -webkit-text-fill-color: #9A3412 !important;
  border-color: #FDBA74 !important;
  background: #FFF7ED !important;
}
html body .app-shell:not(.mobile-shell) .pending-card .ui-badge-with-icon.is-ok,
html body .app-shell .pending-card .ui-badge-with-icon.is-ok {
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
}
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .pending-card .ui-badge-with-icon.is-missing,
html[data-theme="dark"] body .app-shell .pending-card .ui-badge-with-icon.is-missing {
  color: #FCD34D !important;
  -webkit-text-fill-color: #FCD34D !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  background: rgba(245, 158, 11, 0.12) !important;
}
html[data-theme="dark"] body .app-shell:not(.mobile-shell) .pending-card .ui-badge-with-icon.is-ok,
html[data-theme="dark"] body .app-shell .pending-card .ui-badge-with-icon.is-ok {
  color: #6EE7B7 !important;
  -webkit-text-fill-color: #6EE7B7 !important;
}
html body .app-shell .pending-card-caption.ui-meta-line {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: var(--text-sub, #94a3b8) !important;
}
/* 排入日历 / 补全信息 按钮内图标跟文字同色 */
html body .app-shell .pending-schedule-btn .ui-glyph,
html body .app-shell .pending-schedule-btn svg.ui-glyph,
html body .app-shell .pending-card-actions .ui-glyph,
html body .app-shell .pro-card-actions .ui-glyph,
html body .app-shell .action-button .ui-glyph,
html body .app-shell .ghost-button .ui-glyph {
  color: inherit !important;
  stroke: currentColor !important;
  fill: none !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  flex: 0 0 14px !important;
}
html body .app-shell .pending-schedule-btn .ui-glyph *,
html body .app-shell .pro-card-actions .ui-glyph *,
html body .app-shell .action-button .ui-glyph *,
html body .app-shell .ghost-button .ui-glyph * {
  fill: none !important;
  stroke: currentColor !important;
}
html body .app-shell .event-comment-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}
/* mobile pro 卡 meta 行图标 */
html body .app-shell .mobile-pending-card-pro .ui-glyph,
html body .app-shell .mobile-pending-card-pro svg.ui-glyph {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
  color: inherit !important;
  stroke: currentColor !important;
  fill: none !important;
}

/* ──────────────────────────────────────────────────────────────
   任务交办页 P0+P1（2026-07-17）
   本页输入发送 + 筛选 chips + 催办/撤回
   2026-08-27 排版修复（用户截图实锤）：删掉 max-width:1100px + margin:0 auto。
   宽屏（1920）下这两条把双栏挤在页面中间，两侧各留 ~300px 死空间，
   和同类双栏页完全不一致 —— pending-layout / todo-layout（base.css:11443 /
   9672）都是撑满内容区的。本规则的原始注释就写着"对齐 pending-layout"，
   删掉上限才是对齐。
   ────────────────────────────────────────────────────────────── */
html body .app-shell .boss-commands-page {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: stretch;
  padding: 8px 4px 32px;
  box-sizing: border-box;
}

/* 左右两栏开成 flex column 撑满，左右 panel 底部对齐（对齐 pending-layout 会议双栏） */
html body .app-shell .boss-commands-page .boss-commands-compose-col,
html body .app-shell .boss-commands-page .boss-commands-list-col {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-width: 0;
}
html body .app-shell .boss-commands-page .panel-body {
  flex: 1 1 auto;
}

/* 移动端回到上下堆叠（对齐 pending-layout / todo-layout 的 mobile 折叠） */
@media (max-width: 768px) {
  html body .app-shell .boss-commands-page {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
/* 指令概览统计行：对齐会议系统 stat-card 的蓝紫渐变卡片语言（紧凑版） */
html body .app-shell .boss-cmd-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
html body .app-shell .boss-cmd-stat {
  position: relative;
  min-height: 84px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(30, 64, 175, 0.24);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.92));
  color: #fff;
  box-shadow: 0 16px 40px rgba(30, 64, 175, 0.14);
  display: grid;
  gap: 4px;
  align-content: start;
  overflow: hidden;
}
html body .app-shell .boss-cmd-stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(147, 197, 253, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%);
  pointer-events: none;
}
html body .app-shell .boss-cmd-stat strong {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
html body .app-shell .boss-cmd-stat span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
@media (max-width: 768px) {
  html body .app-shell .boss-cmd-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 两栏 panel-header 等高，保证左右 panel-body 起始 Y 对齐（复用 todo-layout 策略） */
html body .app-shell:not(.mobile-shell) .boss-commands-page > .panel > .panel-header {
  min-height: 96px;
  align-items: flex-start;
}
html body .app-shell:not(.mobile-shell) .boss-commands-page > .panel > .panel-header > .panel-title {
  flex: 1 1 auto;
  min-width: 0;
}
html body .app-shell:not(.mobile-shell) .boss-commands-page > .panel > .panel-header > .panel-title > p {
  max-width: 100%;
  line-height: 1.4;
}

html body .app-shell .boss-cmd-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.22));
  background: var(--bg-soft, rgba(255, 255, 255, 0.03));
}
html body .app-shell .boss-cmd-composer-field textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.28));
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg-card, #0f172a);
  color: var(--text-main);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  box-sizing: border-box;
}
html body .app-shell .boss-cmd-composer-field textarea:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #2563eb) 22%, transparent);
}
html body .app-shell .boss-cmd-composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
html body .app-shell .boss-cmd-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
html body .app-shell .boss-cmd-template {
  border-radius: 999px !important;
  font-size: 12.5px !important;
  padding: 6px 12px !important;
}
html body .app-shell .boss-cmd-send {
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 650;
}
html body .app-shell .boss-cmd-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
html body .app-shell .boss-cmd-filter .filter-count {
  margin-left: 4px;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
html body .app-shell .boss-cmd-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
html body .app-shell .command-card-actions-boss {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 10px !important;
}
@media (max-width: 768px) {
  html body .app-shell .boss-cmd-composer-bar {
    flex-direction: column;
    align-items: stretch;
  }
  html body .app-shell .boss-cmd-send {
    width: 100%;
  }
}

/* ──────────────────────────────────────────────────────────────
   2026-08-13 一致性治理：三个双栏布局（todo / pending / inbox）
   统一列宽为 1fr/1fr + gap 18px，消除切页时的骨架跳变。
   原定义分散在 base.css 9788/9936/11571 及 desktop 覆盖 30937/30974。
   ────────────────────────────────────────────────────────────── */
html body .app-shell:not(.mobile-shell) :is(.todo-layout, .pending-layout, .inbox-reference-layout) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 20px !important;
}

/* pending 详情面板（右栏 form）padding 与 todo 详情对齐（原 12px 压太紧） */
html body .app-shell:not(.mobile-shell)[data-role="assistant"] .pending-layout > section.panel:nth-child(2) .panel-header {
  padding: 18px 20px 12px !important;
}
html body .app-shell:not(.mobile-shell)[data-role="assistant"] .pending-layout > section.panel:nth-child(2) .panel-body {
  padding: 16px 20px 18px !important;
}


/* ──────────────────────────────────────────────────────────────
   2026-07-19 审计落地：浮层协调 + 热区
   ────────────────────────────────────────────────────────────── */
html body:has(.onb-checklist-panel) #__feedback-widget-fab,
html body:has(.onb-checklist-panel) .xq-help-fab,
html body:has(.xqj-spot-overlay.is-active) #__feedback-widget-fab,
html body:has(.xqj-spot-overlay.is-active) .xq-help-fab,
html body:has(#__feedback-widget-modal) .xqj-checklist-chip,
html body:has(#__feedback-widget-modal) .onb-checklist-panel,
html body:has(.modal-backdrop:not([hidden])) #__feedback-widget-fab,
html body:has(.global-search-overlay.is-open) #__feedback-widget-fab {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
html body .xqj-checklist-chip .xqj-checklist-chip__close,
html body .onb-close-btn {
  min-width: 44px !important;
  min-height: 44px !important;
  width: 44px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ══════════════════════════════════════════════════════════════════
   2026-07-19 theme-fit audit fixes (light/dark 适配)
   ══════════════════════════════════════════════════════════════════ */

/* 次级文案：浅色对比度抬到 ≥4.5 友好 */
html[data-theme="light"] body .app-shell .xqj-status-message,
html[data-theme="light"] body .app-shell .assistant-chat-empty-text,
html[data-theme="light"] body .app-shell .detail-subnote,
html[data-theme="light"] body .app-shell .empty-state-action,
html[data-theme="light"] body .app-shell .page-header p,
html[data-theme="light"] body .app-shell .panel-header p,
html[data-theme="light"] body .app-shell .mobile-nav-label,
html[data-theme="light"] body .app-shell .mobile-nav-item {
  color: #475569 !important;
}

/* 暗色次级文案：不要掉到 slate-400 以下 */
html[data-theme="dark"] body .app-shell .xqj-status-message,
html[data-theme="dark"] body .app-shell .assistant-chat-empty-text,
html[data-theme="dark"] body .app-shell .detail-subnote,
html[data-theme="dark"] body .app-shell .empty-state-action,
html[data-theme="dark"] body .app-shell .page-header p,
html[data-theme="dark"] body .app-shell .panel-header p {
  color: #cbd5e1 !important;
}

/* 页头图标：去掉硬编码紫蓝，走 brand */
html body .app-shell .assistant-homepage-reference-icon,
html body .app-shell .assistant-route-reference-icon-symbol,
html body .app-shell .boss-overview-header-icon,
html body .app-shell .boss-settings-header-icon,
html body .app-shell .boss-pending-header-icon,
html body .app-shell .boss-guide-header-icon,
html body .app-shell [class*="header-icon"],
html body .app-shell [class*="reference-icon"] {
  color: var(--brand, #1e40af) !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}
html[data-theme="dark"] body .app-shell .assistant-homepage-reference-icon,
html[data-theme="dark"] body .app-shell .assistant-route-reference-icon-symbol,
html[data-theme="dark"] body .app-shell [class*="header-icon"],
html[data-theme="dark"] body .app-shell [class*="reference-icon"] {
  color: var(--brand-2, #60a5fa) !important;
}

/* 设置页：角色徽章 / 分区图标 / 通知图标 — 暗色可读 */
html body .app-shell .settings-v3-wrapper .sv3-role-badge {
  background: var(--brand-soft, #eff6ff) !important;
  color: var(--brand-strong, #1e3a8a) !important;
  border-color: color-mix(in srgb, var(--brand, #1e40af) 28%, var(--line, #e5e7eb)) !important;
}
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-role-badge {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #93c5fd !important;
  border-color: rgba(96, 165, 250, 0.35) !important;
}
html body .app-shell .settings-v3-wrapper .sv3-section-head-icon,
html body .app-shell .settings-v3-wrapper .sv3-notif-icon {
  color: var(--brand, #1e40af) !important;
  background: var(--brand-soft, #eff6ff) !important;
}
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-section-head-icon,
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-notif-icon {
  color: #93c5fd !important;
  background: rgba(37, 99, 235, 0.16) !important;
}
/* 退出图标在暗色保持危险红但提亮 */
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-logout-icon {
  color: #fca5a5 !important;
}

/* 教程跳转按钮：去紫，用 brand */
html body .app-shell .tut-jump {
  background: color-mix(in srgb, var(--brand, #1e40af) 12%, transparent) !important;
  color: var(--brand, #1e40af) !important;
  border-color: color-mix(in srgb, var(--brand, #1e40af) 28%, transparent) !important;
}
html body .app-shell .tut-jump:hover {
  background: color-mix(in srgb, var(--brand, #1e40af) 18%, transparent) !important;
}
html[data-theme="dark"] body .app-shell .tut-jump {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #93c5fd !important;
  border-color: rgba(96, 165, 250, 0.32) !important;
}
html body .app-shell .tut-card h3,
html body .app-shell .tut-title-block h3 {
  color: var(--text-main) !important;
}
html body .app-shell .tut-num,
html body .app-shell .tut-bullets li strong {
  color: var(--brand, #1e40af) !important;
}
html[data-theme="dark"] body .app-shell .tut-num,
html[data-theme="dark"] body .app-shell .tut-bullets li strong {
  color: #93c5fd !important;
}

/* 移动底栏：暗色标签对比 */
html[data-theme="dark"] body .app-shell.mobile-shell .mobile-nav-label,
html[data-theme="dark"] body .app-shell.mobile-shell .mobile-nav-item {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] body .app-shell.mobile-shell .mobile-nav-item.active,
html[data-theme="dark"] body .app-shell.mobile-shell .mobile-nav-item.active .mobile-nav-label {
  color: #93c5fd !important;
}
html[data-theme="light"] body .app-shell.mobile-shell .mobile-nav-item.active,
html[data-theme="light"] body .app-shell.mobile-shell .mobile-nav-item.active .mobile-nav-label {
  color: var(--brand, #1e40af) !important;
}

/* 中心 FAB 图标在品牌底上必须白 */
html body .app-shell .mobile-nav-center-fab,
html body .app-shell .mobile-nav-center-action {
  color: #fff !important;
}
html body .app-shell .mobile-nav-center-fab *,
html body .app-shell .mobile-nav-center-action * {
  color: #fff !important;
  stroke: #fff !important;
  fill: none !important;
}

/* 浅色页禁用/幽灵按钮：不要白字 */
html[data-theme="light"] body .app-shell button:disabled,
html[data-theme="light"] body .app-shell .action-button:disabled,
html[data-theme="light"] body .app-shell .ghost-button:disabled {
  color: #64748b !important;
}

/* 设置页 slider 轨道在浅色要可见 */
html[data-theme="light"] body .app-shell .settings-v3-wrapper .sv3-slider {
  background: #cbd5e1 !important;
}
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-slider {
  background: #475569 !important;
}

/* 暗色下输入框：避免纯黑吸入 */
html[data-theme="dark"] body .app-shell input,
html[data-theme="dark"] body .app-shell textarea,
html[data-theme="dark"] body .app-shell select {
  background-color: var(--bg-soft, #1f2937) !important;
  color: var(--text-main, #f8fafc) !important;
  border-color: var(--line, #334155) !important;
}
html[data-theme="dark"] body .app-shell input::placeholder,
html[data-theme="dark"] body .app-shell textarea::placeholder {
  color: #94a3b8 !important;
}

/* 登录页字段尾部/协议链接暗色对比 */
html[data-theme="dark"] body .auth-shot-field-tail,
html[data-theme="dark"] body .auth-shot-panel a {
  color: #93c5fd !important;
}
html[data-theme="light"] body .auth-shot-field-tail,
html[data-theme="light"] body .auth-shot-panel a {
  color: var(--brand, #1e40af) !important;
}

/* 登录禁用主按钮：浅色不要低对比灰底白字 */
html[data-theme="light"] body .auth-shot-submit.is-pending-agreement,
html[data-theme="light"] body .auth-shot-submit:disabled {
  background: #cbd5e1 !important;
  color: #475569 !important;
  border-color: #94a3b8 !important;
}
html[data-theme="dark"] body .auth-shot-submit.is-pending-agreement,
html[data-theme="dark"] body .auth-shot-submit:disabled {
  background: #334155 !important;
  color: #94a3b8 !important;
  border-color: #475569 !important;
}

/* ── theme-fit pass2: switch ON + mobile bottom nav ── */
html body .app-shell .settings-v3-wrapper .sv3-switch input:checked + .sv3-slider {
  background: var(--brand, #1e40af) !important;
}
html body .app-shell .settings-v3-wrapper .sv3-switch input:checked + .sv3-slider::before {
  background: #fff !important;
}
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-switch input:checked + .sv3-slider {
  background: #2563eb !important;
}
html[data-theme="light"] body .app-shell .settings-v3-wrapper .sv3-slider {
  background-color: #cbd5e1 !important;
}
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-slider {
  background-color: #475569 !important;
}

/* mobile bottom nav must stay dark surfaces under dark theme */
html[data-theme="dark"] body > #app > .mobile-bottom-nav,
html[data-theme="dark"] .app-shell.mobile-shell .mobile-bottom-nav {
  background: rgba(17, 24, 39, 0.97) !important;
  border-top: 1px solid #334155 !important;
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] body > #app > .mobile-bottom-nav .mobile-nav-item,
html[data-theme="dark"] body > #app > .mobile-bottom-nav .mobile-nav-label,
html[data-theme="dark"] body > #app > .mobile-bottom-nav .mobile-nav-item-main {
  color: #cbd5e1 !important;
  background: transparent !important;
}
html[data-theme="dark"] body > #app > .mobile-bottom-nav .mobile-nav-item.active,
html[data-theme="dark"] body > #app > .mobile-bottom-nav .mobile-nav-item.active .mobile-nav-label,
html[data-theme="dark"] body > #app > .mobile-bottom-nav .mobile-nav-item.active .mobile-nav-item-main {
  color: #93c5fd !important;
}
html[data-theme="dark"] body > #app > .mobile-bottom-nav .mobile-nav-item.active .mobile-nav-icon {
  background: #2563eb !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35) !important;
}
html[data-theme="dark"] body > #app > .mobile-bottom-nav .mobile-nav-item:not(.active) .mobile-nav-icon {
  background: transparent !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}
html[data-theme="light"] body > #app > .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top: 1px solid #e5e7eb !important;
}
html[data-theme="light"] body > #app > .mobile-bottom-nav .mobile-nav-item.active,
html[data-theme="light"] body > #app > .mobile-bottom-nav .mobile-nav-item.active .mobile-nav-label {
  color: #1e40af !important;
}
html[data-theme="light"] body > #app > .mobile-bottom-nav .mobile-nav-item.active .mobile-nav-icon {
  background: #1e40af !important;
  color: #fff !important;
}

/* page header icons: use stroke brand, avoid bg=color collision false positive */
html body .app-shell [class*="reference-icon"],
html body .app-shell [class*="header-icon"] {
  background: transparent !important;
  color: var(--brand, #1e40af) !important;
}
html[data-theme="dark"] body .app-shell [class*="reference-icon"],
html[data-theme="dark"] body .app-shell [class*="header-icon"] {
  color: #60a5fa !important;
}

/* settings notif icon: soft brand surface, not solid brand fill */
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-notif-icon,
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-section-head-icon {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #93c5fd !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
}
html[data-theme="light"] body .app-shell .settings-v3-wrapper .sv3-notif-icon,
html[data-theme="light"] body .app-shell .settings-v3-wrapper .sv3-section-head-icon {
  background: #eff6ff !important;
  color: #1e40af !important;
  border-color: #bfdbfe !important;
}
html[data-theme="dark"] body .app-shell .settings-v3-wrapper .sv3-role-badge {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #dbeafe !important;
  border-color: rgba(96, 165, 250, 0.35) !important;
}

/* ══════════════════════════════════════════════════════════════════
   2026-07-19 screenshot defects: meta / primary CTA / empty mascot / timeline
   ══════════════════════════════════════════════════════════════════ */

/* 1) 详情 meta 行：标题/时间/地点 — 浅色深字、暗色亮字，禁止灰在灰上 */
html body .app-shell .detail-drawer .detail-meta-item,
html body .app-shell .event-detail-modal-card .detail-meta-item,
html body .app-shell .detail-drawer .detail-meta-item strong,
html body .app-shell .event-detail-modal-card .detail-meta-item strong {
  color: var(--text-main, #111827) !important;
}
html body .app-shell .detail-drawer .detail-meta-item > span,
html body .app-shell .event-detail-modal-card .detail-meta-item > span,
html body .app-shell .detail-drawer .detail-meta-item .meta-value,
html body .app-shell .event-detail-modal-card .detail-meta-item .meta-value {
  color: var(--text-sub, #475569) !important;
}
html[data-theme="dark"] body .app-shell .detail-drawer .detail-meta-item,
html[data-theme="dark"] body .app-shell .event-detail-modal-card .detail-meta-item,
html[data-theme="dark"] body .app-shell .detail-drawer .detail-meta-item strong,
html[data-theme="dark"] body .app-shell .event-detail-modal-card .detail-meta-item strong {
  color: #f1f5f9 !important;
}
html[data-theme="dark"] body .app-shell .detail-drawer .detail-meta-item > span,
html[data-theme="dark"] body .app-shell .event-detail-modal-card .detail-meta-item > span,
html[data-theme="dark"] body .app-shell .detail-drawer .detail-meta-item .meta-value,
html[data-theme="dark"] body .app-shell .event-detail-modal-card .detail-meta-item .meta-value {
  color: #cbd5e1 !important;
}
/* meta 图标跟文字同色阶 */
html body .app-shell .detail-meta-item svg,
html body .app-shell .detail-meta-item .ui-glyph,
html body .app-shell .detail-drawer .detail-meta-item svg {
  color: inherit !important;
  stroke: currentColor !important;
  opacity: 0.9 !important;
}
html[data-theme="dark"] body .app-shell .detail-meta-item svg,
html[data-theme="dark"] body .app-shell .detail-meta-item .ui-glyph {
  color: #e2e8f0 !important;
  stroke: currentColor !important;
  opacity: 1 !important;
}

/* pending meta 行同样 */
html body .app-shell .pending-card .pending-card-meta-line,
html body .app-shell .pending-card .pending-card-meta-line > span,
html body .app-shell .pending-card-caption.ui-meta-line {
  color: var(--text-sub, #475569) !important;
}
html[data-theme="dark"] body .app-shell .pending-card .pending-card-meta-line,
html[data-theme="dark"] body .app-shell .pending-card .pending-card-meta-line > span,
html[data-theme="dark"] body .app-shell .pending-card-caption.ui-meta-line {
  color: #cbd5e1 !important;
}

/* 2) 主按钮「排入日历」：字/图标必须纯白（覆盖任意继承灰） */
html body .app-shell .action-button:not(.secondary):not(.ghost-button):not(.is-annotate),
html body .app-shell button.action-button:not(.secondary):not(.ghost-button):not(.is-annotate),
html body .app-shell .pending-schedule-btn:not(.is-disabled),
html body .app-shell .pending-card [data-action="open-event-from-pending"]:not(.is-disabled):not([aria-disabled="true"]),
html body .app-shell .action-button:not(.secondary) .ui-glyph,
html body .app-shell .pending-schedule-btn:not(.is-disabled) .ui-glyph,
html body .app-shell .action-button:not(.secondary) svg,
html body .app-shell .pending-schedule-btn:not(.is-disabled) svg {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  fill: none !important;
  stroke: currentColor !important;
}
html body .app-shell .action-button:not(.secondary):not(.ghost-button):not(.is-annotate) *,
html body .app-shell .pending-schedule-btn:not(.is-disabled) * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  stroke: currentColor !important;
}
/* secondary 恢复品牌字色 */
html body .app-shell button.action-button.secondary,
html body .app-shell button.action-button.secondary * {
  color: var(--v4-brand-fg, var(--brand, #1e40af)) !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-theme="dark"] body .app-shell button.action-button.secondary,
html[data-theme="dark"] body .app-shell button.action-button.secondary * {
  color: var(--v4-brand-fg, #93c5fd) !important;
  -webkit-text-fill-color: currentColor !important;
}

/* 3) 空状态：紫吉祥物在暗色降饱和 + 文案对比 */
html[data-theme="dark"] body .app-shell .inbox-empty-v5-mascot,
html[data-theme="dark"] body .app-shell .empty-state img,
html[data-theme="dark"] body .app-shell .sidebar-empty-state img,
html[data-theme="dark"] body .app-shell [class*="mascot"],
html[data-theme="dark"] body .app-shell [class*="empty"] img {
  filter: saturate(0.55) brightness(0.92) drop-shadow(0 12px 24px rgba(0,0,0,0.4)) !important;
}
html[data-theme="dark"] body .app-shell .empty-state,
html[data-theme="dark"] body .app-shell .empty-state.enhanced .empty-state-title,
html[data-theme="dark"] body .app-shell .inbox-empty-title {
  color: #f1f5f9 !important;
}
html[data-theme="dark"] body .app-shell .empty-state p,
html[data-theme="dark"] body .app-shell .empty-state.enhanced .empty-state-desc,
html[data-theme="dark"] body .app-shell .inbox-empty-desc {
  color: #cbd5e1 !important;
}
/* 空状态图标若是 CSS 紫色块，收成 brand 软底 */
html[data-theme="dark"] body .app-shell .empty-state.enhanced .empty-state-icon {
  background: rgba(37, 99, 235, 0.14) !important;
  color: #93c5fd !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
}

/* 4) 今日重点时间轨标签 — 必须盖过 v5 的 :not(.mobile-shell)[data-role] 特异性
   浅色：深蓝字 + 白描边（原先 #bfdbfe 在浅蓝条上几乎看不见）
   暗色：纯白字 + 深描边 */
html body .app-shell:not(.mobile-shell)[data-role] .v5-dynamic-timeline .v5-timeline-active-label,
html body .app-shell .v5-dynamic-timeline .v5-timeline-active-label,
html:not([data-theme="dark"]) body .app-shell .v5-dynamic-timeline .v5-timeline-active-label {
  fill: #1e3a8a !important;
  paint-order: stroke fill !important;
  stroke: rgba(255, 255, 255, 0.95) !important;
  stroke-width: 2.8px !important;
  stroke-linejoin: round !important;
  font-weight: 700 !important;
}
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role] .v5-dynamic-timeline .v5-timeline-active-label,
html[data-theme="dark"] body .app-shell .v5-dynamic-timeline .v5-timeline-active-label {
  fill: #ffffff !important;
  stroke: rgba(15, 23, 42, 0.75) !important;
  stroke-width: 2.8px !important;
}
html body .app-shell:not(.mobile-shell)[data-role] .v5-dynamic-timeline .v5-timeline-event-hatch,
html body .app-shell .v5-dynamic-timeline .v5-timeline-event-hatch {
  opacity: 0.4 !important;
}
html body .app-shell:not(.mobile-shell)[data-role] .v5-dynamic-timeline .v5-timeline-event.is-active,
html body .app-shell .v5-dynamic-timeline .v5-timeline-event.is-active {
  stroke: #1e40af !important;
}
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role] .v5-dynamic-timeline .v5-timeline-event.is-active {
  stroke: #60a5fa !important;
}

/* ══════════════════════════════════════════════════════════════════
   2026-07-19 老板「确认事项池」chip 对比：字色必须贴色块语义
   浅色截图：待确认偏桃浅、待安排会议灰字贴浅灰底 → 几乎糊掉
   ══════════════════════════════════════════════════════════════════ */
html body .app-shell .boss-confirm-status.status-pill,
html body .app-shell .boss-confirm-status.status-pill.pending,
html body .app-shell .decision-card .boss-confirm-status,
html body .app-shell:not(.mobile-shell)[data-role="boss"] .layout-boss > .assistant-panel .boss-confirm-status {
  background: #FFF7ED !important;
  color: #9A3412 !important;
  border: 1px solid #FDBA74 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #9A3412 !important;
  font-weight: 700 !important;
}
html body .app-shell .boss-confirm-type.pill-muted,
html body .app-shell .boss-confirm-type,
html body .app-shell .decision-card .boss-confirm-type,
html body .app-shell:not(.mobile-shell)[data-role="boss"] .layout-boss > .assistant-panel .boss-confirm-type {
  background: #F1F5F9 !important;
  color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #334155 !important;
  font-weight: 600 !important;
}
/* 暗色：同样保证色块与字对齐、可辨 */
html[data-theme="dark"] body .app-shell .boss-confirm-status.status-pill,
html[data-theme="dark"] body .app-shell .boss-confirm-status.status-pill.pending,
html[data-theme="dark"] body .app-shell .decision-card .boss-confirm-status,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .layout-boss > .assistant-panel .boss-confirm-status {
  background: rgba(251, 191, 36, 0.16) !important;
  color: #FCD34D !important;
  border: 1px solid rgba(251, 191, 36, 0.38) !important;
  -webkit-text-fill-color: #FCD34D !important;
}
html[data-theme="dark"] body .app-shell .boss-confirm-type.pill-muted,
html[data-theme="dark"] body .app-shell .boss-confirm-type,
html[data-theme="dark"] body .app-shell .decision-card .boss-confirm-type,
html[data-theme="dark"] body .app-shell:not(.mobile-shell)[data-role="boss"] .layout-boss > .assistant-panel .boss-confirm-type {
  background: rgba(148, 163, 184, 0.14) !important;
  color: #E2E8F0 !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  -webkit-text-fill-color: #E2E8F0 !important;
}
/* 主按钮去掉残留紫渐变 */
html body .app-shell .boss-confirm-primary,
html body .app-shell:not(.mobile-shell)[data-role="boss"] .layout-boss > .assistant-panel .boss-confirm-primary {
  background: #1e40af !important;
  border: 1px solid #1e3a8a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   2026-07-19 FULL SWEEP: light-mode semantic chip / badge / pill text
   Rule: light theme NEVER uses pastel text on pastel bg.
         light = deep semantic ink; dark = pastel highlight (existing).
   Scope: risk-pill / status-pill / badge / pending-tag / status-chip /
          urgency / pill-muted / event-comment / priority chips
   ══════════════════════════════════════════════════════════════════════════ */

/* ---- light: risk-pill ---- */
html:not([data-theme="dark"]) body .app-shell .risk-pill.high,
html:not([data-theme="dark"]) body .app-shell .risk-pill.urgency-high,
html:not([data-theme="dark"]) body .app-shell .risk-pill.urgent {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
  -webkit-text-fill-color: #B91C1C !important;
  border: 1px solid #FECACA !important;
  opacity: 1 !important;
}
html:not([data-theme="dark"]) body .app-shell .risk-pill.medium,
html:not([data-theme="dark"]) body .app-shell .risk-pill.mid,
html:not([data-theme="dark"]) body .app-shell .risk-pill.urgency-medium,
html:not([data-theme="dark"]) body .app-shell .risk-pill.urgency-mid {
  background: #FFF7ED !important;
  color: #9A3412 !important;
  -webkit-text-fill-color: #9A3412 !important;
  border: 1px solid #FDBA74 !important;
  opacity: 1 !important;
}
html:not([data-theme="dark"]) body .app-shell .risk-pill.low,
html:not([data-theme="dark"]) body .app-shell .risk-pill.urgency-low {
  background: #F1F5F9 !important;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
  opacity: 1 !important;
}

/* ---- light: status-pill ---- */
html:not([data-theme="dark"]) body .app-shell .status-pill.pending,
html:not([data-theme="dark"]) body .app-shell .status-pill.todo,
html:not([data-theme="dark"]) body .app-shell .status-pill.progress,
html:not([data-theme="dark"]) body .app-shell .status-pill.in-progress {
  opacity: 1 !important;
}
html:not([data-theme="dark"]) body .app-shell .status-pill.pending,
html:not([data-theme="dark"]) body .app-shell .status-pill.todo {
  background: #FFF7ED !important;
  color: #9A3412 !important;
  -webkit-text-fill-color: #9A3412 !important;
  border: 1px solid #FDBA74 !important;
}
html:not([data-theme="dark"]) body .app-shell .status-pill.progress,
html:not([data-theme="dark"]) body .app-shell .status-pill.in-progress {
  background: #EFF6FF !important;
  color: #1D4ED8 !important;
  -webkit-text-fill-color: #1D4ED8 !important;
  border: 1px solid #BFDBFE !important;
}
html:not([data-theme="dark"]) body .app-shell .status-pill.done,
html:not([data-theme="dark"]) body .app-shell .status-pill.completed,
html:not([data-theme="dark"]) body .app-shell .status-pill.success {
  background: #ECFDF5 !important;
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
  border: 1px solid #6EE7B7 !important;
}
html:not([data-theme="dark"]) body .app-shell .status-pill.delayed,
html:not([data-theme="dark"]) body .app-shell .status-pill.overdue,
html:not([data-theme="dark"]) body .app-shell .status-pill.danger {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
  -webkit-text-fill-color: #B91C1C !important;
  border: 1px solid #FECACA !important;
}

/* ---- light: badge / status-chip / priority ---- */
html:not([data-theme="dark"]) body .app-shell .badge.urgency-high,
html:not([data-theme="dark"]) body .app-shell .badge.priority-high,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-danger,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-priority-high,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-need-confirm {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
  -webkit-text-fill-color: #B91C1C !important;
  border-color: #FECACA !important;
}
html:not([data-theme="dark"]) body .app-shell .badge.urgency-medium,
html:not([data-theme="dark"]) body .app-shell .badge.urgency-mid,
html:not([data-theme="dark"]) body .app-shell .badge.priority-mid,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-warn,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-pending,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-pending-fill {
  background: #FFF7ED !important;
  color: #9A3412 !important;
  -webkit-text-fill-color: #9A3412 !important;
  border-color: #FDBA74 !important;
}
html:not([data-theme="dark"]) body .app-shell .badge.urgency-low,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-info,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-processing,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-pending-approval {
  background: #EFF6FF !important;
  color: #1D4ED8 !important;
  -webkit-text-fill-color: #1D4ED8 !important;
  border-color: #BFDBFE !important;
}
html:not([data-theme="dark"]) body .app-shell .status-chip.status-ok,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-approved,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-synced,
html:not([data-theme="dark"]) body .app-shell .status-chip.status-done {
  background: #ECFDF5 !important;
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
  border-color: #6EE7B7 !important;
}

/* ---- light: pill-muted generic (类型标签) ---- */
html:not([data-theme="dark"]) body .app-shell .pill-muted {
  background: #F1F5F9 !important;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
  opacity: 1 !important;
}

/* ---- light: kill pastel text that leaks outside dark blocks ---- */
html:not([data-theme="dark"]) body .app-shell .pending-tag,
html:not([data-theme="dark"]) body .app-shell .pending-status-chip,
html:not([data-theme="dark"]) body .app-shell .ui-badge-with-icon,
html:not([data-theme="dark"]) body .app-shell .status-pill,
html:not([data-theme="dark"]) body .app-shell .risk-pill,
html:not([data-theme="dark"]) body .app-shell .status-chip,
html:not([data-theme="dark"]) body .app-shell .badge:not(.priority-p1):not(.priority-P1):not(.priority-p2):not(.priority-P2) {
  text-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
}

/* 浅色禁止 pastel 字色（若仍被高优先规则设成这些，直接压回深色语义） */
html:not([data-theme="dark"]) body .app-shell [class*="pill"],
html:not([data-theme="dark"]) body .app-shell [class*="chip"],
html:not([data-theme="dark"]) body .app-shell [class*="badge"],
html:not([data-theme="dark"]) body .app-shell [class*="tag"] {
  /* no global color override — too broad; handled per class above */
}

/* 浅色下若某规则仍写了 pastel 字，用属性选择器兜不住；
   直接再压一层常见 pastel color 的同组件类（已在上面） */

/* ---- light: event-comment-chip default ---- */
html:not([data-theme="dark"]) body .app-shell .event-comment-chip {
  color: #1e40af !important;
  -webkit-text-fill-color: #1e40af !important;
  border-color: #1e40af !important;
  background: #ffffff !important;
  opacity: 1 !important;
}

/* ---- light: onboarding leftovers ---- */
html:not([data-theme="dark"]) body .onb-gif-summary { color: #1e40af !important; }
html:not([data-theme="dark"]) body .onb-btn-cta { color: #1e40af !important; }
html:not([data-theme="dark"]) body .onb-btn-cta-danger { color: #b91c1c !important; }
html[data-theme="dark"] body .onb-gif-summary { color: #93c5fd !important; }
html[data-theme="dark"] body .onb-btn-cta { color: #93c5fd !important; }
html[data-theme="dark"] body .onb-btn-cta-danger { color: #fca5a5 !important; }

/* ---- light: meta / soft text on cards (readable slate, not ghost) ---- */
html:not([data-theme="dark"]) body .app-shell .pending-card .pending-card-meta-line,
html:not([data-theme="dark"]) body .app-shell .pending-card .pending-card-footnote,
html:not([data-theme="dark"]) body .app-shell .todo-card .todo-meta,
html:not([data-theme="dark"]) body .app-shell .command-card .command-card-meta,
html:not([data-theme="dark"]) body .app-shell .event-card .event-meta,
html:not([data-theme="dark"]) body .app-shell .detail-subnote,
html:not([data-theme="dark"]) body .app-shell .xqj-status-message {
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* ---- light: priority solid badges keep white text on solid bg ---- */
html:not([data-theme="dark"]) body .app-shell .badge.priority-p1,
html:not([data-theme="dark"]) body .app-shell .badge.priority-P1,
html:not([data-theme="dark"]) body .app-shell .badge.priority-p0,
html:not([data-theme="dark"]) body .app-shell .badge.priority-P0 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}