/* ===== 积分管理系统 全局样式（移动端优先） ===== */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ===== 顶栏 ===== */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { font-size: 18px; font-weight: 700; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-light);
}
.nav a:hover { background: var(--bg); color: var(--primary); }
.user-info { font-size: 13px; color: var(--text-light); white-space: nowrap; }
.user-info .pts { color: var(--primary); font-weight: 700; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

/* ===== 首页 ===== */
.home-hero { text-align: center; padding: 16px 0 24px; }
.home-hero h2 { margin-bottom: 16px; }
.points-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  display: inline-block;
  min-width: 200px;
}
.points-num { font-size: 42px; font-weight: 800; }
.points-label { opacity: 0.9; font-size: 14px; }
.hint { margin-top: 12px; font-size: 13px; color: var(--text-light); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.feature-icon { font-size: 32px; }
.feature-name { font-weight: 600; margin-top: 6px; }
.feature-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ===== 登录页 ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-card h1 { text-align: center; font-size: 22px; }
.login-card .subtitle { text-align: center; color: var(--text-light); font-size: 13px; margin: 8px 0 24px; }

/* ===== 表单 ===== */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.form input, .form textarea, .form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  width: 100%;
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
textarea { min-height: 80px; resize: vertical; }

.btn-primary, .btn-secondary, .btn-danger {
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
button:hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.register-box { margin-top: 20px; font-size: 13px; color: var(--text-light); }
.register-box summary { cursor: pointer; text-align: center; }

/* ===== 卡片/列表 ===== */
.section-title { font-size: 17px; font-weight: 700; margin: 20px 0 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-meta { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.tag-pending   { background: #fef3c7; color: #92400e; }
.tag-approved  { background: #dcfce7; color: #166534; }
.tag-rejected  { background: #fee2e2; color: #991b1b; }
.tag-config    { background: #e0e7ff; color: #3730a3; }

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--text-light);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s;
}
.upload-area:hover { border-color: var(--primary); }
.upload-area.has-file { border-color: var(--success); color: var(--success); }

.empty { text-align: center; color: var(--text-light); padding: 32px; }

/* 管理员区块 */
.admin-panel {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 24px;
}
.admin-panel h3 { color: var(--warning); font-size: 15px; margin-bottom: 10px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
}

/* ===== 同事选择（读书会）===== */
.colleague-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.colleague-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: var(--card);
  user-select: none;
  transition: all 0.15s ease;
}
.colleague-chip:hover { transform: translateY(-1px); border-color: var(--primary); }
.colleague-chip.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(79,70,229,0.18);
}

/* ===== 读书会专属 ===== */
.bookclub-page {
  background: linear-gradient(180deg, rgba(79,70,229,0.04), transparent 160px);
  padding: 8px 0 18px;
}
.bookclub-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 20px 18px 16px;
  border: 1px solid rgba(79,70,229,0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.55), transparent 34%),
    radial-gradient(circle at bottom right, rgba(22,163,74,0.12), transparent 28%),
    linear-gradient(135deg, rgba(79,70,229,0.12), rgba(79,70,229,0.05) 55%, rgba(22,163,74,0.08));
  box-shadow: 0 18px 40px rgba(79,70,229,0.08);
}
.bookclub-hero::before,
.bookclub-hero::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}
.bookclub-hero::before {
  width: 220px;
  height: 220px;
  right: -80px;
  top: -110px;
  background: radial-gradient(circle, rgba(79,70,229,0.16), rgba(79,70,229,0));
}
.bookclub-hero::after {
  width: 180px;
  height: 180px;
  left: -80px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(22,163,74,0.12), rgba(22,163,74,0));
}
.bookclub-hero-top,
.bookclub-hero-main {
  position: relative;
  z-index: 1;
}
.bookclub-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.bookclub-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  border: 1px solid rgba(79,70,229,0.12);
  backdrop-filter: blur(8px);
}
.bookclub-hero-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}
.bookclub-hero-title {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: .2px;
}
.bookclub-hero-subtitle {
  max-width: 560px;
  font-size: 14px;
  color: var(--text-light);
}
.bookclub-hero-cta {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.92);
  color: var(--primary-dark);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(79,70,229,0.12);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.bookclub-hero-cta:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 14px 28px rgba(79,70,229,0.16);
}
.bookclub-stats { margin-top: 12px; }
.bookclub-stat-card { padding: 16px 12px; }
.bookclub-stat-num { font-size: 28px; line-height: 1; margin-top: 4px; }
.bookclub-create-card { box-shadow: 0 8px 20px rgba(0,0,0,0.03); }
.bookclub-section { margin-top: 18px; }
.bookclub-section-title { margin-bottom: 10px; }
.bookclub-picker-head { align-items: flex-end; margin-bottom: 6px; }
.bookclub-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bookclub-picked { font-size: 12px; color: var(--primary); font-weight: 700; }
.bookclub-empty { padding: 14px 0; }
.bookclub-card {
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--primary);
  padding: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.bookclub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}
.bookclub-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}
.bookclub-card-header,
.bookclub-card-body,
.bookclub-card-footer {
  padding: 14px 14px 0 18px;
}
.bookclub-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.bookclub-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.bookclub-card-body { padding-top: 10px; }
.bookclub-card-line { font-size: 13px; color: var(--text); margin-top: 6px; }
.bookclub-card-line + .bookclub-card-line { margin-top: 4px; }
.bookclub-card-meta { color: var(--text-light); font-size: 12px; }
.bookclub-actions,
.bookclub-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 0 14px 14px 18px;
}
.bookclub-actions .btn-primary,
.bookclub-actions .btn-danger,
.bookclub-modal-actions .btn-primary,
.bookclub-modal-actions .btn-secondary {
  width: auto;
  flex: 1;
  min-width: 120px;
}
.bookclub-participant-tag {
  margin-left: auto;
  white-space: nowrap;
}
.bookclub-modal-card {
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255,255,255,0.6);
}
.bookclub-modal-summary {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(79,70,229,0.06), rgba(79,70,229,0.03));
  border: 1px solid rgba(79,70,229,0.10);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}
.modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light);
  transition: transform .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.modal-close:hover {
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(79,70,229,0.10);
  transform: translateY(-1px);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: background .15s ease;
}
.check-row:hover { background: rgba(79,70,229,0.04); }
.check-row input { width: 18px; height: 18px; }

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .bookclub-page { padding: 4px 0 14px; }
  .bookclub-hero { padding: 16px 14px 12px; border-radius: 16px; }
  .bookclub-hero-main { flex-direction: column; align-items: flex-start; }
  .bookclub-hero-title { font-size: 24px; }
  .bookclub-hero-cta { width: 100%; }
  .bookclub-grid-2 { grid-template-columns: 1fr; }
  .bookclub-actions,
  .bookclub-modal-actions { flex-direction: column; }
  .bookclub-actions .btn-primary,
  .bookclub-actions .btn-danger,
  .bookclub-modal-actions .btn-primary,
  .bookclub-modal-actions .btn-secondary { width: 100%; }
  .bookclub-card-header,
  .bookclub-card-body,
  .bookclub-card-footer,
  .bookclub-actions { padding-left: 14px; padding-right: 14px; }
}

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
}

