/* 默认白天主题（淡绿色、淡黄色为主） */
:root {
  --brand-primary: #6fbf73; /* 淡绿色主色 */
  --brand-gradient-start: #a8e6cf; /* 浅薄荷绿 */
  --brand-gradient-end: #fff3b0;  /* 浅淡黄 */
  --surface-bg: #fdfdf7; /* 偏暖浅底色 */
  --text-primary: #2d2d2d;
  --text-secondary: #6b6b6b;
  --radius-lg: 20px;
  --radius-md: 10px;
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 黑夜主题覆盖 */
body[data-theme="dark"] {
  --brand-primary: #2e7d32; /* 深绿主色 */
  --brand-gradient-start: #1b5e20; /* 深绿渐变起点 */
  --brand-gradient-end: #37474f;  /* 蓝灰渐变终点 */
  --surface-bg: #121212; /* 深色底 */
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
}

/* 深色模式下的全局背景与页脚色彩 */
body[data-theme="dark"] {
  background-color: var(--surface-bg);
}
body[data-theme="dark"] .footer {
  background-color: #1e1e1e !important;
}
body[data-theme="dark"] .text-muted { color: #9e9e9e !important; }

.page-gradient {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%);
}

.card-surface {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
}

/* 黑夜主题下的卡片与文本 */
body[data-theme="dark"] .card,
body[data-theme="dark"] .card-surface {
  background-color: #1e1e1e;
  color: var(--text-primary);
}

/* 使用变量覆盖主色调，使Bootstrap主色受控 */
.bg-primary { background-color: var(--brand-primary) !important; }
.btn-primary { background-color: var(--brand-primary) !important; border-color: var(--brand-primary) !important; }
.btn-outline-primary { color: var(--brand-primary) !important; border-color: var(--brand-primary) !important; }

/* 统一按钮交互态颜色为主题色，避免出现默认深蓝 */
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.show>.btn-primary.dropdown-toggle {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  filter: brightness(0.95);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
  color: #fff !important;
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-gradient-start);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%);
  color: #fff;
}

/* 浅色轮廓按钮统一到主题色 */
.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active {
  color: #fff !important;
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}

/* 夜间主题下的警告/错误背景微调可按需添加 */

.alert-surface-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-surface-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.back-link a { color: var(--brand-gradient-start); text-decoration: none; font-weight: 500; }
.back-link a:hover { text-decoration: underline; }