/* qkbad light theme: variables + component overrides.
   Triggered by <html data-admin-theme=light>. Dark is default.
   NOTE: keep comments free of quote characters. */

/* ---------- 微黄护眼配色 ----------
   设计目标：纯白长时间注视刺眼，改用米白/象牙底 + 深褐墨字，降低眩光；
   品牌金 #B8860B 保持不变，界面仍带香槟金调。 */
html[data-admin-theme="light"] {
  color-scheme: light;

  /* ---------- 品牌 / 主色（不变，与夜间保持一致的品牌识别） ---------- */
  --gold: #b8860b;
  --gold-light: #d9a441;
  --gold-dim: #8b6914;
  --gold-soft: rgba(184, 134, 11, 0.13);
  --gold-line: rgba(184, 134, 11, 0.34);

  --navy: #1d4ed8;
  --navy-light: #3b82f6;
  --navy-deep: #16215c;
  --navy-soft: rgba(29, 78, 216, 0.07);

  /* ---------- 背景层次：米白护眼底（避免纯白刺眼） ---------- */
  --bg-0: #f2ede2;
  --bg-1: #fbf8f1;
  --bg-2: #f6f1e6;
  --bg-3: #ece5d6;

  --line: #ddd3bf;
  /* ---------- 文字：深褐墨色提高对比度 ---------- */
  --text-1: #2c2415;
  --text-2: #5f5442;
  --text-3: #948873;

  /* ---------- 语义色（亮色下加深保证可读） ---------- */
  --red: #c92a2a;
  --green: #15803d;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #c02626;

  /* ---------- Element Plus 关键变量（对齐米白主题） ---------- */
  --el-bg-color: #fbf8f1;
  --el-bg-color-page: #f2ede2;
  --el-bg-color-overlay: #fffdf8;
  --el-text-color-primary: #2c2415;
  --el-text-color-regular: #453c2c;
  --el-text-color-secondary: #6b5f49;
  --el-text-color-placeholder: #a99c84;
  --el-border-color: #ddd3bf;
  --el-border-color-light: #e6ddcb;
  --el-border-color-lighter: #eee7d8;
  --el-fill-color-blank: #fbf8f1;
  --el-fill-color-light: #f4efe4;
  --el-fill-color-lighter: #f9f5ec;
  --el-mask-color: rgba(60, 48, 24, 0.45);

  --qk-line: #e6ddcb;
}

/* ---------- 页面基底 ---------- */
html[data-admin-theme="light"] body {
  background: #f2ede2;
  color: #2c2415;
}

/* 侧边栏：米白底 + 右侧细线 */
html[data-admin-theme="light"] .adm-side,
html[data-admin-theme="light"] .adm-sidebar {
  background: #f7f2e8 !important;
  border-right: 1px solid #e2d9c6;
}
html[data-admin-theme="light"] .adm-side .el-menu,
html[data-admin-theme="light"] .adm-sidebar .el-menu {
  background: transparent;
  border-right: none;
}

/* 顶栏 */
html[data-admin-theme="light"] .adm-top,
html[data-admin-theme="light"] header.adm-header {
  background: #fbf8f1;
  border-bottom: 1px solid #e2d9c6;
}

/* 卡片 */
html[data-admin-theme="light"] .el-card,
html[data-admin-theme="light"] .cfg-card,
html[data-admin-theme="light"] .g-card {
  background: #fbf8f1;
  border-color: #e2d9c6;
  box-shadow: 0 1px 3px rgba(92, 76, 40, 0.07);
}

/* 表格 */
html[data-admin-theme="light"] .el-table,
html[data-admin-theme="light"] .el-table tr,
html[data-admin-theme="light"] .el-table th.el-table__cell {
  background-color: #fbf8f1;
}
html[data-admin-theme="light"] .el-table td.el-table__cell,
html[data-admin-theme="light"] .el-table th.el-table__cell.is-leaf {
  border-bottom-color: #e6ddcb;
}
html[data-admin-theme="light"] .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
  background-color: #f6f1e6;
}

