
/* ==========================================================================
   18. 浅色主题（data-theme="light"）

   设计原则
     · **只换令牌**：组件里凡是以 var(--surface-*) / var(--line-*) / var(--tx-*)
       取色的，都自动跟随，不需要逐个改；
     · 少数历史遗留的「写死色值」（顶栏/底栏/弹层/骨架/地图浮层）在这里统一覆盖，
       每条都注明它替换的是哪个深色值，避免以后又冒出新的写死色；
     · 阴影在浅色下不是「更亮」而是「更淡 + 更小」，否则会脏；
     · 扉页（#splash）与封面图保持深色——那是品牌页与照片，浅色化反而更差。
   ========================================================================== */

[data-theme="light"] {
  /* 背景：由白到浅灰，保留极小的纵深步进 */
  --bg-0: #F4F6FA;
  --bg-1: #EDF1F7;
  --bg-2: #FFFFFF;

  /* 面与线：深色下是「提亮」，浅色下等价为「压暗」 */
  --surface-1: rgba(16, 24, 40, 0.032);
  --surface-2: rgba(16, 24, 40, 0.055);
  --surface-3: rgba(16, 24, 40, 0.085);
  --line-1: rgba(16, 24, 40, 0.09);
  --line-2: rgba(16, 24, 40, 0.14);
  --line-3: rgba(16, 24, 40, 0.22);
  --inset-hl: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* 文字：之前 --tx-3/--tx-4 用的是 #64748B / #98A2B3，
     后者在白底上只有 2.6:1（副标题、时间、提示语几乎看不清），
     这里整体压深，正文 ≥7:1、次要信息 ≥4.5:1（WCAG AA）。 */
  --tx-1: #0B1220;
  --tx-2: #334155;
  --tx-3: #4B5A70;
  --tx-4: #5F6E85;

  /* 语义色：深色主题下是「高亮荧光色」，放到白底上同样过淡（尤其 --bad） */
  --ok: #047857;
  --warn: #B45309;
  --bad: #BE123C;

  /* 阴影：浅色下要「短而淡」 */
  --sh-1: 0 1px 2px rgba(16, 24, 40, 0.06);
  --sh-2: 0 12px 28px -14px rgba(16, 24, 40, 0.18);
  --sh-3: 0 28px 56px -28px rgba(16, 24, 40, 0.26);
  --sh-ac: 0 14px 34px -16px rgba(91, 140, 255, 0.42);

  /* 强调整体亮度：主色在浅底上略压深，保证对比度 */
  --ac-1: #2F6BFF;
}

/* ---- 环境光 / 噪点：浅色下几乎不可见，只留一点层次 ---- */
[data-theme="light"] body::before { opacity: 0.5; }
[data-theme="light"] body::after { opacity: 0.018; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(16, 24, 40, 0.16); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(16, 24, 40, 0.26); }

/* ---- 外壳 ---- */
[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.6)); }
[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.74); }
[data-theme="light"] .tabbar { background: rgba(255, 255, 255, 0.92); }
[data-theme="light"] .sb-item.on { color: var(--ac-1); background: rgba(91, 140, 255, 0.1); }
[data-theme="light"] .sb-item.on::before { background: var(--ac-1); }

