/* ============================================================
   二次元主题 · 小熊真昼  v3
   ------------------------------------------------------------
   · 深色 / 亮色双模式都保证可读
   · 椎名真昼背景（内页 / 登录 / 亮色 三套）
   · 小熊元素见 anime-bear.css
   ============================================================ */

:root {
  --an-bg-0: #1a0a14;
  --an-panel: rgba(56, 18, 40, 0.92);
  --an-line: rgba(255, 110, 170, 0.46);
  --an-line-soft: rgba(255, 140, 190, 0.26);
  --an-sakura: #ffb0d4;
  --an-sakura-deep: #ff4d94;
  --an-violet: #ffa8d8;
  --an-bear: #e09a72;

  /* 暗色模式文字 */
  --an-text: #fff5fa;
  --an-text-dim: #f2d0e2;
  --an-text-mute: #d6b0c4;

  color-scheme: dark;
}

/* ---------- 字体：清晰优先 ---------- */
html,
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans SC", "Source Han Sans SC", Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  letter-spacing: 0 !important;
}

/* ============================================================
   背景：椎名真昼，暗化已烘焙进图片
   ============================================================ */
html {
  background-color: var(--an-bg-0) !important;
}

body {
  background-color: var(--an-bg-0) !important;
  background-image: url("/anime-bg.webp") !important;
  background-size: cover !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
  min-height: 100vh !important;
  color: var(--an-text) !important;
}

/* 仪表盘：换成镜像版背景（角色在右侧、整体更亮）
   用 anime-route.js 打在 <html> 上的 data-page 判断，
   比 :has(canvas) 稳（ECharts 可能渲染成 SVG） */
html.dark[data-page="dashboard"] body {
  background-image: url("/anime-bg-dash.webp") !important;
  background-position: center 50% !important;
}

/* sub2api 自带的两个全屏遮罩层（深色渐变 + 青色网格）
   会把背景图完全盖住，必须打掉 */
[class*="absolute"][class*="inset-0"][class*="bg-gradient-to-br"],
[class*="absolute"][class*="inset-0"][class*="bg-[linear-gradient"] {
  background-image: none !important;
  background-color: transparent !important;
}

/* 关键：bg-mesh-gradient 是 fixed inset-0 的全屏装饰层，
   带青色 radial-gradient，会把整个背景图压住 —— 必须清掉 */
.bg-mesh-gradient,
div[class*="bg-mesh-gradient"] {
  background-image: none !important;
  background-color: transparent !important;
  opacity: 0 !important;
  display: none !important;
}

/* ---------- driver.js 引导遮罩 ----------
   绝对不要隐藏 .driver-popover！
   sub2api 的引导没走完时，body 上会挂 .driver-active，而自带 CSS 有：
     .driver-active .driver-overlay, .driver-active * { pointer-events: none }
   这条会让全站每个元素都变成 pointer-events: none —— 按钮看得见、点了没反应。
   唯一能解开它的是引导弹窗上的「跳过 / 退出」按钮。
   如果把这个弹窗 display:none 掉，用户就永远点不到「跳过」，
   driver-active 永久残留，整个站彻底报废。
   所以这里只压掉遮罩的暗色背景，弹窗和按钮必须保留可交互。 */

.driver-overlay {
  background-color: transparent !important;
  background-image: none !important;
}

/* 弹窗自己的按钮必须能点 */
.driver-active .driver-popover,
.driver-active .driver-popover * {
  pointer-events: auto !important;
}

/* 引导弹窗跟主题配色统一 */
.driver-popover {
  background: #1a0f2e !important;
  border: 1px solid rgba(255, 143, 193, 0.32) !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.62) !important;
  color: #f2e9ff !important;
}
.driver-popover-title {
  color: #ffd6e8 !important;
  font-weight: 700 !important;
}
.driver-popover-description { color: #d9c9f2 !important; }
.driver-popover-footer button {
  background: rgba(255, 143, 193, 0.18) !important;
  border-color: rgba(255, 143, 193, 0.42) !important;
  color: #ffe7f1 !important;
  border-radius: 8px !important;
  pointer-events: auto !important;
}
.driver-popover-footer button:hover {
  background: rgba(255, 143, 193, 0.32) !important;
}

/* 登录 / 注册页：换成通亮版背景（暗色模式） */
html:has(input[type="password"]) body {
  background-image: url("/anime-bg-login.webp") !important;
  background-position: center center !important;
}

/* 登录页文字要压得住花背景：给标题区加暗色衬底 */
html.dark:has(input[type="password"]) h1,
html.dark:has(input[type="password"]) .text-2xl,
html.dark:has(input[type="password"]) .text-xl,
html.dark:has(input[type="password"]) .text-lg,
html.dark:has(input[type="password"]) .text-sm,
html.dark:has(input[type="password"]) .text-xs,
html.dark:has(input[type="password"]) p,
html.dark:has(input[type="password"]) span {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85), 0 0 22px rgba(0, 0, 0, 0.55);
}

/* 登录卡片加实底，和花背景分开 */
html:has(input[type="password"]) form,
html:has(input[type="password"]) [class*="rounded-2xl"] {
  backdrop-filter: blur(18px) saturate(1.1);
}

