/* ══ 近黑主题（data-theme=manus）══
   2026-10-23:底色用 85% 黑的灰。255 的 15% 是 38，即 #262626。
   卡片再浅一档，字用浅色。
   只在本主题生效。不改侧栏宽度、不改顶栏的 fixed 位置。 */

html[data-theme="manus"] {
  color-scheme: dark;
  --memo-stroke: #f0f2f4;        /* 深底描边，比纯白收一点 */
  --bg: #262626;                 /* 主画布，85% 黑 */
  --surface: #323232;            /* 卡片，比底浅一档 */
  --surface-2: #3a3a3a;          /* 悬停、选中、输入 */
  --surface-3: #424242;
  --text: #f4f4f5;
  --text-2: #d4d4d4;
  --text-3: #c0c0c0;             /* 压在 #323232 上仍过 4.5:1 */
  --accent: #f4f4f5;             /* 主操作是白，不是蓝紫 */
  --accent-hover: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.10);
  --border: #444444;
  --border-strong: #505050;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);
  --green: #3ddc97;
  --green-soft: rgba(61, 220, 151, 0.16);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, 0.16);
  --amber: #f5b942;
  --amber-soft: rgba(245, 185, 66, 0.16);
  --amber-strong: #f5b942;
  --purple: #f4f4f5;
  --purple-soft: rgba(255, 255, 255, 0.10);
  --neutral: #c8c8c8;
  --neutral-soft: #323232;
  --orange: #f5b942;
  --orange-soft: rgba(245, 185, 66, 0.16);
  --sky: #f4f4f5;
  --sky-soft: rgba(255, 255, 255, 0.10);
  --bd-done-bg: rgba(61, 220, 151, 0.18);
  --bd-done-fg: #d8ffe9;
  --bd-done-bd: #2f8f66;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --font: Inter, -apple-system, BlinkMacSystemFont, 'PingFang SC',
          'HarmonyOS Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 15px;
  --fs-xl: 17px;
  --fs-2xl: 20px;
  --fs-3xl: 26px;
  --fs-4xl: 34px;
}

html[data-theme="manus"] body {
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

html[data-theme="manus"] ::-webkit-scrollbar-thumb { background: #404040; }
html[data-theme="manus"] ::-webkit-scrollbar-thumb:hover { background: #505050; }

/* 侧栏比画布略抬一层，选中项再浅一档，不画色条 */
html[data-theme="manus"] .sidebar {
  background: #2c2c2c;
  border-right: 1px solid var(--border);
  box-shadow: none;
}
html[data-theme="manus"] .sidebar-brand { background: transparent; }
html[data-theme="manus"] .sidebar-brand .brand-logo-mini { filter: brightness(2.6); }
html[data-theme="manus"] .sidebar-brand .brand-row .icon { color: var(--text); }
html[data-theme="manus"] .sb-quad-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: none;
  color: var(--text);
}
html[data-theme="manus"] .project-item {
  background: transparent;
  border-color: transparent;
  border-radius: 12px;
  color: var(--text-2);
}
html[data-theme="manus"] .project-item:hover {
  background: var(--surface-2);
  border-color: transparent;
}
html[data-theme="manus"] .project-item.active {
  background: #424242;
  border-color: transparent;
  box-shadow: none;
  color: var(--text);
}

/* 主按钮是白底黑字。带紫色内联底的按钮同样改成黑字，避免白字贴在白底上。 */
html[data-theme="manus"] .btn-add,
html[data-theme="manus"] .btn-primary,
html[data-theme="manus"] button.primary,
html[data-theme="manus"] .brand-qbtn.primary,
html[data-theme="manus"] .ent-btn-primary,
html[data-theme="manus"] .eff-quick-btn.primary,
html[data-theme="manus"] .ja-btn.primary,
html[data-theme="manus"] .wc-enter {
  background: #f4f4f5;
  color: #141414;
  border-color: #f4f4f5;
  border-radius: 999px;
  box-shadow: none;
}
html[data-theme="manus"] .btn-add:hover,
html[data-theme="manus"] .btn-primary:hover,
html[data-theme="manus"] button.primary:hover,
html[data-theme="manus"] .brand-qbtn.primary:hover,
html[data-theme="manus"] .ent-btn-primary:hover,
html[data-theme="manus"] .eff-quick-btn.primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #141414;
  box-shadow: none;
  transform: none;
}
html[data-theme="manus"] .btn-add.added {
  background: var(--green);
  border-color: var(--green);
  color: #10281c;
}
html[data-theme="manus"] :is(
  .kpi-controls-inline .seg button.active,
  .kpi-controls .seg button.active,
  .direct-seg-btn.active,
  .snap-seg-btn.active,
  .dept-all-btn.active,
  .inv-tab.active,
  .inv-view-switch button.active,
  .li-mode-btn.active,
  .li-act-btn:hover,
  .annex-btn-dl,
  .jd-back-btn:hover,
  .seg-btn.active,
  .kpi-detail-btn:hover
) {
  background: #f4f4f5;
  color: #141414;
  border-color: #f4f4f5;
}
html[data-theme="manus"] .seg-btn.active:hover,
html[data-theme="manus"] .annex-btn-dl:hover { color: #141414; background: #ffffff; }
html[data-theme="manus"] .jd-box {
  outline-color: var(--border-strong);
  box-shadow: none;
}
html[data-theme="manus"] [style*="background:var(--purple)"],
html[data-theme="manus"] [style*="background: var(--purple)"] {
  color: #141414 !important;
}
html[data-theme="manus"] .btn-ghost,
html[data-theme="manus"] .btn-secondary {
  background: transparent;
  border-radius: 999px;
  border-color: var(--border-strong);
  color: var(--text);
}
html[data-theme="manus"] .btn-ghost:hover,
html[data-theme="manus"] .btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--text);
  color: var(--text);
}

