/* ============================================================
   熊仓 · lgf6.com
   暗色绿 / 米纸暖白 双主题 · 指路牌版式
   配色口径：accent 拆「填充」与「文字」两个角色，全部文字 ≥ 4.5:1
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", "Roboto Mono", Consolas, monospace;

  --max-w: 988px;          /* 页宽 988 = 内容列 940，与 /live/ 截图带 1:1 对齐 */
  --radius: 14px;

  /* 暗色（默认） */
  --bg: #060807;
  --panel: #0a0d0b;
  --panel-2: #0e1411;
  --glass: rgba(10, 13, 11, .72);
  --text: #e8ede9;
  --text-2: #8fa096;       /* 7.30:1 */
  --text-3: #75867c;       /* 4.84:1（最差底 #0e1411）—— 元数据小字 */
  --accent: #00e676;       /* 填充角色：按钮底、圆点、描边 */
  --accent-ink: #00e676;   /* 文字角色：12.03:1，暗色下与填充同值 */
  --tag-ink: #57eaa0;
  --tag-bg: rgba(0, 230, 118, .08);
  --accent-border: rgba(0, 230, 118, .28);
  --glow: rgba(0, 230, 118, .16);
  --border: #17211b;
  --border-hover: #2b3d32;
  --elev: 0 10px 24px rgba(0, 0, 0, .38);
  --border-2: #101812;
}

[data-theme="light"] {
  /* 米纸暖白 —— 与暗色侧共用绿色身份，不是另一套皮肤 */
  --bg: #f4f1ea;
  --panel: #fbf9f4;
  --panel-2: #efebe1;
  --glass: rgba(251, 249, 244, .80);
  --text: #1a1c19;
  --text-2: #4a5348;
  --text-3: #5d6a62;       /* 4.76:1（最差底 #efebe1） */
  --accent: #0f6b3c;       /* 墨绿：暖纸底 5.84:1，同时干填充与文字两个角色 */
  --accent-ink: #0f6b3c;
  --tag-ink: #0f6b3c;
  --tag-bg: rgba(15, 107, 60, .07);
  --accent-border: rgba(15, 107, 60, .30);
  --glow: rgba(15, 107, 60, .12);
  --border: #e0dbcf;
  --border-hover: #c8c0ad;
  --elev: 0 10px 24px rgba(26, 28, 25, .08);
  --border-2: #eae6dc;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); }
img { max-width: 100%; }
::selection { background: var(--tag-bg); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
section[id], header[id] { scroll-margin-top: 76px; }

/* ---------- Navbar ---------- */
nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: 60px; padding: 0 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-2);
}
.nav-inner {
  width: 100%; max-width: var(--max-w);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: inline-flex; align-items: baseline; gap: 9px; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; }
