html[data-theme="light"] {
  color-scheme: light;
}

[v-cloak] {
  display: none !important;
}

html[data-theme="dark"] {
  color-scheme: dark;
  /* 品牌色 / 玻璃层 / 阴影统一取自 design-system.css；
     本文件只保留旧页面类名（.el-* 等）的暗色兜底。 */
  --bg: var(--bg-gradient);
}

html[data-theme="dark"] body {
  background: var(--bg-gradient) !important;
  color: #e8eeff !important;
}

html[data-theme="dark"] #app,
html[data-theme="dark"] .container,
html[data-theme="dark"] .main-container {
  color: #e8eeff;
}

html[data-theme="dark"] .header,
html[data-theme="dark"] .header-content,
html[data-theme="dark"] .card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .preview-card,
html[data-theme="dark"] .el-dialog,
html[data-theme="dark"] .el-dialog__body,
html[data-theme="dark"] .el-dialog__header,
html[data-theme="dark"] .el-dialog__footer,
html[data-theme="dark"] .el-message,
html[data-theme="dark"] .el-message-box,
html[data-theme="dark"] .el-message-box__content,
html[data-theme="dark"] .el-message-box__header,
html[data-theme="dark"] .el-message-box__btns,
html[data-theme="dark"] .el-card:not(.video-card):not(.audio-card):not(.file-card),
html[data-theme="dark"] .image-card,
html[data-theme="dark"] .storage-btn,
html[data-theme="dark"] .method-btn,
html[data-theme="dark"] .format-tab,
html[data-theme="dark"] .upload-item,
html[data-theme="dark"] .result-item,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .stats,
html[data-theme="dark"] .search-card .el-input__inner,
html[data-theme="dark"] .el-input__inner,
html[data-theme="dark"] .url-input-container input,
html[data-theme="dark"] .batch-links {
  background: rgba(15, 23, 39, 0.9) !important;
  color: #e8eeff !important;
  border-color: rgba(130, 152, 196, 0.35) !important;
}

html[data-theme="dark"] .header-title,
html[data-theme="dark"] .title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .file-name,
html[data-theme="dark"] .file-title,
html[data-theme="dark"] .video-title,
html[data-theme="dark"] .audio-title,
html[data-theme="dark"] .result-item-name,
html[data-theme="dark"] .upload-item-name,
html[data-theme="dark"] .image-card-name,
html[data-theme="dark"] .preview-filename,
html[data-theme="dark"] .el-dropdown-link,
html[data-theme="dark"] .el-dialog__title {
  color: #e8eeff !important;
}

html[data-theme="dark"] .upload-hint,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .file-size,
html[data-theme="dark"] .result-item-link,
html[data-theme="dark"] .upload-item-size,
html[data-theme="dark"] .stat-item,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .footer a,
html[data-theme="dark"] .el-form-item__label,
html[data-theme="dark"] .el-dialog__body,
html[data-theme="dark"] .el-message-box__message p {
  color: #c4cde3 !important;
}

html[data-theme="dark"] a {
  color: #c4d4ff;
}

html[data-theme="dark"] .upload-zone,
html[data-theme="dark"] .container,
html[data-theme="dark"] .image-card,
html[data-theme="dark"] .el-main,
html[data-theme="dark"] .el-header {
  border-color: rgba(130, 152, 196, 0.35) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #90a0bf !important;
}

.theme-floating-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1.5px solid rgba(138, 75, 255, 0.25);
  background: linear-gradient(
    135deg,
    rgba(138, 75, 255, 0.16),
    rgba(200, 241, 255, 0.42)
  );
  color: #2f3243;
  font-size: 0.88em;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-floating-toggle i {
  color: #8a4bff;
  width: 14px;
  text-align: center;
}

.theme-floating-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(138, 75, 255, 0.2);
}

/* 这里原本还有 .theme-auto-inline-toggle / .theme-admin-toggle 两套完整样式
   （含 i / :hover / [data-theme-label] / dark 变体）。它们对应的 DOM 只由
   theme.js 的 ensureAutoToggle() 注入 —— 而那条「往页头里塞」的分支在
   本仓库 8 个页面里永远匹配不到（没有 .header / .nav-links / .header-content），
   已经删除。类名因此再无人生成，样式随之成为死代码，一并移除。
   现在实际生效的浮动开关是 .theme-floating-toggle（就在下面）。 */

html[data-theme="dark"] .theme-floating-toggle {
  border-color: rgba(154, 169, 255, 0.45);
  background: linear-gradient(
    135deg,
    rgba(154, 169, 255, 0.2),
    rgba(84, 106, 156, 0.35)
  );
  color: #e8eeff;
}

html[data-theme="dark"] .theme-floating-toggle i {
  color: #c4d4ff;
}@media (max-width: 768px) {
  .theme-floating-toggle {
    top: 12px;
    right: 12px;
    padding: 8px 12px;
    font-size: 0.82em;
  }
}

