/* ============================================================
   Bytivo — modern editorial tech-news design system
   Evolved from the Spire.PDF buy-page reference:
   warm-neutral palette, Fraunces display + Inter body + JetBrains Mono,
   glassy sticky header, card grids w/ micro-interactions, dark footer.
   ============================================================ */

/* ---- Self-hosted fonts (primary) ---- */
/* Google Fonts CDN <link> in <head> serves as backup if self-hosted fails */
@font-face { font-family: "Inter-Self"; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter-Self"; src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter-Self"; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter-Self"; src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces-Self"; src: url("/assets/fonts/fraunces-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces-Self"; src: url("/assets/fonts/fraunces-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces-Self"; src: url("/assets/fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces-Self"; src: url("/assets/fonts/fraunces-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrainsMono-Self"; src: url("/assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrainsMono-Self"; src: url("/assets/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --muted: #6b6b6b;
  --muted-soft: #9a9a9a;
  --line: #e8e6e1;
  --line-soft: #f0eee9;
  --bg: #faf9f6;
  --bg-warm: #f5f2eb;
  --card: #ffffff;
  --brand: #2a6d8f;
  --brand-dark: #1d4f6b;
  --brand-soft: #e8f1f6;
  --accent: #c2410c;
  --accent-soft: #fdf0e6;
  --accent-warm: #e8d5b7;
  --ok: #15803d;
  --ok-soft: #ecfdf5;
  --err: #b91c1c;
  --err-soft: #fef2f2;
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --container: 1180px;
  --font-display: "Fraunces-Self", "Fraunces", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Georgia, "Times New Roman", serif;
  --font-body: "Inter-Self", "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrainsMono-Self", "JetBrains Mono", "PingFang SC", "Microsoft YaHei", ui-monospace, SFMono-Regular, monospace;
  --shadow-sm: 0 1px 2px rgba(26,26,26,0.04), 0 2px 8px rgba(26,26,26,0.04);
  --shadow-md: 0 8px 24px rgba(26,26,26,0.08);
  --shadow-lg: 0 18px 48px rgba(26,26,26,0.12);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(194,65,12,0.045), transparent 460px),
    radial-gradient(circle at 0% 100%, rgba(42,109,143,0.05), transparent 420px);
  background-attachment: fixed;
}
body.menu-open { overflow: hidden; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 600; line-height: 1.14; letter-spacing: -0.018em; color: var(--ink); }
h1 { font-size: clamp(34px, 5.2vw, 52px); font-weight: 500; }
h2 { font-size: clamp(23px, 3vw, 30px); }
h3 { font-size: 19px; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

.container { width: min(100% - 36px, var(--container)); margin: 0 auto; }
.section { padding: 52px 0; }
.section-tight { padding: 30px 0; }
.text-muted { color: var(--muted); }
.text-small { font-size: 13px; }
.text-center { text-align: center; }
.skip-link { position: absolute; top: -48px; left: 16px; z-index: 999; padding: 9px 15px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-md);
  cursor: pointer; font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #000; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: #9a3412; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(194,65,12,0.28); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { min-height: 36px; padding: 7px 13px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }

/* ---------- Segmented control (publish mode switch) ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); }
.seg-btn { border: none; background: transparent; color: var(--ink-soft); padding: 9px 18px; border-radius: 999px; font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: var(--ink); color: #fff; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.preview-head h4 { margin-bottom: 0; }
.seg-mini { padding: 3px; }
.seg-mini .seg-btn { padding: 5px 12px; font-size: 12.5px; }

/* ---------- Header ---------- */
/* The sticky + frosted-glass styling lives on #site-header, which is a
   direct child of <body> and therefore has the whole page as its containing
   block. Putting position:sticky on .header (nested inside #site-header)
   constrains it to the 66px-tall wrapper, so it would scroll away after a
   few pixels — the bar would NOT stay on top. Keeping it on #site-header
   makes it pin to the top across the full scroll. */
#site-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(250,249,246,0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(26,26,26,0.04), 0 8px 22px -10px rgba(26,26,26,0.12);
}
.header {
  /* layout only — sticky + glass are handled by #site-header */
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 22px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-size: 21px; font-weight: 600; text-decoration: none; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.logo .dot { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--ink-soft); font-size: 14px; font-weight: 500; text-decoration: none; position: relative; padding: 4px 0; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--accent); transition: width .2s ease; }
.nav a:hover, .nav a.active { color: var(--ink); text-decoration: none; }
.nav a.active::after, .nav a:hover::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { content: ""; display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; position: relative; }
.menu-toggle span::before { position: absolute; top: -6px; }
.menu-toggle span::after { position: absolute; top: 6px; }
.lang-toggle { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; cursor: pointer; font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--ink); letter-spacing: .02em; }
.lang-toggle:hover { border-color: var(--ink); }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em; background: var(--brand-soft); color: var(--brand-dark);
  text-decoration: none; transition: background .15s, color .15s;
}
.pill:hover { text-decoration: none; background: #d8e9f1; }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-accent:hover { background: #fbe2cc; }
.pill-ghost { background: #fff; color: var(--ink-soft); border: 1px solid var(--line); }
.tag { display: inline-flex; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--bg-warm); text-decoration: none; }
.tag:hover { color: var(--ink); background: var(--accent-warm); text-decoration: none; }

/* ---------- Eyebrow / section heading ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 1.5px; background: var(--accent); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.section-head h2 { display: flex; align-items: baseline; gap: 12px; }
.section-head .num { font-family: var(--font-mono); font-size: 13px; color: var(--muted-soft); font-weight: 500; }
.section-head p { max-width: 460px; color: var(--muted); font-size: 14px; }

/* ---------- Article cards ---------- */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.article-card {
  position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.article-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--ink-soft); }
.card-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.card-cover .cover-fill { position: absolute; inset: 0; transition: transform .4s ease; }
.article-card:hover .cover-fill { transform: scale(1.05); }
.card-cover .cover-label { position: absolute; left: 14px; bottom: 14px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.card-cat { position: absolute; left: 14px; top: 14px; z-index: 2; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 20px; flex: 1; }
.card-title { font-size: 18.5px; line-height: 1.25; font-weight: 600; }
.article-card:hover .card-title { color: var(--brand-dark); }
.card-excerpt { color: var(--muted); font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.card-meta .author { font-weight: 600; color: var(--ink-soft); }
.card-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-soft); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 2; }
/* Stretched overlay link makes the whole card clickable without nesting <a> in <a> */
.card-link { position: absolute; inset: 0; z-index: 1; text-indent: -9999px; overflow: hidden; }
.card-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--radius-lg); }

