/* 第三批学术名片的底层样式：只管结构、可读性与无障碍；每张名片的样子在 c-<slug>.css 里。
   主题可覆盖的变量：--bg --paper --ink --ink-2 --ink-3 --rule --acc --acc-ink --head --body --mono --bar-bg --bar-ink */
:root {
  --bg: #f4f1ea; --paper: #fbf9f4; --ink: #1d1b18; --ink-2: #4c4740; --ink-3: #8a8378; --rule: rgba(29, 27, 24, .16);
  --acc: #8a2b1d; --acc-ink: #fff;
  --head: "Noto Serif SC", "Songti SC", "STSong", serif; --body: "Noto Serif SC", "Songti SC", "STSong", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --bar: 48px; --bar-bg: rgba(244, 241, 234, .92); --bar-ink: var(--ink);
  --chip-bg: rgba(255, 255, 255, .62); --chip-ring: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 8px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
body.c3 { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.75; text-rendering: optimizeLegibility; overflow-x: hidden; }
.c3 img { max-width: 100%; height: auto; }
.c3 a { color: inherit; }
.c3 :focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 2000; padding: 10px 16px; background: #111; color: #fff; font: 600 15px/1.2 "Noto Sans SC", sans-serif; box-shadow: 0 0 0 2px #fff; }
.skip:focus { left: 8px; }
.ap { font-family: Georgia, "Times New Roman", serif; }
.mk { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; color: var(--ink-3); }

/* 页头 */
.c3bar { position: fixed; inset: 0 0 auto 0; z-index: 900; height: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--bar-bg); color: var(--bar-ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); font-size: 14px; }
.c3bar__logo { display: inline-flex; width: 20px; height: 22px; color: inherit; }
.c3bar__logo svg { width: 100%; height: 100%; }
.c3bar__t { margin: 0; display: flex; gap: 10px; align-items: baseline; min-width: 0; white-space: nowrap; overflow: hidden; }
.c3bar__t a { text-decoration: none; font-weight: 700; }
.c3bar__t span { color: inherit; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.c3bar__nav { margin-left: auto; display: flex; gap: 14px; white-space: nowrap; }
.c3bar__nav a { text-decoration: none; opacity: .85; }
.c3bar__nav a:hover { opacity: 1; text-decoration: underline; }
.c3bar__prog { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--acc); }

/* 目录：桌面在右侧，手机隐藏（主题可改） */
.c3toc { position: fixed; z-index: 800; right: 12px; top: 50%; transform: translateY(-50%); }
.c3toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.c3toc a { display: flex; align-items: center; justify-content: flex-end; gap: 8px; text-decoration: none; font-size: 12px; color: var(--ink-3); }
.c3toc a span { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s; }
.c3toc a:hover span, .c3toc a:focus-visible span { max-width: 16em; }
.c3toc a b { font-weight: 400; font-variant-numeric: tabular-nums; }
.c3toc a::after { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid currentColor; }
.c3toc a[aria-current="true"] { color: var(--acc); }
.c3toc a[aria-current="true"]::after { background: currentColor; }
@media (max-width: 1300px) { .c3toc a span, .c3toc a b { display: none; } .c3toc { right: 6px; } }
@media (max-width: 860px) { .c3toc { display: none; } .hide-s { display: none; } }

