/* 51吃瓜 - 主样式文件 */
:root {
  --primary: #e8192c;
  --primary-dark: #c0001a;
  --secondary: #ff6b35;
  --accent: #4caf50;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text: #333;
  --text-muted: #888;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
}

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

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

body {
  font-family: "PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

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

/* ===== 顶部公告栏 ===== */
.top-bar {
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  padding: 6px 0;
  text-align: center;
}
.top-bar a { color: #ffe; }

/* ===== 头部 ===== */
.site-header {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.site-logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.site-logo .brand-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.site-logo .brand-slogan {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== 导航 ===== */
.main-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--primary);
  color: #fff;
}

/* ===== 搜索框 ===== */
.header-search {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  gap: 8px;
  flex-shrink: 0;
}
.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 160px;
  color: var(--text);
}
.header-search button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 4px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background .2s;
}
.header-search button:hover { background: var(--primary-dark); }

/* ===== 搜索栏（导航下方） ===== */
.search-bar-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 14px 0;
}
.search-bar-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 0;
}
.search-bar-inner input {
  flex: 1;
  border: none;
  border-radius: 24px 0 0 24px;
  padding: 10px 20px;
  font-size: 15px;
  outline: none;
}
.search-bar-inner button {
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: 0 24px 24px 0;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.search-bar-inner button:hover { background: #f0f0f0; }
.search-hot-words {
  max-width: 800px;
  margin: 8px auto 0;
  padding: 0 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.search-hot-words span { color: rgba(255,255,255,0.8); font-size: 13px; }
.search-hot-words a {
  color: #fff;
  font-size: 13px;
  background: rgba(255,255,255,0.2);
  padding: 2px 10px;
  border-radius: 12px;
  transition: background .2s;
}
.search-hot-words a:hover { background: rgba(255,255,255,0.35); }

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

/* ===== 首屏焦点图 ===== */
.hero-section {
  background: #fff;
  margin-bottom: 20px;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.hero-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-main img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}
.hero-main-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
  padding: 30px 16px 16px;
}
.hero-main-caption h2 { font-size: 20px; margin-bottom: 6px; }
.hero-main-caption p { font-size: 13px; opacity: .85; }
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-side-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  flex: 1;
}
.hero-side-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 100px;
}
.hero-side-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  padding: 20px 10px 8px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== 通用模块标题 ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}
.section-header-left { display: flex; align-items: center; gap: 10px; }
.section-icon {
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}
.section-more {
  font-size: 13px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-more:hover { color: var(--primary-dark); }

/* ===== 主内容区 ===== */
.main-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 30px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}
.main-content { min-width: 0; }
.sidebar { min-width: 0; }

/* ===== 视频卡片 ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.video-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.video-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.video-card:hover .video-thumb img { transform: scale(1.05); }
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}
.video-card:hover .play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.play-btn svg { width: 22px; height: 22px; fill: var(--primary); margin-left: 3px; }
.video-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}
.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}
.video-info {
  padding: 12px;
}
.video-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.video-meta span { display: flex; align-items: center; gap: 3px; }
.video-author {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.video-author img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== 热门列表 ===== */
.hot-list {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.hot-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.hot-list-item:last-child { border-bottom: none; }
.hot-list-item:hover { background: #fafafa; }
.hot-rank {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hot-rank.top1 { background: #e8192c; color: #fff; }
.hot-rank.top2 { background: #ff6b35; color: #fff; }
.hot-rank.top3 { background: #ffa726; color: #fff; }
.hot-list-title {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
.hot-list-title:hover { color: var(--primary); }
.hot-list-heat {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== 专题卡片 ===== */
.special-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.special-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.special-card:hover { transform: translateY(-2px); }
.special-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.special-card-body { padding: 10px 12px; }
.special-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.special-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== 侧边栏 ===== */
.sidebar-widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.widget-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget-body { padding: 12px 16px; }

/* 作者卡片 */
.author-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.author-item:last-child { border-bottom: none; }
.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-info { flex: 1; min-width: 0; }
.author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.author-fans { font-size: 12px; color: var(--text-muted); }
.follow-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
}
.follow-btn:hover { background: var(--primary-dark); }

/* 侧边栏热门 */
.sidebar-hot-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-hot-item:last-child { border-bottom: none; }
.sidebar-hot-img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.sidebar-hot-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-hot-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== 评论区 ===== */
.comment-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.comment-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.comment-form textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 14px;
  resize: none;
  height: 70px;
  outline: none;
  font-family: inherit;
}
.comment-form textarea:focus { border-color: var(--primary); }
.comment-submit {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background .2s;
}
.comment-submit:hover { background: var(--primary-dark); }
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item {
  display: flex;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; padding-bottom: 0; }
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.comment-content { flex: 1; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.comment-user { font-size: 14px; font-weight: 600; color: var(--text); }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.comment-action-btn {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  transition: color .2s;
}
.comment-action-btn:hover { color: var(--primary); }

/* ===== FAQ ===== */
.faq-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.faq-question::after {
  content: '+';
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item.open .faq-question::after { transform: rotate(45deg); }
.faq-answer {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s, padding .3s;
}
.faq-item.open .faq-answer {
  max-height: 200px;
  padding-top: 8px;
}

/* ===== 分类标签 ===== */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cat-tab {
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow);
}
.cat-tab:hover, .cat-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== 互动按钮 ===== */
.action-bar {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  color: var(--text-muted);
  transition: all .2s;
}
.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.action-btn.liked {
  background: #fff0f0;
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== 通知条 ===== */
.notice-bar {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: #795548;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 页脚 ===== */
.site-footer {
  background: #222;
  color: #aaa;
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.footer-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.footer-desc { font-size: 13px; line-height: 1.7; }
.footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #444;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { color: #aaa; font-size: 13px; transition: color .2s; }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.footer-bottom a { color: #aaa; }
.footer-bottom a:hover { color: var(--primary); }

/* ===== 面包屑 ===== */
.breadcrumb {
  background: var(--card-bg);
  padding: 10px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.breadcrumb-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb-inner a { color: var(--text-muted); }
.breadcrumb-inner a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0;
}
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.page-btn:hover, .page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== 标签 ===== */
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  background: #f0f0f0;
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
  transition: all .2s;
}
.tag:hover { background: var(--primary); color: #fff; }

/* ===== 统计数字 ===== */
.stats-bar {
  display: flex;
  gap: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.stat-item { text-align: center; flex: 1; }
.stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .special-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .header-inner { gap: 10px; }
  .main-nav { display: none; }
  .header-search input { width: 100px; }
  .footer-top { grid-template-columns: 1fr; }
  .special-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-wrap: wrap; }
}

/* ===== 懒加载占位 ===== */
img[data-src] {
  background: #f0f0f0;
  min-height: 60px;
}

/* ===== 搜索结果提示 ===== */
.search-tip {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}