/* News featured (top 2 on news page) */
.news-featured { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 36px; }
.news-featured-card {
  display: flex; flex-direction: column; gap: 12px; padding: 24px 26px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  text-decoration: none; color: inherit;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.news-featured-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--ink-soft); text-decoration: none; }
.news-featured-card .pill { align-self: flex-start; }
.news-featured-card .card-title { font-size: 22px; line-height: 1.2; color: var(--accent); }
.news-featured-card:hover .card-title { color: var(--accent); }
.news-featured-card .card-excerpt { font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-featured-card .card-meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* News remainder list (after top 2) — flat grid, column flow for pagination */
.news-remainder { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(10, auto); grid-auto-flow: column; gap: 0 48px; }
.news-row {
  display: flex; align-items: baseline; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit;
  transition: color .15s ease;
}
.news-row:hover { color: var(--brand); text-decoration: none; }
.news-row-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted-soft); white-space: nowrap; flex-shrink: 0; width: 92px; border-right: 1px solid var(--line-soft); padding-right: 14px; box-sizing: border-box; }
.news-row-cat { font-family: var(--font-mono); font-size: 11px; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.news-row-title { font-size: 15px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.pagination-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: all .15s ease; text-decoration: none; }
.pagination-btn:hover:not(:disabled):not(.active) { border-color: var(--brand); color: var(--brand); }
.pagination-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; cursor: default; }
.pagination-btn:disabled { opacity: .4; cursor: default; }
.pagination-ellipsis { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted-soft); font-family: var(--font-mono); }

