@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─────────────────────────────────────────────────────────
   sambeskind.info 排版系统复刻（2026-08-08 定稿）。
   一天内试过的偏离（放大字号/宽栏/侧栏/bento/Apple 风）全部被否，
   本文件 = 最初复刻版原样恢复。改任何值之前先读 CLAUDE.md 的弯路清单。
   唯一 delta：.home-photo img 加 height:auto（修 width/height 属性拉伸 bug）
   ───────────────────────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #737373;
  --accent: #1e3a8a;
  --accent-hover: #14275c;
  --border: #e8e8e8;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 0 2rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
nav .logo {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  text-decoration: none; letter-spacing: -0.02em;
}
nav .nav-links { display: flex; gap: 1.5rem; list-style: none; }
nav .nav-links a {
  font-size: 0.82rem; color: var(--text-muted);
  text-decoration: none; transition: color 0.2s;
}
nav .nav-links a:hover,
nav .nav-links a.active { color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--text); }
.nav-toggle svg { width: 20px; height: 20px; }

/* ── LAYOUT ── */
main { margin-top: 56px; }
.section { border-top: 1px solid var(--border); padding: 3.5rem 2rem; }
.section:first-child { border-top: none; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.75rem; letter-spacing: -0.01em; }

.page-header { padding: 3rem 2rem 1rem; }
.page-header-inner { max-width: var(--max-width); margin: 0 auto; }
.page-header h1 {
  font-size: 1.7rem; font-weight: 600; letter-spacing: -0.01em;
  padding-bottom: 0.6rem; border-bottom: 2px solid var(--text);
}
.page-header + .section { border-top: none; }

/* ── TYPOGRAPHY ── */
p { margin-bottom: 1rem; font-size: 0.95rem; }
p:last-child { margin-bottom: 0; }
a {
  color: var(--accent); text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover { color: var(--accent-hover); text-decoration-color: var(--accent-hover); }

/* ── HOME (About) ──
   三块网格：intro / photo / rest。桌面端实测值不变（bio 栏 720-200-48 = 472px，照片 200px 右上）。
   拆成三块是为了手机端：塌成一列时顺序变 intro → photo → rest，
   否则照片作为第二个子元素会掉到所有正文后面成孤儿（2026-08-09 Amos 在手机上发现）。 */
.home-grid { display: grid; grid-template-columns: 1fr 200px; gap: 3rem; align-items: start; }
.home-intro { grid-column: 1; grid-row: 1; }
.home-photo { grid-column: 2; grid-row: 1 / span 2; }
.home-rest  { grid-column: 1; grid-row: 2; }
.home-photo img { width: 100%; height: auto; border-radius: 6px; display: block; }

.about-sub { margin-top: 2rem; margin-bottom: 2.5rem; }
.home-rest .about-sub:first-child { margin-top: 2rem; }
.about-sub h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 1rem; color: var(--text); }
.about-sub p { margin-bottom: 0.85rem; }

.contact-links { display: flex; gap: 1rem; margin-top: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.contact-links a { font-size: 0.82rem; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.contact-links a:hover { color: var(--accent); }
/* 邮箱：明文 + 点击复制（不做图标式）。样式对齐 contact-links a */
.email-copy {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-sans); font-size: 0.82rem; color: var(--text-muted);
  transition: color 0.2s; text-align: left;
}
.email-copy:hover { color: var(--accent); }
.email-copy.copied { color: var(--accent); }

/* ── LINK LISTS (Writing) ── */
.link-list { list-style: none; }
.link-list li {
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.link-list li:last-child { border-bottom: none; }
.link-list a {
  color: var(--text); font-size: 0.9rem; text-decoration: none;
  border-bottom: 1px solid transparent; transition: border-color 0.2s, color 0.2s;
}
.link-list a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.link-list .meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }


/* ── USER MANUAL ── */
.manual-section { margin-top: 2rem; margin-bottom: 2.5rem; }
.manual-section:first-of-type { margin-top: 0; }
.manual-section h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; color: var(--accent); }
.manual-section p { margin-bottom: 0.85rem; }
.manual-section strong { font-weight: 600; }
.manual-close { border-top: 1px solid var(--border); padding-top: 1.75rem; margin-top: 0.5rem; }

