*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;

  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.16);

  --text-main: #1f293b;   /* 深蓝灰 */
  --text-muted: #6b7280;

  --border-subtle: rgba(209, 213, 219, 0.9);

  --shadow-soft: 0 22px 50px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 18px 40px rgba(15, 23, 42, 0.05);

  --radius-lg: 24px;
  --radius-md: 20px;
  --radius-sm: 999px;
}

/* ===== Global ===== */

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: "SF Pro Rounded", "SF Pro Text", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  background: radial-gradient(circle at top left, #e0f2fe, #eef2ff 45%, #f9fafb);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1040px;
  margin: 20px auto 28px;
  padding: 22px 20px 26px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

/* ===== Header ===== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logo 泡泡 */

.logo-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(226, 236, 255, 0.98),
    rgba(148, 176, 238, 0.98)
  );
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 10px 24px rgba(79, 114, 184, 0.45),
    0 0 0 1px rgba(209, 213, 224, 0.6);
  backdrop-filter: blur(10px);
}

/* GossipHub.io 标题 */

.brand h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #1e293b;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.9);
}

.tagline {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 420px;
}

.last-updated {
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.last-updated .label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.last-updated .value {
  margin-top: 2px;
  font-weight: 500;
}

/* ===== Hero ===== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}

/* 左侧 Hero */

.hero-left h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.01em;
}

.hero-left p {
  margin: 0 0 14px;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.hero-subscribe {
  margin-top: 4px;
  border-radius: var(--radius-md);
  padding: 14px 14px 12px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.hero-subscribe h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 600;
  color: #1e293b;
}

.hero-subcopy {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Inputs + button */

.subscribe-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.subscribe-form input[type="email"] {
  flex: 1 1 auto;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-main);
}

.subscribe-form input[type="email"]::placeholder {
  color: #9ca3af;
}

.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.subscribe-form button {
  border-radius: var(--radius-sm);
  border: none;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f9fafb;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.subscribe-form button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.5);
}

.subscribe-form button:active {
  transform: translateY(1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.4);
}

.flash-messages {
  list-style: none;
  padding-left: 0;
  margin: 4px 0 0;
  font-size: 0.78rem;
}

.flash {
  margin: 2px 0;
}

.flash.success {
  color: #166534;
}

.flash.error {
  color: #b91c1c;
}

/* ===== Hero 右侧：大三块 topic cells ===== */

.hero-right {
  display: flex;
  align-items: stretch;
}

.hero-image-frame {
  position: relative;
  flex: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(209, 213, 219, 0.9);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  min-height: 200px;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 占位层：一行说明 + 三个大 cell */

.hero-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;        /* was: space-between – now centered vertically */
  gap: 8px;
  padding: 14px 16px 16px;
}

.hero-placeholder::before {
  content: "";
  position: absolute;
  inset: 10px 16px 24px 16px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 10% 0, rgba(226, 236, 255, 0.9), transparent 60%),
    radial-gradient(circle at 90% 100%, rgba(189, 209, 255, 0.9), transparent 55%);
  opacity: 0.9;
  filter: blur(8px);
  z-index: 0;
}

.hero-topics-text {
  position: relative;
  z-index: 1;
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* 大号 topic cell */

.hero-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: #e2ecff;
  border: 1px solid #cbd5f1;
  box-shadow: 0 8px 20px rgba(148, 163, 233, 0.4);
  color: #1e3a8a;
  font-size: 0.8rem;
}

.hero-pill-large {
  display: flex;
  align-items: center;
  padding: 8px 12px;              /* slightly smaller padding */
  font-size: 0.88rem;             /* a touch smaller */
  min-height: 44px;               /* was 52px – bubbles are less tall */
}

.hero-pill-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.hero-pill-text {
  line-height: 1.3;
}

/* ===== Category sections ===== */

.category {
  margin-top: 18px;
  margin-bottom: 20px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.category-title-block h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 600;
  color: #1e293b;
}

.category-subtitle {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 580px;
}

.count-chip {
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  background: #eef2ff;
  color: #9ca3af;
}

/* ===== Story cards ===== */

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.story-card {
  border-radius: var(--radius-md);
  padding: 12px 14px 10px;
  background: var(--card-bg);
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: var(--shadow-card);
}

.story-header {
  margin-bottom: 6px;
}

.story-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.story-title a {
  color: #1f293b;
  text-decoration: none;
}

.story-title a:hover {
  text-decoration: underline;
}

.story-meta {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== Summary blocks ===== */

.story-summary {
  font-size: 0.9rem;
  color: #374151;
}

/* WHAT IT IS: full text */

.summary-block-main {
  padding: 8px 10px;
  border-radius: 16px;
  background: #f3f6ff;
  border: 1px solid #e0e7ff;
  margin-top: 6px;
}

.summary-block-main p {
  margin: 0;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Secondary row: Who / Why / How */

.summary-secondary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.summary-block-sub {
  padding: 6px 8px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

/* How to talk about it: full width */

.summary-block-how {
  grid-column: 1 / -1;
}

/* label */

.summary-label {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #647acb;
  margin-bottom: 2px;
}

/* Secondary paragraphs: base style (no clamp by default) */

.summary-block-sub p {
  margin: 0;
  color: #374151;
  font-size: 0.86rem;
  line-height: 1.45;
}

/* When JS decides this block should be clamped */

.summary-block-sub.is-clamped p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Expanded state overrides clamp */

.summary-block.expanded p {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}

/* More / Less 按钮 (secondary only) */

.summary-toggle {
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
}

.summary-toggle:hover {
  text-decoration: underline;
}

.fallback-snippet {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: #374151;
}

.story-footer {
  margin-top: 8px;
  font-size: 0.8rem;
}

.story-link {
  color: var(--accent-strong);
  text-decoration: none;
}

.story-link:hover {
  text-decoration: underline;
}

.empty {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ===== Footer ===== */

.site-footer {
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== Responsive ===== */

@media (max-width: 800px) {
  .page {
    margin: 10px auto 20px;
    padding: 16px 12px 22px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .last-updated {
    text-align: left;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-right {
    order: -1;
  }
}

@media (max-width: 640px) {
  .subscribe-form {
    flex-direction: column;
  }

  .subscribe-form button {
    width: 100%;
  }

  .story-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
