/* ==========================================================
   ScriptPilot · 视觉降噪（护眼版）
   独立覆盖层：删掉 index.html 里引用这一行即可完全还原
   ========================================================== */

/* ---------- 1. 底色：告别近纯黑，降低明暗对撞 ---------- */
html.dark body {
  background-color: #0e1117 !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 所有"纯 slate-950"背景统一到同一底色，消除黑白断层 */
html.dark [class~="bg-slate-950"] {
  background-color: #0e1117 !important;
}

/* 顶部/背景里的装饰光斑压到几乎看不见 */
html.dark [class*="blur-3xl"],
html.dark [class*="blur-2xl"] {
  opacity: .35 !important;
}

/* ---------- 2. 干掉所有彩色霓虹发光 ---------- */
html.dark [class*="shadow-indigo"],
html.dark [class*="shadow-violet"],
html.dark [class*="shadow-purple"],
html.dark [class*="shadow-fuchsia"],
html.dark [class*="shadow-sky"],
html.dark [class*="shadow-emerald"],
html.dark [class*="shadow-rose"],
html.dark [class*="shadow-amber"],
html.dark [class*="shadow-red"],
html.dark [class*="shadow-black"] {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .30) !important;
}

/* 中性投影：层级靠"离地高度"体现，不靠光 */
html.dark [class*="shadow-2xl"] {
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .70) !important;
}
html.dark [class*="shadow-xl"] {
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .55) !important;
}
html.dark [class*="shadow-lg"] {
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .50) !important;
}
html.dark [class*="shadow-md"] {
  box-shadow: 0 2px 6px -3px rgba(0, 0, 0, .45) !important;
}
html.dark [class*="shadow-sm"] {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35) !important;
}

/* ---------- 3. 卡片描边：高饱和紫边降为中性细线 ---------- */
html.dark [class*="border-indigo-500/"],
html.dark [class*="border-indigo-600/"],
html.dark [class*="border-violet-500/"],
html.dark [class*="border-purple-500/"] {
  border-color: rgba(148, 163, 184, .14) !important;
}