/* ---------- 侧边栏 ---------- */
.sidebar, .sidebar-nav, .sidebar-section {
  background: linear-gradient(180deg,
    rgba(24, 14, 42, 0.99) 0%,
    rgba(17, 10, 32, 1) 100%) !important;
  border-color: var(--an-line-soft) !important;
}

.sidebar {
  border-right: 1px solid var(--an-line-soft) !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45) !important;
}

.sidebar-header {
  background: rgba(20, 12, 36, 0.99) !important;
  border-bottom: 1px solid var(--an-line-soft) !important;
  padding-right: 56px !important;
}

.sidebar-section-title {
  color: var(--an-text-mute) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  font-size: 12px !important;
}

.sidebar-link {
  border-radius: 10px !important;
  transition: background .18s ease, color .18s ease !important;
  color: var(--an-text-dim) !important;
}

.sidebar-link:hover {
  background: rgba(255, 143, 193, 0.14) !important;
  color: var(--an-text) !important;
}

.sidebar-link-active, .sidebar-link-active:hover {
  background: linear-gradient(100deg,
    rgba(255, 143, 193, 0.32) 0%,
    rgba(255, 168, 210, 0.22) 100%) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 143, 193, 0.48) !important;
}

/* ---------- 卡片 ---------- */
/* 仪表盘用专用背景，卡片要更透才能看见角色 */
.card, .bg-white,
.dark\:bg-dark-800, .dark\:bg-dark-900, .dark\:bg-dark-950 {
  background: var(--an-panel) !important;
  border-color: var(--an-line-soft) !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.42) !important;
}

/* 仪表盘：.card 半透明，让真昼透上来
   左侧（数据区）实，右侧（空白多）透 */
html.dark[data-page="dashboard"] main .card {
  background-image: linear-gradient(100deg,
    rgba(20, 11, 36, 0.70) 0%,
    rgba(20, 11, 36, 0.50) 42%,
    rgba(20, 11, 36, 0.16) 76%,
    rgba(20, 11, 36, 0.08) 100%) !important;
  background-color: transparent !important;
  backdrop-filter: blur(3px) saturate(1.2) !important;
  border-color: rgba(255, 143, 193, 0.30) !important;
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.26),
              inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* 布局包裹层必须完全透明，否则会盖住背景 */
html.dark[data-page="dashboard"] main [class*="col-span"],
html.dark[data-page="dashboard"] main .space-y-6,
html.dark[data-page="dashboard"] main .grid {
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

/* 仪表盘文字加投影，半透明底上更清楚 */
html.dark[data-page="dashboard"] main .card * {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 0, 0, 0.35);
}

header, .topbar, .dark\:bg-dark-700 {
  background: rgba(17, 10, 32, 0.98) !important;
  border-color: var(--an-line-soft) !important;
}

