/* ===============
   主题变量定义
   =============== */
:root {
  --primary: #4361ee;          /* 主色调（蓝色） */
  --primary-hover: #3a56d4;
  --danger: #f43f5e;
  --gray-dark: #374151;
  --gray: #6b7280;
  --gray-light: #f3f4f6;
  --white: #ffffff;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --transition: all 0.3s ease;
}

/* ===============
   重置与基础样式
   =============== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ===============
   认证容器（加宽）
   =============== */
.auth-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.board-container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 50px 40px; /* 内边距加大 */
  text-align: center;
  transition: transform 0.3s ease;
}

.logo-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 72px;
  height: 72px;
  background: rgba(67, 97, 238, 0.1);
  border-radius: 50%;
  margin-bottom: 20px;
  border: 2px solid rgba(67, 97, 238, 0.2);
}

/* ===============
   标题与副文本
   =============== */
h2 {
  font-size: 1.8rem;
  color: var(--gray-dark);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--gray);
  font-size: 1rem;
  margin-bottom: 30px;
}

/* ===============
   输入框组（浮动标签）
   =============== */
.input-group {
  position: relative;
  margin-bottom: 24px;
}

.input-field {
  width: 100%;
  padding: 14px 12px;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  background: var(--gray-light);
  transition: all 0.3s ease;
  color: var(--gray-dark);
  box-sizing: border-box;
}

.input-field:focus,
.input-field:not(:placeholder-shown) {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* ===============
   表单选项（记住我 + 忘记密码）
   =============== */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  color: var(--gray);
}

.checkbox-label input {
  display: none;
}

.checkbox-custom {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray);
  border-radius: 4px;
  margin-right: 8px;
  transition: var(--transition);
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.link-small,
.link-primary {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.link-small:hover,
.link-primary:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ===============
   按钮样式
   =============== */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

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

.btn-block {
  margin-top: 10px;
}

/* ===============
   底部注册链接
   =============== */
.auth-footer {
  margin-top: 30px;
  font-size: 0.95rem;
  color: var(--gray);
}

.auth-footer a {
  font-weight: 600;
}

/* ===============
   响应式适配
   =============== */
@media (max-width: 480px) {
  .form-card {
    padding: 30px 20px;
  }

  h2 {
    font-size: 1.6rem;
  }

  .input-field,
  .btn {
    font-size: 1rem;
  }
}
/* ===============
   Flask Flash 消息样式
   =============== */
.flashes {
  list-style: none;
  margin: 0 0 24px 0;
  padding: 0;
}

.flashes li {
  position: relative;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background-color: var(--primary);
  box-shadow: var(--shadow);
  opacity: 0.95;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flashes li::before {
  content: "ℹ️";
  margin-right: 8px;
  font-size: 1.2em;
}

/* 不同消息类型的支持（需配合 Flask 中分类 flash）*/
.flashes li.info {
  background-color: var(--primary);
}

.flashes li.success {
  background-color: #10b981; /* 绿色 */
}

.flashes li.warning {
  background-color: #f59e0b; /* 黄色/橙色 */
  color: #1f2937;
}

.flashes li.error {
  background-color: var(--danger);
}

/* Hover 效果 */
.flashes li:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* 移动端适配 */
@media (max-width: 480px) {
  .flashes li {
    font-size: 0.9rem;
    padding: 10px 14px;
  }
}

.social-login {
    margin: 20px 0;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #888;
    margin: 16px 0;
    font-size: 14px;
}

.divider span {
    padding: 0 10px;
    background: white;
    position: relative;
    z-index: 1;
}

.divider::before {
    content: '';
    border-top: 1px solid #ddd;
    flex-grow: 1;
    margin: 0 10px;
}

.btn-outline {
    border: 1px solid #ddd;
    color: #333;
    background: white;
    transition: all 0.3s;
}

.btn-outline:hover {
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
}

.btn-outline svg {
    stroke: #333;
}

.btn-outline:hover svg {
    stroke: #007bff;
}
/* ===============
   分页组件样式
   =============== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  margin-bottom: 0;
  list-style: none;
  padding: 0;
  flex-wrap: wrap;
}

.pagination .page-item {
  display: inline-flex;
}

.pagination .page-link,
.pagination .page-ellipsis,
.pagination .page-current {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  font-size: 14px;
  text-decoration: none;
  border-radius: 8px;
  transition: var(--transition);
  min-width: 40px;
  text-align: center;
}

/* 默认链接 */
.pagination .page-link {
  color: var(--primary);
  border: 1px solid var(--primary);
  background-color: white;
}

.pagination .page-link:hover {
  background-color: rgba(67, 97, 238, 0.1);
  transform: translateY(-1px);
}

/* 当前页高亮 */
.pagination .page-current {
  background-color: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  font-weight: bold;
}

/* 禁用状态（如首页/末页不可点） */
.pagination .page-disabled {
  color: #ccc;
  border: 1px solid #ddd;
  cursor: not-allowed;
  pointer-events: none;
}

/* 省略号 */
.pagination .page-ellipsis {
  color: var(--gray);
  border: none;
  font-size: 18px;
  pointer-events: none;
}
/* ===============
   次要按钮样式
   =============== */
.btn-secondary {
  background-color: var(--gray);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  min-width: 120px;
}

.btn-secondary:hover {
  background-color: var(--gray-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
