/* ============================================================
   Helpme 网站样式表
   基调：酷黑 + 蓝紫渐变强调色，参考 Vercel 首页极简风格
   ============================================================ */

/* ---------- 全局变量 ---------- */
:root {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --bg-card: #0d0d0f;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent-1: #6366f1;
  --accent-2: #a855f7;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
  --nav-height: 64px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  background: none;
  color: var(--text-primary);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(168, 85, 247, 0.45);
}

.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-outline {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 14px 30px;
  font-size: 15px;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
  margin-top: 18px;
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* 滚动后导航栏加深（由 js 控制 .scrolled） */
.navbar.scrolled {
  background: rgba(0, 0, 0, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.navbar-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

/* 桌面导航链接 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 汉堡按钮（默认隐藏，移动端显示） */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 汉堡展开态：三条线变为 X */
.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 移动端折叠菜单 */
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 24px 20px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.mobile-menu.open {
  display: flex;
}

.mobile-link {
  padding: 14px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-link:hover {
  color: var(--text-primary);
}

.mobile-auth {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.mobile-auth .btn {
  flex: 1;
}

/* ---------- Hero 主视觉区 ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 60px) 24px 80px;
  overflow: hidden;
}

/* 背景渐变光晕 */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.hero-glow-1 {
  width: 560px;
  height: 560px;
  top: -140px;
  left: 10%;
  background: rgba(99, 102, 241, 0.28);
}

.hero-glow-2 {
  width: 480px;
  height: 480px;
  bottom: -120px;
  right: 8%;
  background: rgba(168, 85, 247, 0.24);
}

/* 顶部微弱网格纹理 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-title {
  font-size: clamp(42px, 7vw, 84px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- 主体容器 / 板块 ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0 120px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  margin: 12px 0 56px;
  font-size: 16px;
}

/* ---------- 卡片网格 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* 五张卡片：前三行三列，后两行居中两列 */
@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1080px;
    margin: 0 auto;
  }

  /* 后两张卡片单独一行居中（占两列 + 空一列） */
  .card:nth-child(4) {
    grid-column: 1 / 2;
  }

  .card:nth-child(5) {
    grid-column: 2 / 3;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

/* 板块图标 */
.card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.card-icon-blue {
  background: rgba(59, 130, 246, 0.14);
}

.card-icon-green {
  background: rgba(34, 197, 94, 0.14);
}

.card-icon-orange {
  background: rgba(249, 115, 22, 0.14);
}

.card-icon-purple {
  background: rgba(168, 85, 247, 0.14);
}

.card-icon-pink {
  background: rgba(236, 72, 153, 0.14);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 18px;
}

/* 核心知识点标签 */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 72px 24px 32px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}

.footer-logo {
  margin-bottom: 14px;
}

.footer-about {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
}

.footer-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-links li,
.footer-contact li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-contact li {
  font-size: 14px;
  color: var(--text-muted);
}

.footer-bottom {
  max-width: 1200px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-bottom .beian {
  margin-left: 10px;
  color: inherit;
  text-decoration: none;
}

.footer-bottom .beian:hover {
  text-decoration: underline;
}

/* ---------- 弹窗遮罩 / 弹窗 ---------- */
.excluded {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.nav-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: -5px;
  margin-right: 2px;
}

/* ---------- 积分排行榜 ---------- */
.rank-board {
  max-width: 1200px;
  margin: 0 auto 44px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.10));
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: var(--radius-lg);
}

.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rank-head h3 {
  font-size: 17px;
}

.rank-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 13.5px;
}

.rank-item.me {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.08);
}

.rank-no {
  flex: 0 0 auto;
  width: 28px;
  text-align: center;
  font-weight: 800;
  color: var(--text-secondary);
}

.rank-avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.25);
  font-size: 13px;
}

.rank-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-pts {
  flex: 0 0 auto;
  color: #fde68a;
  font-weight: 700;
}

.rank-me {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  font-size: 13.5px;
  color: var(--text-secondary);
}

.rank-me b {
  color: #fde68a;
}

/* ---------- 榜单切换标签 ---------- */
.rank-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.rank-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rank-tab.active {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-weight: 600;
}

.rank-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 4px;
}

/* ---------- 首页：榜单入口 + 强制弹出排行榜 ---------- */
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.rank-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalFade 0.18s ease;
}

.rank-modal-mask[hidden] {
  display: none;
}

.rank-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 26px 26px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.rank-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rank-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.rank-modal-title {
  font-size: 22px;
  font-weight: 700;
}

.rank-modal-sub {
  margin: 6px 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.rank-modal-tabs {
  margin-bottom: 14px;
  width: fit-content;
}

.rank-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-modal .rank-item {
  padding: 9px 12px;
  font-size: 13.5px;
}


.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 10, 16, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalFade 0.18s ease;
}

.modal-mask[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 34px 30px 30px;
  box-shadow: var(--shadow-card);
  animation: modalPop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-sub {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 兴趣板块选择 ---------- */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.interest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.22s ease;
}

.interest-card:hover {
  border-color: rgba(99, 102, 241, 0.65);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.10));
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.interest-icon {
  font-size: 30px;
  line-height: 1;
}

.interest-card b {
  font-size: 15px;
}

.interest-card small {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

/* ---------- 滚动渐入动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 全局提示气泡 ---------- */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 2000;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 响应式 ---------- */
/* 有汉堡下拉菜单的页面：移动端只保留下拉，避免导航重复 */
@media (max-width: 900px) {
  .navbar-inner:has(.hamburger) .nav-links {
    display: none;
  }
  .navbar-inner:has(.hamburger) .nav-actions .btn-ghost,
  .navbar-inner:has(.hamburger) .nav-actions .btn-primary {
    display: none;
  }
  .navbar-inner:has(.hamburger) .hamburger {
    display: flex;
  }
  /* 没有下拉菜单的页面：导航保持可用，缩小并允许横向滚动 */
  .navbar-inner:not(:has(.hamburger)) .nav-links {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .navbar-inner:not(:has(.hamburger)) .nav-link {
    padding: 6px 9px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .navbar-inner:not(:has(.hamburger)) .nav-actions .btn-ghost {
    display: inline-flex;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-actions .btn-ghost,
  .nav-actions .btn-primary {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    min-height: 80vh;
    padding-top: calc(var(--nav-height) + 40px);
  }

  .section {
    padding: 70px 0 90px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
