/* 白月光主题样式 — bygcloud.net（皎洁月光 · 冷调银白） */

/* ===== 浅色主题 (默认) ===== */
:root,
:root[data-theme="light"] {
  /* 主色调 - 月光冷银蓝（按钮可读，整体洁白） */
  --primary-color: #4b6b8a;
  --primary-hover: #3a5571;
  --primary-light: rgba(75, 107, 138, 0.1);
  --primary-glow: rgba(75, 107, 138, 0.2);
  
  /* 背景色 - 浅色主题 */
  --bg-primary: #f9fafb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.9);
  --bg-input: #ffffff;
  
  /* 边框 */
  --border-color: #e5e7eb;
  --border-hover: #d1d5db;
  --border-light: #f3f4f6;
  
  /* 文字 */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-white: #ffffff;
  
  /* 状态色 */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
  
  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* ===== 深色主题 ===== */
:root[data-theme="dark"],
:root.dark {
  /* 主色调 - 绿色系 (深色模式下稍微亮一点) */
  --primary-color: #34d399;
  --primary-hover: #10b981;
  --primary-light: rgba(52, 211, 153, 0.15);
  --primary-glow: rgba(52, 211, 153, 0.25);
  
  /* 背景色 - 深色主题 */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-sidebar: #1e293b;
  --bg-header: rgba(30, 41, 59, 0.9);
  --bg-input: #334155;
  
  /* 边框 */
  --border-color: #334155;
  --border-hover: #475569;
  --border-light: #1e293b;
  
  /* 文字 */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-white: #ffffff;
  
  /* 状态色 */
  --success-color: #34d399;
  --warning-color: #fbbf24;
  --error-color: #f87171;
  --info-color: #60a5fa;
  
  /* 阴影 - 深色模式下使用更暗的阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

/* 全局样式 */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI", Arial, Roboto, "PingFang SC", miui, "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* 选中文本样式 */
::selection {
  background: var(--primary-color);
  color: white;
}

/* 链接样式 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

/* 按钮基础样式 */
.btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* 卡片样式 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* 输入框样式 */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input::placeholder {
  color: var(--text-muted);
}

/* Ant Design 覆盖样式 - 浅色主题 */
.ant-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  font-weight: 500 !important;
  border-radius: 0.5rem !important;
  height: auto !important;
  padding: 0.5rem 1rem !important;
}

.ant-btn-primary {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.ant-btn-primary:hover,
.ant-btn-primary:focus {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: #ffffff !important;
}

.ant-btn-default {
  background: #ffffff !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.ant-btn-default:hover,
.ant-btn-default:focus {
  background: #f9fafb !important;
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
}

/* 小尺寸按钮 */
.ant-btn-sm {
  padding: 0.25rem 0.75rem !important;
  font-size: 0.875rem !important;
}

/* 大尺寸按钮 */
.ant-btn-lg {
  padding: 0.75rem 1.5rem !important;
  font-size: 1rem !important;
}

/* 按钮图标对齐 */
.ant-btn > .anticon {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 1em !important;
}

.ant-btn > .anticon + span,
.ant-btn > span + .anticon {
  margin-left: 0 !important;
}

/* 输入框样式 - 浅色主题 */
.ant-input,
.ant-input-affix-wrapper,
.ant-select-selector,
.ant-picker,
.ant-input-number,
.ant-input-password {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.ant-input-affix-wrapper {
  padding: 0 !important;
}

.ant-input-affix-wrapper > input.ant-input {
  background: transparent !important;
  padding: 8px 11px !important;
}

.ant-input-affix-wrapper .ant-input-prefix,
.ant-input-affix-wrapper .ant-input-suffix {
  color: var(--text-muted) !important;
  margin: 0 8px !important;
}

.ant-input:focus,
.ant-input-focused,
.ant-input-affix-wrapper:focus,
.ant-input-affix-wrapper-focused,
.ant-select-focused .ant-select-selector {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 2px var(--primary-light) !important;
  background: #ffffff !important;
}

.ant-input::placeholder,
.ant-input-affix-wrapper input::placeholder {
  color: var(--text-muted) !important;
}

/* 输入框前缀图标 */
.ant-input-prefix {
  color: var(--text-muted) !important;
}

.ant-modal-content {
  background: var(--bg-card) !important;
  border-radius: var(--radius-xl) !important;
}

.ant-modal-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.ant-modal-title {
  color: var(--text-primary) !important;
}

.ant-modal-close-x {
  color: var(--text-secondary) !important;
}

.ant-message-notice-content {
  background: var(--bg-card) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text-primary) !important;
}

.ant-tabs-tab {
  color: var(--text-secondary) !important;
}

.ant-tabs-tab-active .ant-tabs-tab-btn {
  color: var(--primary-color) !important;
}

.ant-tabs-ink-bar {
  background: var(--primary-color) !important;
}

/* 导航栏样式 */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-color);
  font-weight: 500;
}

/* 标签样式 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.tag-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.tag-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.tag-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

/* 加载动画 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 渐变背景 */
.gradient-primary {
  background: linear-gradient(135deg, var(--primary-color), #34d399);
}

/* 玻璃态效果 */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 响应式工具类 */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}
