:root {
  --ink: #10231c;
  --muted: #5b6f66;
  --paper: #f3f7f4;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(16, 35, 28, 0.12);
  --accent: #0f7a5f;
  --accent-2: #1aa37f;
  --glow: rgba(26, 163, 127, 0.18);
  --radius: 14px;
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 12% -10%, var(--glow), transparent 60%),
    radial-gradient(700px 360px at 90% 0%, rgba(15, 122, 95, 0.12), transparent 55%),
    linear-gradient(180deg, #eaf3ee 0%, var(--paper) 42%, #e7efea 100%);
}
.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(16, 35, 28, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 28, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

.shell {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}
.shell.narrow { width: min(760px, calc(100% - 2rem)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(243, 247, 244, 0.82);
  border-block-end: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.brand picture { display: block; }
.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 100%;
  transition: opacity 0.15s ease;
}
.brand:hover .brand-logo { opacity: 0.85; }
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}
.nav a[aria-current="page"] { color: var(--ink); }

.lang-menu {
  position: relative;
}
.lang-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
}
.lang-menu[open] > summary {
  border-color: rgba(15, 122, 95, 0.35);
}
.lang-list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  min-width: 11rem;
  max-height: min(70vh, 22rem);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(16, 35, 28, 0.12);
}
.lang-list a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--ink);
}
.lang-list a:hover {
  background: rgba(15, 122, 95, 0.08);
  color: var(--accent);
}
.lang-list a[aria-current="true"] {
  background: rgba(15, 122, 95, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.hero {
  padding-block: clamp(2.5rem, 8vw, 5rem) 1.5rem;
}
.hero-inner { max-width: 40rem; }
.brand-hero {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 600;
  color: var(--ink);
}
.hero-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 34rem;
}

.feed { padding-block: 1rem 4rem; }

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.article-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}
.article-item:hover {
  border-color: rgba(15, 122, 95, 0.35);
  transform: translateY(-1px);
}
.article-link {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 140px;
  color: inherit;
}
.thumb {
  background: #d7e6df center/cover no-repeat;
  min-height: 140px;
}
.thumb-empty {
  background:
    linear-gradient(145deg, rgba(15,122,95,.16), transparent 55%),
    repeating-linear-gradient(-35deg, rgba(16,35,28,.05) 0 2px, transparent 2px 10px),
    #d9e8e1;
}
.article-body {
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.article-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta {
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.pager {
  margin-block-start: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.pager-link {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 500;
}
.pager-status { color: var(--muted); font-size: 0.9rem; }

.article-page { padding-block: 1.5rem 4rem; }
.crumb { margin: 0 0 1rem; color: var(--muted); }
.article-head h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.prose {
  font-size: 1.05rem;
  line-height: 1.8;
}
.prose :where(p, ul, ol, pre, table, blockquote) { margin-block: 1rem; }
.prose :where(h2, h3, h4) {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin-block: 1.6rem 0.7rem;
  line-height: 1.25;
}
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose pre, .prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
.prose pre {
  overflow: auto;
  padding: 1rem;
  background: #10231c;
  color: #e7f5ef;
  border-radius: 10px;
}
.prose blockquote {
  margin-inline: 0;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--accent);
  color: var(--muted);
}

.site-footer {
  border-block-start: 1px solid var(--line);
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-inner p { margin: 0.25rem 0; }
.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

[hidden] { display: none !important; }

/* Sponsored short-drama cards */
.ad-badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border: 1px solid rgba(15, 122, 95, 0.35);
  border-radius: 999px;
  background: rgba(15, 122, 95, 0.06);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* 3:4 poster box via padding: WeChat's older iOS/X5 webviews lack aspect-ratio
   and would stretch the image to the row height. */
.ad-cover {
  position: relative;
  display: block;
  height: 0;
  padding-bottom: 133.333%;
  overflow: hidden;
  border-radius: 10px;
  background: #d9e8e1;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.ad-cover img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
a:hover .ad-cover img { transform: scale(1.03); }
.ad-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--ink);
}
.ad-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.ad-desc:empty { display: none; }
.ad-cta {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

.ad-block {
  margin-block-start: 2.5rem;
  padding: 1.1rem 1.2rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-end: 0.9rem;
}
.ad-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.ad-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}
.ad-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: inherit;
}

.prose .ad-inline { margin-block: 1.75rem; }
.prose .ad-inline a,
.prose .ad-inline a:hover { color: inherit; text-decoration: none; }
.ad-inline-link {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(15, 122, 95, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 122, 95, 0.07), rgba(255, 255, 255, 0.85));
  line-height: 1.4;
}
.ad-inline-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
}
.ad-inline .ad-title { font-size: 1rem; }

.article-link.ad-list-link { grid-template-columns: 105px minmax(0, 1fr); }
.ad-list-link .ad-cover {
  height: auto;
  padding-bottom: 0;
  min-height: 140px;
  border-radius: 0;
}
.ad-list-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.ad-item .meta { align-items: center; gap: 0.6rem; }

