/* ============================================
   EarnLab Professional Theme
   Inspired by Bloomberg, 36Kr, Stratechery
   ============================================ */

:root {
  /* Neutral palette */
  --ink: #0a0a0a;
  --ink-2: #1a1a1a;
  --ink-3: #2a2a2a;
  --gray-1: #404040;
  --gray-2: #6b6b6b;
  --gray-3: #9a9a9a;
  --gray-4: #c8c8c8;
  --gray-5: #e8e8e8;
  --gray-6: #f4f4f4;
  --bg: #ffffff;
  --bg-soft: #fafaf9;

  /* Brand — single accent */
  --accent: #0a4d68;
  --accent-dark: #07384e;
  --accent-light: #e6f0f4;
  --gold: #b8860b;

  /* Category accents (muted, not candy) */
  --c-ads: #92400e;
  --c-aff: #0e7490;
  --c-content: #9d174d;
  --c-fin: #166534;
  --c-ai: #6b21a8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  letter-spacing: -0.005em;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

/* ============================================
   Top Navigation (like a serious news site)
   ============================================ */
.site-header {
  border-bottom: 1px solid var(--gray-5);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  border-radius: 4px;
  font-family: 'Georgia', serif;
  font-style: italic;
}
.brand:hover { text-decoration: none; }
.nav-main {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: 14px;
}
.nav-main a {
  color: var(--ink-2);
  font-weight: 500;
}
.nav-main a:hover { color: var(--accent); text-decoration: none; }
.nav-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--gray-2);
}
.nav-meta a { color: var(--gray-1); }
.nav-lang-switch {
  font-size: 12px;
  border: 1px solid var(--gray-5);
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--gray-1);
}

/* ============================================
   Hero / Masthead (newspaper feel)
   ============================================ */
.masthead {
  border-bottom: 1px solid var(--ink);
  padding: 56px 0 40px;
  background: var(--bg-soft);
}
.masthead-eyebrow {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-2);
  margin-bottom: 16px;
  font-weight: 600;
}
.masthead h1 {
  font-size: 48px;
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.masthead-lede {
  font-size: 19px;
  color: var(--gray-1);
  max-width: 720px;
  margin-bottom: 28px;
  line-height: 1.55;
  font-weight: 400;
}
.masthead-byline {
  font-size: 13px;
  color: var(--gray-2);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--gray-5);
}
.byline-item { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================
   KPI Strip (instead of emoji stats)
   ============================================ */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--gray-5);
  border-radius: 6px;
  margin: 32px 0;
  background: var(--bg);
}
.kpi-cell {
  padding: 22px 24px;
  border-right: 1px solid var(--gray-5);
}
.kpi-cell:last-child { border-right: none; }
.kpi-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-2);
  margin-bottom: 8px;
  font-weight: 600;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.kpi-unit {
  font-size: 14px;
  color: var(--gray-2);
  font-weight: 400;
}

/* ============================================
   Sections
   ============================================ */
section { padding: 56px 0; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}
.section-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-link {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Category grid (like research areas)
   ============================================ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--gray-5);
  border: 1px solid var(--gray-5);
  border-radius: 6px;
  overflow: hidden;
}
.cat-card {
  background: var(--bg);
  padding: 28px 24px;
  transition: background 0.15s;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
}
.cat-card:hover { background: var(--bg-soft); text-decoration: none; }
.cat-card:hover .cat-title { color: var(--accent); }
.cat-tag {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-2);
  font-weight: 700;
  margin-bottom: 12px;
}
.cat-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  transition: color 0.15s;
}
.cat-desc {
  font-size: 14px;
  color: var(--gray-1);
  margin-bottom: 16px;
  flex-grow: 1;
}
.cat-meta {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-2);
  font-weight: 600;
  padding-top: 14px;
  border-top: 1px solid var(--gray-5);
  font-feature-settings: 'tnum';
}

