/* ============================================================
   51吃瓜 · 西瓜清新吃瓜风
   ============================================================ */

:root {
  --bg: #fffdf7;
  --bg-2: #f4fbf2;
  --surface: #ffffff;
  --red: #ff5f6d;
  --red-deep: #e8444f;
  --green: #22b573;
  --green-deep: #128a56;
  --gold: #ffb020;
  --ink: #33302e;
  --ink-2: #6f6862;
  --ink-3: #a79d93;
  --line: #ffe4e6;
  --line-green: #d8f0df;
  --grad: linear-gradient(135deg, #ff8a5c 0%, #ff5f6d 100%);
  --grad-green: linear-gradient(135deg, #7ee7a8 0%, #22b573 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 138, 92, 0.14), rgba(255, 95, 109, 0.14));
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 6px 18px -8px rgba(255, 95, 109, 0.3);
  --shadow: 0 16px 40px -14px rgba(255, 95, 109, 0.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--red-deep); }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; position: relative; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: 24px; height: 68px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800; letter-spacing: 1px;
  color: var(--ink); flex: 0 0 auto;
}
.logo .logo-mark {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px -6px rgba(34, 181, 115, 0.6);
}
.logo .logo-mark svg { width: 38px; height: 38px; }
.logo em { font-style: normal; color: var(--red-deep); }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a {
  padding: 8px 15px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--ink-2);
}
.main-nav a:hover, .main-nav a.active { color: var(--red-deep); background: var(--grad-soft); }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 8px 16px; color: var(--ink-3);
  flex: 0 0 auto; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 95, 109, 0.14); }
.search-box input {
  border: none; outline: none; background: transparent;
  font-size: 14px; width: 160px; color: var(--ink); font-family: var(--font);
}
.search-box input::placeholder { color: var(--ink-3); }
.nav-toggle {
  display: none; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); border-radius: 12px; width: 42px; height: 42px;
  cursor: pointer; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 60px;
  background:
    radial-gradient(760px 420px at 88% -8%, rgba(255, 95, 109, 0.13), transparent 60%),
    radial-gradient(640px 360px at 4% 110%, rgba(34, 181, 115, 0.14), transparent 60%);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(34, 181, 115, 0.12) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6), transparent 72%);
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6), transparent 72%);
  pointer-events: none;
}
.hero-inner {
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: 44px; align-items: center; position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 18px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid #ffc9ce;
  color: var(--red-deep); font-size: 14px; font-weight: 700; margin-bottom: 22px;
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 12px var(--red); animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}
.hero h1 { font-size: 46px; line-height: 1.24; font-weight: 800; letter-spacing: 0.5px; margin-bottom: 16px; }
.hero h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero .lead { font-size: 17px; color: var(--ink-2); max-width: 500px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 38px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 999px;
  font-size: 16px; font-weight: 700; transition: transform 0.15s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 12px 26px -10px rgba(255, 95, 109, 0.85); }
.btn-primary:hover { color: #fff; box-shadow: 0 16px 34px -10px rgba(255, 95, 109, 0.95); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { color: var(--red-deep); border-color: var(--red); }
.hero-stats { display: flex; gap: 38px; }
.hero-stats .stat strong { display: block; font-size: 23px; font-weight: 800; color: var(--red-deep); }
.hero-stats .stat span { font-size: 13px; color: var(--ink-3); }

/* 西瓜视觉（截面）：绿皮 + 白瓤 + 红瓤 + 黑籽 */
.hero-visual { position: relative; min-height: 300px; display: grid; place-items: center; }
.melon {
  position: relative; width: 240px; height: 240px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 24px 40px -14px rgba(34, 181, 115, 0.5), inset 0 0 0 16px #fffdf7;
  display: grid; place-items: center;
  animation: bob 5s ease-in-out infinite;
}
.melon::after {
  content: ""; width: 190px; height: 190px; border-radius: 50%;
  background: var(--grad);
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}
.melon-seed {
  position: absolute; width: 9px; height: 14px; border-radius: 50%;
  background: #2d2a32; z-index: 2;
}
.s1 { top: 76px; left: 102px; transform: rotate(18deg); }
.s2 { top: 128px; right: 86px; transform: rotate(-22deg); }
.s3 { top: 172px; left: 96px; transform: rotate(30deg); }
.s4 { top: 112px; left: 66px; transform: rotate(-14deg); }
.s5 { top: 158px; right: 70px; transform: rotate(8deg); }
.float-chip {
  position: absolute; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  color: var(--red-deep); box-shadow: var(--shadow-sm); white-space: nowrap;
}
.chip1 { top: 16px; right: 0; animation: bounce 5s ease-in-out infinite 0.4s; }
.chip2 { bottom: 44px; left: -6px; animation: bounce 4.2s ease-in-out infinite 0.9s; }
.chip3 { bottom: 0; right: 16px; animation: bounce 5.6s ease-in-out infinite 1.3s; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- 区块通用 ---------- */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-2); border-top: 1px dashed var(--line-green); border-bottom: 1px dashed var(--line-green); }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: 32px; font-weight: 800; letter-spacing: 1px; margin-bottom: 8px; }
.section-head h2 span { color: var(--red-deep); }
.section-head p { color: var(--ink-3); font-size: 14px; }