/* Related cards (Keep reading — compact, no cover) */
.related-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.related-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--ink-soft); }
.related-card .pill { align-self: flex-start; }
.related-card-title { font-size: 17px; line-height: 1.25; font-weight: 600; }
.related-card:hover .related-card-title { color: var(--brand-dark); }
.related-card-excerpt { font-size: 13.5px; line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-card-meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.related-card-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-soft); }

/* Featured (hero) */
.feature {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-xl);
  overflow: hidden; background: var(--card); box-shadow: var(--shadow-sm);
}
.feature .feature-cover { position: relative; min-height: 340px; overflow: hidden; }
.feature .feature-cover .cover-fill { position: absolute; inset: 0; }
.feature .feature-body { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 40px; }
.feature .feature-body h1 { font-size: clamp(28px, 3.4vw, 40px); }
.feature .feature-body .card-excerpt { font-size: 15.5px; -webkit-line-clamp: 4; }
.feature-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.feature-meta .author { font-weight: 600; color: var(--ink-soft); }

/* ---------- Secondary grid (2-col compact) ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* ---------- List / filter bar ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s ease; text-decoration: none;
}
.chip:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.search-box { margin-left: auto; position: relative; display: flex; align-items: center; }
.search-box input {
  height: 42px; width: 260px; max-width: 100%; padding: 0 14px 0 38px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-box svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted-soft); }

/* ---------- Article detail ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; padding: 18px 0 4px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; color: var(--ink); }
.breadcrumb .sep { color: var(--muted-soft); }
.article-head { max-width: 760px; margin: 8px auto 0; }
.article-head h1 { font-size: clamp(30px, 4.4vw, 46px); }
.article-sub { margin-top: 16px; color: var(--ink-soft); font-size: 18px; line-height: 1.55; }
.article-byline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.article-byline .author { font-weight: 600; color: var(--ink-soft); }
/* Detail-page hero cover: fixed width, natural aspect — height follows the
   image (scaled to container width). Cards keep the 16:9 crop via .card-cover. */