/* ---------- 表格 ---------- */
table, td, th { border-color: var(--an-line-soft) !important; }
thead { background: rgba(70, 20, 46, 0.96) !important; }
th { color: #e9dcff !important; font-weight: 600 !important; }
td { color: var(--an-text) !important; }
tbody tr:hover { background: rgba(255, 143, 193, 0.08) !important; }

/* 表格所在的 section / 容器要有实底，否则亮色下会露出灰 */
section,
[class*="overflow-hidden"][class*="rounded-2xl"] {
  background-color: var(--an-panel) !important;
  border-color: var(--an-line-soft) !important;
}

/* 表格外层容器：内页保持半透，让角色隐约透出 */
html.dark main section,
html.dark main [class*="overflow-hidden"][class*="rounded-2xl"] {
  background-color: rgba(24, 13, 42, 0.82) !important;
}

/* 表体容器 */
[class*="overflow-x-auto"],
[class*="overflow-y-auto"] {
  background-color: transparent !important;
}

/* 分页栏 */
[class*="pagination"],
[class*="page-size"] {
  background-color: transparent !important;
}

/* 右侧那条粉色竖条是滚动条轨道，收窄一点 */
::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

/* ============================================================
   主色：teal / emerald / primary -> 樱粉
   ============================================================ */
[class*="from-primary-"], [class*="from-emerald-"],
[class*="from-teal-"], [class*="from-green-"] {
  --tw-gradient-from: var(--an-sakura-deep) var(--tw-gradient-from-position, 0%) !important;
  --tw-gradient-to: rgba(255, 77, 148, 0) var(--tw-gradient-to-position, 100%) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

[class*="to-primary-"], [class*="to-emerald-"],
[class*="to-teal-"], [class*="to-green-"] {
  --tw-gradient-to: var(--an-violet) var(--tw-gradient-to-position, 100%) !important;
}

.bg-emerald-500, .bg-emerald-600, .bg-emerald-700,
.bg-teal-500, .bg-teal-600, .bg-green-500, .bg-green-600,
.btn-primary, .bg-primary-500, .bg-primary-600 {
  background-color: transparent !important;
  background-image: linear-gradient(100deg, var(--an-sakura-deep) 0%, var(--an-violet) 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 3px 14px rgba(255, 77, 148, 0.28) !important;
}

.btn-primary:hover, .bg-primary-500:hover {
  filter: brightness(1.10);
  box-shadow: 0 5px 20px rgba(255, 77, 148, 0.44) !important;
}

.bg-emerald-50, .bg-emerald-100, .bg-emerald-900, .bg-emerald-950,
.bg-primary-50, .bg-primary-100, .bg-primary-900 {
  background-color: rgba(255, 143, 193, 0.16) !important;
}

.text-emerald-500, .text-emerald-600, .text-emerald-700,
.text-teal-500, .text-teal-600, .text-green-500, .text-green-600,
.text-primary-500, .text-primary-600, .accent-primary-600 {
  color: var(--an-sakura) !important;
}

.border-emerald-200, .border-emerald-300, .border-emerald-400, .border-emerald-500,
.border-emerald-600, .border-emerald-700, .border-emerald-800, .border-emerald-900,
.border-primary-200, .border-primary-300, .border-primary-400, .border-primary-500,
[class*="border-b-primary-"], [class*="border-b-emerald-"] {
  border-color: rgba(255, 143, 193, 0.55) !important;
}

[class*="ring-primary-"], [class*="ring-emerald-"], [class*="ring-teal-"] {
  --tw-ring-color: rgba(255, 143, 193, 0.45) !important;
}

/* ---------- 次要按钮 ---------- */
.btn-secondary {
  background: rgba(88, 28, 62, 0.88) !important;
  border-color: var(--an-line-soft) !important;
  color: var(--an-text) !important;
  border-radius: 10px !important;
}

.btn-secondary:hover {
  background: rgba(112, 34, 76, 0.92) !important;
  border-color: var(--an-sakura) !important;
}

.btn { border-radius: 10px !important; }

/* ---------- 输入 ---------- */
input, textarea, select, .input {
  background: rgba(12, 7, 22, 0.92) !important;
  border-color: rgba(255, 150, 200, 0.24) !important;
  color: var(--an-text) !important;
  border-radius: 10px !important;
}

input:focus, textarea:focus, select:focus, .input:focus {
  border-color: var(--an-sakura) !important;
  box-shadow: 0 0 0 3px rgba(255, 143, 193, 0.18) !important;
  outline: none !important;
}

::placeholder { color: rgba(171, 161, 194, 0.78) !important; }

/* ---------- 文字 ---------- */
.dark\:text-white, h1, h2, h3, h4, h5, h6 { color: var(--an-text) !important; }
.dark\:text-gray-300, .dark\:text-gray-400, .dark\:text-gray-500 {
  color: var(--an-text-dim) !important;
}
.text-gray-500, .text-gray-600 { color: var(--an-text-dim) !important; }
.text-gray-400 { color: var(--an-text-mute) !important; }

/* ---------- 徽章 ---------- */
.badge, span.rounded-full, .tag { border-radius: 999px !important; }
.badge-primary {
  background: rgba(255, 143, 193, 0.18) !important;
  color: #ffd8e8 !important;
  border: 1px solid rgba(255, 143, 193, 0.38) !important;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(12, 7, 22, 0.7); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255,143,193,0.78), rgba(255, 168, 210,0.78));
  border-radius: 999px;
  border: 2px solid rgba(12, 7, 22, 0.85);
}

/* ---------- 链接 ---------- */
a { color: var(--an-sakura) !important; }
a:hover { color: var(--an-violet) !important; }

/* ---------- 弹窗 ---------- */
[role="dialog"], .modal {
  background: linear-gradient(165deg, rgba(48, 14, 34, 0.99), rgba(18, 11, 34, 1)) !important;
  border: 1px solid var(--an-line-soft) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.66) !important;
}

hr, .dark\:border-dark-700, .dark\:border-dark-600 {
  border-color: var(--an-line-soft) !important;
}

/* ============================================================
   亮色模式：整体重写，保证对比度
   ------------------------------------------------------------
   核心思路：亮底 + 深字，主色用更深的玫红，卡片近白不透明
   ============================================================ */
html:not(.dark) {
  background-color: #fff0f7 !important;
  color-scheme: light;
}

html:not(.dark) body {
  background-color: #fff0f7 !important;
  background-image: url("/anime-bg-light.webp") !important;
  background-size: cover !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
  color: #2b2038 !important;
}

/* 亮色下背景要淡，否则压不住 */
html:not(.dark) body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(255, 250, 252, 0.52);
}

html:not(.dark) .sidebar,
html:not(.dark) .sidebar-nav,
html:not(.dark) .sidebar-section,
html:not(.dark) .sidebar-header {
  background: rgba(255, 252, 254, 0.97) !important;
  border-color: rgba(214, 120, 165, 0.22) !important;
}

html:not(.dark) .sidebar {
  box-shadow: 4px 0 22px rgba(180, 120, 150, 0.14) !important;
}

html:not(.dark) .sidebar-link {
  color: #55415f !important;
}

html:not(.dark) .sidebar-link:hover {
  background: rgba(255, 143, 193, 0.18) !important;
  color: #d81b6b !important;
}