/* ============================================
   Article cards (research-report style)
   ============================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}
.article-card {
  background: var(--bg);
  border-bottom: 1px solid var(--gray-5);
  padding-bottom: 28px;
  transition: all 0.2s;
}
.article-card:hover {
  border-bottom-color: var(--ink);
}
.article-card .badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-2);
  font-weight: 700;
  margin-bottom: 10px;
  padding: 3px 0;
  border-bottom: 1px solid var(--ink);
}
.article-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.article-card h3 a {
  color: var(--ink);
  text-decoration: none;
}
.article-card h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}
.article-card p {
  font-size: 15px;
  color: var(--gray-1);
  margin-bottom: 16px;
  line-height: 1.55;
}
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--gray-2);
  font-feature-settings: 'tnum';
}
.article-meta span { display: inline-flex; align-items: center; }
.article-meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* ============================================
   Buttons (professional, not flashy)
   ============================================ */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: all 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: #fff; text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--gray-4);
}
.btn-ghost:hover { border-color: var(--ink); text-decoration: none; }

/* ============================================
   CTA Boxes (instead of "rainbow gradient")
   ============================================ */
.cta-box {
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  padding: 40px;
  text-align: center;
  margin: 40px 0;
}
.cta-box h3 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 24px;
}
.cta-box p { color: rgba(255,255,255,0.75); margin-bottom: 24px; }
.cta-box .btn-primary { background: #fff; color: var(--ink); }
.cta-box .btn-primary:hover { background: var(--gray-6); }

/* ============================================
   Callout boxes (research-note style)
   ============================================ */
.callout {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 24px 28px;
  margin: 32px 0;
}
.callout h4 {
  color: var(--accent-dark);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  font-weight: 700;
}
.callout p { color: var(--ink-2); }

/* ============================================
   Tables (financial report style)
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 14px;
  font-feature-settings: 'tnum';
}
.data-table th, .data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-5);
}
.data-table th {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--ink);
}
.data-table tbody tr:hover { background: var(--bg-soft); }
.data-table td:first-child { font-weight: 600; }

/* ============================================
   Footer (newspaper colophon style)
   ============================================ */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--bg-soft);
  padding: 48px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-col h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 700;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; font-size: 14px; }
.footer-col a { color: var(--gray-1); }
.footer-col a:hover { color: var(--accent); }
.footer-tagline {
  font-size: 14px;
  color: var(--gray-2);
  line-height: 1.6;
  margin-top: 12px;
}
.footer-bottom {
  border-top: 1px solid var(--gray-5);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-2);
}
.subscribe {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.subscribe input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gray-4);
  background: var(--bg);
  color: var(--ink);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
.subscribe input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.subscribe button {
  padding: 10px 18px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
}

/* ============================================
   Article Page (Medium / Stratechery style)
   ============================================ */
.article-hero {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--gray-5);
}
.article-hero .container-narrow { max-width: 760px; }
.article-hero .category-tag {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
  display: inline-block;
  padding: 4px 0;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--gray-5);
  padding: 6px 0;
}
.article-hero h1 {
  font-size: 42px;
  line-height: 1.15;
  font-weight: 800;
  margin: 16px 0 20px;
  letter-spacing: -0.025em;
}
.article-hero .lede {
  font-size: 19px;
  color: var(--gray-1);
  line-height: 1.55;
  margin-bottom: 24px;
  font-weight: 400;
}
.article-hero .byline {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--gray-2);
  padding-top: 20px;
  border-top: 1px solid var(--gray-5);
  font-feature-settings: 'tnum';
}
.byline strong { color: var(--ink); font-weight: 600; }

/* Article body */
.article-body { padding: 48px 0 80px; }
.article-body .container-narrow { max-width: 720px; }
.article-body h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 56px 0 20px;
  letter-spacing: -0.02em;
  padding-top: 32px;
  border-top: 1px solid var(--gray-5);
}
.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--ink);
}
.article-body h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--ink);
}
.article-body p {
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 20px;
  color: var(--ink-2);
}
.article-body ul, .article-body ol {
  margin: 16px 0 24px 24px;
}
.article-body li {
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 10px;
  color: var(--ink-2);
}
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body blockquote {
  border-left: 3px solid var(--ink);
  padding: 8px 0 8px 24px;
  margin: 28px 0;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-2);
  line-height: 1.65;
}