.article-cover { max-width: 920px; margin: 30px auto; border-radius: var(--radius-lg); overflow: hidden; background: var(--line-soft); box-shadow: var(--shadow-sm); }
.article-cover img { display: block; width: 100%; height: auto; }
.prose { max-width: 720px; margin: 30px auto 0; font-size: 16.5px; line-height: 1.8; color: var(--ink-soft); }
.prose p { margin: 0 0 22px; }
.prose h2 { font-size: 26px; margin: 38px 0 14px; }
.prose h3 { font-size: 20px; margin: 28px 0 10px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; word-break: break-word; }
.prose blockquote { margin: 0 0 22px; padding: 14px 20px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-soft); font-style: italic; }
.prose code { font-family: var(--font-mono); font-size: 14px; background: var(--bg-warm); padding: 2px 6px; border-radius: 5px; color: var(--accent); }
.prose pre { background: var(--bg-warm); border: 1px solid var(--line); color: var(--ink-soft); padding: 16px 18px; border-radius: var(--radius-sm); overflow: auto; margin: 0 0 22px; font-size: 13.5px; line-height: 1.65; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose img { max-width: 100%; border-radius: var(--radius-md); margin: 6px 0 22px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-warm); font-weight: 600; color: var(--ink); }
.prose tbody tr:nth-child(even) { background: var(--bg-warm); }
.article-foot { max-width: 720px; margin: 32px auto 0; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-row { max-width: 720px; margin: 18px auto 0; display: flex; gap: 10px; align-items: center; }

/* 来源板块（弱化展示） */
.article-references { max-width: 720px; margin: 20px auto 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-warm); }
.article-references-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.article-references-body { font-size: 12.5px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; word-break: break-word; }
.article-references-body ul { margin: 0; padding-left: 18px; list-style: none; }
.article-references-body li { margin-bottom: 4px; }
.article-references-body li::before { content: "—"; margin-right: 6px; color: var(--muted-soft, #ccc); }
.ref-list { margin: 0; padding: 0; list-style: none; }
.ref-list li { margin-bottom: 6px; line-height: 1.6; }
.ref-num { color: var(--brand); font-weight: 600; margin-right: 4px; }
.ref-list a { color: var(--brand); text-decoration: none; word-break: break-all; }
.ref-list a:hover { text-decoration: underline; }

/* ---------- Related ---------- */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---------- Publish form ---------- */
.publish-wrap { max-width: 820px; margin: 0 auto; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.field input[type=text], .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 14.5px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-toolbar { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.editor-toolbar button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }
.editor-toolbar button:hover { border-color: var(--ink); color: var(--ink); }

/* image uploader (cover + inline) */
.uploader { margin-top: 10px; }
.uploader-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--radius-md); background: var(--bg-warm); color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.uploader-drop:hover, .uploader-drop.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.uploader-ico { font-size: 20px; line-height: 1; }
.uploader-text { font-size: 13px; font-weight: 500; }
.uploader-preview { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.uploader-thumb { width: 84px; height: 52px; border-radius: var(--radius-sm); background-size: cover; background-position: center; background-color: var(--bg-warm); border: 1px solid var(--line); flex: none; }
.uploader-msg { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.uploader-msg.err { color: #c0392b; }

/* 正文图片管理模块 */
.img-mgr { margin-top: 10px; }
.img-mgr .uploader-drop { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.img-mgr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 12px; border: 1.5px dashed var(--line); border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--bg-warm); }
.img-mgr-item { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.img-mgr-thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); background-size: cover; background-position: center; background-color: var(--bg-warm); border: 1px solid var(--line); flex: none; }
.img-mgr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.img-mgr-url { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.img-mgr-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.preview-pane { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 22px; background: var(--bg-warm); margin-top: 10px; }
.preview-pane h4 { font-family: var(--font-body); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }

/* token gate modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(20,20,20,.5); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { width: min(420px, 100%); background: #fff; border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 22px; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.modal .field { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; margin-top: 6px; }

/* ---------- States ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--line-soft); border-radius: var(--radius-md); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .ico { font-size: 34px; margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 300; background: var(--ink); color: #fff; padding: 13px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; font-size: 14px; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--err); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #cfcabf; margin-top: 40px; }
.footer a { color: #cfcabf; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 32px; padding: 52px 0 30px; }
.footer .brand-blurb { max-width: 300px; color: #a59f93; font-size: 13.5px; line-height: 1.6; margin-top: 14px; }
.footer h5 { color: #fff; font-family: var(--font-body); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer ul { list-style: none; display: grid; gap: 9px; }
.footer ul a { font-size: 13.5px; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #8d877b; }

/* ---------- Page intro / subtitles ---------- */
.page-subtitle { color: var(--ink-soft); font-size: 16px; line-height: 1.6; max-width: 62ch; margin-top: 4px; }
.section-link { margin-left: auto; align-self: flex-end; color: var(--brand); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; color: var(--brand-dark); }

/* ---------- Intro card (callout) ---------- */
.intro-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; background: var(--card); box-shadow: var(--shadow-sm); }
.intro-card-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin-bottom: 6px; }

/* ---------- News list (home) ---------- */
.news-list { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.news-col { display: flex; flex-direction: column; }
.news-item { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit; transition: color .15s ease; }
.news-item:hover { color: var(--brand); }
.news-item-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted-soft); white-space: nowrap; flex-shrink: 0; }
.news-item-title { font-size: 14px; font-weight: 500; line-height: 1.4; }

/* ---------- Apps & Tools grid ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tool-card {
  display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px; text-decoration: none; color: inherit;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tool-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--ink-soft); }
.tool-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tool-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink); }
.tool-cat { flex: none; }
.tool-desc { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; flex: 1; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-go { font-size: 13px; font-weight: 600; color: var(--brand); }

/* ---------- Categories grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cat-card {
  display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; text-decoration: none; color: inherit;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.cat-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--ink-soft); }
.cat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-top h3 { font-size: 20px; }
.cat-count { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg-warm); padding: 3px 10px; border-radius: 999px; }
.cat-blurb { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; flex: 1; }
.cat-go { font-size: 13.5px; font-weight: 600; color: var(--brand); }

/* ---------- Filter row (tools page) ---------- */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

/* ---------- Submit card / forms (tools) ---------- */
.submit-card { max-width: 720px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; background: var(--card); box-shadow: var(--shadow-sm); }
.submit-card h3 { font-size: 22px; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.form-grid label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--ink); }
.form-grid input[type=text], .form-grid input[type=email], .form-grid input[type=url], .form-grid select, .form-grid textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 14.5px;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-grid textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.span-2 { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Auth (login) modal ---------- */
.auth-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(20,20,20,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-overlay[hidden] { display: none; }
.auth-card { width: min(400px, 100%); background: #fff; border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-lg); }
.auth-brand { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--ink); margin-bottom: 18px; }
.auth-title { font-size: 24px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--ink); }
.auth-form input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14.5px; }
.auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-error { color: var(--err); font-size: 13px; font-weight: 500; }
.auth-error[hidden] { display: none; }
.auth-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Lock screen (page-level gate) ---------- */
.lock-screen { display: flex; justify-content: center; padding: 60px 0; }
.lock-screen[hidden] { display: none; }
.lock-card { text-align: center; max-width: 380px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 32px; background: var(--card); box-shadow: var(--shadow-sm); }
.lock-ico { font-size: 34px; margin-bottom: 12px; }
.lock-card h2 { font-size: 24px; margin-bottom: 8px; }
.lock-card p { margin-bottom: 18px; }