/* ---- 图标底色：深色下是浅蓝发光，浅色下要压成实色 ---- */
[data-theme="light"] .tile-ico,
[data-theme="light"] .row-icon,
[data-theme="light"] .row-ico { color: #2F6BFF; }
[data-theme="light"] .chip.brand { color: #1D4ED8; }

/* ---- 骨架屏 ---- */
[data-theme="light"] .sk {
  background: linear-gradient(90deg, rgba(16, 24, 40, 0.05) 25%, rgba(16, 24, 40, 0.1) 37%, rgba(16, 24, 40, 0.05) 63%);
  background-size: 400% 100%;
}

/* ---- 浮层：弹层 / Toast / 抽屉 / 灯箱 ---- */
[data-theme="light"] .sheet { background: #FFFFFF; }
[data-theme="light"] .sheet-mask { background: rgba(15, 23, 42, 0.4); }
[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.97); color: var(--tx-1); }
[data-theme="light"] .toast.err { color: #B42318; border-color: rgba(251, 113, 133, 0.45); }
[data-theme="light"] .ai-drawer-mask { background: rgba(15, 23, 42, 0.38); }
[data-theme="light"] .ai-drawer {
  background: linear-gradient(180deg, #FFFFFF, #F7F9FC 72%);
  box-shadow: 24px 0 60px -34px rgba(16, 24, 40, 0.45);
}
[data-theme="light"] .img-lightbox { background: rgba(15, 23, 42, 0.84); }

/* ---- 少数写死的浅色叠层（深色下是「提亮 4%~15%」）---- */
[data-theme="light"] .ai-seg button:hover { background: rgba(16, 24, 40, 0.05); }
[data-theme="light"] .ai-q:hover { color: var(--tx-1); background: rgba(91, 140, 255, 0.1); }
[data-theme="light"] .ms-clear { background: rgba(16, 24, 40, 0.06); }
[data-theme="light"] .ms-clear:hover { background: rgba(16, 24, 40, 0.12); }
[data-theme="light"] .rb-x { background: rgba(16, 24, 40, 0.05); }
[data-theme="light"] .rb-x:hover { background: rgba(16, 24, 40, 0.1); }
[data-theme="light"] .upl-cell { border-color: rgba(16, 24, 40, 0.12); }
[data-theme="light"] .upl-bar { background: rgba(16, 24, 40, 0.12); }
[data-theme="light"] .upl-mask { background: rgba(255, 255, 255, 0.74); color: var(--tx-2); }
[data-theme="light"] .upl-mask.bad { color: #B42318; }
[data-theme="light"] .free-room + .free-room { border-top-color: rgba(16, 24, 40, 0.06); }
[data-theme="light"] .dr-list::-webkit-scrollbar-thumb,
[data-theme="light"] .agent-list::-webkit-scrollbar-thumb,
[data-theme="light"] .map-plist::-webkit-scrollbar-thumb { background: rgba(16, 24, 40, 0.14); }
[data-theme="light"] .article-body { color: var(--tx-2); }
/* 行内写死的图标色（#8FB6FF）在浅底上偏淡，统一压深 */
[data-theme="light"] .row-icon,
[data-theme="light"] .grid-ico { color: var(--ac-1) !important; }
[data-theme="light"] .row-icon { background: rgba(91, 140, 255, 0.1); border-color: rgba(91, 140, 255, 0.18); }

/* 系统通知：铃铛红点与列表图标 */
[data-theme="light"] .bell-dot { box-shadow: 0 0 0 2px #fff; }
[data-theme="light"] .sys-item.tone-login .sys-ico { color: var(--ac-1); }
[data-theme="light"] .sys-item.tone-security .sys-ico { color: #B45309; }

/* ---- 图片上的文字：封面/主视觉永远是深色照片，白字不能跟着变深 ---- */
[data-theme="light"] .hero-title { color: #FFFFFF; }
[data-theme="light"] .hero-eyebrow { color: rgba(226, 236, 252, 0.8); }
[data-theme="light"] .hero-sub { color: rgba(206, 219, 238, 0.94); }

/* ---- 低对比强调色：深色下的浅蓝/淡紫在浅底上几乎看不清 ---- */
[data-theme="light"] .me-bind-chip { color: #1D4ED8; background: rgba(91, 140, 255, 0.12); }
[data-theme="light"] .ai-model-btn.is-deepseek { color: #1D4ED8; }
[data-theme="light"] .ai-model-btn.is-local { color: #047857; }
[data-theme="light"] .ai-model.deepseek { color: #1D4ED8; }
[data-theme="light"] .pc-body .pc-badges .chip {
  color: var(--tx-2);
  background: var(--surface-2);
  border-color: var(--line-2);
}
[data-theme="light"] .pc-body .pc-badges .chip.danger { color: #BE123C; background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.3); }

/* ---- 地图：浅色底图保持原色，不做任何滤镜（降饱和会整体发灰） ---- */
[data-theme="light"] .map-view .leaflet-tile-pane { filter: none; }
[data-theme="light"] .map-shell { background: #E8EDF5; box-shadow: var(--inset-hl), 0 26px 56px -38px rgba(16, 24, 40, 0.4); }
[data-theme="light"] .map-view {
  background:
    radial-gradient(90% 80% at 28% 16%, rgba(91, 140, 255, 0.08), transparent 60%),
    linear-gradient(155deg, #EFF3F9 0%, #E7ECF4 100%);
}
[data-theme="light"] .map-view .leaflet-tile-pane { filter: none; }
[data-theme="light"] .map-search,
[data-theme="light"] .map-btn { background: rgba(255, 255, 255, 0.94); }
[data-theme="light"] .map-btn:hover { color: var(--ac-1); background: #fff; }
[data-theme="light"] .map-pop { background: rgba(255, 255, 255, 0.97); box-shadow: 0 20px 44px -26px rgba(16, 24, 40, 0.45), var(--inset-hl); }
[data-theme="light"] .map-view .leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.94);
  color: var(--tx-1);
}
[data-theme="light"] .map-tip { color: #92400E; background: rgba(255, 251, 235, 0.97); border-color: rgba(251, 191, 36, 0.5); }