/* 顶栏胶囊落在深灰上 */
html[data-theme="manus"] #efficiencyBanner,
html[data-theme="manus"] #langSwitch,
html[data-theme="manus"] #themeToggle,
html[data-theme="manus"] #dbBadge,
html[data-theme="manus"] #chatLauncher {
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}
html[data-theme="manus"] #askInput {
  border-radius: 16px !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none;
  min-height: 32px;
}
html[data-theme="manus"] #askBtn {
  border-radius: 999px !important;
  background: #f4f4f5 !important;
  color: #141414 !important;
  border-color: #f4f4f5 !important;
  box-shadow: none !important;
}

html[data-theme="manus"] .widget-box,
html[data-theme="manus"] .okr-card,
html[data-theme="manus"] .weekly-plan-card,
html[data-theme="manus"] .modal-content {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: none;
  border: 1px solid var(--border);
}
html[data-theme="manus"] .modal-header { padding: 18px 24px; background: transparent; }
html[data-theme="manus"] .modal-body { padding: 20px 24px; }
html[data-theme="manus"] .modal-header h2 { letter-spacing: -0.02em; font-weight: 600; color: var(--text); }

html[data-theme="manus"] input,
html[data-theme="manus"] textarea,
html[data-theme="manus"] select,
html[data-theme="manus"] .ipt {
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  border-color: var(--border-strong);
}

html[data-theme="manus"] .tab-btn.active,
html[data-theme="manus"] .group-btn.active {
  color: var(--text);
  border-bottom-color: #f4f4f5;
}

html[data-theme="manus"] #mainTopMask {
  background: var(--bg);
  border-bottom-color: transparent;
  box-shadow: none;
}

/* 近黑和任务台一样，用页顶对话框，不留原来那条固定提问框。 */
html[data-theme="manus"] #askBar { display: none !important; }
html[data-theme="manus"] #welcome { margin-top: 28px !important; }

