* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { --header-row-height: 86px; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-row-height) + 11px); }
body {
  --brand: #28996d; --accent: #176b4c; --pale: #e9f6ee; --paper: #f4faf5; --ink: #17271f;
  --muted: #4e6257; --stroke: #e5ede7; --footer: #17271f; --footer-text: #b5c6bc;
  --cta-end: #156c40; --cta-button: #addb72;
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body[data-brand="eggplant"] {
  --brand: #8b40c7; --accent: #6d2ea6; --pale: #f2e8fa; --paper: #f8f4fc; --ink: #281d30;
  --muted: #786b80; --stroke: #eae2f0; --footer: #251730; --footer-text: #d1c1d8;
  --cta-end: #62208d; --cta-button: #e6bcef;
}
body[data-brand="corn"] {
  --brand: #ba7709; --accent: #815000; --pale: #fff4dc; --paper: #fffbf2; --ink: #302316;
  --muted: #675645; --stroke: #f0e8da; --footer: #302316; --footer-text: #d6c5af;
  --cta-end: #81500d; --cta-button: #fadc91;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.shell { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.header { position: sticky; top: 0; z-index: 10; background: #fff; border-top: 3px solid var(--brand); }
.header-row { min-height: var(--header-row-height); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; width: fit-content; max-width: 100%; }
.brand-wordmark { display: block; max-width: 100%; height: auto; }
.header-visit { flex: none; }
.button { min-height: 46px; display: inline-flex; justify-content: center; align-items: center; gap: 5px; padding: 10px 21px; border: 1px solid transparent; border-radius: 999px; font-size: 14px; font-weight: 730; white-space: nowrap; cursor: pointer; }
.button--primary { background: var(--brand); color: #fff; }
.button--primary:hover { background: var(--accent); }
.button--quiet { background: #fff; color: var(--ink); border-color: var(--stroke); }
.button--quiet:hover { color: var(--accent); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 38%; align-items: center; gap: 25px; padding-block: 51px 66px; }
.hero-copy { position: relative; min-width: 0; padding-right: min(6vw, 85px); }
.hero-art { position: absolute; right: -1px; top: 50%; translate: 0 -50%; width: min(7vw, 76px); height: auto; }
.eyebrow { display: block; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .075em; }
.hero .eyebrow::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 9px; border-radius: 50%; vertical-align: .15em; background: var(--brand); }
.hero h1 { margin-top: 18px; font-size: clamp(32px, 4.2vw, 52px); font-weight: 830; letter-spacing: -.045em; line-height: 1.16; }
.hero-description { margin-top: 16px; color: var(--muted); font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.promo-caption { margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.hero-promos { display: grid; gap: 9px; }
.promo {
  --shade: #2b1205; --edge: #9c5617; position: relative; isolation: isolate; display: flex;
  align-items: center; min-width: 0; min-height: 126px; overflow: hidden; padding: 13px 18px; border-radius: 14px;
  background: linear-gradient(110deg, var(--shade), var(--edge)); color: #fff;
}
.promo--comics { --shade: #25102f; --edge: #705695; }
.promo--live { --shade: #2e061b; --edge: #662234; }
.promo--resource { --shade: #211249; --edge: #5331a4; }
.promo-image { position: absolute; z-index: -2; right: 0; width: 66%; height: 100%; object-fit: cover; object-position: center; }
.promo::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--shade) 24%, var(--shade) 38%, transparent 88%); }
.promo-copy { display: grid; min-width: 0; justify-items: start; gap: 6px; }
.promo-title { display: flex; align-items: center; gap: 8px; }
.promo-icon { border-radius: 6px; object-fit: contain; }
.promo-title strong { font-size: clamp(16px, 2vw, 24px); line-height: 1.15; }
.promo-title small { padding: 2px 4px; border-radius: 3px; color: #fff8e7; background: #fff2; font-size: 10px; white-space: nowrap; }
.promo-description { font-size: 13px; color: #fff; }
.promo-action { padding: 1px 8px; border: 1px solid #fff6; border-radius: 999px; font-size: 11px; }
a.promo:hover .promo-action { background: #fff2; }
.promo-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.promo-pair .promo { width: 100%; min-height: auto; aspect-ratio: 3.2 / 1; padding-inline: 24px; }
.promo--live .promo-image, .promo--resource .promo-image { width: 100%; }

.featured { padding-block: 30px 26px; scroll-margin-top: 24px; }
.section-meta { margin-bottom: 34px; }
.section-meta h2 { margin-top: 4px; font-size: 29px; line-height: 1.2; }
.section-meta p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.card-status { grid-column: 1 / -1; padding: 12px; color: var(--muted); font-size: 14px; text-align: center; }
.site-card {
  display: flex; position: relative; min-width: 0; min-height: 86px; align-items: center; gap: 14px;
  padding: 13px 18px; border: 1px solid var(--stroke); border-radius: 14px; background: #fff;
}
a.site-card:hover { border-color: var(--brand); }
.site-corner-label {
  position: absolute; inset-block-start: 0; inset-inline-end: 0; padding: 2px 7px;
  border-start-end-radius: 13px; border-end-start-radius: 7px;
  background: #fff0d6; color: #7b460e; font-size: 11px; font-weight: 650; line-height: 1.35;
}
.site-icon, .preview-icon { flex: none; width: 45px; height: 45px; border-radius: 11px; object-fit: contain; background: var(--pale); }
.preview-icon { display: grid; place-items: center; overflow: hidden; color: var(--accent); }
.preview-icon > * { grid-area: 1 / 1; }
.preview-icon > .site-icon { opacity: 0; }
.preview-icon > .site-icon.is-loaded { opacity: 1; }
.site-label { display: grid; gap: 2px; min-width: 0; }
.site-label h3, .site-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-label h3 { font-size: 16px; font-weight: 700; }
.site-label small { color: var(--muted); font-size: 12px; }
.site-next { display: grid; flex: none; place-items: center; width: 26px; height: 26px; margin-left: auto; border-radius: 100%; color: var(--accent); background: var(--pale); }
.primary-pair { margin-block: 44px 30px; }
.media { padding-bottom: 52px; }
.media h2 { margin-bottom: 14px; padding-left: 9px; border-left: 5px solid var(--brand); font-size: 22px; line-height: 1.16; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px 12px; padding: 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.media-cover { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 2; border-radius: 9px; overflow: hidden; color: var(--accent); background: linear-gradient(145deg, var(--paper), var(--pale)); }
.media-cover > * { grid-area: 1 / 1; }
.media-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-top: 7px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.media-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.cta { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 26px; margin-block: 32px 56px; border-radius: 22px; background: linear-gradient(105deg, var(--footer), var(--cta-end)); color: #fff; }
.cta h2 { font-size: 22px; }
.cta p { margin-top: 4px; color: var(--footer-text); font-size: 13px; }
.cta .button { background: var(--cta-button); color: var(--footer); }
.footer { padding-block: 31px 20px; background: var(--footer); color: var(--footer-text); font-size: 13px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 22px; }
.footer-links a:hover { color: #fff; }
.footer-text { max-width: 730px; margin-top: 14px; }
.footer-text p + p { margin-top: 7px; }
.footer-end {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px;
  margin-top: 21px; padding-top: 13px; border-top: 1px solid #fff2; font-size: 12px;
}
.age-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: clamp(22px, 5vw, 38px); border: 1px solid var(--stroke); border-radius: 22px; color: var(--ink); background: #fff; }
.age-dialog::backdrop { background: #14231dd1; }
body:has(.age-dialog[open]) { overflow: hidden; }
.age-mark { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 18px; border-radius: 19px; background: var(--pale); }
.age-dialog h2 { margin-bottom: 10px; font-size: clamp(24px, 5vw, 34px); }
#age-title:focus { outline: none; }
.age-dialog p { color: var(--muted); }
.age-return-hint { margin-top: 10px; font-size: 14px; }

/* 已有完整行时，省去论坛博客列表末尾排不满的一行。 */
@media not all and (max-width: 900px) {
  .site-grid > li:nth-child(3n + 4):nth-last-child(-n + 2),
  .site-grid > li:nth-child(3n + 5):last-child { display: none; }
}
@media (max-width: 900px) {
  .hero { gap: 16px; padding-block: 38px 46px; grid-template-columns: minmax(0, 1fr) 41%; }
  .hero-copy { padding-right: 0; }
  .hero-art { display: none; }
  .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-grid > li:nth-child(2n + 3):last-child { display: none; }
}
@media (max-width: 620px) {
  html { --header-row-height: 64px; }
  .shell { width: calc(100% - 32px); }
  .header-row { gap: 8px; padding-block: 8px; }
  .header .brand-wordmark { width: min(37vw, 128px); }
  .header .button { min-height: 44px; padding-inline: 11px; font-size: 12px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 25px; padding-block: 28px 32px; }
  .hero h1 { margin-top: 12px; }
  .hero-description { margin-top: 9px; font-size: 14px; }
  .promo { min-height: 105px; }
  .promo-pair { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .promo-pair .promo { min-height: 100px; }
  .featured { padding-block: 0; }
  .section-meta { margin-bottom: 20px; }
  .site-grid { gap: 8px; }
  .site-card { min-height: 66px; gap: 7px; padding: 9px 8px; }
  .site-corner-label { padding: 1px 5px; font-size: 10px; }
  .site-icon, .preview-icon { width: 34px; height: 34px; border-radius: 8px; }
  .site-label h3 { font-size: 14px; }
  .site-next { width: 19px; height: 19px; }
  .primary-pair { margin-block: 30px 23px; }
  .media { padding-bottom: 28px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 8px; padding: 9px; }
  .cta { align-items: flex-start; flex-direction: column; padding: 16px; margin-block: 22px 32px; }
  .cta h2 { font-size: 19px; }
  .footer { padding-block: 20px 14px; }
  .footer-links { gap: 8px 13px; }
}
@media (max-width: 360px) {
  .site-card { min-height: 78px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.reading-page { display: flex; flex-direction: column; min-height: 100vh; }
.reading-header .shell { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 86px; padding-block: 12px; }
.reading-main { flex: 1; width: min(800px, calc(100% - 48px)); margin-inline: auto; padding-block: clamp(28px, 6vw, 72px); }
.reading-article { padding: clamp(20px, 5vw, 48px); border: 1px solid var(--stroke); border-radius: 22px; background: #fff; overflow-wrap: anywhere; }
.reading-article h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.2; }
.reading-article p { color: var(--muted); line-height: 1.8; }
.reading-intro { margin-top: 14px; }
.reading-article section { margin-top: 26px; }
.reading-article h2 { margin-bottom: 6px; font-size: 19px; }
.reading-related { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--stroke); }
.reading-article a { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.reading-footer { padding-block: 22px; }

@media (max-width: 620px) {
  .reading-header .shell { min-height: 62px; }
  .reading-main { width: calc(100% - 32px); }
  .reading-article { border-radius: 16px; }
}
