/* ============================================================
   全站背景：夜空 + 三层星点缓缓上移
   ============================================================
   由 js/site-bg.js 在 DOMContentLoaded 时挂载（每个页面都引入它）。
   `.star-layer` 的 box-shadow 由脚本**生成**，不在这里手写 ——
   手写要抄一千多行星点坐标，改一次密度就得重抄，而且坐标写死之后
   屏幕一宽右侧就是一片没星星的空档。

   三个不能丢的点：
     · z-index:-1 + pointer-events:none —— 纯装饰层，不盖内容、不拦点击
     · 星点纵向只铺 2000px 再整体上移 2000px —— 首尾相接才能无缝循环
     · prefers-reduced-motion 关动画 —— 大面积移动的亮点会让人不适
   ============================================================ */

.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* 夜空底色：底部稍亮、四周压暗，视线收到中间 */
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
}

.star-layer {
  position: absolute;
  top: 0;
  left: 0;
  background: transparent;
  border-radius: 50%;
  will-change: transform;
  backface-visibility: hidden;
  animation-name: star-drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* 三层：1px 密集移动慢、2px 中等、3px 稀疏移动快 —— 层次感与视差都在这 */
.star-1 { width: 1px; height: 1px; animation-duration: 60s; }
.star-2 { width: 2px; height: 2px; animation-duration: 100s; }
.star-3 { width: 3px; height: 3px; animation-duration: 150s; opacity: .9; }

@keyframes star-drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-2000px); }
}

@media (prefers-reduced-motion: reduce) {
  .star-layer { animation: none; }
}

/* ============================================================
   深色外壳（让星空真正透上来）
   ============================================================
   ⚠️ 关键一步：body 自己有不透明底色（var(--bg)），而 z-index:-1 的星空在
   **body 背景之下** —— 不让开的话星空一点都看不见（登录页当初能看见，
   只是因为它本来就没给 body 设底色）。

   做法是「深色毛玻璃外壳 + 白底业务卡片」：
     · 侧边栏 / 顶栏：半透明深色 + 背景模糊，导航文字翻成浅色
     · 内容区：全透明，星空直接可见（标题、说明、工具栏都在星空上）
     · 卡片 .dsh-card、弹窗 #modalOv、表单控件：**保持原来的浅色主题** ——
       表格 / 表单 / 按钮的可读性不能为了好看让路
   ============================================================ */
body.has-stars { background: transparent !important; color: #E7EAF0; }

body.has-stars #appSidebar {
  background: rgba(11, 17, 30, .58) !important;
  border-right: 1px solid rgba(255, 255, 255, .10) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
body.has-stars header {
  background: rgba(11, 17, 30, .48) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .10) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
body.has-stars #shellContent { background: transparent !important; }

/* ---------- 卡片外的一切：翻成深色主题 ----------
   只覆盖这套界面实际在用的那几个 Tailwind 颜色类（先扫过一遍：
   灰三档 + 蓝 + 状态色）。用 `[class^=]` / `[class*=" 空格"]` 两种写法
   **精确匹配独立类名** —— 不能只用 `[class*=...]`：那会把
   `hover:text-[#1F2329]`、`hover:bg-[#F7F8FA]` 也匹配掉，
   于是鼠标还没移上去颜色就变了。 */
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="text-[#1F2329]"], [class*=" text-[#1F2329]"]):not(input):not(select):not(textarea) { color: #EEF1F6 !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="text-[#646A73]"], [class*=" text-[#646A73]"]):not(input):not(select):not(textarea) { color: #C8CFDB !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="text-[#8F959E]"], [class*=" text-[#8F959E]"]):not(input):not(select):not(textarea) { color: #98A2B3 !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="text-[#2563EB]"], [class*=" text-[#2563EB]"]):not(input):not(select):not(textarea) { color: #8AB4FF !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="text-[#EF4444]"], [class*=" text-[#EF4444]"],
                   [class^="text-[#B91C1C]"], [class*=" text-[#B91C1C]"]):not(input):not(select):not(textarea) { color: #FCA5A5 !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="text-[#047857]"], [class*=" text-[#047857]"]):not(input):not(select):not(textarea) { color: #6EE7B7 !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="text-[#B45309]"], [class*=" text-[#B45309]"]):not(input):not(select):not(textarea) { color: #FCD34D !important; }

/* 边框与浅色底：不换成半透明的话，星空上会浮出一块块白斑和白边。
   ⚠️ 每条翻转规则都带 `:not(input):not(select):not(textarea)` ——
   表单控件必须留在浅色主题里。踩过一次：顶栏那个「店铺筛选」下拉带着
   `bg-white` 类，被这条改成 7% 透明底，而它的文字被我另一条规则设成了深色，
   于是**深色字 + 透明底**在星空上完全看不见（截图里就是个空白的白框）。 */
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="border-[#EDEFF2]"], [class*=" border-[#EDEFF2]"]):not(input):not(select):not(textarea) { border-color: rgba(255, 255, 255, .12) !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="bg-white"], [class*=" bg-white"]):not(input):not(select):not(textarea) { background: rgba(255, 255, 255, .07) !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="bg-[#F7F8FA]"], [class*=" bg-[#F7F8FA]"]):not(input):not(select):not(textarea) { background: rgba(255, 255, 255, .06) !important; }
body.has-stars :is(#appSidebar, header, #page-content) :is([class^="bg-[#EDEFF2]"], [class*=" bg-[#EDEFF2]"]):not(input):not(select):not(textarea) { background: rgba(255, 255, 255, .14) !important; }
body.has-stars [class*="hover:bg-[#F7F8FA]"]:hover { background: rgba(255, 255, 255, .10) !important; }
body.has-stars [class*="hover:bg-[#2563EB]/10"]:hover { background: rgba(138, 180, 255, .16) !important; }
body.has-stars .dsh-empty { color: #98A2B3 !important; }
body.has-stars ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); }

