/**
 * ========================================
 *  小鸽子聚集地管理系统 V2 - 全局样式
 * ========================================
 */

/* ---------- 字体导入 ---------- */
@import url('https://fonts.googleapis.com/css2?family=Saira:wght@400;500;600;700&display=swap');

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

body {
  font-family: 'Saira', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  background: #f0f2f5;
}

/* ---------- 登录页背景 ---------- */
body.login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---------- 毛玻璃卡片（登录用） ---------- */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.card h1 {
  font-size: 28px;
  color: #333;
  margin-bottom: 8px;
}

.card .subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 30px;
}

.logo {
  font-size: 50px;
  margin-bottom: 10px;
}

/* ---------- 角色切换标签 ---------- */
.role-tabs {
  display: flex;
  margin-bottom: 25px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #667eea;
}

.role-tab {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  background: white;
  color: #667eea;
  transition: all 0.3s;
}

.role-tab.active {
  background: #667eea;
  color: white;
}

/* ---------- 输入框 ---------- */
.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
  font-weight: bold;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  transition: border-color 0.3s;
  outline: none;
}

.input-group input:focus,
.input-group select:focus {
  border-color: #667eea;
}

/* ---------- 按钮 ---------- */
.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-danger {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
}

.btn-small {
  width: auto;
  padding: 8px 16px;
  font-size: 14px;
  margin: 4px;
  display: inline-block;
}

/* ---------- 提示信息 ---------- */
.message {
  padding: 12px;
  border-radius: 10px;
  margin-top: 15px;
  font-size: 14px;
  display: none;
}

.message-error {
  background: #ffe0e0;
  color: #d63031;
}

.message-success {
  background: #e0ffe0;
  color: #00b894;
}

/* ========== 主页布局 ========== */

/* 顶部导航栏 */
.top-nav {
  background: white;
  padding: 12px 30px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav .nav-logo {
  font-size: 24px;
  font-weight: bold;
  color: #667eea;
  margin-right: 30px;
}

.top-nav .nav-links {
  display: flex;
  gap: 20px;
}

.top-nav .nav-links a {
  text-decoration: none;
  color: #555;
  font-size: 16px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s;
}

.top-nav .nav-links a:hover,
.top-nav .nav-links a.active {
  background: #f0f0ff;
  color: #667eea;
}

/* 主内容区域 */
.main-container {
  display: flex;
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
  gap: 24px;
}

/* 左侧内容 */
.content-area {
  flex: 1;
}

.content-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.content-card h2 {
  font-size: 18px;
  color: #333;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-card p {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
}

/* 可折叠公告 */
.announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.announcement-header .toggle-icon {
  font-size: 20px;
  transition: transform 0.3s;
}

.announcement-header .toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.announcement-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  transition: all 0.3s;
}

.announcement-body.hidden {
  display: none;
}

/* 右侧用户卡片 */
.user-sidebar {
  width: 240px;
}

.user-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.user-card .user-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #667eea;
  margin: 0 auto 12px;
}

.user-card .user-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.user-card .user-id {
  font-size: 13px;
  color: #888;
  margin-bottom: 10px;
}

.user-card .user-score {
  font-size: 24px;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 4px;
}

.user-card .user-score-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 16px;
}

.user-card .user-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-card .user-actions button {
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.user-card .user-actions .btn-change-pwd {
  background: #f0f0ff;
  color: #667eea;
}

.user-card .user-actions .btn-change-pwd:hover {
  background: #667eea;
  color: white;
}

.user-card .user-actions .btn-logout {
  background: #fff0f0;
  color: #f5576c;
}

.user-card .user-actions .btn-logout:hover {
  background: #f5576c;
  color: white;
}

/* 底部 copyright */
.footer {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 13px;
  margin-top: 20px;
}

/* ========== 管理后台布局 ========== */
.admin-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 20px;
}

.admin-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.admin-section h2 {
  font-size: 18px;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

/* 用户列表表格 */
.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.user-table th,
.user-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.user-table th {
  background: #f8f9ff;
  color: #667eea;
  font-weight: bold;
}

.user-table tr:hover {
  background: #fafbff;
}

/* 管理后台的输入框 */
.admin-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.admin-form .input-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 120px;
}

.admin-form .btn {
  width: auto;
  padding: 14px 24px;
  margin-top: 0;
  white-space: nowrap;
}

/* 公告输入框 */
.admin-textarea {
  width: 100%;
  height: 100px;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s;
  font-family: inherit;
  margin-bottom: 12px;
}

.admin-textarea:focus {
  border-color: #667eea;
}

/* ---------- 积分排名页 ---------- */
.ranking-list {
  list-style: none;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.ranking-item:hover {
  background: #fafbff;
}

.ranking-item .rank-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  margin-right: 14px;
  color: #555;
}

.ranking-item:nth-child(1) .rank-num {
  background: #ffd700;
  color: white;
}

.ranking-item:nth-child(2) .rank-num {
  background: #c0c0c0;
  color: white;
}

.ranking-item:nth-child(3) .rank-num {
  background: #cd7f32;
  color: white;
}

.ranking-item .rank-avatar {
  font-size: 24px;
  margin-right: 12px;
}

