/* ============================================================
   YILI Light-Theme Fix (light-fix.css)
   ------------------------------------------------------------
   修复日间模式下仍残留夜间配色的板块，覆盖三个来源：
   1) workspace.css        —— 工作空间页（原画师/评价）
   2) workspace-shell.css  —— 侧栏 / 顶栏框架
   3) assets/index-98c17182.css —— 首页 React 应用 + 资产库
      （该文件被压缩、无源码，这里用更高优先级覆盖）
   ============================================================ */

/* ------------------------------------------------------------
   0) 通用：确保 html/body 背景随主题变量走
   ---------------------------------------------------------- */
html[data-theme="light"], html[data-theme="light"] body {
  background: #f4f5f9;
  color: #1b1924;
}

/* ------------------------------------------------------------
   1) workspace.css —— 工作空间页遗漏组件
   ---------------------------------------------------------- */
[data-theme="light"] .brand-mark {
  background: #f4f0fc;
  color: #5b21b6;
  border: 1px solid rgba(109, 40, 217, .22);
}

[data-theme="light"] .generated-image {
  box-shadow: 0 18px 44px rgba(30, 27, 48, .18);
}

[data-theme="light"] .progress-title { color: #2a2436; }
[data-theme="light"] .progress-note  { color: #625d6e; }
[data-theme="light"] .progress-ring  { border-color: rgba(124, 58, 237, .22); border-top-color: #6d28d9; }

[data-theme="light"] .status-line   { color: #4b4657; }
[data-theme="light"] .breadcrumb strong { color: #2a2436; }

[data-theme="light"] .empty-orbit {
  border-color: rgba(124, 58, 237, .3);
  background: radial-gradient(circle, rgba(124, 58, 237, .1), rgba(124, 58, 237, .02));
  color: #6d28d9;
  box-shadow: 0 0 30px rgba(124, 58, 237, .08);
}
[data-theme="light"] .empty-state h3 { color: #2a2436; }

[data-theme="light"] .dropzone-title { color: #37324a; }

[data-theme="light"] .toast {
  background: rgba(255, 255, 255, .98);
  color: #2c2736;
  border-color: rgba(30, 27, 48, .12);
}
[data-theme="light"] .toast.error { border-color: rgba(244, 63, 94, .34); color: #9f1239; }

[data-theme="light"] .history-card-preview span {
  background: rgba(255, 255, 255, .85);
  color: #2a2436;
}

[data-theme="light"] .notice.info    { border-color: rgba(14, 116, 144, .3);  background: rgba(6, 182, 212, .08);  color: #155e75; }
[data-theme="light"] .notice.success { border-color: rgba(5, 150, 105, .3);   background: rgba(16, 185, 129, .08); color: #065f46; }
[data-theme="light"] .notice.error   { border-color: rgba(225, 29, 72, .3);   background: rgba(244, 63, 94, .08);  color: #9f1239; }

[data-theme="light"] .field-error { color: #be123c; }
[data-theme="light"] .btn.danger { border-color: rgba(225, 29, 72, .34); color: #be123c; }

/* ------------------------------------------------------------
   2) workspace-shell.css —— 框架层遗漏
   ---------------------------------------------------------- */
html[data-theme="light"] .brand-mark {
  background: #f4f0fc url('/workspace-assets/yili-mark.svg') center / cover no-repeat !important;
  box-shadow: 0 0 18px rgba(124, 58, 237, .14) !important;
}

/* 侧栏状态卡片（shell 中用 !important 强制暗色） */
html[data-theme="light"] .sidebar-status {
  background: #ffffff !important;
  border: 1px solid rgba(30, 27, 48, .13) !important;
  color: #3d3749 !important;
}

/* 主题切换按钮在 shell 中也是 !important 强制暗色 */
html[data-theme="light"] #yili-theme-toggle {
  background: #ffffff !important;
  border: 1px solid rgba(30, 27, 48, .16) !important;
  color: #3d3749 !important;
}
html[data-theme="light"] #yili-theme-toggle:hover {
  background: #f2f0f9 !important;
  border-color: rgba(109, 40, 217, .45) !important;
}

/* ------------------------------------------------------------
   3) assets/index-98c17182.css —— 首页 React 应用 + 资产库
      压缩文件无法改源码，用更高优先级覆盖
   ---------------------------------------------------------- */

/* 3.1 根变量反转：React 应用用 var(--*) 的地方会跟随 */
html[data-theme="light"] body,
html[data-theme="light"] #root {
  background: #f4f5f9;
  color: #1b1924;
}

/* 3.2 通用面板/卡片反白（限定在 React 应用容器内，避免污染工作空间页） */
#root [class*="panel"],
#root [class*="card"],
#root [class*="modal"],
#root [class*="dialog"] {
  /* 仅当组件原本用暗色背景时才需要反转，
     但由于压缩文件无法判断，统一给浅色 + 深文字 */
  --tw-shadow: 0 8px 30px rgba(30, 27, 48, .06);
}

/* 3.3 资产库（library-*）逐类覆盖 */
html[data-theme="light"] .library-page,
html[data-theme="light"] .library-page * {
  /* 文字基色 */
  color: inherit;
}
html[data-theme="light"] .library-page { color: #1b1924; }

html[data-theme="light"] .library-stats,
html[data-theme="light"] .library-auth-card,
html[data-theme="light"] .library-state-card,
html[data-theme="light"] .library-upload-panel,
html[data-theme="light"] .library-card,
html[data-theme="light"] .library-modal > div {
  background: #ffffff;
  border-color: rgba(30, 27, 48, .13);
  color: #1b1924;
  box-shadow: 0 8px 30px rgba(30, 27, 48, .06);
}

/* storage 面板保留一点浅绿渐变，避免单调 */
html[data-theme="light"] .library-storage-panel {
  background: linear-gradient(135deg, #f2f7f4, #f7f5fc);
  border-color: rgba(30, 27, 48, .13);
  color: #1b1924;
}

/* 分割线 / 网格线 */
html[data-theme="light"] .library-stats span,
html[data-theme="light"] .library-storage-grid article,
html[data-theme="light"] .library-security-grid > div,
html[data-theme="light"] .library-card-actions button,
html[data-theme="light"] .library-card-actions a {
  border-color: rgba(30, 27, 48, .13);
}

/* 输入框 */
html[data-theme="light"] .library-toolbar input,
html[data-theme="light"] .library-search input,
html[data-theme="light"] .library-upload-fields input,
html[data-theme="light"] .library-upload-fields textarea,
html[data-theme="light"] .library-modal input,
html[data-theme="light"] .library-modal textarea {
  background: #ffffff;
  border-color: rgba(30, 27, 48, .18);
  color: #201d29;
}
html[data-theme="light"] .library-toolbar input::placeholder,
html[data-theme="light"] .library-search input::placeholder,
html[data-theme="light"] .library-upload-fields textarea::placeholder {
  color: #9893a3;
}

/* 按钮 */
html[data-theme="light"] .library-toolbar button,
html[data-theme="light"] .library-upload-fields button,
html[data-theme="light"] .library-card-actions button,
html[data-theme="light"] .library-card-actions a,
html[data-theme="light"] .library-modal footer button,
html[data-theme="light"] .library-storage-panel button {
  background: #f6f5fa;
  border-color: rgba(30, 27, 48, .16);
  color: #3d3749;
}
html[data-theme="light"] .library-toolbar button:hover,
html[data-theme="light"] .library-upload-fields button:hover,
html[data-theme="light"] .library-modal footer button:hover,
html[data-theme="light"] .library-storage-panel button:hover {
  background: #eceaf6;
}
html[data-theme="light"] .library-card-actions button:first-child { color: #6d28d9; }
html[data-theme="light"] .library-card-actions .danger { color: #be123c; }

/* 文字层级 */
html[data-theme="light"] .library-card-body,
html[data-theme="light"] .library-empty,
html[data-theme="light"] .library-drop-zone { color: #3d3749; }
html[data-theme="light"] .library-empty > svg { color: #8b5cf6; }
html[data-theme="light"] .library-drop-zone {
  background: rgba(124, 58, 237, .035);
  border-color: rgba(109, 40, 217, .3);
}

/* HTTP 警告 */
html[data-theme="light"] .library-http-warning {
  color: #8a5a0a;
  background: #fdf3e0;
  border-color: #e5c07b;
}

/* storage 面板细节 */
html[data-theme="light"] .library-storage-panel > header small { color: #1e8a5a; }
html[data-theme="light"] .library-storage-grid article > small,
html[data-theme="light"] .library-storage-grid article > p { color: #625d6e; }
html[data-theme="light"] .library-storage-grid article > strong { color: #1e2430; }
html[data-theme="light"] .library-storage-grid article.healthy > strong { color: #15803d; }
html[data-theme="light"] .library-storage-grid article > svg { color: #22a06b; }
html[data-theme="light"] .library-quota-track { background: #e3e8e5; }
html[data-theme="light"] .library-storage-panel > footer { color: #625d6e; }
html[data-theme="light"] .library-storage-panel > footer code { color: #6d28d9; }

/* 弹窗 */
html[data-theme="light"] .library-modal { background: rgba(30, 27, 48, .45); }
html[data-theme="light"] .library-modal label span { color: #625d6e; }
html[data-theme="light"] .library-modal header button { color: #9893a3; }

/* 资产库 hero 刻意保留深紫 banner，但把文字调亮 */
html[data-theme="light"] .library-hero h1,
html[data-theme="light"] .library-hero p { color: #ffffff; }
html[data-theme="light"] .library-hero .section-kicker { color: #d8b4fe; }

/* ------------------------------------------------------------
   4) 选择文本颜色，避免反白后选中色突兀
   ---------------------------------------------------------- */
html[data-theme="light"] ::selection {
  background: rgba(124, 58, 237, .18);
  color: #1b1924;
}