/* ---------- 翻回来：卡片 / 弹窗 / 表单控件仍是浅色主题 ----------
   这三处是「业务内容」，白底深字不能动。选择器比上面多一层，优先级更高。 */
body.has-stars #page-content .dsh-card,
body.has-stars #modalOv > div { color: #1F2329 !important; }
body.has-stars #page-content .dsh-card :is([class^="text-[#1F2329]"], [class*=" text-[#1F2329]"]),
body.has-stars #modalOv :is([class^="text-[#1F2329]"], [class*=" text-[#1F2329]"]):not(input):not(select):not(textarea) { color: #1F2329 !important; }
body.has-stars #page-content .dsh-card :is([class^="text-[#646A73]"], [class*=" text-[#646A73]"]),
body.has-stars #modalOv :is([class^="text-[#646A73]"], [class*=" text-[#646A73]"]):not(input):not(select):not(textarea) { color: #646A73 !important; }
body.has-stars #page-content .dsh-card :is([class^="text-[#8F959E]"], [class*=" text-[#8F959E]"]),
body.has-stars #modalOv :is([class^="text-[#8F959E]"], [class*=" text-[#8F959E]"]):not(input):not(select):not(textarea) { color: #8F959E !important; }
body.has-stars #page-content .dsh-card :is([class^="text-[#2563EB]"], [class*=" text-[#2563EB]"]),
body.has-stars #modalOv :is([class^="text-[#2563EB]"], [class*=" text-[#2563EB]"]):not(input):not(select):not(textarea) { color: #2563EB !important; }
body.has-stars #page-content .dsh-card :is([class^="text-[#EF4444]"], [class*=" text-[#EF4444]"], [class^="text-[#B91C1C]"], [class*=" text-[#B91C1C]"]),
body.has-stars #modalOv :is([class^="text-[#EF4444]"], [class*=" text-[#EF4444]"], [class^="text-[#B91C1C]"], [class*=" text-[#B91C1C]"]):not(input):not(select):not(textarea) { color: #EF4444 !important; }
body.has-stars #page-content .dsh-card :is([class^="text-[#047857]"], [class*=" text-[#047857]"]),
body.has-stars #modalOv :is([class^="text-[#047857]"], [class*=" text-[#047857]"]):not(input):not(select):not(textarea) { color: #047857 !important; }
body.has-stars #page-content .dsh-card :is([class^="text-[#B45309]"], [class*=" text-[#B45309]"]),
body.has-stars #modalOv :is([class^="text-[#B45309]"], [class*=" text-[#B45309]"]):not(input):not(select):not(textarea) { color: #B45309 !important; }
body.has-stars #page-content .dsh-card :is([class^="border-[#EDEFF2]"], [class*=" border-[#EDEFF2]"]),
body.has-stars #modalOv :is([class^="border-[#EDEFF2]"], [class*=" border-[#EDEFF2]"]) { border-color: #EDEFF2 !important; }
body.has-stars #page-content .dsh-card :is([class^="bg-white"], [class*=" bg-white"]),
body.has-stars #modalOv :is([class^="bg-white"], [class*=" bg-white"]) { background: #fff !important; }
body.has-stars #page-content .dsh-card :is([class^="bg-[#F7F8FA]"], [class*=" bg-[#F7F8FA]"]),
body.has-stars #modalOv :is([class^="bg-[#F7F8FA]"], [class*=" bg-[#F7F8FA]"]) { background: #F7F8FA !important; }
body.has-stars #page-content .dsh-card :is([class^="bg-[#EDEFF2]"], [class*=" bg-[#EDEFF2]"]),
body.has-stars #modalOv :is([class^="bg-[#EDEFF2]"], [class*=" bg-[#EDEFF2]"]) { background: #EDEFF2 !important; }
body.has-stars #page-content .dsh-card .dsh-empty { color: #8F959E !important; }