/* The carousel avoids aspect-ratio, inset, flex gap and bare clamp() so it
   keeps its shape in WeChat's older iOS / X5 webviews. */
.hero-ad { padding: 1.5rem 0 0.5rem; padding-top: clamp(1.25rem, 4vw, 2.25rem); }
.article-carousel { margin: 1.25rem 0 1.75rem; }
.ad-carousel { position: relative; }
.ad-carousel-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  -webkit-scroll-snap-type: x mandatory;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 18px;
  box-shadow: 0 18px 40px -24px rgba(16, 35, 28, 0.6);
}
.ad-carousel-track::-webkit-scrollbar { display: none; }
.ad-slide {
  display: flex;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.ad-slide[hidden] { display: none; }
.ad-hero-link {
  position: relative;
  z-index: 0;
  overflow: hidden;
  display: grid;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  grid-template-columns: 150px minmax(0, 1fr);
  grid-template-columns: clamp(120px, 17vw, 176px) minmax(0, 1fr);
  align-items: center;
  grid-column-gap: 1.5rem;
  column-gap: 1.5rem;
  column-gap: clamp(1rem, 3vw, 2rem);
  padding: 1.5rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  border-radius: 18px;
  background: #0d1f18;
  color: #fff;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}
.ad-hero-link:hover { color: #fff; }
.ad-hero-backdrop,
.ad-hero-link::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.ad-hero-backdrop {
  z-index: -2;
  object-fit: cover;
  -webkit-filter: blur(28px) saturate(1.3);
  filter: blur(28px) saturate(1.3);
  -webkit-transform: scale(1.25);
  transform: scale(1.25);
  opacity: 0.6;
}
.ad-hero-link::after {
  content: "";
  z-index: -1;
  background: rgba(8, 20, 15, 0.62);
}
.ad-hero-cover { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); }
.ad-hero-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.ad-hero-body > * + * { margin-top: 0.55rem; }
.hero-ad .ad-badge,
.article-carousel .ad-badge {
  border-color: rgba(191, 243, 224, 0.45);
  background: rgba(191, 243, 224, 0.12);
  color: #bff3e0;
}
.ad-hero-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-size: clamp(1.3rem, 3.6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #fff;
}
.article-carousel .ad-hero-title {
  font-size: 1.45rem;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
}
.ad-hero-desc {
  -webkit-line-clamp: 3;
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-size: clamp(0.88rem, 1.6vw, 1rem);
}
.ad-hero-body > .ad-hero-cta { margin-top: 0.9rem; }
.ad-hero-cta {
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.2s ease;
}
.ad-hero-link:hover .ad-hero-cta { background: #12936f; }
.ad-carousel-arrow,
.ad-carousel-dot {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ad-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(8, 20, 15, 0.55);
  color: #fff;
  font-size: 26px;
  line-height: 36px;
  text-align: center;
  opacity: 0;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  transition: opacity 0.2s ease, background 0.2s ease;
}
.ad-carousel-arrow span { display: inline-block; }
.ad-carousel-prev { left: 12px; }
.ad-carousel-next { right: 12px; }
[dir="rtl"] .ad-carousel-prev { left: auto; right: 12px; }
[dir="rtl"] .ad-carousel-next { right: auto; left: 12px; }
[dir="rtl"] .ad-carousel-arrow span { -webkit-transform: scaleX(-1); transform: scaleX(-1); }
.ad-carousel:hover .ad-carousel-arrow,
.ad-carousel-arrow:focus-visible { opacity: 1; }
.ad-carousel-arrow:hover { background: var(--accent); }
.ad-carousel-dots {
  display: flex;
  justify-content: center;
  padding-top: 12px;
  line-height: 0;
}
.ad-carousel-dots[hidden], .ad-carousel-arrow[hidden] { display: none; }
.ad-carousel-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: 0 3.5px;
  border: 0;
  border-radius: 4px;
  background: rgba(16, 35, 28, 0.22);
  transition: width 0.25s ease, background 0.25s ease;
}
.ad-carousel-dot[aria-current="true"] { width: 22px; background: var(--accent); }
@media (hover: none) { .ad-carousel-arrow { display: none; } }
@media (hover: hover) and (min-width: 721px) {
  .ad-carousel-multi .ad-hero-link { padding-left: 4rem; padding-right: 4rem; }
}
@media (prefers-reduced-motion: reduce) { .ad-carousel-dot { transition: none; } }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .article-link { grid-template-columns: 1fr; }
  .thumb { min-height: 160px; }
  .brand-logo { height: 34px; }
  .ad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-link.ad-list-link { grid-template-columns: 90px minmax(0, 1fr); }
  .ad-list-link .ad-cover { min-height: 120px; }
  .ad-inline-link { grid-template-columns: 76px minmax(0, 1fr); gap: 0.8rem; }
  .ad-hero-link { grid-template-columns: 96px minmax(0, 1fr); }
  .ad-hero-desc { -webkit-line-clamp: 2; }
  .ad-hero-cta { padding: 0.45rem 1rem; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .brand-logo { height: 36px; }
  .header-actions { gap: 0.75rem; }
}