html:not(.dark) .sidebar-link-active,
html:not(.dark) .sidebar-link-active:hover {
  background: linear-gradient(100deg, rgba(255, 143, 193, 0.32) 0%, rgba(255, 168, 210, 0.24) 100%) !important;
  color: #a8155c !important;
  font-weight: 600 !important;
  box-shadow: inset 0 0 0 1px rgba(214, 90, 150, 0.32) !important;
}

html:not(.dark) .sidebar-section-title {
  color: #8a7a95 !important;
}

html:not(.dark) .card,
html:not(.dark) .bg-white {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(232, 100, 155, 0.26) !important;
  box-shadow: 0 4px 16px rgba(180, 120, 150, 0.10) !important;
}

html:not(.dark) header,
html:not(.dark) .topbar {
  background: rgba(255, 252, 254, 0.96) !important;
  border-color: rgba(232, 100, 155, 0.26) !important;
}

html:not(.dark) thead {
  background: rgba(255, 232, 243, 0.90) !important;
}

html:not(.dark) th {
  color: #a8155c !important;
  font-weight: 600 !important;
}

html:not(.dark) td,
html:not(.dark) table {
  color: #2b2038 !important;
  border-color: rgba(214, 120, 165, 0.16) !important;
}

html:not(.dark) tbody tr:hover {
  background: rgba(255, 143, 193, 0.10) !important;
}

html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4 {
  color: #2e1424 !important;
}

html:not(.dark) .text-gray-900,
html:not(.dark) .text-gray-800,
html:not(.dark) .text-gray-700 {
  color: #2b2038 !important;
}

html:not(.dark) .text-gray-600,
html:not(.dark) .text-gray-500 {
  color: #7a4a62 !important;
}

html:not(.dark) .text-gray-400 {
  color: #7d6f88 !important;
}

html:not(.dark) a {
  color: #d81b6b !important;
}

html:not(.dark) a:hover {
  color: #d63b7d !important;
}

html:not(.dark) .btn-primary {
  background-image: linear-gradient(100deg, #e93c86 0%, #ff5c9e 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 14px rgba(214, 60, 134, 0.28) !important;
}

html:not(.dark) .btn-secondary {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(214, 120, 165, 0.30) !important;
  color: #6a3a52 !important;
}

html:not(.dark) input,
html:not(.dark) textarea,
html:not(.dark) select,
html:not(.dark) .input {
  background: #ffffff !important;
  border-color: rgba(214, 120, 165, 0.28) !important;
  color: #2b2038 !important;
}

html:not(.dark) ::placeholder {
  color: #9a8ca6 !important;
}

html:not(.dark) ::-webkit-scrollbar-track {
  background: rgba(255, 240, 247, 0.94);
}

html:not(.dark) ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(233,60,134,0.55), rgba(255, 92, 158,0.55));
  border-color: rgba(255, 240, 247, 0.94);
}

html:not(.dark) [role="dialog"],
html:not(.dark) .modal {
  background: #ffffff !important;
  border-color: rgba(214, 120, 165, 0.24) !important;
}

html:not(.dark) .text-emerald-500,
html:not(.dark) .text-emerald-600,
html:not(.dark) .text-primary-500,
html:not(.dark) .text-primary-600 {
  color: #d81b6b !important;
}

/* 亮色模式下小熊水印淡一点 */
html:not(.dark) body::after {
  opacity: 0.22;
}

html:not(.dark) .chart-container text,
html:not(.dark) canvas {
  color: #6a3a52 !important;
}

/* ---------- 亮色模式兜底：把残留的 dark:* 深色类全部压掉 ---------- */
html:not(.dark) .dark\:bg-dark-800,
html:not(.dark) .dark\:bg-dark-900,
html:not(.dark) .dark\:bg-dark-950,
html:not(.dark) .dark\:bg-dark-700,
html:not(.dark) .dark\:bg-dark-600 {
  background-color: rgba(255, 255, 255, 0.94) !important;
  background-image: none !important;
  border-color: rgba(214, 120, 165, 0.18) !important;
}

html:not(.dark) .dark\:bg-slate-800,
html:not(.dark) .dark\:bg-slate-900,
html:not(.dark) .dark\:bg-gray-800,
html:not(.dark) .dark\:bg-gray-900 {
  background-color: rgba(255, 255, 255, 0.94) !important;
  background-image: none !important;
}

html:not(.dark) .dark\:text-white,
html:not(.dark) .dark\:text-gray-100,
html:not(.dark) .dark\:text-gray-200,
html:not(.dark) .dark\:text-gray-300 {
  color: #2e1424 !important;
}

html:not(.dark) .dark\:text-gray-400,
html:not(.dark) .dark\:text-gray-500 {
  color: #7a4a62 !important;
}

html:not(.dark) .dark\:border-dark-600,
html:not(.dark) .dark\:border-dark-700,
html:not(.dark) .dark\:border-dark-800 {
  border-color: rgba(232, 100, 155, 0.26) !important;
}

/* 主内容区：亮底，别让背景透太多 */
html:not(.dark) main {
  background: rgba(255, 250, 252, 0.42) !important;
}