/* 表单控件永远白底深字：白底配浅字等于看不见。
   上面那几条翻转已经用 :not() 排除掉表单控件，这里再兜一道 ——
   卡片里的输入框、下拉框也必须保持浅色主题。 */
body.has-stars input,
body.has-stars select,
body.has-stars textarea { background: #fff !important; color: #1F2329 !important; }
/* 顶栏那个「店铺筛选」下拉在深色顶栏上，边框提亮一点更好认 */
body.has-stars #shopSwitcher { border-color: rgba(255, 255, 255, .30) !important; }

/* ---------- 侧边栏 / 顶栏：元素级兜底 ----------
   上面那套 `[class*=...]` 翻转在 `#page-content` 里稳定生效，但在侧边栏上
   实测**时好时坏**（同一份 CSS、同一个元素，不同页面结果不同；加 ID、
   加 !important 都没能稳定压住 Tailwind 运行时注入的工具类）。
   这两块区域结构固定（导航链接 + 图标 + 几个按钮），按元素写死更可靠 ——
   优先级恒定为 (1,0,1) 起步，工具类盖不过它。 */
body.has-stars #appSidebar a,
body.has-stars #appSidebar i { color: #C8CFDB !important; }
body.has-stars #appSidebar a:hover,
body.has-stars #appSidebar a:hover i { color: #EEF1F6 !important; }
/* 当前选中项：navItem 会给它加 font-medium，用这个区分，不必再读类名 */
body.has-stars #appSidebar a.font-medium,
body.has-stars #appSidebar a.font-medium i { color: #8AB4FF !important; }

body.has-stars header span,
body.has-stars header i,
body.has-stars header button,
body.has-stars header div { color: #C8CFDB !important; }
body.has-stars header button:hover,
body.has-stars header button:hover i { color: #EEF1F6 !important; }

/* ============================================================
   首屏即时底色 + 外壳骨架（v1.12.7）
   ============================================================
   为什么要写在这里：
     ① **即时底色**：`.starfield`（深色渐变）是 JS 在 DOMContentLoaded 才插进来的，
        在那之前浏览器按默认浅色画一帧 → 每次切页都看到「浅 → 深」换底，
        用户描述成「星空重新布满」。把底色提到 html 上，首次绘制就已经是深色。
     ② **外壳骨架**：多页应用切页时外壳要等 renderShell() 才有，
        这段时间页面是空的（用户说「整套 UI 白一下再出来」）。
        骨架由 js/site-bg.js 在解析阶段塞进 #shellMain，renderShell() 会覆盖它。
   颜色取侧边栏/顶栏的实际底色（深navy）——骨架只存在一两百毫秒，够"接住"这一帧就行。
*/
html { background: #090a0f; }

.boot-shell { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.boot-side {
  position: fixed; top: 0; bottom: 0; left: 0; width: 240px;
  background: rgba(11, 17, 30, .58); border-right: 1px solid rgba(255, 255, 255, .10);
}
.boot-top {
  position: fixed; top: 0; left: 240px; right: 0; height: 64px;
  background: rgba(11, 17, 30, .48); border-bottom: 1px solid rgba(255, 255, 255, .10);
}
/* 骨架跟真外壳保持一致（nav-rail / nav-open 由 site-bg.js 在解析阶段提前挂到 html 上）：
   未钉住 → 64px 图标栏；钉住 → 240px 展开态。 */
html.nav-rail .boot-side { width: 64px; }
html.nav-rail .boot-top { left: 64px; }
html.nav-rail.nav-open .boot-side { width: 240px; }
html.nav-rail.nav-open .boot-top { left: 240px; }
@media (max-width: 1023px) {
  .boot-side { display: none; }
  .boot-top { left: 0; }
}

/* ============================================================
   侧边栏菜单分组（v1.13.0 起）
   ============================================================
   为什么这些值必须写在这里、而不是 admin.js 里那套：
   **侧边栏永远是深色半透明玻璃**（`body.has-stars` 在解析阶段就挂上了），
   而 admin.js 里注入的是「浅色底」的默认值。
   踩过一次：组间分割线用了近白 `#F1F3F6`，在深底上就是**一条亮线**
   —— 用户原话「分界线太亮了」。浅色底上淡 ≠ 深色底上淡，两个方向反着来。

   所以深色这里重新给三样东西的值：
     · 分割线：白色 5.5% 的细线（深底上"看得见但不刺眼"的量级）；
     · 分组小标题：比菜单文字再暗一档，形成层级；
     · 菜单文字：未选中降一档、当前项纯白（底色是品牌蓝实心块）。
   放在文件末尾，靠「同优先级后者胜」压过上面那段元素级兜底。 */
body.has-stars #navList .nav-group-title { color: #7F8A9B; }

body.has-stars #navList .nav-group + .nav-group { border-top-color: rgba(255, 255, 255, .055); }

/* 鼠标指示块：深底上原来是 7% 蓝（几乎看不见），换成 7% 白 */
body.has-stars #navHighlight { background: rgba(255, 255, 255, .07); }

/* 未选中：比主文字(#C8CFDB)淡一档，但仍清晰 */
body.has-stars #appSidebar a { color: #AEB8C7 !important; }

/* 当前项：品牌蓝实心底块上的白字（admin.js 给的 #fff 会被上面那条 !important 盖掉） */
body.has-stars #appSidebar a.is-active,
body.has-stars #appSidebar a.is-active i,
body.has-stars #appSidebar a.is-active:hover,
body.has-stars #appSidebar a.is-active:hover i { color: #fff !important; }

/* ============================================================
   主题：暗色调（默认）/ 暖色调（v1.14.0）
   ============================================================
   用户在「系统设置 → 功能开关 → 主题配色」里切换，存在 `localStorage.dsh_theme`：
     · dark（默认）= 暗夜星空：星空底 + 深色玻璃外壳 + 浅色文字（原有观感，不改）
     · warm        = 米白纸感：米白页面底 + 白卡片 + 深色文字，没有星星
   主题类挂在 `<html>` 上（`theme-dark` / `theme-warm`），两处负责把它挂早：
     ① 每个页面 `<head>` 里的那一行内联脚本（最先执行，决定**首帧**底色）
     ② js/site-bg.js（星空与首屏骨架，按主题决定挂不挂）
   为什么必须这么早：这个项目为"切页先白/先闪一下"返工过两次（v1.12.5 / v1.12.8）。
   主题晚一步挂，暖色调用户每次点菜单都会先闪一帧深色底 —— 那就又回到老问题上了。
   ============================================================ */

/* ---------- 暖色调：只换"底色/描边"，文字仍是深色 ---------- */
html.theme-warm {
  /* 覆盖 admin.js 注入的 :root 令牌。暖色是"纸感"，不是另一个深色主题：
     卡片保持纯白、正文保持深字，只有页面底与几档浅色面变暖。 */
  --bg: #F6F1E6;          /* 页面底：米白 */
  --line: #E7DFCE;        /* 卡片描边：暖灰（冷灰放在米白上会发脏） */
  --nav-line: #FFFFFF;    /* 侧边栏分组分割线：纯白（用户：边界线才应该是纯白） */
  --w-f7f8fa: #F6F1E6;    /* 次级底色跟着暖（内容区、工具栏、表头都用它） */
  --w-edeff2: #EBE4D5;    /* 浅底/浅描边跟着暖（分组底、开关轨道、表格线） */
  background: #F6F1E6;
}

/* ---------- 暖色调：外壳（侧边栏 / 顶栏）也必须是米白 ----------
   用户对着截图说：「暖色调除内容块外都应该是米白色，左侧导航栏、上方标题栏以及
   左上角项目内容，而边界线才应该是纯白」。
   也就是说**白只留给内容卡片**：侧边栏、顶栏、品牌区全部跟页面底同色（米白），
   三块之间的接缝用 1px 纯白细线画出来 —— 白线在米白上是一条"亮缝"，比灰线更像纸感。
   注意只改外壳这四处的描边（`w-border-edeff2` 全站 197 处，卡片边框必须保持暖灰，
   否则白卡+白边等于没有边）。 */
html.theme-warm #appSidebar,
html.theme-warm #shellContent > header { background: #F6F1E6; }
html.theme-warm #appSidebar { border-right-color: #FFFFFF; }
html.theme-warm #shellContent > header { border-bottom-color: #FFFFFF; }
html.theme-warm #navBrandRow { border-bottom-color: #FFFFFF; }
html.theme-warm #navFootRow { border-top-color: #FFFFFF; }
/* 侧边栏底部那块「营业中 / 闭店」是个小组件（不是外壳），给白底才看得出是独立一块 */
html.theme-warm #shopBizBox > div { background: #FFFFFF; }

/* 首屏骨架跟真外壳保持一致：米白侧边栏 + 米白顶栏 + 纯白接缝 */
html.theme-warm .boot-side { background: #F6F1E6; border-right: 1px solid #FFFFFF; }
html.theme-warm .boot-top { background: #F6F1E6; border-bottom: 1px solid #FFFFFF; }

/* ---------- 暗色调：把 w-* 的文字色位整体翻浅 ----------
   ⚠️ 这一段修的就是"暗夜星空主题下某些字还是黑的"：
   页面早在 v1.11 就从 `text-[#1F2329]` 迁到了 `w-text-1f2329`（走 web-theme.css 的
   主题色位），而上面那套 `[class^="text-[#1F2329]"]…` 的翻转**一条都匹配不到** ——
   于是侧边栏/顶栏靠元素级兜底看得见，而正文里直接压在星空上的标题、tab、说明文字
   全是黑的（用户看到的"某些字还是黑色"）。
   现在按**变量**翻：改这一处 `--w-t-*`，832 处 `w-text-*` 一起变，且以后新增页面自动跟上。

   ⚠️ 只翻**文字**色位（`--w-t-*`）：`--w-2563eb` / `--w-ef4444` / `--w-10b981` 这些
   还兼着实心按钮的底色（`w-bg-2563eb`…），翻它们会把"蓝底白字"的按钮做成浅蓝底白字。 */
body.has-stars {
  --w-t-1f2329: #EEF1F6;   /* 主文字 */
  --w-t-646a73: #C8CFDB;   /* 次文字 */
  --w-t-8f959e: #98A2B3;   /* 辅助文字 */
  --w-t-b0b6be: #8A94A6;   /* 最弱（占位级） */
  --w-t-2563eb: #8AB4FF;   /* 品牌蓝（深底上要提亮，否则糊成一片） */
  --w-t-ef4444: #FCA5A5;   /* 警示 */
  --w-t-b91c1c: #FCA5A5;
  --w-t-10b981: #6EE7B7;   /* 成功 */
  --w-t-047857: #6EE7B7;
  --w-t-f59e0b: #FCD34D;   /* 提醒 */
  --w-t-b45309: #FCD34D;
}

/* 浅色底 / 浅描边：不换成半透明白的话，星空上会浮出一块块白斑与白边 */
body.has-stars .w-bg-f7f8fa { background-color: rgba(255, 255, 255, .06); }
body.has-stars .w-bg-f7f8fa-h:hover { background-color: rgba(255, 255, 255, .10); }
body.has-stars .w-bg-edeff2 { background-color: rgba(255, 255, 255, .14); }
body.has-stars .w-border-edeff2 { border-color: rgba(255, 255, 255, .12); }
body.has-stars .w-border-f7f8fa { border-color: rgba(255, 255, 255, .10); }
body.has-stars .w-placeholder-8f959e::placeholder { color: #8A94A6; }

/* ---------- 翻回来：卡片 / 弹窗里仍然是浅色主题 ----------
   白卡上放浅色字等于看不见。这里**重新声明变量**而不是逐个类写规则：
   卡片内部层级任意深，CSS 变量天然继承，一处声明管整棵子树。 */
body.has-stars #page-content .dsh-card,
body.has-stars #modalOv > div {
  --w-t-1f2329: var(--w-1f2329);
  --w-t-646a73: var(--w-646a73);
  --w-t-8f959e: var(--w-8f959e);
  --w-t-b0b6be: var(--w-b0b6be);
  --w-t-2563eb: var(--w-2563eb);
  --w-t-ef4444: var(--w-ef4444);
  --w-t-b91c1c: var(--w-b91c1c);
  --w-t-10b981: var(--w-10b981);
  --w-t-047857: var(--w-047857);
  --w-t-f59e0b: var(--w-f59e0b);
  --w-t-b45309: var(--w-b45309);
}
body.has-stars #page-content .dsh-card .w-bg-f7f8fa,
body.has-stars #modalOv > div .w-bg-f7f8fa { background-color: var(--w-f7f8fa); }
body.has-stars #page-content .dsh-card .w-bg-f7f8fa-h:hover,
body.has-stars #modalOv > div .w-bg-f7f8fa-h:hover { background-color: var(--w-f7f8fa); }
body.has-stars #page-content .dsh-card .w-bg-edeff2,
body.has-stars #modalOv > div .w-bg-edeff2 { background-color: var(--w-edeff2); }
body.has-stars #page-content .dsh-card .w-border-edeff2,
body.has-stars #modalOv > div .w-border-edeff2 { border-color: var(--w-edeff2); }
body.has-stars #page-content .dsh-card .w-border-f7f8fa,
body.has-stars #modalOv > div .w-border-f7f8fa { border-color: var(--w-f7f8fa); }

/* ============================================================
   卡片透明度联动「卡片内字色」（v2.3.8）
   ============================================================
   用户要求：「修改透明度的时候字的颜色也应该修改，暗色调字是从黑到白；
   暖色调不用」，补充「只修改卡片内的字体颜色」。

   做法：透明度 > 45% 时 `<html>` 上挂 `card-text-light`（site-bg.js 判定，
   且**只在暗色调**下挂），这里把卡片内重新声明的那组 `--w-t-*` 再翻回浅色，
   同时给卡片压一层"暗玻璃底"（`--card-scrim`，从 0.35 涨到 0.50）。

   ⚠️ 为什么是「过 45% 翻一次」而不是 0~100 线性渐变：
      白卡压在深色星空上，透明度越高底色越暗；字色若同时从 #1F2329 线性插到
      #EEF1F6，两者会在中间相遇 —— 实测 50% 时底色 #848587、字 #878B90，
      对比度只有 1.9:1，整张卡的字等于消失。
      45% 这个阈值按 WCAG 相对亮度算出来：深字在 44% 有 5.1:1、浅字从 46% 起
      5.4:1，**全区间最低 5.0**，都过 4.5 的正文标准（`work/contrast-final.mjs`
      就是算这个的，换参数要重新跑一遍）。

   ⚠️ 只作用在 `.dsh-card` 上：
      · 弹窗 `#modalOv` 是**实心白卡**（不参与透明度），字必须保持深色；
      · 侧边栏 / 顶栏 / 卡片外的标题本来就在星空上，早就翻浅了，不受影响。
   ============================================================ */
html.card-text-light body.has-stars #page-content .dsh-card {
  --w-t-1f2329: #EEF1F6;   /* 主文字 */
  --w-t-646a73: #C8CFDB;   /* 次文字 */
  --w-t-8f959e: #98A2B3;   /* 辅助文字 */
  --w-t-b0b6be: #8A94A6;   /* 最弱 */
  --w-t-2563eb: #8AB4FF;   /* 品牌蓝 */
  --w-t-ef4444: #FCA5A5;   /* 警示 */
  --w-t-b91c1c: #FCA5A5;
  --w-t-10b981: #6EE7B7;   /* 成功 */
  --w-t-047857: #6EE7B7;
  --w-t-f59e0b: #FCD34D;   /* 提醒 */
  --w-t-b45309: #FCD34D;
  /* ⚠️ 这一行是 v2.3.11 补的，**不能删**：
     上面那 11 个变量只管得住"写了 `w-text-*` 类"的文字。
     而上面第 112 行给卡片定了 `color: #1F2329 !important`（白卡模式要深字），
     **没写文字色类的元素是从卡片继承这个深色的** —— 表格里满是这种
     `<td class="py-2.5">`（平台工作台的「店铺排行」就是），
     于是卡片翻成暗玻璃之后，字还是黑的（用户截图：「容器卡片字体还是黑色没改」）。
     变量改不了"继承来的 color"，只能在这里把卡片的 color 一并按 `!important` 覆盖回来。
     弹窗 `#modalOv` 是实心白卡、不参与透明度，那条规则不受影响、照旧深字。 */
  color: var(--w-t-1f2329) !important;
  /* 暗玻璃底：盖在背景色**之上**（不是替换），所以星空仍透得出来，只是被压暗 */
  background-image: linear-gradient(
    rgba(11, 18, 32, var(--card-scrim, .35)),
    rgba(11, 18, 32, var(--card-scrim, .35))
  );
  border-color: rgba(255, 255, 255, .14);
}

/* 卡片内部的浅色面也要跟着翻 ——
   否则"浅字 + 没翻的白底小方块"= 白字白底，比不改还糟。
   取值与卡片外那几条翻转规则一致，整张卡看起来才是同一块暗玻璃。
   表单控件照旧排除（输入框必须白底深字，见上面 body.has-stars input 那条）。 */
html.card-text-light body.has-stars #page-content .dsh-card :is([class^="bg-white"], [class*=" bg-white"]):not(input):not(select):not(textarea) { background-color: rgba(255, 255, 255, .06) !important; }
html.card-text-light body.has-stars #page-content .dsh-card .w-bg-f7f8fa { background-color: rgba(255, 255, 255, .06) !important; }
html.card-text-light body.has-stars #page-content .dsh-card .w-bg-f7f8fa-h:hover { background-color: rgba(255, 255, 255, .10) !important; }
html.card-text-light body.has-stars #page-content .dsh-card :is([class^="bg-[#F7F8FA]"], [class*=" bg-[#F7F8FA]"]):not(input):not(select):not(textarea) { background-color: rgba(255, 255, 255, .06) !important; }
html.card-text-light body.has-stars #page-content .dsh-card .w-bg-edeff2,
html.card-text-light body.has-stars #page-content .dsh-card :is([class^="bg-[#EDEFF2]"], [class*=" bg-[#EDEFF2]"]):not(input):not(select):not(textarea) { background-color: rgba(255, 255, 255, .14) !important; }
html.card-text-light body.has-stars #page-content .dsh-card .w-border-edeff2,
html.card-text-light body.has-stars #page-content .dsh-card :is([class^="border-[#EDEFF2]"], [class*=" border-[#EDEFF2]"]) { border-color: rgba(255, 255, 255, .12) !important; }
html.card-text-light body.has-stars #page-content .dsh-card .w-border-f7f8fa { border-color: rgba(255, 255, 255, .10) !important; }
/* 表格行 hover：原来靠 var(--bg)（浅灰），在暗玻璃上会是一道白杠 */
html.card-text-light body.has-stars #page-content .dsh-card .dsh-table tbody tr:hover { background: rgba(255, 255, 255, .05); }