/* ---------- 热搜榜 ---------- */
.hot-list {
  max-width: 860px; margin: 0 auto;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
}
.hot-item {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 24px; border-bottom: 1px solid #fff3f4;
  transition: background 0.2s;
}
.hot-item:last-child { border-bottom: none; }
.hot-item:hover { background: #fff6f0; }
.hot-rank {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: #f5efe8; color: var(--ink-3);
  font-size: 15px; font-weight: 800;
}
.hot-rank.r1 { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -6px rgba(255, 95, 109, 0.8); }
.hot-rank.r2 { background: linear-gradient(135deg, #ff8a5c, #ffb020); color: #fff; }
.hot-rank.r3 { background: var(--grad-green); color: #fff; }
.hot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hot-title {
  font-size: 15.5px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hot-item:hover .hot-title { color: var(--red-deep); }
.hot-meta { display: flex; gap: 6px; }
.tag {
  font-style: normal; font-size: 11.5px; font-weight: 700;
  padding: 1px 9px; border-radius: 999px;
  background: var(--grad-soft); color: var(--red-deep);
}
.tag-car{ color:#e8444f; } .tag-ai{ color:#8a5cff; } .tag-space{ color:#2b6cb0; }
.tag-game{ color:#8a5cff; } .tag-movie{ color:#d66f20; } .tag-med{ color:#0e9f9f; }
.tag-news{ color:#e8444f; } .tag-variety{ color:#d69e2e; } .tag-tech{ color:#2b6cb0; }
.tag-tv{ color:#d6579c; } .tag-love{ color:#e8444f; }
.hot-heat { flex: 0 0 120px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.hot-heat b { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.heat-bar { width: 100%; height: 5px; background: #f5efe8; border-radius: 999px; overflow: hidden; }
.heat-bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }

/* ---------- 吃瓜速递 ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-card {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--green); }
.news-cover {
  position: relative; aspect-ratio: 16 / 9;
  display: grid; place-items: center; font-size: 52px;
}
.news-cover span { filter: drop-shadow(0 10px 16px rgba(0,0,0,0.22)); transition: transform 0.3s; }
.news-card:hover .news-cover span { transform: scale(1.12) rotate(-6deg); }
.news-cover .nc-tag {
  position: absolute; top: 10px; left: 12px;
  font-style: normal; font-size: 12px; font-weight: 800;
  background: rgba(51, 48, 46, 0.82); color: #fff;
  padding: 2px 12px; border-radius: 999px;
}
.nc-car   { background: linear-gradient(160deg, #ffe9c9, #ffc9a8); }
.nc-space { background: linear-gradient(160deg, #c9d9ff, #a8b8ff); }
.nc-wd    { background: linear-gradient(160deg, #c9f0d8, #90dcb4); }
.nc-sc    { background: linear-gradient(160deg, #e0ccff, #c2a5ff); }
.nc-med   { background: linear-gradient(160deg, #c2f2f0, #8fd9d6); }
.nc-show  { background: linear-gradient(160deg, #ffd6dd, #ffb3c0); }
.news-body { padding: 18px 20px 16px; display: flex; flex-direction: column; flex: 1; }
.news-body h3 { font-size: 16.5px; font-weight: 800; line-height: 1.5; margin-bottom: 8px; }
.news-body p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; }
.news-body .news-meta {
  margin-top: auto; margin-bottom: 0; display: flex;
  justify-content: space-between; align-items: center;
  padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-3);
}
.news-meta span { color: var(--red-deep); font-weight: 700; }
.news-meta time { font-variant-numeric: tabular-nums; }

/* ---------- 瓜田分类 ---------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-item {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 20px 8px; text-align: center;
  font-size: 15px; font-weight: 700; color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.cat-item:hover { transform: translateY(-3px); border-color: var(--green-deep); box-shadow: var(--shadow-sm); color: var(--ink); }
.cat-icon { font-size: 26px; }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.about-item {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 22px; text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.about-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.about-item svg { width: 38px; height: 38px; color: var(--green-deep); margin-bottom: 12px; }
.about-item h3 { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.about-item p { font-size: 13.5px; color: var(--ink-2); }

/* ---------- 页脚 ---------- */
.site-footer { background: #2f3b31; color: #eef4ec; padding: 48px 0 28px; }
.site-footer .logo { color: #fff; }
.site-footer .logo em { color: #ff9a9f; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer-brand p { color: #b9c9ba; font-size: 13.5px; max-width: 280px; margin-top: 12px; }
.footer-col h4 { font-size: 15px; font-weight: 800; color: #fff; margin-bottom: 13px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #b9c9ba; font-size: 13.5px; }
.footer-col a:hover { color: #ff9a9f; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 20px; text-align: center; font-size: 12.5px; color: #9db09f;
}

/* ---------- Toast / 回顶 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: #2f3b31; color: #fff; padding: 12px 22px;
  border-radius: 12px; font-size: 14px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.back-top {
  position: fixed; right: 28px; bottom: 28px; width: 46px; height: 46px;
  border-radius: 50%; background: var(--grad); border: none; color: #fff;
  cursor: pointer; display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 99;
  box-shadow: 0 10px 24px -8px rgba(255, 95, 109, 0.8);
}
.back-top.show { opacity: 1; pointer-events: auto; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { order: -1; min-height: 280px; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .search-box { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .section-head h2 { font-size: 26px; }
  .news-grid { grid-template-columns: 1fr; gap: 16px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .main-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg); flex-direction: column; padding: 12px;
    border-bottom: 1px solid var(--line);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; margin-left: auto; }
  .melon { width: 200px; height: 200px; }
  .melon::after { width: 156px; height: 156px; }
  .hot-item { flex-wrap: wrap; gap: 10px 14px; }
  .hot-heat { flex: 1 1 100%; align-items: stretch; }
  .heat-bar { width: 100%; }
  .hot-heat b { text-align: right; }
}