.logo-mono { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-link { font-size: 13.5px; color: var(--text-2); transition: color .2s ease; }
.nav-link:hover { color: var(--accent-ink); }
.theme-btn {
  font-family: inherit; font-size: 12.5px; color: var(--text-2);
  padding: 6px 13px; border-radius: 100px;
  border: 1px solid var(--border); background: transparent; cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.theme-btn:hover { color: var(--accent-ink); border-color: var(--accent-border); }

/* ---------- Masthead ---------- */
.masthead {
  position: relative; overflow: hidden;
  padding: 126px 24px 52px;
  border-bottom: 1px solid var(--border-2);
}
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.masthead-inner { position: relative; z-index: 1; max-width: var(--max-w); margin: 0 auto; }
.masthead h1 {
  font-size: clamp(40px, 6.2vw, 62px);
  font-weight: 800; letter-spacing: 3px; line-height: 1.05;
}
.masthead h1 .cursor { color: var(--accent-ink); font-weight: 400; }
.tagline { margin-top: 18px; font-size: 19px; font-weight: 600; text-wrap: balance; }
.lede { margin-top: 10px; font-size: 15px; color: var(--text-2); max-width: 620px; text-wrap: pretty; }

/* 首屏承接：一行等宽索引（站内有什么），代替装饰性背景 */
.hero-index {
  display: flex; flex-wrap: wrap; gap: 22px;
  margin-top: 30px; padding-top: 14px;
  max-width: 620px; border-top: 1px solid var(--border-2);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--text-3);
}

/* ---------- Sections ---------- */
main { margin-top: 54px; }
.section { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section + .section { margin-top: 58px; }

/* 分组标签：纯中文小字 + 一条细分隔线 */
.group {
  display: flex; align-items: center; gap: 14px;
  font-size: 15px; font-weight: 600; letter-spacing: .5px;
  color: var(--text-2); margin: 0 0 20px;
}
.group::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Cards（一套组件，两档尺寸） ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
/* 奇数张时最后一张横跨两列，避免右下角出现一块空洞 */
.grid > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.card {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--elev); }
.card__tags { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pill {
  font-size: 12px; font-weight: 600; line-height: 1.6;
  padding: 2px 11px; border-radius: 100px;
  background: var(--tag-bg); color: var(--tag-ink);
  border: 1px solid var(--accent-border);
}
.pick { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--accent-ink); }
.card h3 { text-wrap: balance; font-size: 19px; font-weight: 700; line-height: 1.45; margin-bottom: 10px; letter-spacing: -.1px; }
.card h3 a:hover { color: var(--accent-ink); }
.card__excerpt {
  font-size: 15px; line-height: 1.75; color: var(--text-2); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta {
  display: flex; align-items: center; gap: 14px;
  margin-top: 20px; padding-top: 14px;
  border-top: 1px solid var(--border-2);
  font-size: 13px; color: var(--text-3);
}
.card__meta time { font-family: var(--font-mono); letter-spacing: .2px; }
.act { margin-left: auto; color: var(--accent-ink); font-weight: 600; white-space: nowrap; }
.act:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 主推大卡：文本块 + 全宽图带（图带宽度 = 内容列 940，截图按原尺寸呈现） */
.card--lead { padding: 30px; overflow: hidden; }
.card--lead h3 { text-wrap: balance; font-size: clamp(24px, 2.7vw, 30px); letter-spacing: -.3px; line-height: 1.35; }
.card--lead .card__excerpt { font-size: 15px; line-height: 1.8; max-width: 760px; }
.lead-media { position: relative; margin: 26px -30px -30px; border-top: 1px solid var(--border-2); background: var(--panel-2); }
/* 图是一张静态截图，标一行说明免得被当成能点的页面控件 */
.lead-media figcaption {
  font-size: 11.5px; letter-spacing: .5px; color: var(--text-3);
  padding: 9px 30px; border-bottom: 1px solid var(--border-2);
}
.lead-media img { display: block; width: 100%; height: auto; }
/* 底部渐隐：这张截图是 /live/ 的一个截面，下面还有内容，别让它在行中间硬切 */
.lead-media::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 54px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--panel));
  pointer-events: none;
}

/* ---------- Footer ---------- */
footer { margin-top: 72px; border-top: 1px solid var(--border-2); padding: 48px 24px 32px; }
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px;
}
.footer-brand .logo { font-size: 17px; }
.footer-brand p { font-size: 13.5px; color: var(--text-3); margin-top: 10px; max-width: 340px; text-wrap: pretty; }
.footer-col h5 { font-size: 12.5px; font-weight: 600; letter-spacing: .3px; color: var(--text-3); margin-bottom: 12px; }
.footer-col a, .footer-text { display: block; font-size: 13.5px; color: var(--text-2); margin-bottom: 9px; transition: color .2s ease; }
.footer-col a:hover { color: var(--accent-ink); }
.footer-bottom {
  max-width: var(--max-w); margin: 36px auto 0; padding-top: 20px;
  border-top: 1px solid var(--border-2);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-3);
}
.footer-mono { font-size: 12.5px; color: var(--text-3); }

/* ---------- 入场动画（无 JS 时内容照常可见） ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  nav { height: 56px; padding: 0 20px; }
  .nav-link { display: none; }
  .masthead { padding: 104px 20px 42px; }
  .masthead-glow { width: 420px; height: 420px; }
  .tagline { font-size: 17px; }
  .section { padding: 0 20px; }
  main { margin-top: 44px; }
  .section + .section { margin-top: 46px; }
  .card { padding: 22px; }
  .card--lead { padding: 24px; }
  /* 940px 的截图缩到手机宽度后正文只剩 5–7px，宁可不出图 */
  .lead-media { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  footer { margin-top: 56px; }
}