/*
 * 出海笔记 · 样式
 * 原则：留白多、字大、颜色少（黑白灰 + 一个蓝色），动画轻
 * 后台（public/admin/admin.css）也用这里的颜色变量
 */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --link: #0066cc;
  --hl: #0066cc;
  --notice-bg: #f5f5f7;
  --notice-ink: #6e6e73;
  --code-bg: #f5f5f7;
  --nav-bg: rgba(255, 255, 255, .78);
  --nav-h: 52px;
  --radius: 18px;
  --radius-lg: 28px;
  --w: 1080px;
  --w-text: 692px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #161617;
    --card: #1d1d1f;
    --ink: #f5f5f7;
    --ink-2: #d2d2d7;
    --muted: #86868b;
    --line: #424245;
    --link: #2997ff;
    --hl: #2997ff;
    --notice-bg: #1d1d1f;
    --notice-ink: #a1a1a6;
    --code-bg: #1d1d1f;
    --nav-bg: rgba(22, 22, 23, .78);
  }
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 17px; line-height: 1.6; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.02em; }
p { margin: 0; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

/* 「进入板块 ›」这样的文字链接 */
.more { color: var(--link); font-size: 17px; white-space: nowrap; }
.more::after { content: "›"; display: inline-block; margin-left: .3em; transition: transform .3s var(--ease); }
a:hover .more, .more:hover { text-decoration: underline; }
a:hover .more::after, .more:hover::after { transform: translateX(3px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 11px 24px;
  border-radius: 9999px; background: var(--ink); color: var(--bg); border: 2px solid var(--ink);
  font-size: 16px; font-weight: 500; white-space: nowrap; transition: opacity .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { opacity: .82; text-decoration: none; }
/* 次要按钮：黑色描边胶囊 */
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { opacity: 1; background: var(--ink); color: var(--bg); }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; height: var(--nav-h);
  background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.nav-inner { max-width: var(--w); height: 100%; margin: 0 auto; padding: 0 22px; display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-img { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; }
.logo-text { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.nav-links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--ink); opacity: .8; font-size: 13px; padding: 6px 10px; white-space: nowrap;
  transition: opacity .2s ease;
}
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links a.active { opacity: 1; font-weight: 600; }

/* ---------- 首页大标题 ---------- */
.hero { text-align: center; padding: 96px 22px 24px; max-width: var(--w); margin: 0 auto; }
.hero-eyebrow { font-size: 21px; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.hero-title { font-size: clamp(40px, 7vw, 80px); line-height: 1.05; letter-spacing: -.03em; font-weight: 500; word-break: keep-all; text-wrap: balance; }
.hero-sub { font-size: clamp(19px, 2.4vw, 28px); line-height: 1.3; color: var(--ink); margin-top: 14px; font-weight: 400; }
.hero-links { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 32px; flex-wrap: wrap; }
.hero-img { width: min(640px, 100%); margin: 48px auto 0; }

/* ---------- 板块方块 ---------- */
.tiles {
  max-width: calc(var(--w) + 44px); margin: 48px auto 0; padding: 0 22px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--bg-soft); border-radius: var(--radius-lg); padding: 52px 32px 0; overflow: hidden; color: var(--ink);
}
.tile:hover { text-decoration: none; }
.tile-eyebrow { font-size: 14px; font-weight: 600; color: var(--c); margin-bottom: 6px; }
.tile-title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.tile-desc { font-size: 17px; color: var(--muted); margin: 10px auto 14px; max-width: 26em; }
.tile-img { display: block; width: 86%; margin-top: 32px; border-radius: 18px 18px 0 0; overflow: hidden; }
.tile-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .8s var(--ease); }
.tile:hover .tile-img img { transform: scale(1.03); }

/* ---------- 区块 ---------- */
.block { max-width: calc(var(--w) + 44px); margin: 0 auto; padding: 96px 22px 24px; }
.block-top { padding-top: 24px; }
.block-title { font-size: clamp(32px, 4.5vw, 48px); line-height: 1.1; letter-spacing: -.025em; font-weight: 500; color: var(--muted); text-align: center; margin-bottom: 40px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- 文章卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
.card { display: flex; flex-direction: column; color: var(--ink); }
.card:hover { text-decoration: none; }
.card-img { display: block; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.card-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 4px 0; }
.card-sec { font-size: 12px; font-weight: 600; color: var(--c); letter-spacing: .02em; }
.card-title { font-size: 19px; font-weight: 600; line-height: 1.35; letter-spacing: -.015em; }
.card:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card-sum { font-size: 15px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-date { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-text { background: var(--bg-soft); border-radius: var(--radius); padding: 24px; }

/* ---------- 板块页头 ---------- */
.page-head { text-align: center; padding: 88px 22px 40px; max-width: 820px; margin: 0 auto; }
.page-eyebrow { font-size: 17px; font-weight: 600; color: var(--c, var(--muted)); margin-bottom: 8px; }
.page-title { font-size: clamp(40px, 6vw, 64px); line-height: 1.07; letter-spacing: -.03em; font-weight: 500; }
.page-sub { font-size: clamp(19px, 2.2vw, 24px); color: var(--muted); margin-top: 14px; line-height: 1.4; }

.notice {
  background: var(--notice-bg); color: var(--notice-ink); border-radius: 12px;
  padding: 12px 18px; font-size: 14px; line-height: 1.5; margin: 24px auto 0; max-width: var(--w-text); text-align: center;
}

/* ---------- 文章页 ---------- */
.article { padding-bottom: 40px; }
.article-head { max-width: calc(var(--w-text) + 44px); margin: 0 auto; padding: 72px 22px 0; }
.article-head .notice { margin: 0 0 24px; text-align: left; }
.article-sec { display: inline-block; font-size: 14px; font-weight: 600; color: var(--c, var(--link)); margin-bottom: 12px; }
.article-title { font-size: clamp(32px, 5vw, 48px); line-height: 1.12; letter-spacing: -.025em; font-weight: 500; text-wrap: balance; }
.article-sub { font-size: clamp(19px, 2vw, 22px); color: var(--muted); line-height: 1.45; margin-top: 16px; }
.article-meta { font-size: 14px; color: var(--muted); margin-top: 20px; }
.article-cover { max-width: calc(var(--w) + 44px); margin: 44px auto 0; padding: 0 22px; }
.article-cover img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--radius-lg); }
.article-body { max-width: calc(var(--w-text) + 44px); margin: 0 auto; padding: 48px 22px 0; }
.article-body-top { padding-top: 80px; }
.article-body > .notice { margin: 0 0 32px; text-align: left; }

.toc { background: var(--bg-soft); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 44px; }
.toc-title { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.4em; font-size: 16px; line-height: 1.9; }
.toc a { color: var(--ink); }
.toc a:hover { color: var(--link); }

/* 正文（后台预览也用这一段） */
.prose { font-size: 17px; line-height: 1.8; letter-spacing: 0; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 .6em; }
.prose h2 { font-weight: 500; font-size: 28px; line-height: 1.25; letter-spacing: -.02em; margin: 2.2em 0 .7em; }
.prose h3 { font-weight: 600; font-size: 21px; line-height: 1.35; margin: 1.8em 0 .5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }
.prose a { color: var(--link); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose blockquote {
  margin: 0 0 1.4em; padding: 4px 0 4px 20px; border-left: 3px solid var(--c, var(--line));
  color: var(--ink-2); font-size: 19px; line-height: 1.6;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { background: var(--code-bg); padding: 2px 6px; border-radius: 6px; font-size: .88em; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.prose pre { background: var(--bg-soft); color: var(--ink); padding: 18px 20px; border-radius: 14px; overflow-x: auto; font-size: 14px; line-height: 1.65; margin: 0 0 1.4em; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }
.prose img { border-radius: 14px; margin: .4em 0; }
.prose li.task { list-style: none; position: relative; }
.prose li.task::before { content: ""; position: absolute; left: -1.4em; top: .42em; width: .9em; height: .9em; border: 1.5px solid var(--muted); border-radius: 4px; }
.prose li.task.done::before { background: var(--link); border-color: var(--link); }
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.55; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 12px 14px 12px 0; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; color: var(--muted); font-size: 13px; border-bottom-color: var(--ink); }

.pager {
  max-width: calc(var(--w-text) + 44px); margin: 72px auto 0; padding: 0 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.pager a { background: var(--bg-soft); border-radius: var(--radius); padding: 18px 20px; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.4; transition: background .2s ease; }
.pager a:hover { text-decoration: none; background: color-mix(in srgb, var(--bg-soft) 70%, var(--line)); }
.pager a span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-bottom: 4px; }
.pager a.next { text-align: right; grid-column: 2; }

/* ---------- 页脚 ---------- */
.footer { background: var(--bg-soft); margin-top: 120px; padding: 28px 22px 36px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.footer-inner { max-width: var(--w); margin: 0 auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.footer a { color: var(--ink-2); }
.footer p + p { margin-top: 4px; }

/* ---------- 滚动浮现（只在支持且没关闭动画时生效） ---------- */
.js-reveal .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s);
}
.js-reveal .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile-img img, .card-img img { transition: none; }
}

/* ---------- 平板 / 手机 ---------- */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 734px) {
  body { font-size: 16px; }
  .nav-inner { gap: 12px; padding: 0 16px; }
  .logo-text { display: none; }
  .nav-links a { padding: 6px 8px; }
  .hero { padding: 56px 16px 8px; }
  .hero-img { margin-top: 32px; }
  .tiles { grid-template-columns: minmax(0, 1fr); padding: 0 12px; margin-top: 32px; }
  .tile { padding: 40px 20px 0; border-radius: 22px; }
  .block { padding: 72px 16px 16px; }
  .block-title { margin-bottom: 28px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .page-head { padding: 56px 16px 24px; }
  .article-head { padding: 48px 16px 0; }
  .article-cover { padding: 0 12px; margin-top: 32px; }
  .article-cover img { border-radius: 18px; }
  .article-body { padding: 36px 16px 0; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 24px; }
  .pager { grid-template-columns: 1fr; padding: 0 16px; margin-top: 56px; }
  .pager a.next { grid-column: 1; }
  .footer { margin-top: 88px; padding: 24px 16px 32px; }
}
