/* ==========================================================================
   assets/css/style.css —— 全站样式
   --------------------------------------------------------------------------
   日常补内容不用改这个文件。想整体换肤，只改第 1 节 :root 里的变量。
   视觉参考：简洁学术个人主页（白底、深藏青标题、蓝色强调、圆角卡片、横向滑轨）。
   本文件为本站自行编写。

   目录
     1. 变量与基础    2. 导航栏    3. 首页顶部    4. 子页页头
     5. 教育时间线    6. 标签与提示 7. 横向滑轨卡片  8. 论文列表
     9. Thinking 列表 10. 文章正文  11. 页脚       12. 响应式
   ========================================================================== */

/* 1. 变量与基础 ------------------------------------------------------------ */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --text: #3f4a5a;
  --heading: #14213d;
  --muted: #7a8699;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eef4ff;
  --border: #e5eaf1;
  --card: #ffffff;
  --green: #16a34a;  --green-soft: #e8f6ee;
  --amber: #d97706;  --amber-soft: #fef3e2;
  --slate: #475569;  --slate-soft: #eef2f7;

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, .05);
  --shadow: 0 2px 4px rgba(20, 33, 61, .04), 0 12px 32px rgba(20, 33, 61, .06);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1424;
    --bg-alt: #121a2e;
    --text: #b6c0d1;
    --heading: #eaf0fb;
    --muted: #8593a8;
    --accent: #6ea0ff;
    --accent-dark: #8db4ff;
    --accent-soft: #16223d;
    --border: #232e47;
    --card: #141c31;
    --green: #4ade80;  --green-soft: #12301f;
    --amber: #fbbf24;  --amber-soft: #33270f;
    --slate: #a8b4c6;  --slate-soft: #1b2438;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-family: var(--font-serif);
  font-size: 30px; font-weight: 700;
  color: var(--heading);
  margin: 0 0 28px;
}
.section-title::after {
  content: ""; display: block;
  width: 44px; height: 3px; margin-top: 10px;
  background: var(--accent); border-radius: 2px;
}
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.view-all { flex-shrink: 0; font-size: 14px; font-weight: 600; }
.sub-title { font-size: 20px; color: var(--heading); margin: 40px 0 18px; }
.sub-title:first-child { margin-top: 0; }
.lead { font-size: 18px; color: var(--heading); margin: 0 0 16px; }
.muted { color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.back-link { margin: 32px 0 0; font-size: 15px; }

/* 2. 导航栏 ---------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand { font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--heading); }
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-menu { display: flex; gap: 4px; }
.nav-link { padding: 8px 13px; border-radius: 8px; color: var(--text); font-size: 15px; }
.nav-link:hover, .nav-link.active { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.nav-link.active { font-weight: 600; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--heading); border-radius: 2px; }

/* 3. 首页顶部 -------------------------------------------------------------- */
.hero {
  padding: 64px 0;
  background: radial-gradient(1200px 500px at 15% -10%, var(--accent-soft) 0%, transparent 60%), var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero-inner { display: flex; align-items: center; gap: 48px; }
.hero-photo { flex-shrink: 0; }
.hero-photo img, .hero-photo .avatar {
  width: 220px; height: 220px; object-fit: cover; border-radius: 50%;
  border: 5px solid var(--card); box-shadow: var(--shadow);
}
/* 没有照片时的占位头像：显示姓名首字 */
.hero-photo .avatar {
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 84px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
}
.hero-text h1 { margin: 0; font-family: var(--font-serif); font-size: 42px; color: var(--heading); line-height: 1.2; }
.hero-zh { font-size: 26px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.hero-role { margin: 10px 0 0; font-size: 20px; color: var(--accent); font-weight: 600; }
.hero-affil { margin: 6px 0 0; color: var(--muted); }
.hero-tagline { margin: 14px 0 20px; font-size: 17px; color: var(--heading); max-width: 560px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--heading); background: var(--card);
  font-size: 14px; font-weight: 500;
  transition: all .15s ease;
}
.hero-link svg { width: 16px; height: 16px; fill: currentColor; }
.hero-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; transform: translateY(-1px); }

/* 4. 子页页头 -------------------------------------------------------------- */
.page-header {
  padding: 52px 0 40px;
  background: radial-gradient(1100px 420px at 20% -20%, var(--accent-soft) 0%, transparent 60%), var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.page-header h1 { margin: 0; font-family: var(--font-serif); font-size: 38px; color: var(--heading); line-height: 1.2; }
.page-desc { margin: 12px 0 0; font-size: 17px; color: var(--muted); max-width: 680px; }
.page-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

/* 5. 教育时间线 ------------------------------------------------------------ */
.edu-list { border-left: 2px solid var(--border); padding-left: 24px; }
.edu-item { position: relative; padding: 6px 0 22px; }
.edu-item::before {
  content: ""; position: absolute; left: -31px; top: 12px;
  width: 10px; height: 10px; background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.edu-date { font-size: 14px; color: var(--accent); font-weight: 600; }
.edu-body strong { color: var(--heading); font-size: 17px; }
.edu-body p { margin: 2px 0 0; color: var(--muted); }

/* 6. 标签与提示 ------------------------------------------------------------ */
.tag {
  display: inline-block; padding: 2px 10px;
  font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap;
  color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px;
}
.tag-amber { color: var(--amber); background: var(--amber-soft); }
.tag-green { color: var(--green); background: var(--green-soft); }
.tag-slate { color: var(--slate); background: var(--slate-soft); }
a.tag:hover { text-decoration: none; filter: brightness(.95); }
.notice {
  margin: 20px 0; padding: 14px 18px;
  border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: 8px;
  background: var(--card); font-size: 14.5px;
}
.notice code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-alt); padding: 1px 5px; border-radius: 4px; }
.placeholder {
  margin: 20px 0; padding: 24px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--muted); text-align: center; font-size: 15px;
}

