/**
 * 森语全站主题 token + 暗色覆盖
 * 与地图主题共用 html[data-theme="light"|"dark"]
 */

html[data-theme="dark"] {
  color-scheme: dark;

  /* 对齐 iOS Assets：primary / secondary / tertiary / hint */
  --color-text-primary: #fefefe;
  --color-text-secondary: #e0e0e0;
  --color-text-tertiary: rgba(255, 255, 255, 0.55);
  --color-text-hint: #b0b0b0;

  /* 对齐 iOS main / module 123 级（深蓝黑，不是系统灰） */
  --color-main-bg: #020914;
  --color-module: #151e28;
  --color-module-secondary: #0c1824;
  --color-module-tertiary: #08121c;
  --color-bg-primary: #151e28;
  --color-bg-secondary: #0c1824;
  --color-bg-tertiary: #08121c;

  /* iOS dark systemBlue */
  --color-accent: #0a84ff;
  --color-accent-hover: #409cff;
  --color-accent-light: rgba(10, 132, 255, 0.2);
  --color-tab-selected: rgba(10, 132, 255, 0.32);

  --color-success: #30d158;
  --color-warning: #ff9f0a;
  --color-error: #ff453a;
  --color-info: #0a84ff;

  --color-separator: rgba(255, 255, 255, 0.1);
  --color-border: rgba(255, 255, 255, 0.14);

  --sidebar-panel-bg: rgb(2, 9, 20);
  --sidebar-shadow: 4px 0 28px rgba(0, 0, 0, 0.55);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-card-bg: #151e28;
  --sidebar-card-border: rgba(255, 255, 255, 0.06);
  --sidebar-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --sidebar-avatar-grad: linear-gradient(145deg, #64d2ff 0%, #0a84ff 100%);

  --control-surface: rgba(21, 30, 40, 0.96);
  --control-surface-hover: rgba(28, 40, 54, 0.98);
  --control-border: rgba(255, 255, 255, 0.12);
  --control-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  --search-bar-bg: rgba(2, 9, 20, 0.96);
  --overlay-scrim: rgba(0, 0, 0, 0.55);
}

html[data-theme="light"] {
  color-scheme: light;
  --control-surface: rgba(255, 255, 255, 0.95);
  --control-surface-hover: #ffffff;
  --control-border: rgba(148, 163, 184, 0.35);
  --control-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  --search-bar-bg: #ffffff;
  --overlay-scrim: rgba(15, 23, 42, 0.4);
}

/* ——— 侧栏硬编码浅色覆盖 ——— */
html[data-theme="dark"] .woodsper-sidebar,
html[data-theme="dark"] .sidebar-detail-host,
html[data-theme="dark"] .woodsper-map-detail-layer {
  background: var(--sidebar-panel-bg);
  border-color: var(--sidebar-border);
  box-shadow: var(--sidebar-shadow);
  color: var(--color-text-primary);
}

html[data-theme="dark"] .sidebar-toggle {
  background: #151e28;
  color: var(--color-text-hint);
  border-color: var(--color-separator);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .sidebar-toggle:hover {
  background: #1c2836;
  color: var(--color-accent);
}

html[data-theme="dark"] .sidebar-tabs {
  background: #020914;
}

/* 暗色搜索栏：默认透明；侧栏展开 / 地图详情打开时再铺底（与亮色同逻辑，带动画） */
html[data-theme="dark"] .global-search-bar {
  background: transparent !important;
  border-color: transparent !important;
  transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

html[data-theme="dark"] .woodsper-sidebar:not(.collapsed) ~ .woodsper-search-layer .global-search-bar,
html[data-theme="dark"] .map-layout:has(.woodsper-map-detail-layer.is-open) .global-search-bar,
html[data-theme="dark"] .global-search-bar.is-expanded {
  background: var(--search-bar-bg) !important;
  border-color: var(--sidebar-border) !important;
}

html[data-theme="dark"] .search-collapse-btn {
  background: var(--search-bar-bg) !important;
  border-color: var(--sidebar-border) !important;
  color: var(--color-text-primary);
}

html[data-theme="dark"] .global-search-input {
  background: var(--color-module-secondary) !important;
  color: var(--color-text-primary) !important;
  border-color: var(--color-border) !important;
}

html[data-theme="dark"][data-view-mode="browse"] .global-search-bar,
html[data-theme="dark"][data-view-mode="browse"] .woodsper-sidebar:not(.collapsed) ~ .woodsper-search-layer .global-search-bar,
html[data-theme="dark"][data-view-mode="browse"] .map-layout:has(.woodsper-map-detail-layer.is-open) .global-search-bar,
html[data-theme="dark"][data-view-mode="browse"] .global-search-bar.is-expanded,
html[data-theme="dark"][data-view-mode="browse"] .global-search-input {
  background: transparent !important;
  border-color: var(--color-border, rgba(255, 255, 255, 0.18)) !important;
}

html[data-theme="dark"] .global-search-input::placeholder {
  color: var(--color-text-hint);
}

html[data-theme="dark"] .global-search-results,
html[data-theme="dark"] .search-results-content,
html[data-theme="dark"] .search-results-tabs {
  background: var(--color-main-bg) !important;
  border-color: var(--sidebar-border) !important;
  color: var(--color-text-primary);
}

html[data-theme="dark"] .sidebar-tabs {
  background: var(--color-main-bg) !important;
  border-color: var(--sidebar-border) !important;
}

html[data-theme="dark"] .sidebar-tab {
  color: var(--color-text-tertiary);
}

html[data-theme="dark"] .sidebar-tab:hover {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .sidebar-tab.active {
  color: var(--color-accent);
  background: var(--color-tab-selected);
}

html[data-theme="dark"] .spirit-item,
html[data-theme="dark"] .work-item,
html[data-theme="dark"] .plan-item,
html[data-theme="dark"] .atlas-item,
html[data-theme="dark"] .thing-item,
html[data-theme="dark"] .search-result-item {
  background: var(--color-module) !important;
  border-color: var(--sidebar-card-border) !important;
  color: var(--color-text-primary);
}

html[data-theme="dark"] .spirit-item:hover,
html[data-theme="dark"] .work-item:hover,
html[data-theme="dark"] .plan-item:hover,
html[data-theme="dark"] .atlas-item:hover,
html[data-theme="dark"] .thing-item:hover,
html[data-theme="dark"] .search-result-item:hover {
  background: #1c2a38 !important;
}

html[data-theme="dark"] .spirit-item *,
html[data-theme="dark"] .work-item *,
html[data-theme="dark"] .plan-item *,
html[data-theme="dark"] .atlas-item *,
html[data-theme="dark"] .thing-item *,
html[data-theme="dark"] .search-result-item *,
html[data-theme="dark"] .sidebar-empty,
html[data-theme="dark"] .sidebar-empty-state,
html[data-theme="dark"] .empty-state-title,
html[data-theme="dark"] .sidebar-loading,
html[data-theme="dark"] .sidebar-error,
html[data-theme="dark"] .search-empty {
  color: inherit;
}

html[data-theme="dark"] .spirit-name,
html[data-theme="dark"] .work-title,
html[data-theme="dark"] .plan-title,
html[data-theme="dark"] .atlas-title,
html[data-theme="dark"] .thing-title,
html[data-theme="dark"] .detail-title,
html[data-theme="dark"] .sidebar-detail-title,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .spirit-meta,
html[data-theme="dark"] .work-meta,
html[data-theme="dark"] .plan-meta,
html[data-theme="dark"] .atlas-meta,
html[data-theme="dark"] .thing-meta,
html[data-theme="dark"] .detail-meta,
html[data-theme="dark"] .empty-state-desc,
html[data-theme="dark"] .sidebar-subtitle {
  color: var(--color-text-tertiary) !important;
}

html[data-theme="dark"] .sidebar-page-nav,
html[data-theme="dark"] .sidebar-sheet-bar {
  background: var(--color-module) !important;
  border-color: var(--color-separator) !important;
  color: var(--color-text-primary);
}

html[data-theme="dark"] .sidebar-page-nav button,
html[data-theme="dark"] .detail-back,
html[data-theme="dark"] .sidebar-detail-close {
  color: var(--color-accent) !important;
  background: transparent;
}

html[data-theme="dark"] .sidebar-page-nav button:hover,
html[data-theme="dark"] .detail-back:hover,
html[data-theme="dark"] .sidebar-detail-close:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"] .sidebar-page-nav button:active,
html[data-theme="dark"] .detail-back:active,
html[data-theme="dark"] .sidebar-detail-close:active {
  background: rgba(255, 255, 255, 0.22) !important;
}

html[data-theme="dark"] .comment-item,
html[data-theme="dark"] .comments-section,
html[data-theme="dark"] .detail-section {
  border-color: var(--color-separator) !important;
  color: var(--color-text-primary);
}

/* ——— 资料 / 个人面板（index.html） ——— */
html[data-theme="dark"] .profile-panel,
html[data-theme="dark"] .profile-panel-pane--detail,
html[data-theme="dark"] .profile-panel-push-nav,
html[data-theme="dark"] .profile-panel-detail-scroll {
  background: var(--sidebar-panel-bg) !important;
  border-color: var(--sidebar-border) !important;
  color: var(--color-text-primary);
}

html[data-theme="dark"] .profile-panel-tabs {
  background: transparent !important;
  border-color: var(--color-separator) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .profile-panel-tab {
  color: var(--color-text-hint) !important;
  background: transparent !important;
}

html[data-theme="dark"] .profile-panel-tab.is-active {
  color: var(--color-accent) !important;
  background: transparent !important;
}

html[data-theme="dark"] .profile-panel-tab:hover {
  color: var(--color-text-secondary) !important;
  background: transparent !important;
}

html[data-theme="dark"] .profile-panel-tab::after {
  background: var(--color-accent) !important;
}

html[data-theme="dark"] .profile-panel-nickname,
html[data-theme="dark"] .profile-panel-push-title,
html[data-theme="dark"] .profile-name,
html[data-theme="dark"] .profile-panel-detail-scroll {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .profile-panel-intro,
html[data-theme="dark"] .profile-panel-story-body {
  color: var(--color-text-secondary) !important;
}

html[data-theme="dark"] .profile-panel-id-text,
html[data-theme="dark"] .profile-panel-id-copy,
html[data-theme="dark"] .profile-panel-story-label,
html[data-theme="dark"] .profile-panel-story-arrow,
html[data-theme="dark"] .profile-panel-story-key,
html[data-theme="dark"] .profile-panel-meta-foot,
html[data-theme="dark"] .profile-panel-empty,
html[data-theme="dark"] .goal-item-meta,
html[data-theme="dark"] .goal-item-progress-meta,
html[data-theme="dark"] .goal-item-progress--checklist {
  color: var(--color-text-hint) !important;
}

html[data-theme="dark"] .goal-group-title,
html[data-theme="dark"] .goal-item-title {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .goal-item-note {
  color: var(--color-text-secondary) !important;
}

html[data-theme="dark"] .goal-group-header:hover .goal-group-title {
  color: var(--color-accent) !important;
}

html[data-theme="dark"] .thing-item-thumb {
  background: var(--sidebar-avatar-grad) !important;
}

html[data-theme="dark"] .thing-item-title,
html[data-theme="dark"] .map-plan-item-title {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .thing-item-content,
html[data-theme="dark"] .map-plan-item-detail {
  color: var(--color-text-secondary) !important;
}

html[data-theme="dark"] .thing-item-category,
html[data-theme="dark"] .thing-item-cat-icon,
html[data-theme="dark"] .map-plan-item-time,
html[data-theme="dark"] .map-plan-item-location {
  color: var(--color-text-hint) !important;
}

html[data-theme="dark"] .profile-panel-push-back,
html[data-theme="dark"] .profile-panel-icon-btn {
  color: var(--color-accent) !important;
  background: transparent !important;
}

/* ——— 地图控件 ——— */
html[data-theme="dark"] .leaflet-control-zoom,
html[data-theme="dark"] .woodsper-locate-control,
html[data-theme="dark"] .woodsper-random-explore-control,
html[data-theme="dark"] .woodsper-map-theme-control,
html[data-theme="dark"] .woodsper-map-filter-control,
html[data-theme="dark"] .woodsper-map-settings-control {
  background: var(--control-surface) !important;
  border: 0 !important;
  box-shadow: var(--control-shadow) !important;
}

html[data-theme="dark"] .woodsper-map-filter-button,
html[data-theme="dark"] .woodsper-map-settings-button {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--color-accent) !important;
}

html[data-theme="dark"] .leaflet-control-zoom a,
html[data-theme="dark"] .woodsper-locate-button,
html[data-theme="dark"] .woodsper-random-explore-button,
html[data-theme="dark"] .woodsper-map-theme-button {
  color: var(--color-accent) !important;
  background: transparent !important;
}

html[data-theme="dark"] .leaflet-control-zoom a:hover,
html[data-theme="dark"] .woodsper-locate-button:hover,
html[data-theme="dark"] .woodsper-random-explore-button:hover,
html[data-theme="dark"] .woodsper-map-theme-button:hover,
html[data-theme="dark"] .woodsper-map-filter-button:hover,
html[data-theme="dark"] .woodsper-map-settings-button:hover {
  background: var(--color-accent-light) !important;
  color: var(--color-accent-hover) !important;
}

html[data-theme="dark"] .leaflet-control-zoom a:first-child {
  border-bottom-color: var(--color-separator) !important;
}

html[data-theme="dark"] .woodsper-top-actions .woodsper-view-mode-segment,
html[data-theme="dark"] .woodsper-view-mode-control .woodsper-view-mode-segment {
  background: var(--color-main-bg, #020914);
  border: 1px solid var(--control-border, rgba(255, 255, 255, 0.12));
  box-shadow: var(--control-shadow);
}

html[data-theme="dark"] .woodsper-top-actions .woodsper-view-mode-btn,
html[data-theme="dark"] .woodsper-view-mode-control .woodsper-view-mode-btn {
  color: #94a3b8;
}

html[data-theme="dark"] .woodsper-top-actions .woodsper-view-mode-btn:hover,
html[data-theme="dark"] .woodsper-view-mode-control .woodsper-view-mode-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}

html[data-theme="dark"] .woodsper-top-actions .woodsper-view-mode-btn.is-active,
html[data-theme="dark"] .woodsper-view-mode-control .woodsper-view-mode-btn.is-active {
  background: var(--color-module, #151e28);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  color: #0a84ff;
}

html[data-theme="dark"] .woodsper-browse-surface {
  background: var(--color-main-bg, #07111f);
}

html[data-theme="dark"] .browse-card,
html[data-theme="dark"] .browse-spirit-row {
  background: var(--color-module, #0f1a2b);
  box-shadow: none;
}

html[data-theme="dark"] .browse-card:hover,
html[data-theme="dark"] .browse-spirit-row:hover {
  background: #1c2a38;
}

html[data-theme="dark"] .browse-spirit-work:hover {
  filter: brightness(1.12);
}

html[data-theme="dark"] .browse-card-placeholder {
  background: linear-gradient(145deg, #122033, #0b1524);
  color: rgba(64, 156, 255, 0.45);
}

html[data-theme="dark"] .browse-filter-btn {
  background: transparent;
  color: var(--color-text-primary);
  box-shadow: none;
}

html[data-theme="dark"] .browse-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .browse-filter-btn.is-active {
  background: transparent;
  color: var(--color-accent);
}

html[data-theme="dark"] .browse-filter-btn.is-active:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-accent);
}

html[data-theme="dark"] .browse-tab.is-active {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

html[data-theme="dark"] .woodsper-map-filter-panel {
  background: var(--color-main-bg, #020914) !important;
  border: 1px solid var(--control-border) !important;
  color: var(--color-text-primary) !important;
  box-shadow: var(--control-shadow) !important;
}

html[data-theme="dark"] .woodsper-map-options-backdrop {
  background: rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .woodsper-map-filter-sheet .woodsper-map-options-close {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .woodsper-map-filter-sheet .woodsper-map-options-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--color-text-primary);
}

html[data-theme="dark"] .woodsper-map-options-chip {
  background: rgba(120, 120, 128, 0.28);
  border: 0;
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .woodsper-map-options-chip.is-active {
  background: var(--color-accent);
  border: 0;
  color: #fff;
}

html[data-theme="dark"] .woodsper-map-options-segment {
  background: rgba(120, 120, 128, 0.32);
}

html[data-theme="dark"] .woodsper-map-options-segment-thumb {
  background: var(--color-module, #151e28);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .woodsper-map-options-segment-btn {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .woodsper-map-options-segment-btn.is-active {
  background: transparent;
  color: var(--color-text-primary);
  box-shadow: none;
}

html[data-theme="dark"] .woodsper-map-options-author-input {
  background: var(--color-module);
  border-color: var(--control-border);
  color: var(--color-text-primary);
}

html[data-theme="dark"] .woodsper-map-filter-chipbar,
html[data-theme="dark"] .woodsper-map-filter-empty-card,
html[data-theme="dark"] .woodsper-map-place-label,
html[data-theme="dark"] .woodsper-map-data-loading {
  background: var(--control-surface) !important;
  border-color: var(--control-border) !important;
  color: var(--color-text-primary) !important;
  box-shadow: var(--control-shadow) !important;
}

html[data-theme="dark"] .woodsper-map-place-label-text {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .woodsper-map-place-label-spinner {
  border-color: rgba(255, 255, 255, 0.28);
  border-top-color: var(--color-accent, #0a84ff);
}

html[data-theme="dark"] .woodsper-map-filter-title,
html[data-theme="dark"] .woodsper-map-filter-row {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip {
  background: var(--color-module) !important;
  color: var(--color-text-primary) !important;
  box-shadow: var(--control-shadow);
}

html[data-theme="dark"] .leaflet-popup-content {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .leaflet-container {
  background: #020914;
}

html[data-theme="dark"] #map {
  background: #020914;
}

html[data-theme="dark"] .woodsper-theme-toggle {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .woodsper-theme-option.is-active {
  background: var(--color-module);
  color: var(--color-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .woodsper-map-layer-list.has-theme-above {
  border-top-color: var(--color-separator);
}

html[data-theme="dark"] .woodsper-map-layer-tile {
  background: rgba(120, 120, 128, 0.28);
  border: 0;
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .woodsper-map-layer-tile.is-on {
  background: var(--color-accent);
  border: 0;
  color: #fff;
}

html[data-theme="dark"] .woodsper-map-layer-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .woodsper-map-layer-icon {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

html[data-theme="dark"] .woodsper-map-switch-track {
  background: rgba(120, 120, 128, 0.36);
}

html[data-theme="dark"] .woodsper-map-switch-thumb {
  background: #fff;
}

/* 旧主题按钮样式保留兼容，已不再挂载 */
.woodsper-map-theme-control {
  display: none !important;
}

/* ——— 地图标注气泡（暗色下略压暗，保持可读） ——— */
html[data-theme="dark"] .map-ann-bubble,
html[data-theme="dark"] .map-ann-work-text-bubble {
  background: rgba(28, 28, 30, 0.92) !important;
  color: var(--color-text-primary) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* 封面 title：始终用轻渐变（底半透明黑 → 顶透明），不要纯色底 */
html[data-theme="dark"] .map-ann-cover-caption {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.28) 55%,
    rgba(0, 0, 0, 0.5) 100%
  ) !important;
  color: #fff !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .map-ann-bubble-title,
html[data-theme="dark"] .map-ann-side-title {
  color: var(--color-text-primary) !important;
}

/* ——— 滚动条（WebKit） ——— */
html[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: transparent;
}

/* ——— Toast / notice ——— */
html[data-theme="dark"] .woodsper-toast,
html[data-theme="dark"] .woodsper-notice {
  background: rgba(44, 44, 46, 0.96) !important;
  color: var(--color-text-primary) !important;
  border: 1px solid var(--color-border);
}

html[data-theme="dark"] .sidebar-detail-page,
html[data-theme="dark"] .sidebar-page-nav,
html[data-theme="dark"] .sidebar-detail-header,
html[data-theme="dark"] .search-results-tabs,
html[data-theme="dark"] .search-collapse-btn,
html[data-theme="dark"] .sidebar-search-input {
  background: var(--color-module) !important;
  color: var(--color-text-primary) !important;
  border-color: var(--color-separator) !important;
}

html[data-theme="dark"] .search-results-content {
  background: var(--color-main-bg) !important;
}

/* 覆盖残留的浅灰 hover / 分割线 */
html[data-theme="dark"] .spirit-item:hover,
html[data-theme="dark"] .work-item:hover,
html[data-theme="dark"] .plan-item:hover,
html[data-theme="dark"] .atlas-item:hover {
  background: #1c2a38 !important;
}

html[data-theme="dark"] .atlas-tag-chip,
html[data-theme="dark"] .detail-atlas-facility {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary) !important;
}

html[data-theme="dark"] .detail-atlas-facility-check {
  color: var(--color-accent) !important;
}

html[data-theme="dark"] .detail-atlas-category {
  background: var(--color-accent-light) !important;
  color: var(--color-accent) !important;
}

/* 画廊底色与页面一致，避免发灰块 */
html[data-theme="dark"] .woodsper-work-gallery-viewport,
html[data-theme="dark"] .woodsper-work-gallery-slide,
html[data-theme="dark"] .detail-atlas .woodsper-work-gallery-viewport,
html[data-theme="dark"] .detail-atlas .woodsper-work-gallery-slide {
  background: var(--color-main-bg) !important;
}

/* 评论：昵称用 secondary 灰；正文主色；时间/回复可读 */
html[data-theme="dark"] .woodsper-comment-name {
  color: var(--color-text-secondary) !important;
}

html[data-theme="dark"] .woodsper-comment-content {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .woodsper-comment-time {
  color: var(--color-text-hint) !important;
}

html[data-theme="dark"] .woodsper-comment-reply {
  color: var(--color-text-tertiary) !important;
}

html[data-theme="dark"] .woodsper-comment-reply:hover {
  color: var(--color-accent) !important;
}

html[data-theme="dark"] .woodsper-comment-item {
  border-bottom-color: var(--color-separator) !important;
}

html[data-theme="dark"] .woodsper-work-comments-title {
  color: var(--color-text-primary) !important;
}

/* 默认头像：系统蓝渐变；首字保持白色可读 */
html[data-theme="dark"] .woodsper-comment-avatar,
html[data-theme="dark"] .work-item-author-avatar,
html[data-theme="dark"] .detail-spirit-avatar {
  background: var(--sidebar-avatar-grad) !important;
  color: #fff !important;
}

html[data-theme="dark"] .work-item-author-initial,
html[data-theme="dark"] .woodsper-comment-avatar-fallback {
  color: #fff !important;
}

/* 身份标签：暗色沿用 --color-accent / --color-accent-light（无需另设灰底） */

html[data-theme="dark"] .sidebar-list-footer,
html[data-theme="dark"] .sidebar-list-footer--more,
html[data-theme="dark"] .sidebar-list-footer--loading,
html[data-theme="dark"] .sidebar-list-footer--end,
html[data-theme="dark"] .woodsper-comment-footer {
  color: var(--color-text-hint) !important;
}

html[data-theme="dark"] .plan-status-badge--completed {
  color: #30d158 !important;
}

html[data-theme="dark"] .plan-status-badge--in-progress {
  color: #0a84ff !important;
}

html[data-theme="dark"] .plan-status-badge--expired {
  color: #ff6961 !important;
}

html[data-theme="dark"] .plan-status-badge--upcoming {
  color: #ff9f0a !important;
}

html[data-theme="dark"] .goal-checklist-item {
  color: var(--color-text-primary) !important;
}

html[data-theme="dark"] .goal-checklist-item.is-done {
  color: var(--color-text-hint) !important;
}

html[data-theme="dark"] .profile-panel-detail-title {
  color: var(--color-text-primary) !important;
}

/* 小屏（≤768px）：暗色搜索栏也保持透明，不铺底 */
@media (max-width: 768px) {
  html[data-theme="dark"] .global-search-bar,
  html[data-theme="dark"] .woodsper-sidebar:not(.collapsed) ~ .woodsper-search-layer .global-search-bar,
  html[data-theme="dark"] .map-layout:has(.woodsper-map-detail-layer.is-open) .global-search-bar,
  html[data-theme="dark"] .global-search-bar.is-expanded {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