/* ── ARTICLE PAGES ──（Sam 原样：article-header / article-body / back-link。
   delta：blockquote / ul / ol / hr 是补充——Sam 的文章不用这些元素，我们的 Substack 正文用了，
   样式沿用 Sam token（border 色 / muted 色 / “—” 分隔符与 .rule 一致）─── */
.article-header { padding: 3rem 2rem 1rem; }
.article-header-inner { max-width: var(--max-width); margin: 0 auto; padding-bottom: 0.75rem; border-bottom: 2px solid var(--text); }
.article-header + .section { border-top: none; }
.article-header h1 { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.5rem; line-height: 1.25; }
.article-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.article-subtitle { font-style: italic; color: var(--text-muted); margin-top: 0.5rem; font-size: 0.95rem; }
.article-body { max-width: var(--max-width); margin: 0 auto; }
.article-body p { margin-bottom: 1rem; font-size: 0.95rem; line-height: 1.75; }
.article-body h2 { font-size: 1.3rem; font-weight: 600; margin-top: 2.5rem; margin-bottom: 1rem; color: var(--text); }
.article-body h3 { font-size: 1.1rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.75rem; }
.article-body blockquote { margin: 1.75rem 0; padding-left: 1.25rem; border-left: 2px solid var(--border); color: var(--text-muted); }
.article-body ul, .article-body ol { margin: 0 0 1rem 1.4rem; font-size: 0.95rem; }
.article-body li { margin-bottom: 0.35rem; }
.article-body hr { border: none; margin: 2.5rem 0; }
.article-body hr::before { content: "—"; color: var(--text-muted); opacity: 0.5; }
.article-body .epigraph { font-style: italic; text-align: left; color: var(--text-muted); font-size: 1.05rem; margin: 1.75rem 0; }
.article-body .rule { text-align: left; margin: 2.5rem 0; line-height: 1; }
.article-body .rule::before { content: "—"; color: var(--text-muted); opacity: 0.5; }
.article-body .article-thanks { font-style: italic; color: var(--text-muted); font-size: 0.9rem; margin-top: 2.5rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); text-decoration: none; margin-bottom: 1.5rem; transition: color 0.2s; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); padding: 2rem; text-align: center; }
footer p { font-size: 0.8rem; color: var(--text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  nav .nav-links {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 1rem 2rem; gap: 0.75rem;
  }
  nav .nav-links.open { display: flex; }
  .section { padding: 2.5rem 1.25rem; }
  .page-header { padding: 2rem 1.25rem 1rem; }
  nav { padding: 0 1.25rem; }

  /* 单列，并显式指定行序：照片插在 intro 和 Currently 之间，不再掉到页面最底 */
  .home-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .home-intro { grid-column: 1; grid-row: 1; }
  .home-photo { grid-column: 1; grid-row: 2; max-width: 190px; }
  .home-rest  { grid-column: 1; grid-row: 3; }
  .home-rest .about-sub:first-child { margin-top: 0; }

  /* 日期错位修复：桌面端 space-between 让日期靠右，但手机上标题一换行，
     日期就被挤到单独一行、又被 space-between 推回左边 —— 短标题日期在右、
     长标题日期在左，看着就是错位。手机端统一改成上下两行，一律左对齐。 */
  .link-list li { flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 0.7rem 0; }
  .link-list a { font-size: 0.95rem; line-height: 1.5; }

  /* 文章页：大标题在窄屏上收一档 */
  .article-header { padding: 2rem 1.25rem 1rem; }
  .article-header h1 { font-size: 1.5rem; }
  .article-body h2 { font-size: 1.15rem; }
}
