/* ============================================================
   index.css — 用户端首页样式（暗黑炫酷版）
   依赖 common.css 的 CSS 变量与基础工具类
   ============================================================ */

/* ---------- Hero 欢迎区 ---------- */
.hero {
  position: relative;
  margin-bottom: 40px;
  padding: 56px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 50%, #1a1a2e 100%);
  color: #fff;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease;
}

/* 流光装饰 */
@supports (background: conic-gradient(from 0deg, red, blue)) {
  .hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(251, 176, 0, 0.08) 25%, transparent 50%);
    animation: heroRotate 8s linear infinite;
  }
}

@keyframes heroRotate {
  to { transform: rotate(360deg); }
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(251, 176, 0, 0.15);
  filter: blur(40px);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.hero__title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 1px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
  line-height: 1.6;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero__actions {
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  margin: 0 8px;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: #1a1a2e;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 20px rgba(251, 176, 0, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color var(--transition);
}

.hero__btn:hover {
  color: #1a1a2e;
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(251, 176, 0, 0.5);
}

/* 描边按钮变体 */
.hero__btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  box-shadow: none;
}

.hero__btn--outline:hover {
  color: #1a1a2e;
  background: var(--color-primary);
  box-shadow: 0 0 20px rgba(251, 176, 0, 0.3);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* ---------- 模块区块 ---------- */
.module-section {
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease both;
}

.module-section:nth-child(2) { animation-delay: 0.1s; }
.module-section:nth-child(3) { animation-delay: 0.15s; }
.module-section:nth-child(4) { animation-delay: 0.2s; }
.module-section:nth-child(5) { animation-delay: 0.25s; }
.module-section:nth-child(6) { animation-delay: 0.3s; }

.module-section:last-child {
  margin-bottom: 0;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.module-title {
  position: relative;
  padding-left: 14px;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
}

.module-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: var(--color-primary);
  box-shadow: 0 0 8px rgba(251, 176, 0, 0.4);
}

.module-more {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: color var(--transition), text-shadow var(--transition);
}

.module-more:hover {
  color: var(--color-primary);
  text-shadow: 0 0 8px rgba(251, 176, 0, 0.3);
}

/* ---------- 资源卡片 ---------- */
.resource-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* 卡片内流光条 */
.resource-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  transition: left 0.5s ease;
}

.resource-card:hover::before {
  left: 100%;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(251, 176, 0, 0.15), var(--shadow-lg);
  border-color: var(--color-primary);
}

.resource-card__title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-card__intro {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 文章卡片 ---------- */
.article-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  transition: left 0.5s ease;
}

.article-card:hover::before {
  left: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(251, 176, 0, 0.15), var(--shadow-lg);
  border-color: var(--color-primary);
}

.article-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-card__type {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.article-card__title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__content {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .hero {
    padding: 36px 20px;
  }

  .hero__title {
    font-size: 24px;
  }

  .hero__subtitle {
    font-size: var(--font-size-base);
  }

  .module-title {
    font-size: var(--font-size-lg);
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 28px 16px;
  }

  .hero__title {
    font-size: 20px;
  }

  .hero__btn {
    width: 100%;
  }
}