/* 7. 横向滑轨 + 卡片 ------------------------------------------------------- */
.hscroll {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 4px 18px; cursor: grab; -webkit-overflow-scrolling: touch;
}
.hscroll.dragging { cursor: grabbing; scroll-snap-type: none; }
.hscroll::-webkit-scrollbar { height: 10px; }
.hscroll::-webkit-scrollbar-track { background: var(--bg-alt); border-radius: 5px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid var(--bg-alt); }
.hscroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.slide-card {
  flex: 0 0 300px; scroll-snap-align: start;
  display: flex; flex-direction: column;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 22px; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.slide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); text-decoration: none; }
.slide-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.slide-card-top .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.slide-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.slide-card h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.45; color: var(--heading); }
.slide-desc { margin: 0; font-size: 14px; flex: 1; }
.slide-foot {
  margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--muted);
}
.slide-more { color: var(--accent); font-weight: 600; }

/* 8. 论文列表 -------------------------------------------------------------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: none; }
.pub-main { flex: 1; min-width: 0; }
.pub-title { font-size: 16px; font-weight: 600; color: var(--heading); line-height: 1.45; }
a.pub-title:hover { color: var(--accent); }
.pub-authors { margin: 3px 0 1px; font-size: 14px; }
.pub-authors strong { color: var(--heading); }
.pub-venue { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.pub-summary { margin: 6px 0 0; font-size: 14px; color: var(--text); }
.pub-status { flex-shrink: 0; margin-top: 4px; }

/* 9. Thinking：标签筛选 + 论坛式列表 --------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filter-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.chip {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .count { font-size: 12px; opacity: .7; margin-left: 4px; }
.filter-desc { margin: 0 0 24px; font-size: 15px; color: var(--muted); min-height: 1.5em; }
.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 20px; background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.thread:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); text-decoration: none; }
.thread-main { flex: 1; min-width: 0; }
.thread-title { margin: 0; font-size: 16.5px; font-weight: 600; color: var(--heading); line-height: 1.4; }
.thread-desc { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.thread-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thread-meta { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.thread-date { font-size: 12px; color: var(--muted); }

/* 产品卡片的"状态点" */
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-dot.live::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* 10. 文章正文（Markdown 渲染结果） ---------------------------------------- */
.container-narrow { max-width: 820px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.prose { font-size: 16.5px; line-height: 1.85; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-family: var(--font-serif); font-size: 26px; color: var(--heading); margin: 44px 0 14px; line-height: 1.3; }
.prose h3 { font-size: 20px; color: var(--heading); margin: 32px 0 10px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 26px; }
.prose li { margin-bottom: 6px; }
.prose blockquote {
  margin: 20px 0; padding: 10px 20px; border-left: 4px solid var(--accent);
  background: var(--bg-alt); color: var(--heading); border-radius: 0 8px 8px 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font-family: var(--font-mono); font-size: 14px; background: var(--bg-alt); padding: 2px 6px; border-radius: 4px; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 16px 20px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 24px auto; border-radius: 10px; box-shadow: var(--shadow-sm); }
.prose table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-alt); color: var(--heading); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* 11. 页脚 ----------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; text-align: center; color: var(--muted); font-size: 14px; }
.footer p { margin: 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

/* 12. 响应式 --------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-inner { flex-direction: column; text-align: center; gap: 28px; }
  .hero-links { justify-content: center; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-text h1 { font-size: 34px; }
}
@media (max-width: 640px) {
  .section { padding: 52px 0; }
  .page-header { padding: 40px 0 32px; }
  .page-header h1 { font-size: 30px; }
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px; display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-link { padding: 12px 10px; }
  .hero-photo img, .hero-photo .avatar { width: 170px; height: 170px; }
  .hero-photo .avatar { font-size: 64px; }
  .pub { flex-direction: column; gap: 8px; }
  .slide-card { flex-basis: 82vw; }
  .section-title-row { flex-wrap: wrap; }
  .thread { flex-direction: column; align-items: flex-start; gap: 8px; }
  .thread-meta { flex-direction: row; align-items: center; gap: 12px; }
  .prose { font-size: 16px; }
}