/* ---------- Data table (admin) ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-family: var(--font-body); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg-warm); padding: 13px 16px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-soft); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .nowrap { white-space: nowrap; }
.data-table .from { font-weight: 600; color: var(--ink); }
.data-table .msg { max-width: 480px; line-height: 1.5; }
.empty-cell { text-align: center; padding: 50px 16px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-soft); }
.status-new::before { background: var(--accent); }
.status-done::before { background: var(--ok); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .article-grid, .related-grid, .tool-grid, .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .feature { grid-template-columns: 1fr; }
  .feature .feature-cover { min-height: 220px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .news-featured { grid-template-columns: 1fr; }
  .news-remainder { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
}
@media (max-width: 680px) {
  .nav { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 18px 18px; transform: translateY(-120%); transition: transform .25s ease, opacity .25s ease, visibility .25s ease; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; pointer-events: none; z-index: 99; }
  body.menu-open .nav { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }
  .nav a { padding: 13px 4px; border-bottom: 1px solid var(--line-soft); }
  .nav a::after { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-actions .desktop-only { display: none; }
  .article-grid, .related-grid, .grid-2, .tool-grid, .cat-grid { grid-template-columns: 1fr; }
  .search-box { width: 100%; }
  .search-box input { width: 100%; }
  .toolbar { gap: 10px; }
  .feature .feature-body { padding: 26px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .publish-wrap { grid-template-columns: 1fr !important; }
  .page-intro { grid-template-columns: 1fr !important; gap: 18px !important; align-items: start !important; }
  .news-list { grid-template-columns: 1fr; gap: 0; }
}