.ranking-item .rank-name {
  flex: 1;
  font-size: 16px;
  color: #333;
}

.ranking-item .rank-score {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
}

/* ---------- 弹窗（修改密码用） ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: 16px;
  padding: 30px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-box h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #333;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.modal-actions .btn {
  flex: 1;
}

/* ==========================================
   🎨 原型图风格 V3 - 新增样式
   ========================================== */

/* ---------- 标题栏（深蓝底） ---------- */
.prototype-titlebar {
  background: #1a2744;
  color: #fff;
  padding: 0 20px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prototype-titlebar .titlebar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prototype-titlebar .titlebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #e8891e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  color: #fff;
}

.prototype-titlebar .titlebar-nav a {
  color: #b0c4de;
  text-decoration: none;
  font-size: 13px;
  margin-left: 16px;
  transition: color 0.2s;
}

.prototype-titlebar .titlebar-nav a:hover {
  color: #fff;
}

/* ---------- 三栏主体布局 ---------- */
.prototype-body {
  display: flex;
  min-height: calc(100vh - 48px - 40px);
}

.prototype-left {
  width: 140px;
  background: #f0f4f8;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prototype-left .left-btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.prototype-left .left-btn:hover {
  background: #1d4ed8;
}

.prototype-left .left-btn.active {
  background: #1e40af;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.prototype-center {
  flex: 1;
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.prototype-right {
  width: 200px;
  background: #2563eb;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  text-align: center;
}

.prototype-right .right-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #facc15;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #854d0e;
}

.prototype-right .right-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.prototype-right .right-role {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 16px;
}

.prototype-right .right-btn {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.prototype-right .right-btn-logout {
  background: #ef4444;
  color: #fff;
}

.prototype-right .right-btn-logout:hover {
  background: #dc2626;
}

.prototype-right .right-btn-pwd {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.prototype-right .right-btn-pwd:hover {
  background: rgba(255,255,255,0.35);
}

/* ---------- 登录表单（原型风格） ---------- */
.login-form-wrap {
  width: 320px;
}

.login-form-wrap .form-title {
  font-size: 22px;
  font-weight: bold;
  color: #1a2744;
  margin-bottom: 24px;
  text-align: center;
}

.login-form-wrap .input-group label {
  color: #1a2744;
  font-size: 13px;
}

.login-form-wrap .input-group input {
  border: 2px solid #93c5fd;
  border-radius: 6px;
  padding: 12px 14px;
}

.login-form-wrap .input-group input:focus {
  border-color: #2563eb;
}

.login-form-wrap .btn-ok {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s;
}

.login-form-wrap .btn-ok:hover {
  background: #1d4ed8;
}

/* ---------- 版权 ---------- */
.prototype-footer {
  text-align: center;
  padding: 10px;
  color: #999;
  font-size: 12px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

/* ==========================================
   📚 题库页面样式
   ========================================== */

/* 筛选栏 */
.problem-filterbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.problem-filterbar .search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.problem-filterbar .search-input:focus {
  border-color: #2563eb;
}

.problem-filterbar .filter-select {
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}

.problem-filterbar .filter-select:focus {
  border-color: #2563eb;
}

/* 题目表格 */
.problem-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.problem-table th {
  background: #f0f4f8;
  color: #1a2744;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
}

.problem-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.problem-table tr {
  cursor: pointer;
  transition: background 0.15s;
}

.problem-table tr:hover {
  background: #f0f7ff;
}

/* 难度标签 - 洛谷风格 */
.badge-difficulty {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-difficulty.ru-men {
  background: #fff5f5;
  color: #e74c3c;
  border-color: #e74c3c;
}

.badge-difficulty.pu-ji {
  background: #fffbe6;
  color: #d48806;
  border-color: #d48806;
}

.badge-difficulty.pu-ti {
  background: #fffbe6;
  color: #d48806;
  border-color: #d48806;
}

.badge-difficulty.pu-jia {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #16a34a;
}

/* 标签 */
.problem-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.problem-tags .tag {
  display: inline-block;
  padding: 2px 10px;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 10px;
  font-size: 11px;
}

/* 状态图标 */
.status-icon {
  font-size: 18px;
}

/* 通过率条 */
.passrate-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.passrate-bar .bar-track {
  width: 60px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.passrate-bar .bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.passrate-bar .bar-fill.high { background: #16a34a; }
.passrate-bar .bar-fill.mid  { background: #ca8a04; }
.passrate-bar .bar-fill.low  { background: #dc2626; }

/* 题目详情弹窗 */
.problem-detail-content {
  text-align: left;
}

.problem-detail-content h3 {
  font-size: 20px;
  color: #1a2744;
  margin-bottom: 8px;
}

.problem-detail-content .detail-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.problem-detail-content .detail-desc {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* ---------- 分页控件 ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination .page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.pagination .page-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.pagination .page-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 13px;
  color: #6b7280;
  margin: 0 4px;
}

/* ---------- 详情弹窗关闭按钮 ---------- */
.btn-close-detail {
  width: 100%;
  padding: 10px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-close-detail:hover {
  background: #dc2626;
}
