/* ============================================
   51暗网 - 全网热点与星光动态追踪站
   主题色系：星光紫 + 热点粉
   ============================================ */

:root {
  --primary: #9C27B0;
  --primary-dark: #7B1FA2;
  --primary-light: #CE93D8;
  --accent: #FF4081;
  --accent-light: #FF80AB;
  --bg: #F5F8FA;
  --card: #FFFFFF;
  --text: #2C3E50;
  --text-light: #7F8C8D;
  --border: #E8E8E8;
  --hot: #FF4444;
  --new: #4CAF50;
  --boom: #FF9800;
  --shadow: 0 2px 12px rgba(156, 39, 176, 0.08);
  --shadow-hover: 0 6px 24px rgba(156, 39, 176, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部导航 */
.site-header {
  background: var(--card);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.site-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.main-nav {
  display: flex;
  gap: 28px;
  list-style: none;
}

.main-nav a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 20px;
  padding: 6px 14px;
  gap: 8px;
}

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  width: 140px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}

/* 轮播区 */
.hero-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 30px 30px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
}

.carousel-caption h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.carousel-caption p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.carousel-dots {
  position: absolute;
  bottom: 15px;
  right: 20px;
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* 热搜榜 */
.hot-list {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.hot-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.hot-list-header h3 {
  font-size: 1.1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hot-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.hot-item:last-child {
  border-bottom: none;
}

.hot-item:hover {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding-left: 8px;
}

.hot-rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 12px;
  color: #fff;
}

.hot-rank.top3 {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.hot-rank.normal {
  background: var(--text-light);
}

.hot-title {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text);
}

.hot-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  margin-left: 8px;
}

.tag-hot {
  background: var(--hot);
}

.tag-new {
  background: var(--new);
}

.tag-boom {
  background: var(--boom);
}

/* 主体布局 */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin: 24px auto;
  max-width: 1200px;
  padding: 0 20px;
}

.main-content {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
}

/* 模块标题 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.section-header h2 {
  font-size: 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 2px;
}

.section-more {
  font-size: 0.85rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 瀑布流卡片 */
.waterfall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.news-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.news-card-img {
  position: relative;
  overflow: hidden;
}

.news-card-img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.news-card:hover .news-card-img img {
  transform: scale(1.05);
}

.news-card-body {
  padding: 16px;
}

.news-card-body h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-body p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* 时间线组件 */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-content {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
}

/* 投票组件 */
.vote-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.vote-question {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.vote-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vote-option {
  position: relative;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.vote-option:hover {
  border-color: var(--primary);
}

.vote-option.selected {
  border-color: var(--primary);
  background: rgba(156, 39, 176, 0.05);
}

.vote-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(156, 39, 176, 0.1), rgba(255, 64, 129, 0.1));
  transition: width 0.6s ease;
}

.vote-count {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 12px;
  text-align: center;
}

/* 吃瓜按钮 */
.melon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.melon-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.melon-btn .melon-icon {
  display: inline-block;
  animation: melonBounce 1.5s infinite;
}

@keyframes melonBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* 日历组件 */
.calendar-widget {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-day {
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.calendar-day:hover {
  background: var(--bg);
}

.calendar-day.has-event {
  background: rgba(156, 39, 176, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.calendar-day.has-event::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  margin: 2px auto 0;
}

/* 页脚 */
.site-footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.footer-col a {
  display: block;
  color: #aaa;
  font-size: 0.85rem;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid #333;
  font-size: 0.8rem;
  color: #888;
}

/* 面包屑 */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  margin: 0 8px;
}

/* 详情页 */
.detail-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 40px 0;
  margin-bottom: 30px;
}

.detail-header h1 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.detail-body {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  line-height: 1.9;
}

.detail-body h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin: 24px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

.detail-body p {
  margin-bottom: 16px;
  text-indent: 2em;
}

/* 搜索页 */
.search-box {
  max-width: 600px;
  margin: 40px auto;
  display: flex;
  gap: 12px;
}

.search-box input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid var(--border);
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box button {
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.search-box button:hover {
  transform: scale(1.05);
}

/* 404页 */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-page h1 {
  font-size: 6rem;
  color: var(--primary);
  opacity: 0.3;
}

.error-page h2 {
  font-size: 1.5rem;
  margin: 16px 0;
}

.error-page p {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* 按钮通用 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(156, 39, 176, 0.3);
  color: #fff;
}

/* 气泡提示 */
.bubble-tip {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-hover);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: bubbleIn 0.4s ease;
  z-index: 999;
}

@keyframes bubbleIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 懒加载渐显 */
.lazy-img {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.lazy-img.loaded {
  opacity: 1;
}

/* 响应式 */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .header-search {
    display: none;
  }
  .carousel-slide img {
    height: 240px;
  }
  .waterfall-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .detail-header h1 {
    font-size: 1.3rem;
  }
  .search-box {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  .carousel-slide img {
    height: 180px;
  }
  .container {
    padding: 0 12px;
  }
}

/* 页面内容区通用 */
.page-section {
  margin-bottom: 40px;
}

/* FAQ折叠 */
.faq-list {
  margin-top: 20px;
}

.faq-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-question {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.faq-question:hover {
  background: var(--bg);
}

.faq-answer {
  padding: 0 20px 16px;
  color: var(--text-light);
  line-height: 1.8;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* APP下载页 */
.app-hero {
  background: linear-gradient(135deg, var(--primary), #6A1B9A);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}

.app-hero h1 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.app-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 40px 0;
}

.app-feature-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.app-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

@media (max-width: 768px) {
  .app-features {
    grid-template-columns: 1fr;
  }
}