html[data-theme="manus"] .studio-box {
  display: none;
  position: relative;
  width: auto;
  margin: 0 0 16px;
  max-height: 280px;
  flex-direction: column;
  background: #323232;
  border: 1px solid #444444;
  border-radius: 16px;
  box-shadow: none;
  overflow: hidden;
  color: #f4f4f5;
}
html[data-theme="manus"] .studio-box .st-title {
  padding: 10px 12px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f4f4f5;
}
html[data-theme="manus"] .studio-box .st-log {
  min-height: 72px;
  max-height: 160px;
  overflow: auto;
  padding: 12px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
html[data-theme="manus"] .studio-box .st-row { display: flex; width: 100%; min-width: 0; }
html[data-theme="manus"] .studio-box .st-you { justify-content: flex-end; }
html[data-theme="manus"] .studio-box .st-bubble {
  max-width: min(560px, 86%);
  padding: 7px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
html[data-theme="manus"] .studio-box .st-me .st-bubble { background: #3a3a3a; color: #f4f4f5; }
html[data-theme="manus"] .studio-box .st-you .st-bubble { background: #f4f4f5; color: #141414; }
html[data-theme="manus"] .studio-box .st-chips, html[data-theme="manus"] .studio-box .st-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}
html[data-theme="manus"] .studio-box .st-chip, html[data-theme="manus"] .studio-box .st-link {
  border: 1px solid #505050;
  background: #3a3a3a;
  color: #f4f4f5;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
html[data-theme="manus"] .studio-box .st-link { border-radius: 10px; }
html[data-theme="manus"] .studio-box .st-compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 8px 12px 10px;
}
html[data-theme="manus"] .studio-box .st-compose textarea {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  max-height: 72px;
  resize: none;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 14px;
  background: #3a3a3a;
  color: #f4f4f5;
  border: 1px solid #505050;
}
html[data-theme="manus"] .studio-box .st-card { line-height: 1.5; }
html[data-theme="manus"] .studio-box .st-card .st-acts { padding: 8px 0 0; }

/* 助手浮窗跟近黑同一阶：外框用卡片灰，内卡再浅一档，边线用主题灰，不用蓝灰。 */
html[data-theme="manus"] .studio-box.studio-float,
html[data-theme="manus"] .studio-box.studio-home-look.studio-float,
html[data-theme="manus"] #cleanHome .studio-box.studio-home-look {
  position: fixed;
  z-index: 40;
  top: 72px;
  left: 424px;
  width: min(760px, calc(100vw - 448px));
  max-height: calc(100vh - 96px);
  margin: 0;
  overflow: auto;
  background: #323232;
  border: 1px solid #505050;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: 10px 12px 12px;
  color: #f4f4f5;
}
html[data-theme="manus"] #cleanHome .studio-box.studio-home-look {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  max-height: none;
  display: flex;
  overflow: visible;
}
html[data-theme="manus"] .studio-box.studio-float .studio-home-card,
html[data-theme="manus"] .studio-box.studio-home-look.studio-float .studio-home-card,
html[data-theme="manus"] #cleanHome .studio-box.studio-home-look .studio-home-card {
  background: #3a3a3a;
  border-color: #505050;
}
html[data-theme="manus"] .studio-box.studio-float .studio-home-head,
html[data-theme="manus"] #cleanHome .studio-box.studio-home-look .studio-home-head { color: #f4f4f5; }
html[data-theme="manus"] .studio-box.studio-float .st-log,
html[data-theme="manus"] .studio-box.studio-home-look.studio-float .st-log,
html[data-theme="manus"] #cleanHome .studio-box.studio-home-look .st-log {
  min-height: 140px;
  max-height: 320px;
}
html[data-theme="manus"] .studio-box.studio-orb-win.studio-float {
  position: fixed;
  top: auto;
  left: auto;
  width: auto;
  max-height: none;
  z-index: 97000;
  overflow: hidden;
  padding: 0;
}
html[data-theme="manus"] .studio-box.studio-home-look.studio-float.studio-orb-win .st-log,
html[data-theme="manus"] .studio-box.studio-orb-win .st-log {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

/* 功能区页面跟近黑走：深灰底、浅色字、白底黑字的主操作。 */
html[data-theme="manus"] .main,
html[data-theme="manus"] .modal-body,
html[data-theme="manus"] .tab-content { background: var(--bg); color: var(--text); }
html[data-theme="manus"] .detail-section,
html[data-theme="manus"] .cand-item,
html[data-theme="manus"] .project-meta,
html[data-theme="manus"] .jd-box,
html[data-theme="manus"] .kpi-col-title,
html[data-theme="manus"] .kpi-hero-card,
html[data-theme="manus"] .kpi-month-card {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
html[data-theme="manus"] .modal-header h2,
html[data-theme="manus"] .widget-box h3,
html[data-theme="manus"] .project-meta h1,
html[data-theme="manus"] .kpi-col-title,
html[data-theme="manus"] .okr-card h3,
html[data-theme="manus"] .weekly-plan-card h3,
html[data-theme="manus"] td,
html[data-theme="manus"] .project-meta-rows .ml-vl,
html[data-theme="manus"] .cand-name { color: var(--text); }
html[data-theme="manus"] .project-meta .meta-client,
html[data-theme="manus"] .cand-meta,
html[data-theme="manus"] th { color: var(--text-3); }
html[data-theme="manus"] .tab-btn { color: var(--text-2); }
html[data-theme="manus"] .jd-box,
html[data-theme="manus"] .project-meta { outline-color: var(--border-strong); box-shadow: none; }
/* 主色在近黑里是白。写了白字的主按钮改成黑字，避免白字贴在白底上。 */
html[data-theme="manus"] [style*="background:var(--accent)"],
html[data-theme="manus"] [style*="background: var(--accent)"] { color: #141414 !important; }

/* 首页：对话框跟在标题下面。外框是卡片灰，内卡再浅一档。 */
html[data-theme="manus"] #cleanHome .studio-box.studio-home-look .studio-home-card {
  background: #3a3a3a;
  border-color: #505050;
}