/* 亮色下表格容器要白，不然露出一片灰 */
html:not(.dark) section,
html:not(.dark) [class*="overflow-hidden"][class*="rounded-2xl"] {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(232, 100, 155, 0.26) !important;
}

html:not(.dark) .pz-cell {
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: #2b2038 !important;
}

/* 亮色下的滚动条更细更淡 */
html:not(.dark) ::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}
html:not(.dark) ::-webkit-scrollbar-thumb {
  background: rgba(214, 120, 165, 0.32) !important;
  border: 2px solid rgba(255, 250, 252, 0.9) !important;
}

/* 亮色下登录页：换成亮色背景图，文字改深色不用阴影 */
html:not(.dark):has(input[type="password"]) body {
  background-image: url("/anime-bg-light.webp") !important;
  background-position: center center !important;
}

html:not(.dark):has(input[type="password"]) h1,
html:not(.dark):has(input[type="password"]) .text-2xl,
html:not(.dark):has(input[type="password"]) .text-xl,
html:not(.dark):has(input[type="password"]) .text-lg,
html:not(.dark):has(input[type="password"]) p,
html:not(.dark):has(input[type="password"]) span {
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.95), 0 0 16px rgba(255, 255, 255, 0.8) !important;
  color: #3b2a48 !important;
}

html:not(.dark):has(input[type="password"]) form,
html:not(.dark):has(input[type="password"]) [class*="rounded-2xl"] {
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 18px 50px rgba(150, 90, 120, 0.18) !important;
}

/* 亮色模式的小熊水印换个色（棕熊在浅底上要深点） */
html:not(.dark) body::after {
  filter: drop-shadow(0 4px 10px rgba(180, 120, 90, 0.28)) saturate(0.9);
}

/* ============================================================
   粉色强化（2026-11-29）
   目标：整体从「紫黑」偏向「樱粉玫瑰」，紫色只作为点缀
   ============================================================ */

/* 主按钮：樱花粉渐变，去掉紫味 */
.btn-primary,
.bg-primary-500,
.bg-primary-600,
.bg-emerald-500,
.bg-emerald-600 {
  background-image: linear-gradient(100deg, #ff5c9e 0%, #ff8fc1 55%, #ffb3d1 100%) !important;
  box-shadow: 0 3px 16px rgba(255, 92, 158, 0.40) !important;
}

.btn-primary:hover,
.bg-primary-500:hover {
  box-shadow: 0 6px 24px rgba(255, 92, 158, 0.58) !important;
  filter: brightness(1.06) !important;
}

/* 侧边栏激活项：粉色高亮带 */
.sidebar-link-active,
.sidebar-link[class*="active"] {
  background: linear-gradient(90deg,
    rgba(255, 92, 158, 0.26) 0%,
    rgba(255, 143, 193, 0.10) 60%,
    transparent 100%) !important;
  border-left: 3px solid #ff5c9e !important;
  color: #ffe4f0 !important;
}

/* 表格 hover：淡粉 */
tbody tr:hover {
  background: rgba(255, 143, 193, 0.10) !important;
}

/* 表头：粉调 */
thead {
  background: rgba(88, 22, 52, 0.94) !important;
}
th {
  color: #ffd2e6 !important;
}

/* 卡片描边：粉 */
.card,
.dark\:bg-dark-800,
.dark\:bg-dark-900 {
  border-color: rgba(255, 128, 180, 0.24) !important;
}

/* 徽章 / 标签：粉 */
.tag,
.badge,
[class*="badge"] {
  background: rgba(255, 128, 180, 0.18) !important;
  color: #ffc4dd !important;
}

/* 输入框聚焦：粉光环 */
input:focus,
textarea:focus,
select:focus {
  border-color: #ff5c9e !important;
  box-shadow: 0 0 0 3px rgba(255, 92, 158, 0.18) !important;
  outline: none !important;
}

/* 滚动条：粉 */
::-webkit-scrollbar-thumb {
  background: rgba(255, 128, 180, 0.42) !important;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 128, 180, 0.68) !important;
}
::-webkit-scrollbar-track {
  background: rgba(56, 18, 40, 0.5) !important;
}

/* 链接 / 强调文字 */
a.text-primary-600,
.text-primary-600,
.text-primary-500 {
  color: #ff8fc1 !important;
}

/* 顶部导航条：粉边框 */
header,
.topbar {
  border-bottom: 1px solid rgba(255, 128, 180, 0.22) !important;
}

/* 分隔线 */
hr,
.divide-y > *,
[class*="divide-"] > * {
  border-color: rgba(255, 128, 180, 0.14) !important;
}

/* ============================================================
   粉色强化 · 第二轮（2026-11-29 晚）
   上一轮还是偏玫瑰紫，这轮把底色和卡片彻底钉到粉调
   ============================================================ */

/* 页面底色：粉调深底 */
html,
body {
  background-color: #1a0a14 !important;
}

/* 侧边栏：玫瑰粉底 */
.sidebar,
aside.sidebar,
.sidebar-header,
.sidebar-nav,
.sidebar-section {
  background: linear-gradient(180deg,
    rgba(64, 16, 40, 0.98) 0%,
    rgba(38, 10, 24, 0.98) 100%) !important;
  border-right: 1px solid rgba(255, 110, 170, 0.28) !important;
}

