/* ============================================================
   瓜田周报 · MELON DAILY  —  共享设计系统
   风格：明亮撞色「街头小报 × 西瓜」 硬边框 + 硬投影 + 大字号
   ============================================================ */

:root {
  /* 色板 */
  --ink: #16130e;
  --ink-2: #2c2621;
  --muted: #6c6155;
  --paper: #f6efdd;
  --paper-2: #fdf8ec;
  --card: #fffdf6;
  --pink: #ff2d5e;
  --pink-2: #ff7a96;
  --rind: #0fa85a;
  --rind-2: #0b7a42;
  --yolk: #ffd23f;
  --grape: #7a4dff;
  --sky: #2f7bff;

  /* 渐变 */
  --grad-hot: linear-gradient(105deg, var(--pink), var(--yolk));
  --grad-melon: linear-gradient(135deg, var(--rind), var(--yolk));

  /* 字体 */
  --font-display: "Arial Black", "Impact", "Haettenschweiler", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-ui: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui,
    -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Songti SC", "SimSun", "Noto Serif SC", Georgia, "Times New Roman",
    serif;

  /* 结构 */
  --line: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-lg: 10px 10px 0 var(--ink);
  --radius: 14px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(22, 19, 14, 0.06) 1.2px, transparent 1.3px),
    radial-gradient(rgba(15, 168, 90, 0.05) 1.2px, transparent 1.3px);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--card);
  border-bottom: var(--line);
  transition: box-shadow .25s ease, transform .25s ease;
}
.topbar.is-stuck { box-shadow: 0 6px 0 rgba(22, 19, 14, 0.12); }
.topbar__inner {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand__mark {
  width: 44px; height: 44px; border: var(--line); border-radius: 12px;
  background: var(--grad-melon); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; font-size: 22px; flex: none;
}
.brand__text { display: flex; flex-direction: column; }
.brand__name {
  font-family: var(--font-display); font-size: 22px; line-height: 1;
  letter-spacing: -0.03em;
}
.brand__sub {
  font-size: 10px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 14px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: 2px solid transparent; transition: .18s ease;
}
.nav a:hover { background: var(--yolk); border-color: var(--ink); }
.nav a[aria-current="page"] {
  background: var(--ink); color: var(--paper-2); border-color: var(--ink);
}
.nav-toggle {
  display: none; background: var(--yolk); border: var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm); font-size: 20px; padding: 4px 12px; line-height: 1.4;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border: var(--line); border-radius: 999px;
  font-weight: 800; font-size: 15px; background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .18s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn--primary { background: var(--pink); color: #fff; }
.btn--yolk { background: var(--yolk); }
.btn--dark { background: var(--ink); color: var(--paper-2); }
.btn--block { width: 100%; justify-content: center; }

/* ---------- 跑马灯 ---------- */
.marquee {
  border-bottom: var(--line); background: var(--ink); color: var(--paper-2);
  overflow: hidden; white-space: nowrap; padding: 9px 0;
}
.marquee__track { display: inline-flex; gap: 34px; animation: slide 26s linear infinite; }
.marquee__track span { font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.marquee__track span::before { content: "●"; color: var(--yolk); margin-right: 8px; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Hero ---------- */
.hero { padding: 54px 0 30px; position: relative; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 34px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 800;
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  background: var(--yolk); border: var(--line); border-radius: 999px;
  padding: 6px 14px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.hero__title {
  font-size: clamp(44px, 8vw, 96px); line-height: .92; letter-spacing: -0.04em;
}
.hero__title .hl {
  color: var(--pink);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 5px 5px 0 var(--yolk);
}
.hero__title .tw { display: block; }
.hero__lead {
  font-family: var(--font-serif); font-size: 18px; color: var(--ink-2);
  max-width: 46ch; margin: 22px 0 26px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* 瓜力值面板 */
.meter {
  background: var(--card); border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 24px; transform: rotate(1.4deg);
}
.meter__head { display: flex; justify-content: space-between; align-items: baseline; }
.meter__label { font-weight: 800; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.meter__num { font-family: var(--font-display); font-size: 58px; line-height: 1; color: var(--pink); }
.meter__bar { height: 18px; border: var(--line); border-radius: 999px; background: var(--paper); margin: 14px 0 18px; overflow: hidden; }
.meter__bar i { display: block; height: 100%; width: 0; background: var(--grad-hot); transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.meter__row { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-top: 2px dashed rgba(22,19,14,.2); font-weight: 700; }
.meter__row span:last-child { color: var(--rind-2); }

/* ---------- 章节 ---------- */
.section { padding: 46px 0; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section__title { font-size: clamp(28px, 4.4vw, 44px); }
.section__title em { font-style: normal; color: var(--rind-2); }
.section__note { color: var(--muted); font-weight: 700; font-size: 14px; }

/* ---------- 分类 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.chip {
  padding: 9px 18px; border: var(--line); border-radius: 999px; background: var(--card);
  font-weight: 800; font-size: 14px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, background .18s ease, color .18s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip.is-active { background: var(--ink); color: var(--paper-2); }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card); border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); }
.card--wide { grid-column: span 2; }
.card__media {
  aspect-ratio: 16 / 10; border-bottom: var(--line);
  display: grid; place-items: center; font-size: 62px; position: relative;
}
.card__media .emoji { filter: drop-shadow(3px 3px 0 rgba(22,19,14,.45)); }
.media--pink { background: linear-gradient(135deg, var(--pink), var(--pink-2)); }
.media--rind { background: linear-gradient(135deg, var(--rind), var(--yolk)); }
.media--grape { background: linear-gradient(135deg, var(--grape), var(--sky)); }
.media--yolk { background: linear-gradient(135deg, var(--yolk), var(--pink)); }
.card__tag {
  position: absolute; top: 12px; left: 12px; background: var(--card);
  border: var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12px;
  font-weight: 800; box-shadow: 3px 3px 0 var(--ink);
}
.card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__title { font-size: 21px; line-height: 1.16; }
.card__title a { background-image: linear-gradient(var(--pink), var(--pink)); background-size: 0 3px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .25s ease; }
.card__title a:hover { background-size: 100% 3px; }
.card__excerpt { font-family: var(--font-serif); font-size: 15px; color: var(--ink-2); margin: 0; }
.card__foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 800; color: var(--muted); padding-top: 12px;
  border-top: 2px dashed rgba(22,19,14,.18);
}
.pill-hot { background: var(--pink); color: #fff; border: var(--line); border-radius: 999px; padding: 3px 10px; box-shadow: 2px 2px 0 var(--ink); }

/* ---------- 榜单 ---------- */
.ranklist { display: flex; flex-direction: column; gap: 16px; }
.rankitem {
  display: grid; grid-template-columns: 74px 1fr auto; gap: 18px; align-items: center;
  background: var(--card); border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 20px;
  transition: transform .14s ease, box-shadow .14s ease;
}
.rankitem:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
.rankno { font-family: var(--font-display); font-size: 42px; line-height: 1; text-align: center; }
.rankitem:nth-child(1) .rankno { color: var(--yolk); -webkit-text-stroke: 2px var(--ink); }
.rankitem:nth-child(2) .rankno { color: var(--pink-2); -webkit-text-stroke: 2px var(--ink); }
.rankitem:nth-child(3) .rankno { color: var(--rind); -webkit-text-stroke: 2px var(--ink); }
.rankitem__main { min-width: 0; }
.rankitem__title { font-size: 19px; margin-bottom: 8px; }
.bar { height: 12px; border: var(--line); border-radius: 999px; background: var(--paper); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad-hot); transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.rankitem__score { text-align: right; }
.rankitem__score b { font-family: var(--font-display); font-size: 26px; display: block; }
.delta { font-size: 13px; font-weight: 800; }
.delta.up { color: var(--rind-2); }
.delta.down { color: var(--pink); }
.delta.flat { color: var(--muted); }

/* ---------- 文章页 ---------- */
.crumb { font-size: 13px; font-weight: 800; color: var(--muted); padding: 22px 0 0; }
.crumb a:hover { color: var(--pink); }
.article { padding: 22px 0 20px; }
.article__head { max-width: 820px; }
.article__title { font-size: clamp(34px, 6vw, 62px); line-height: 1.02; margin: 14px 0 18px; }
.article__meta { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 14px; font-weight: 800; color: var(--muted); }
.article__meta .dot { color: var(--pink); }
.article__hero {
  height: 260px; border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 110px; margin: 26px 0 30px;
}
.article__layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.article__body { font-family: var(--font-serif); font-size: 18px; line-height: 1.9; color: var(--ink-2); }
.article__body p { margin: 0 0 20px; }
.article__body p:first-of-type::first-letter {
  font-family: var(--font-display); font-size: 62px; float: left; line-height: .82;
  padding: 6px 12px 0 0; color: var(--pink);
}
.article__body h2 { font-size: 26px; margin: 34px 0 14px; }
.article__body blockquote {
  margin: 26px 0; padding: 18px 22px; background: var(--paper-2);
  border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font-family: var(--font-ui); font-weight: 700; font-size: 17px;
}
.fakenote {
  margin: 30px 0 0; padding: 16px 20px; border-radius: var(--radius);
  border: 2px dashed var(--ink); background: rgba(255, 210, 63, .35);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700; box-shadow: none;
}
.side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 92px; }
.panel { background: var(--card); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.panel h3 { font-size: 20px; margin-bottom: 14px; }
.panel li { list-style: none; }
.panel ul { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.panel ul a { display: flex; gap: 10px; font-weight: 700; font-size: 15px; }
.panel ul a:hover { color: var(--pink); }
.panel .idx { font-family: var(--font-display); color: var(--rind-2); }

/* 评论 */
.comment { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 18px 0; border-bottom: 2px dashed rgba(22,19,14,.18); }
.avatar {
  width: 52px; height: 52px; border: var(--line); border-radius: 12px;
  display: grid; place-items: center; font-weight: 900; font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.comment__head { display: flex; align-items: baseline; gap: 10px; font-weight: 800; }
.comment__head time { font-size: 12px; color: var(--muted); font-weight: 700; }
.comment p { margin: 6px 0 0; font-family: var(--font-serif); font-size: 16px; }

/* ---------- 订阅 CTA ---------- */
.cta {
  background: var(--ink); color: var(--paper-2); border: var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lg); padding: 40px; margin: 20px 0 60px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center;
  position: relative; overflow: hidden;
}
.cta::after {
  content: "🍉"; position: absolute; right: -10px; bottom: -24px; font-size: 150px;
  opacity: .18; transform: rotate(-14deg);
}
.cta h2 { font-size: clamp(26px, 4vw, 40px); }
.cta p { font-family: var(--font-serif); color: #d9d2c2; margin: 12px 0 0; }
.subform { display: flex; gap: 10px; flex-wrap: wrap; }
.subform input {
  flex: 1; min-width: 180px; padding: 13px 18px; border: var(--line); border-radius: 999px;
  font-family: inherit; font-size: 15px; background: var(--paper-2); color: var(--ink);
}
.subform input:focus { outline: 3px solid var(--yolk); outline-offset: 2px; }

/* ---------- 页脚 ---------- */
.footer { border-top: var(--line); background: var(--paper-2); padding: 40px 0 28px; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; }
.footer h4 { font-size: 16px; margin-bottom: 12px; }
.footer a { display: block; padding: 4px 0; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.footer a:hover { color: var(--pink); }
.footer__disclaimer {
  margin-top: 28px; padding-top: 18px; border-top: 2px dashed rgba(22,19,14,.25);
  font-size: 12.5px; color: var(--muted); font-weight: 700;
}

/* ---------- 回到顶部 ---------- */
.totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  width: 52px; height: 52px; border: var(--line); border-radius: 50%;
  background: var(--yolk); box-shadow: var(--shadow-sm); font-size: 22px;
  display: grid; place-items: center; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .15s ease;
}
.totop.is-show { opacity: 1; pointer-events: auto; }
.totop:hover { transform: translateY(-3px); }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(22, 19, 14, .62); padding: 24px; overflow: auto;
}
.modal.is-open { display: grid; place-items: center; }
.modal__card {
  background: var(--card); border: var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); max-width: 560px; width: 100%; padding: 30px;
  position: relative; animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.92) rotate(-1deg); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__close {
  position: absolute; top: 14px; right: 14px; border: var(--line); border-radius: 50%;
  width: 38px; height: 38px; background: var(--pink); color: #fff; font-size: 18px;
  box-shadow: 3px 3px 0 var(--ink);
}
.modal__card h3 { font-size: 26px; margin-bottom: 10px; }
.modal__card p { font-family: var(--font-serif); color: var(--ink-2); }

/* ---------- 滚动显现 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 装饰 ---------- */
.sticker {
  display: inline-block; background: var(--yolk); border: var(--line);
  border-radius: 10px; padding: 6px 14px; font-weight: 900; font-size: 13px;
  box-shadow: var(--shadow-sm); transform: rotate(-3deg);
}
.tape-hr {
  height: 0; border: 0; border-top: 3px solid var(--ink); margin: 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero__grid, .article__layout, .cta, .footer__grid { grid-template-columns: 1fr; }
  .grid, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .card--wide { grid-column: span 2; }
  .side { position: static; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--card); border-bottom: var(--line); padding: 12px 20px 18px;
    gap: 6px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { width: 100%; }
  .nav-toggle { display: block; }
}
@media (max-width: 620px) {
  .grid, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
  .rankitem { grid-template-columns: 52px 1fr; }
  .rankitem__score { grid-column: 2; text-align: left; }
  .cta { padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
