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

html[data-theme="dark"] {
  color-scheme: dark;
  --primary-color: #9aa9ff;
  --primary-light: #b5bdf8;
  --primary-dark: #768cff;
  --primary: #9aa9ff;
  --accent-color: #8d9dd8;
  --accent: #8d9dd8;
  --bg-gradient: linear-gradient(140deg, #111a2d 0%, #0b1120 55%, #070b16 100%);
  --bg: var(--bg-gradient);
  --card-bg: rgba(15, 23, 39, 0.9);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 14px 32px rgba(0, 0, 0, 0.45);
}

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"] .toast,
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"] .storage-switcher,
html[data-theme="dark"] .stats-bar,
html[data-theme="dark"] .guest-notice {
  background: linear-gradient(
    135deg,
    rgba(20, 29, 49, 0.9) 0%,
    rgba(25, 35, 58, 0.85) 100%
  ) !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"] .el-button:not(.el-button--primary):not(.el-button--danger) {
  background: rgba(33, 45, 72, 0.85) !important;
  color: #e8eeff !important;
  border-color: rgba(130, 152, 196, 0.4) !important;
}

html[data-theme="dark"] .el-button--primary {
  background: linear-gradient(135deg, #6f84ff 0%, #8ea4ff 100%) !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .el-button--danger {
  background: linear-gradient(135deg, #d0617d 0%, #eb839f 100%) !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .preview-modal .preview-btn-default {
  background: rgba(255, 255, 255, 0.2) !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 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  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.86em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

.theme-admin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(138, 75, 255, 0.25);
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(138, 75, 255, 0.16),
    rgba(200, 241, 255, 0.42)
  );
  color: #2f3243;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 8px;
}

.theme-admin-toggle [data-theme-label] {
  display: none;
}

.theme-admin-toggle i {
  color: #8a4bff;
  font-size: 14px;
}

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

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;
}

html[data-theme="dark"] .theme-auto-inline-toggle,
html[data-theme="dark"] .theme-admin-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-auto-inline-toggle i,
html[data-theme="dark"] .theme-admin-toggle i {
  color: #c4d4ff;
}

@media (max-width: 768px) {
  .theme-floating-toggle {
    top: 12px;
    right: 12px;
    padding: 8px 12px;
    font-size: 0.82em;
  }
}
