/* ============================================================
   Melonfield News — 科技新闻杂志
   Design direction: The Verge + Bloomberg × Minimal
   ============================================================ */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0b0d;
  --bg-elev: #141418;
  --bg-elev-2: #1c1c22;
  --text: #ededf0;
  --text-dim: #999aa1;
  --text-muted: #606169;
  --accent: #ff5a2f;
  --accent-soft: rgba(255, 90, 47, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --radius: 6px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Segoe UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

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

::selection { background: var(--accent); color: var(--bg); }

/* --- Layout helpers --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 13, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.site-logo .wordmark-accent {
  color: var(--accent);
  font-weight: 700;
}

.site-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 10vw, 120px);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle at center, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(16px, 2vw, 28px);
  font-weight: 600;
}

.hero-title {
  font-size: clamp(2.4rem, 6.5vw, 5.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 14ch;
  margin-bottom: clamp(16px, 2vw, 24px);
}

.hero-subtitle {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text-dim);
  max-width: 56ch;
  line-height: 1.6;
}

.hero-meta-row {
  margin-top: clamp(28px, 4vw, 44px);
  display: flex;
  gap: clamp(24px, 4vw, 48px);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-meta-row strong {
  color: var(--text);
  font-weight: 600;
}

/* ============================================================
   Section header
   ============================================================ */
.section-head {
  padding: clamp(32px, 5vw, 56px) 0 clamp(24px, 3vw, 32px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-title {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--accent);
  margin-right: 12px;
  vertical-align: middle;
}

.section-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   Article grid
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(24px, 3vw, 40px);
  padding-bottom: clamp(48px, 6vw, 80px);
}

.article-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  position: relative;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.8);
}

.card-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elev-2);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.article-card:hover .card-cover img {
  transform: scale(1.04);
}

.card-body {
  padding: clamp(16px, 2vw, 24px);
}

.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.card-title {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- Featured article: larger card --- */
.article-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.article-card.featured .card-cover {
  aspect-ratio: auto;
  min-height: 360px;
}

.article-card.featured .card-body {
  padding: clamp(24px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-card.featured .card-title {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  -webkit-line-clamp: 3;
}

@media (max-width: 768px) {
  .article-card.featured {
    grid-template-columns: 1fr;
  }
  .article-card.featured .card-cover {
    min-height: 220px;
  }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: clamp(32px, 5vw, 56px) 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   Article detail page
   ============================================================ */
.article-page {
  padding: clamp(32px, 6vw, 72px) 0;
}

.article-page .container {
  max-width: 820px;
}

.article-tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: clamp(16px, 2vw, 24px);
}

.article-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: clamp(16px, 2vw, 24px);
}

.article-byline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: clamp(24px, 3vw, 32px);
  padding-bottom: clamp(24px, 3vw, 32px);
  border-bottom: 1px solid var(--border);
}

.article-byline strong { color: var(--text); }

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: clamp(32px, 4vw, 48px);
  aspect-ratio: 16 / 9;
  background: var(--bg-elev-2);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content {
  font-size: clamp(1rem, 1.2vw, 1.08rem);
  line-height: 1.85;
  color: var(--text);
}

.article-content p { margin-bottom: 1.4em; }
.article-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 2em 0 0.8em;
}
.article-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.6em 0 0.6em;
}
.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.4em 0 0.4em 1.2em;
  color: var(--text-dim);
  font-style: italic;
  margin: 1.6em 0;
}
.article-content ul, .article-content ol {
  margin: 1em 0 1.4em;
  padding-left: 1.6em;
}
.article-content li { margin-bottom: 0.4em; }
.article-content code {
  background: var(--bg-elev-2);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.92em;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}

.article-nav {
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.article-nav a {
  color: var(--text-dim);
  transition: color 0.2s;
}

.article-nav a:hover { color: var(--accent); }

/* ============================================================
   Loading & empty states
   ============================================================
.loading, .empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