/* 侧边栏文字 */
.sidebar a,
.sidebar button,
.sidebar-link {
  color: #ffd9e9 !important;
}

/* 侧边栏 hover */
.sidebar a:hover,
.sidebar-link:hover {
  background: rgba(255, 110, 170, 0.16) !important;
  color: #fff !important;
}

/* 侧边栏当前项：实粉 */
.sidebar-link-active,
.sidebar a[class*="active"] {
  background: linear-gradient(90deg,
    rgba(255, 77, 148, 0.42) 0%,
    rgba(255, 110, 170, 0.18) 70%,
    transparent 100%) !important;
  border-left: 3px solid #ff4d94 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* 卡片：粉透明 */
.card,
.dark\:bg-dark-800,
.dark\:bg-dark-900,
.dark\:bg-dark-950 {
  background: rgba(56, 18, 40, 0.90) !important;
  border-color: rgba(255, 110, 170, 0.26) !important;
  box-shadow: 0 6px 22px rgba(40, 6, 22, 0.55) !important;
}

/* 表格容器 */
section,
[class*="overflow-hidden"][class*="rounded-2xl"] {
  background-color: rgba(48, 15, 34, 0.94) !important;
  border-color: rgba(255, 110, 170, 0.24) !important;
}

/* 表头 */
thead,
thead tr {
  background: rgba(88, 22, 52, 0.96) !important;
}
th {
  color: #ffc9e0 !important;
  border-bottom: 1px solid rgba(255, 110, 170, 0.30) !important;
}

/* 表格行分隔 */
tbody tr {
  border-bottom: 1px solid rgba(255, 110, 170, 0.12) !important;
}
tbody tr:hover {
  background: rgba(255, 110, 170, 0.13) !important;
}

/* 主按钮：纯粉渐变，无紫 */
.btn-primary,
.bg-primary-500,
.bg-primary-600,
.bg-emerald-500,
.bg-emerald-600 {
  background-image: linear-gradient(100deg,
    #ff4d94 0%,
    #ff70ab 50%,
    #ff9dc6 100%) !important;
  border-color: rgba(255, 120, 175, 0.55) !important;
  box-shadow: 0 4px 18px rgba(255, 77, 148, 0.48) !important;
}

/* 次要按钮：粉描边 */
.btn-secondary,
.btn-ghost,
button[class*="btn-"]:not(.btn-primary) {
  background: rgba(255, 110, 170, 0.10) !important;
  border-color: rgba(255, 110, 170, 0.34) !important;
  color: #ffd9e9 !important;
}
.btn-secondary:hover,
.btn-ghost:hover,
button[class*="btn-"]:not(.btn-primary):hover {
  background: rgba(255, 110, 170, 0.22) !important;
  border-color: rgba(255, 110, 170, 0.55) !important;
}

/* 顶栏 */
header,
.topbar {
  background: rgba(44, 12, 30, 0.96) !important;
  border-bottom: 1px solid rgba(255, 110, 170, 0.26) !important;
}

/* 输入框 */
input,
textarea,
select {
  background: rgba(40, 10, 26, 0.92) !important;
  border-color: rgba(255, 110, 170, 0.30) !important;
  color: #fff5fa !important;
}
input::placeholder,
textarea::placeholder {
  color: rgba(255, 200, 220, 0.45) !important;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #ff4d94 !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 148, 0.22) !important;
}

/* 弹窗 */
.modal-overlay {
  background: rgba(20, 4, 12, 0.72) !important;
  backdrop-filter: blur(4px) !important;
}
.modal-content,
.modal-header,
.modal-body,
.modal-footer {
  background: rgba(56, 18, 40, 0.98) !important;
  border-color: rgba(255, 110, 170, 0.28) !important;
}
.modal-header {
  border-bottom: 1px solid rgba(255, 110, 170, 0.26) !important;
}
.modal-footer {
  border-top: 1px solid rgba(255, 110, 170, 0.26) !important;
}

/* 行操作菜单 */
.action-menu-content {
  background: rgba(64, 20, 44, 0.98) !important;
  border: 1px solid rgba(255, 110, 170, 0.32) !important;
  box-shadow: 0 10px 32px rgba(30, 4, 16, 0.68) !important;
}
.action-menu-content a,
.action-menu-content button {
  color: #ffe0ee !important;
}
.action-menu-content a:hover,
.action-menu-content button:hover {
  background: rgba(255, 110, 170, 0.20) !important;
}

/* 数字 / 金额强调 */
.text-emerald-500,
.text-emerald-600,
.text-primary-500,
.text-primary-600 {
  color: #ff8fc1 !important;
}

/* 徽章 */
.tag,
.badge,
[class*="badge"],
[class*="tag"] {
  background: rgba(255, 110, 170, 0.20) !important;
  color: #ffd0e4 !important;
  border-color: rgba(255, 110, 170, 0.34) !important;
}

/* 滚动条 */
::-webkit-scrollbar-thumb {
  background: rgba(255, 110, 170, 0.50) !important;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 110, 170, 0.78) !important;
}
::-webkit-scrollbar-track {
  background: rgba(40, 10, 26, 0.6) !important;
}

/* 分页 / 下拉 */
.pagination button,
[class*="pagination"] button {
  background: rgba(255, 110, 170, 0.10) !important;
  border-color: rgba(255, 110, 170, 0.30) !important;
}

/* ============================================================
   亮色模式（2026-11-29 重写）
   ------------------------------------------------------------
   上一轮的深色粉化规则漏加 html.dark 限定，导致亮色下
   <tr>/<td> 是 rgba(44,12,30,.86) 这种深黑紫，在 #fff0f7 的浅粉
   页面上就是一块块黑斑。
   这里把亮色模式的所有元素重新定义一遍，浅粉底 + 深色字。
   ============================================================ */

html:not(.dark) {
  color-scheme: light;
}

/* 页面底 */
html:not(.dark),
html:not(.dark) body {
  background-color: #fff0f7 !important;
  color: #2b2038 !important;
}

/* 侧边栏 / 顶栏：浅粉白 */
html:not(.dark) .sidebar,
html:not(.dark) aside.sidebar,
html:not(.dark) .sidebar-header,
html:not(.dark) .sidebar-nav,
html:not(.dark) .sidebar-section,
html:not(.dark) header,
html:not(.dark) .topbar {
  background: rgba(255, 252, 254, 0.97) !important;
  border-color: rgba(226, 138, 174, 0.28) !important;
  color: #2b2038 !important;
}

/* 侧边栏文字 */
html:not(.dark) .sidebar a,
html:not(.dark) .sidebar button,
html:not(.dark) .sidebar-link,
html:not(.dark) .sidebar-nav * {
  color: #4a3a52 !important;
}

/* 侧边栏当前项：浅粉底 + 深粉字 */
html:not(.dark) .sidebar-link-active,
html:not(.dark) .sidebar a[class*="active"] {
  background: linear-gradient(90deg,
    rgba(255, 143, 193, 0.30) 0%,
    rgba(255, 143, 193, 0.12) 70%,
    transparent 100%) !important;
  border-left: 3px solid #d81b6b !important;
  color: #a8155c !important;
  font-weight: 600 !important;
}

/* 卡片：纯白微透明 */
html:not(.dark) .card,
html:not(.dark) .dark\:bg-dark-800,
html:not(.dark) .dark\:bg-dark-900,
html:not(.dark) .dark\:bg-dark-950 {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(226, 138, 174, 0.26) !important;
  box-shadow: 0 4px 18px rgba(200, 120, 155, 0.10) !important;
  color: #2b2038 !important;
}

/* 表格容器 */
html:not(.dark) section,
html:not(.dark) [class*="overflow-hidden"][class*="rounded-2xl"],
html:not(.dark) .table-wrapper,
html:not(.dark) .table-scroll-container {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(226, 138, 174, 0.24) !important;
}

/* 表格本体：白底 */
html:not(.dark) table,
html:not(.dark) tbody,
html:not(.dark) tbody tr,
html:not(.dark) tbody td {
  background-color: #ffffff !important;
  color: #2b2038 !important;
}

/* 斑马纹：淡粉 */
html:not(.dark) tbody tr:nth-child(even),
html:not(.dark) tbody tr:nth-child(even) td {
  background-color: #fff8fb !important;
}

/* hover：粉 */
html:not(.dark) tbody tr:hover,
html:not(.dark) tbody tr:hover td {
  background-color: #ffeaf3 !important;
}

/* 表头：浅粉底 + 深粉字 */
html:not(.dark) thead,
html:not(.dark) thead tr,
html:not(.dark) thead th,
html:not(.dark) .table-header {
  background-color: #ffe4ef !important;
  color: #8c1b4a !important;
  border-bottom: 1px solid rgba(226, 138, 174, 0.34) !important;
  font-weight: 600 !important;
}

/* 单元格边框 */
html:not(.dark) td,
html:not(.dark) th {
  border-color: rgba(226, 138, 174, 0.20) !important;
}

/* 固定列 */
html:not(.dark) tbody td:first-child,
html:not(.dark) td.sticky,
html:not(.dark) [class*="sticky-col"] {
  background-color: #ffffff !important;
}
html:not(.dark) thead th:first-child,
html:not(.dark) thead th.sticky,
html:not(.dark) thead [class*="sticky-col"] {
  background-color: #ffe4ef !important;
}

/* 表格里的文字：全深色 */
html:not(.dark) td,
html:not(.dark) td *,
html:not(.dark) tbody span,
html:not(.dark) tbody div {
  color: #2b2038 !important;
}

/* 表头里的文字 */
html:not(.dark) th,
html:not(.dark) th * {
  color: #8c1b4a !important;
}

/* 分页条 */
html:not(.dark) [class*="pagination"],
html:not(.dark) .pagination,
html:not(.dark) footer[class*="border"] {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(226, 138, 174, 0.22) !important;
  color: #4a3a52 !important;
}

/* 输入框：白底深字 */
html:not(.dark) input,
html:not(.dark) textarea,
html:not(.dark) select {
  background-color: #ffffff !important;
  border-color: rgba(226, 138, 174, 0.38) !important;
  color: #2b2038 !important;
}
html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
  color: #a892a0 !important;
}
html:not(.dark) input:focus,
html:not(.dark) textarea:focus,
html:not(.dark) select:focus {
  border-color: #d81b6b !important;
  box-shadow: 0 0 0 3px rgba(216, 27, 107, 0.14) !important;
}