/* ---------- 4. 文字：把"糊掉的灰"提到能看清 ---------- */
html.dark .text-slate-500 { color: #8d96a6 !important; }
html.dark .text-slate-600 { color: #7b8493 !important; }
html.dark .text-slate-400 { color: #9ca6b6 !important; }
html.dark .text-slate-300 { color: #c4cad5 !important; }

/* ---------- 5. 字号：10px / 11px 太小，统一抬到可读档 ---------- */
html.dark [class*="text-[10px]"] {
  font-size: 11.5px !important;
  line-height: 1.5 !important;
}
html.dark [class*="text-[11px]"] {
  font-size: 12px !important;
  line-height: 1.55 !important;
}

/* 行高松一点，长文本不挤成一坨 */
html.dark .text-xs { line-height: 1.6; }
html.dark .text-sm { line-height: 1.6; }

/* ---------- 6. 降低动画干扰 ---------- */
html.dark .animate-ping {
  animation: none !important;
  opacity: .8 !important;
}
html.dark .animate-pulse {
  animation-duration: 4s !important;
}

/* ---------- 7. 交互态：hover 不再整块变色发光 ---------- */
html.dark button,
html.dark a {
  transition: background-color .18s ease, border-color .18s ease,
              color .18s ease, opacity .18s ease !important;
}

/* ---------- 8. 滚动条：细一点、不抢眼 ---------- */
html.dark ::-webkit-scrollbar { width: 8px; height: 8px; }
html.dark ::-webkit-scrollbar-track { background: transparent; }
html.dark ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .18);
  border-radius: 8px;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, .32);
}

/* ---------- 9. 日志/代码区：等宽字别太细太小 ---------- */
html.dark .font-mono {
  font-size: .815rem;
  letter-spacing: .01em;
}

/* ---------- 10. 卡片层次：靠底色差分层，不靠描边发光 ---------- */
html.dark [class*="bg-slate-900/90"],
html.dark [class*="bg-slate-900/60"] {
  background-color: #171b22 !important;
}
html.dark [class*="bg-slate-900/40"] {
  background-color: #141821 !important;
}

/* 统一描边：一圈几乎看不见的浅线，比灰蓝描边干净 */
html.dark [class*="border-slate-800"],
html.dark [class*="border-slate-700"] {
  border-color: rgba(255, 255, 255, .07) !important;
}

/* 卡片里的深色内嵌区（下次执行/脚本名/代码块）→ 微微浮起，不再像个洞 */
html.dark [class*="bg-slate-950/60"],
html.dark [class*="bg-slate-950/80"],
html.dark [class*="bg-slate-950/90"] {
  background-color: rgba(255, 255, 255, .032) !important;
}

/* 顶部栏、侧边栏保持下沉，不受上面那条影响 */
html.dark .app-header {
  background-color: #0b0e13 !important;
  border-bottom: 1px solid rgba(255, 255, 255, .06) !important;
  box-shadow: none !important;
}
html.dark header [class*="bg-slate-950"],
html.dark aside [class*="bg-slate-950"],
html.dark nav [class*="bg-slate-950"] {
  background-color: #0b0e13 !important;
}

/* ---------- 11. 状态色：降饱和，别让一屏绿色抢眼 ---------- */
html.dark [class*="bg-emerald-500/10"] {
  background-color: rgba(52, 211, 153, .07) !important;
}
html.dark [class*="border-emerald-500/20"],
html.dark [class*="border-emerald-500/30"] {
  border-color: rgba(52, 211, 153, .16) !important;
}
html.dark .text-emerald-400 { color: #5ccfa4 !important; }
html.dark .text-emerald-300 { color: #7fd8b8 !important; }

/* ---------- 12. 主色：把刺眼的靛蓝压柔一点 ---------- */
html.dark .bg-indigo-600 { background-color: #4c52cf !important; }
html.dark [class*="hover:bg-indigo-500"]:hover { background-color: #5b61de !important; }
html.dark [class*="bg-indigo-600/20"] { background-color: rgba(76, 82, 207, .18) !important; }

/* ---------- 13. 日志 / 终端区：纯黑改深灰，字提大、行距放松 ---------- */
html.dark [class*="bg-black/"]:not([class*="backdrop-blur"]) {
  background-color: #11151c !important;
}
html.dark [class*="leading-6"] {
  line-height: 1.75 !important;
  font-size: 12.5px !important;
}

/* 弹窗遮罩别太黑，减少"整屏一黑"的压迫感 */
html.dark [class*="bg-black/70"],
html.dark [class*="bg-black/75"],
html.dark [class*="bg-black/80"] {
  background-color: rgba(6, 8, 12, .62) !important;
}


/* ==========================================================
   日间模式：原本只换背景不换字色，浅灰字压在白色上几乎看不清
   ========================================================== */

html:not(.dark) body {
  background-color: #f4f6fa !important;
}

/* 1) 正文灰阶：整体加深两档 */
html:not(.dark) .text-slate-300 { color: #475569 !important; }
html:not(.dark) .text-slate-400 { color: #4f5f76 !important; }
html:not(.dark) .text-slate-500 { color: #5a6a82 !important; }
html:not(.dark) .text-slate-600 { color: #3f4d63 !important; }

/* 2) 彩色文字：深色下的亮色在白底上失效，换成同色系的深色 */
html:not(.dark) .text-indigo-300 { color: #4338ca !important; }
html:not(.dark) .text-indigo-400 { color: #4f46e5 !important; }
html:not(.dark) .text-emerald-300,
html:not(.dark) .text-emerald-400 { color: #0b8f63 !important; }
html:not(.dark) .text-rose-300,
html:not(.dark) .text-rose-400 { color: #c53030 !important; }
html:not(.dark) .text-amber-300,
html:not(.dark) .text-amber-400 { color: #a2590b !important; }
html:not(.dark) .text-sky-400 { color: #0369a1 !important; }

/* 3) 卡片：白底 + 极淡边框 + 轻投影，靠层次而非描边 */
html:not(.dark) [class*="bg-slate-900/90"],
html:not(.dark) [class*="bg-slate-900/60"] {
  background-color: #ffffff !important;
  border-color: #e6ebf3 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05) !important;
}
html:not(.dark) [class*="bg-slate-900/40"] {
  background-color: #fbfcfe !important;
  border-color: #e9eef5 !important;
}

/* 4) 卡片里的内嵌块：比白再浅一档，形成"凹槽" */
html:not(.dark) [class*="bg-slate-950/60"],
html:not(.dark) [class*="bg-slate-950/50"],
html:not(.dark) [class*="bg-slate-950/40"] {
  background-color: #f6f8fc !important;
  border-color: #e8eef6 !important;
}

/* 5) 描边统一，别用深色模式那套灰蓝 */
html:not(.dark) [class*="border-slate-700"],
html:not(.dark) [class*="border-slate-800"] {
  border-color: #e6ebf3 !important;
}

/* 6) 日志 / 终端区：白底黑字，行距照旧放松 */
html:not(.dark) [class*="bg-black/"]:not([class*="backdrop-blur"]) {
  background-color: #f8fafc !important;
}

/* 6.1) 日志弹窗：外壳 / 顶栏 / 终端 / 底栏 全部转浅 */
html:not(.dark) [class*="bg-slate-900/95"] {
  background-color: #ffffff !important;
  border-color: #e6ebf3 !important;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .22) !important;
}
html:not(.dark) [class*="bg-slate-950/70"],
html:not(.dark) [class*="bg-slate-950/90"] {
  background-color: #f6f8fc !important;
  border-color: #e6ebf3 !important;
}

/* 终端正文：黑底浅字 → 浅底深字 */
html:not(.dark) .terminal-dark {
  background-color: #fbfcfe !important;
  color: #33445c !important;
  border-top: 1px solid #e6ebf3 !important;
}

/* 弹窗内的 slate 文字统一加深（标题、状态、行数、空态） */
html:not(.dark) [class*="bg-slate-900/95"] .text-slate-200,
html:not(.dark) [class*="bg-slate-900/95"] .text-slate-300 { color: #33445c !important; }
html:not(.dark) [class*="bg-slate-900/95"] .text-slate-400 { color: #56657c !important; }
html:not(.dark) [class*="bg-slate-900/95"] .text-slate-500 { color: #6b7a90 !important; }

/* 顶栏按钮（复制 / 下载 / 清屏）：深灰块 → 浅灰块 */
html:not(.dark) [class*="bg-slate-900/95"] .bg-slate-800 {
  background-color: #eef2f8 !important;
  color: #3f4d63 !important;
  border: 1px solid #e0e7f1 !important;
}
html:not(.dark) [class*="bg-slate-900/95"] [class*="hover:bg-slate-700"]:hover {
  background-color: #e2e9f4 !important;
}

/* 6.2) 日间弹窗遮罩：别用 80% 黑，压暗即可 */
html:not(.dark) [class*="bg-black/80"][class*="backdrop-blur"] {
  background-color: rgba(15, 23, 42, .34) !important;
}

/* 6.3) 内联写死 #0f172a 的 sticky 列/栏：环境变量表格「操作」列、
       表头、编辑弹窗底部按钮条。日间必须压回白色，否则是一条黑杠 */
html:not(.dark) [style*="sticky"] {
  background-color: #ffffff !important;
  background-image: none !important;
}

/* 7) 状态标签底色：白底上用更淡的色块 */
html:not(.dark) [class*="bg-emerald-500/10"] { background-color: #eafaf2 !important; }
html:not(.dark) [class*="border-emerald-500/20"],
html:not(.dark) [class*="border-emerald-500/30"] { border-color: #bfe9d6 !important; }

/* 8) 顶部栏与侧边栏分界 */
html:not(.dark) .app-header {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e6ebf3 !important;
}

/* 9) 交互态：日间下 hover 不能变深（否则白底上浮出一块黑） */
html:not(.dark) [class*="hover:bg-slate-7"]:hover,
html:not(.dark) [class*="hover:bg-slate-8"]:hover,
html:not(.dark) [class*="hover:bg-slate-9"]:hover {
  background-color: #e8eef7 !important;
}
html:not(.dark) [class*="hover:text-white"]:hover {
  color: #1e293b !important;
}
html:not(.dark) [class*="hover:text-slate-200"]:hover,
html:not(.dark) [class*="hover:text-slate-300"]:hover {
  color: #33445c !important;
}

/* 侧栏未选中项：hover 时给浅底 + 深字 */
html:not(.dark) aside button:hover {
  color: #33445c !important;
}