/* 弹窗 */
html[data-admin-theme="light"] .el-dialog {
  background: #fbf8f1;
}
html[data-admin-theme="light"] .el-dialog__header,
html[data-admin-theme="light"] .el-dialog__footer {
  border-color: #e6ddcb;
}
html[data-admin-theme="light"] .el-dialog__body {
  background: #fbf8f1;
}

/* 下拉 / 气泡 / 消息 */
html[data-admin-theme="light"] .el-dropdown__popper,
html[data-admin-theme="light"] .el-popper,
html[data-admin-theme="light"] .el-select__popper,
html[data-admin-theme="light"] .el-message,
html[data-admin-theme="light"] .el-notification {
  background: #fffdf8;
  border-color: #e2d9c6;
}
html[data-admin-theme="light"] .el-dropdown-menu__item:not(.is-disabled):hover,
html[data-admin-theme="light"] .el-dropdown-menu__item:not(.is-disabled):focus {
  background: #f2ede2;
  color: #2c2415;
}

/* 导航菜单项 */
html[data-admin-theme="light"] .el-menu-item,
html[data-admin-theme="light"] .el-sub-menu__title {
  color: #4a4031;
}
html[data-admin-theme="light"] .el-menu-item:hover,
html[data-admin-theme="light"] .el-sub-menu__title:hover {
  background: #efe8d9;
}

/* 输入框 / 文本域 / 选择器 */
html[data-admin-theme="light"] .el-input__wrapper,
html[data-admin-theme="light"] .el-textarea__inner,
html[data-admin-theme="light"] .el-select__wrapper {
  background: #fffdf8;
  box-shadow: 0 0 0 1px #ddd3bf inset;
  color: #2c2415;
}
html[data-admin-theme="light"] .el-input__inner,
html[data-admin-theme="light"] .el-textarea__inner,
html[data-admin-theme="light"] .el-select__placeholder {
  color: #2c2415;
}
html[data-admin-theme="light"] .el-input__inner::placeholder,
html[data-admin-theme="light"] .el-textarea__inner::placeholder {
  color: #a99c84;
}

/* 标签 / 文字层级 */
html[data-admin-theme="light"] .el-tag {
  border-color: #ddd3bf;
}
html[data-admin-theme="light"] .g-muted,
html[data-admin-theme="light"] .muted,
html[data-admin-theme="light"] .hint {
  color: #6b5f49;
}
html[data-admin-theme="light"] .g-title,
html[data-admin-theme="light"] .cfg-sub {
  color: #2c2415;
}

/* 分隔线 / 虚线区块标题 */
html[data-admin-theme="light"] .section-title {
  border-top-color: #e2d9c6;
  color: #2c2415;
}

/* 分页 */
html[data-admin-theme="light"] .el-pagination {
  background: transparent;
  color: #5f5442;
}

/* 图片上传占位框 */
html[data-admin-theme="light"] .thumb-box,
html[data-admin-theme="light"] .preview,
html[data-admin-theme="light"] .preview.placeholder {
  background: #f7f2e8;
  border-color: #ddd3bf;
  color: #948873;
}

/* 提示条（alert）在米白底上用浅金调边框 */
html[data-admin-theme="light"] .el-alert--info {
  background: #fdf8e8;
  border-color: #e8d9a8;
  color: #5a4a1a;
}
html[data-admin-theme="light"] .el-alert--warning {
  background: #fdf3e4;
  border-color: #eed3a0;
  color: #6b4d16;
}

/* ---------- 顶部切换按钮 ---------- */
.qk-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 12px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--text-2);
  background: var(--fill, #f4efe4);
  border: 1px solid var(--line, #ddd3bf);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.qk-theme-btn:hover {
  color: var(--gold);
  border-color: var(--gold-line);
}
.qk-theme-btn:active {
  transform: scale(0.94);
}

/* 亮色下滚动条 */
html[data-admin-theme="light"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
html[data-admin-theme="light"] ::-webkit-scrollbar-thumb {
  background: #d5c9b2;
  border-radius: 4px;
}
html[data-admin-theme="light"] ::-webkit-scrollbar-track {
  background: transparent;
}