/* 主按钮：亮粉渐变 + 白字 */
html:not(.dark) .btn-primary,
html:not(.dark) .bg-primary-500,
html:not(.dark) .bg-primary-600,
html:not(.dark) .bg-emerald-500,
html:not(.dark) .bg-emerald-600 {
  background-image: linear-gradient(100deg,
    #e93c86 0%,
    #ff5c9e 55%,
    #ff8fc1 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 3px 14px rgba(233, 60, 134, 0.30) !important;
}

/* 次要按钮：浅粉底 + 深粉字 */
html:not(.dark) .btn-secondary,
html:not(.dark) .btn-ghost,
html:not(.dark) button[class*="btn-"]:not(.btn-primary) {
  background-color: rgba(255, 143, 193, 0.14) !important;
  border-color: rgba(226, 138, 174, 0.42) !important;
  color: #8c1b4a !important;
}
html:not(.dark) .btn-secondary:hover,
html:not(.dark) .btn-ghost:hover,
html:not(.dark) button[class*="btn-"]:not(.btn-primary):hover {
  background-color: rgba(255, 143, 193, 0.26) !important;
  border-color: #e93c86 !important;
}

/* 弹窗 */
html:not(.dark) .modal-overlay {
  background: rgba(60, 20, 40, 0.42) !important;
}
html:not(.dark) .modal-content,
html:not(.dark) .modal-header,
html:not(.dark) .modal-body,
html:not(.dark) .modal-footer {
  background-color: #ffffff !important;
  border-color: rgba(226, 138, 174, 0.26) !important;
  color: #2b2038 !important;
}
html:not(.dark) .modal-header,
html:not(.dark) .modal-footer {
  border-color: rgba(226, 138, 174, 0.22) !important;
}

/* 行操作菜单 */
html:not(.dark) .action-menu-content {
  background-color: #ffffff !important;
  border: 1px solid rgba(226, 138, 174, 0.30) !important;
  box-shadow: 0 10px 30px rgba(180, 100, 140, 0.20) !important;
}
html:not(.dark) .action-menu-content a,
html:not(.dark) .action-menu-content button {
  color: #2b2038 !important;
}
html:not(.dark) .action-menu-content a:hover,
html:not(.dark) .action-menu-content button:hover {
  background-color: #ffeaf3 !important;
  color: #a8155c !important;
}

/* 下拉面板 */
html:not(.dark) [class*="dropdown"],
html:not(.dark) [class*="select-menu"],
html:not(.dark) [class*="listbox"],
html:not(.dark) [role="listbox"] {
  background-color: #ffffff !important;
  border-color: rgba(226, 138, 174, 0.30) !important;
  color: #2b2038 !important;
}
html:not(.dark) [role="option"]:hover,
html:not(.dark) [class*="dropdown"] li:hover {
  background-color: #ffeaf3 !important;
}

/* 徽章 / 标签 */
html:not(.dark) .tag,
html:not(.dark) .badge,
html:not(.dark) [class*="badge"],
html:not(.dark) [class*="tag"] {
  background-color: rgba(255, 143, 193, 0.20) !important;
  color: #a8155c !important;
  border-color: rgba(226, 138, 174, 0.38) !important;
}

/* 滚动条 */
html:not(.dark) ::-webkit-scrollbar-thumb {
  background: rgba(226, 138, 174, 0.46) !important;
}
html:not(.dark) ::-webkit-scrollbar-track {
  background: rgba(255, 240, 247, 0.8) !important;
}

/* 强调文字 */
html:not(.dark) .text-primary-500,
html:not(.dark) .text-primary-600,
html:not(.dark) .text-emerald-500,
html:not(.dark) .text-emerald-600 {
  color: #d81b6b !important;
}

/* 分隔线 */
html:not(.dark) hr,
html:not(.dark) .divide-y > *,
html:not(.dark) [class*="divide-"] > * {
  border-color: rgba(226, 138, 174, 0.20) !important;
}

/* 通用文字兜底：亮色下别用浅粉白 */
html:not(.dark) .text-white,
html:not(.dark) .text-gray-100,
html:not(.dark) .text-gray-200 {
  color: #2b2038 !important;
}
html:not(.dark) .text-gray-300,
html:not(.dark) .text-gray-400 {
  color: #6b5b70 !important;
}
html:not(.dark) .text-gray-500,
html:not(.dark) .text-gray-600 {
  color: #5c4d68 !important;
}
/* 但按钮里的白字要保住 */
html:not(.dark) .btn-primary,
html:not(.dark) .btn-primary * {
  color: #ffffff !important;
}