/* 默认版式：首屏 + 每问一屏（主题多半会重写） */
.c3hero, .c3q, .c3end { position: relative; min-height: 100svh; padding: calc(var(--bar) + 40px) clamp(16px, 5vw, 72px) 56px; }
.c3hero__in, .c3end__in { max-width: 860px; margin: 0 auto; }
.c3hero__k { margin: 0; font-size: 13px; letter-spacing: .14em; color: var(--ink-3); }
.c3hero__n { margin: 6px 0 0; font-family: var(--head); font-size: clamp(48px, 9vw, 112px); line-height: 1.02; font-weight: 900; letter-spacing: .02em; }
.c3hero__en { margin: 8px 0 18px; color: var(--ink-2); }
.c3hero__who { margin: 0; font-size: 20px; font-weight: 700; }
.c3hero__now, .c3hero__facts { color: var(--ink-2); }
.c3hero__rel b { margin-right: 8px; font-size: 13px; padding: 1px 8px; border: 1px solid var(--rule); border-radius: 3px; }
.c3-feats { padding-left: 1.4em; }
.c3-books, .c3-links, .c3-qlist { list-style: none; padding: 0; margin: 0; }
.c3-books li, .c3-links li { padding: 4px 0; border-bottom: 1px dashed var(--rule); }
.c3-books small, .c3-links small, .c3-works small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.c3-btn { display: inline-flex; align-items: center; gap: 6px; margin: 4px 8px 4px 0; padding: 8px 14px; border: 1px solid currentColor; border-radius: 3px; text-decoration: none; font-size: 14px; line-height: 1.3; }
.c3-btn--go, .c3-btn--deep { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.c3q { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; }
@media (min-width: 960px) { .c3q { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } .c3q:nth-of-type(odd) .c3q__art { order: 2; } }
.c3q__art:empty { display: none; }
.c3q__txt { max-width: 640px; }
.c3q__when { margin: 0; display: flex; gap: 10px; align-items: baseline; color: var(--ink-3); font-size: 14px; }
.c3q__when b { font-size: 28px; color: var(--acc); font-weight: 700; font-variant-numeric: tabular-nums; }
.c3q__q { margin: 6px 0 14px; font-family: var(--head); font-size: clamp(28px, 4.2vw, 46px); line-height: 1.2; font-weight: 900; }
.c3q__lede { margin: 0 0 16px; font-size: 17px; }
.c3-quote { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--acc); }
.c3-quote blockquote { margin: 0; }
.c3-quote blockquote p { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.7; }
.c3-quote blockquote p::before { content: "“"; } .c3-quote blockquote p::after { content: "”"; }
.c3-orig { margin: 6px 0 0; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.c3-quote figcaption { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.c3-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0; }
.c3-tags li { padding: 1px 9px; border: 1px solid var(--rule); border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.c3-works ul { list-style: none; margin: 0; padding: 0; }
.c3-works li { padding: 3px 0; }
.c3-fig { margin: 0; }
.c3-fig img { display: block; width: 100%; }
.c3-fig figcaption { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.c3-go { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin: 14px 0 0; font-size: 14px; }
.c3-deeplink { display: inline-flex; align-items: center; min-height: 40px; font-weight: 700; }
.c3-ask { display: inline-flex; flex-direction: column; justify-content: center; min-height: 40px; text-decoration: none; padding: 6px 10px; border: 1px dashed var(--rule); border-radius: 6px; }
.c3-ask small { font-size: 12px; color: var(--ink-3); }
.rel { display: inline-block; margin-right: 6px; padding: 0 5px; border: 1px solid currentColor; border-radius: 3px; font-size: 11px; line-height: 1.5; font-weight: 400; font-style: normal; vertical-align: 1px; opacity: .85; }

/* 头像（两个字的圆章） */
.av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--av-bg); color: var(--av-fg);
  font: 700 11px/1 "Noto Sans SC", "PingFang SC", sans-serif; font-style: normal; letter-spacing: 0; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12) inset; }
.av--lg { width: 64px; height: 64px; font-size: 20px; }

/* 群聊入口 */
.c3-talk { margin: 16px 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.c3-talk .mk { margin: 0; }
.talk { display: inline-grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; max-width: 100%;
  padding: 8px 16px 8px 10px; border: 1px solid var(--rule); border-radius: 28px; background: var(--chip-bg); color: inherit; text-decoration: none;
  transition: transform .15s, box-shadow .15s; }
.talk:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.talk__av { grid-row: 1 / span 2; display: flex; align-items: center; }
.talk__av .av { width: 28px; height: 28px; font-size: 10.5px; margin-left: -9px; box-shadow: 0 0 0 2px var(--chip-ring); }
.talk__av .av:first-child { margin-left: 0; }
.talk__av b { margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.talk__t { font-weight: 700; font-size: 15px; line-height: 1.35; }
.talk__n { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.talk::after { content: "💬"; display: none; }

/* 结尾 */
.c3end h2 { font-family: var(--head); font-size: clamp(28px, 4vw, 44px); margin: 0 0 18px; }
.c3end h3 { margin: 32px 0 10px; font-size: 18px; }
.c3-lin { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.c3-lin li { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--chip-bg); }
.c3-lin li > a, .c3-lin__x { display: flex; align-items: center; gap: 8px; min-height: 40px; text-decoration: none; }
.c3-lin li p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.c3-talk--all { flex-direction: row; flex-wrap: wrap; }
.c3-endgo { margin: 28px 0 8px; }
.c3-credits, .c3-fine { font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.c3-fine a, .c3-credits a { color: inherit; }

/* 进入视野 */
.c3 [data-rv] { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.c3 .is-in [data-rv], .c3 [data-rv].is-in { opacity: 1; transform: none; }
@media print { .c3bar, .c3toc, .dlg { display: none !important; } .c3hero, .c3q, .c3end { min-height: 0; padding-top: 24px; } }