/* ===== Unified Background + Glass Layer ===== */
:root {
  /* 与 index.html 的 --bg-gradient 保持一致（浅色） */
  --ui-page-bg: radial-gradient(at 8% 8%, #e0f2fe 0px, transparent 45%),
                radial-gradient(at 92% 92%, #bae6fd 0px, transparent 48%),
                #f0f7ff;
  /* 与 index.html 的深色 --bg-gradient 保持一致 */
  --ui-page-bg-dark: radial-gradient(at 10% 10%, rgba(2, 132, 199, 0.18) 0px, transparent 50%),
                     radial-gradient(at 90% 90%, rgba(14, 165, 233, 0.12) 0px, transparent 50%),
                     #070d19;
  --ui-surface-rgb: 255, 255, 255;
  --ui-surface-rgb-dark: 19, 24, 33;
  --ui-border-rgb: 198, 206, 218;
  --ui-border-rgb-dark: 92, 105, 126;
  --ui-card-opacity: 0.86;
  --ui-card-blur: 14px;
  --ui-card-backdrop-filter: blur(var(--ui-card-blur)) saturate(115%);
  --ui-noise-opacity: 0;
  --ui-shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.09);
  --ui-shadow-soft-dark: 0 14px 32px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] {
  --ui-surface-rgb: var(--ui-surface-rgb-dark);
  --ui-border-rgb: var(--ui-border-rgb-dark);
  --shadow: var(--ui-shadow-soft-dark);
  --shadow-hover: 0 18px 36px rgba(0, 0, 0, 0.42);
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
  /* --ui-page-bg 含渐变，只能用 background 简写；单独写 background-color 会因值无效而变透明 */
  background: var(--ui-page-bg) !important;
}

body::before {
  content: none !important;
  background: none !important;
}

html[data-theme="dark"] body {
  background: var(--ui-page-bg-dark) !important;
}

body > #app,
body > .page,
body > .login-container,
body > .container {
  position: relative;
  z-index: 5;
}

.header,
.header-content,
.toolbar,
.card,
.login-card,
.preview-card,
.folder-sidebar,
.folder-breadcrumb,
.list-view-card,
.search-card,
.stats,
.storage-switcher,
.guest-notice,
.upload-zone,
.storage-target,
.upload-item,
.result-item,
.history-item,
.image-card,
.toolbar-row,
.status-pill,
.file-picker,
.file-queue-wrap,
.result-empty,
.empty-tip,
.token-loading,
.token-empty,
.el-card:not(.video-card):not(.audio-card):not(.file-card),
.el-dialog,
.el-dialog__header,
.el-dialog__body,
.el-dialog__footer,
.el-message-box,
.el-message-box__content,
.el-message-box__header,
.el-message-box__btns {
  background: rgba(var(--ui-surface-rgb), var(--ui-card-opacity)) !important;
  border-color: rgba(var(--ui-border-rgb), 0.46) !important;
  box-shadow: var(--ui-shadow-soft) !important;
  backdrop-filter: var(--ui-card-backdrop-filter);
  -webkit-backdrop-filter: var(--ui-card-backdrop-filter);
}

html[data-theme="dark"] .header,
html[data-theme="dark"] .header-content,
html[data-theme="dark"] .card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .preview-card,
html[data-theme="dark"] .folder-sidebar,
html[data-theme="dark"] .folder-breadcrumb,
html[data-theme="dark"] .list-view-card,
html[data-theme="dark"] .el-card:not(.video-card):not(.audio-card):not(.file-card),
html[data-theme="dark"] .el-dialog,
html[data-theme="dark"] .el-message-box {
  box-shadow: var(--ui-shadow-soft-dark) !important;
}

.theme-floating-toggle,
.gallery-theme-toggle {
  border-color: rgba(var(--ui-border-rgb), 0.58) !important;
  background: rgba(var(--ui-surface-rgb), 0.9) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1) !important;
  color: #344054 !important;
}

html[data-theme="dark"] .theme-floating-toggle,
html[data-theme="dark"] .gallery-theme-toggle {
  color: #e8eeff !important;
}

html[data-theme="dark"] .theme-floating-toggle i,
html[data-theme="dark"] .gallery-theme-toggle i {
  color: #d0dcff !important;
}

body.login-page {
  min-height: 100dvh !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px 16px !important;
}

body.login-page .login-container {
  position: relative;
  z-index: 2;
}

body.login-page .bg-image-layer,
body.login-page .bg-overlay {
  display: none !important;
}@media (max-width: 768px) {
  body.login-page {
    align-items: center !important;
    justify-content: center !important;
    padding: max(14px, env(safe-area-inset-top)) 14px
      max(14px, env(safe-area-inset-bottom)) 14px !important;
  }
}