/* TOC */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--gray-5);
  border-radius: 6px;
  padding: 24px 28px;
  margin: 32px 0;
}
.toc h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray-2);
  margin-bottom: 12px;
  font-weight: 700;
}
.toc ol { margin-left: 20px; }
.toc li { font-size: 14px; margin-bottom: 6px; line-height: 1.5; }
.toc a { color: var(--ink-2); }

/* Verdict box */
.verdict-box {
  background: var(--bg-soft);
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 32px;
  margin: 36px 0;
}
.verdict-box h3 {
  color: var(--ink);
  margin-bottom: 20px;
  font-size: 22px;
}

/* Related box */
.related-box {
  background: var(--bg-soft);
  border-left: 3px solid var(--ink);
  padding: 24px 28px;
  margin: 36px 0;
}
.related-box h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  color: var(--ink);
}
.related-box ul { list-style: none; }
.related-box li {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-5);
  font-size: 15px;
}
.related-box li:last-child { border-bottom: none; }

/* ============================================
   Category landing page
   ============================================ */
.page-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--ink);
  padding: 56px 0 48px;
}
.page-header .eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-2);
  margin-bottom: 12px;
  font-weight: 700;
}
.page-header h1 {
  font-size: 48px;
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-header p {
  font-size: 18px;
  color: var(--gray-1);
  max-width: 720px;
  line-height: 1.6;
}
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--gray-2);
  border-bottom: 1px solid var(--gray-5);
}
.breadcrumb a { color: var(--gray-1); }
.breadcrumb a:hover { color: var(--accent); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 968px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi-cell:nth-child(2) { border-right: none; }
  .kpi-cell:nth-child(1), .kpi-cell:nth-child(2) { border-bottom: 1px solid var(--gray-5); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .nav-main { display: none; }
  .masthead h1 { font-size: 36px; }
  .article-hero h1 { font-size: 32px; }
  .page-header h1 { font-size: 36px; }
}
@media (max-width: 640px) {
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-cell { border-right: none; border-bottom: 1px solid var(--gray-5); }
  .kpi-cell:last-child { border-bottom: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  section { padding: 40px 0; }
}

/* Print */
@media print {
  body { font-size: 11pt; color: #000; background: #fff; }
  .site-header, .site-footer, .cta-box, .subscribe { display: none; }
  .article-body p { font-size: 11pt; }
}
.share-section {
  background: var(--bg-soft);
  border: 1px solid var(--gray-5);
  border-radius: 6px;
  padding: 28px;
  margin: 40px 0;
  text-align: center;
}
.share-section h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-2);
  margin-bottom: 20px;
  font-weight: 700;
}
.share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--gray-4);
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
}
.share-btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}


/* Language switcher */
.nav-lang {
  display: inline-block;
  font-size: 12px;
  border: 1px solid var(--gray-5);
  border-radius: 3px;
  padding: 4px 8px;
  color: var(--gray-1);
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.15s;
}
.nav-lang:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  text-decoration: none;
}

/* Reading progress bar */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* Related articles */
.related-articles {
  margin: 40px 0;
  padding-top: 32px;
  border-top: 1px solid var(--gray-5);
}
.related-articles h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-2);
  margin-bottom: 24px;
  font-weight: 700;
}
.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.related-articles-grid a {
  display: block;
  padding: 16px 20px;
  background: var(--bg-soft);
  border: 1px solid var(--gray-5);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  transition: all 0.15s;
}
.related-articles-grid a:hover {
  border-color: var(--ink);
  background: var(--bg);
  text-decoration: none;
}
.related-articles-grid .related-cat {
  display: block;
  font-size: 11px;
  color: var(--gray-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 6px;
}
