/* ============================================================
   luckyshi.cn · 学习经验总结
   Static personal portal (replaces WordPress homepage)
   ============================================================ */
:root {
  --paper: #f7f4ee;
  --paper-2: #fbf9f5;
  --card: #ffffff;
  --ink: #1b2430;
  --ink-2: #3d4a5c;
  --muted: #6d7889;
  --muted-2: #9aa3b2;
  --line: #e4ded3;
  --line-2: #eee9e1;
  --accent: #2d5bd1;
  --accent-deep: #1f449e;
  --teal: #0f8f7e;
  --amber: #b47718;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(27, 36, 48, 0.04), 0 10px 30px rgba(27, 36, 48, 0.06);
  --shadow-hover: 0 2px 4px rgba(27, 36, 48, 0.05), 0 18px 45px rgba(27, 36, 48, 0.11);
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --mono: "DejaVu Sans Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(45, 91, 209, 0.16); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- background texture ---------- */
.paper-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(circle at 1px 1px, rgba(27, 36, 48, 0.055) 1px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(ellipse 80% 50% at 82% -8%, rgba(45, 91, 209, 0.065), transparent 70%),
    radial-gradient(ellipse 55% 42% at 6% 8%, rgba(15, 143, 126, 0.05), transparent 70%),
    var(--paper);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.45));
}

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(247, 244, 238, 0.86);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #1b2430, #39465a);
  color: #f7f4ee; font-size: 15px; font-family: var(--serif);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.brand-text { min-width: 0; line-height: 1.2; }
.brand-text b { display: block; font-family: var(--serif); font-size: 16px; letter-spacing: .5px; white-space: nowrap; }
.brand-text i { display: block; font-style: normal; font-family: var(--mono); font-size: 9px; letter-spacing: 1.4px; color: var(--muted-2); white-space: nowrap; margin-top: 2px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: 14px;
  border: 1px solid transparent; transition: all .16s;
}
.nav a:hover { color: var(--ink); background: rgba(27,36,48,0.045); }
.nav a.active { color: var(--accent); border-color: rgba(45,91,209,0.24); background: rgba(45,91,209,0.07); }
.top-meta { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .6px; color: var(--muted);
  border: 1px solid var(--line); background: rgba(255,255,255,0.55); padding: 3px 9px; border-radius: 999px;
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
main { display: block; }
section { scroll-margin-top: 76px; }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(34px, 5vw, 64px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.6px; color: var(--accent);
  border-left: 2px solid var(--accent); padding-left: 9px; margin-bottom: 20px;
}
.eyebrow span { color: var(--muted-2); }
.hero h1 {
  margin: 0 0 20px; font-family: var(--serif); font-weight: 700;
  font-size: clamp(38px, 6vw, 68px); line-height: 1.12; letter-spacing: .5px; color: #121a24;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lead { margin: 0 0 16px; font-size: clamp(16px, 1.35vw, 18px); color: var(--ink-2); max-width: 35em; }
.hero-sub { margin: 0 0 26px; font-size: 13px; color: var(--muted); max-width: 36em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 14px; cursor: pointer; transition: all .16s;
}
.btn:hover { border-color: #c9c0b2; color: var(--ink); transform: translateY(-1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2b3647; border-color: #2b3647; color: #fff; }
.hero-note { margin-top: 18px; font-size: 11.5px; color: var(--muted-2); font-family: var(--mono); letter-spacing: .3px; }

/* hero side: featured card */
.featured {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  transform: rotate(.6deg); transition: transform .25s, box-shadow .25s;
}
.featured:hover { transform: rotate(0) translateY(-2px); box-shadow: var(--shadow-hover); }
.featured .thumb { aspect-ratio: 16 / 9; background: #eae5da; overflow: hidden; }
.featured .thumb img { width: 100%; height: 100%; object-fit: cover; }
.featured .body { padding: 16px 18px 18px; }
.featured .tag-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .8px; color: var(--muted); border: 1px solid var(--line); background: var(--paper-2); padding: 1px 7px; border-radius: 999px; }
.tag-accent { color: var(--accent); border-color: rgba(45,91,209,0.25); background: rgba(45,91,209,0.06); }
.featured h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 20px; line-height: 1.35; }
.featured p { margin: 0; font-size: 12.5px; color: var(--muted); }
.featured .go { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent); margin-top: 7px; }
.hero-stats { display: flex; gap: 22px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.hero-stats div b { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.2; color: var(--ink); }
.hero-stats div span { font-size: 10.5px; color: var(--muted-2); letter-spacing: .4px; }

/* ---------- section ---------- */
.section { padding: clamp(34px, 5vw, 62px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.section-title .no { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 1px; }
.section-title h2 { margin: 0; font-family: var(--serif); font-size: clamp(24px, 2.5vw, 30px); line-height: 1.25; color: #121a24; }
.section-desc { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 42em; }
.section-more { font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--ink); box-shadow: 0 1px 2px rgba(27,36,48,0.03);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #d4cabb; }
.card .thumb { aspect-ratio: 16 / 9; background: #ece7de; overflow: hidden; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .thumb img { transform: scale(1.025); }
.card .thumb.grad-1 { background: linear-gradient(135deg, #dbe6ff, #f1e8dc); }
.card .thumb.grad-2 { background: linear-gradient(135deg, #d9f0ea, #f3ecdf); }
.card .thumb.grad-3 { background: linear-gradient(135deg, #e6e1f7, #f3eee3); }
.card .thumb.grad-4 { background: linear-gradient(135deg, #f7e5d7, #e8eef8); }
.card .thumb .glyph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 44px; color: rgba(27,36,48,0.5); letter-spacing: 1px;
}
.card .thumb .glyph small { font-family: var(--mono); font-size: 9px; letter-spacing: 1.6px; color: rgba(27,36,48,0.36); display: block; text-align: center; margin-top: 5px; }
.card .body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.card .tag-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card h3 { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.42; letter-spacing: .1px; }
.card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.65; flex: 1 1 auto; }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; padding-top: 8px; border-top: 1px solid var(--line-2); font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.card .meta .arrow { color: var(--accent); font-size: 13px; }
.card.compact .body { padding: 15px 16px 16px; gap: 5px; }
.card.compact h3 { font-size: 15.5px; }
.card.compact p { font-size: 11.5px; }

/* article cards: horizontal */
.article-card { flex-direction: row; align-items: stretch; }
.article-card .thumb { flex: 0 0 42%; aspect-ratio: auto; min-height: 170px; }
.article-card .body { padding: 18px 20px; }
.article-card h3 { font-size: 20px; }
.article-card p { font-size: 13px; }
.article-card .meta { margin-top: 10px; }

/* history banner */
.history-card {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px; align-items: center;
  background: linear-gradient(135deg, #fbf9f4, #f2eee5);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: 0 1px 2px rgba(27,36,48,0.03);
}
.history-card .hc-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: 1.6px; color: var(--amber); margin-bottom: 8px; }
.history-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 25px; line-height: 1.3; }
.history-card p { margin: 0; font-size: 13px; color: var(--muted); max-width: 36em; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chip { font-size: 11px; color: var(--ink-2); border: 1px solid var(--line); background: rgba(255,255,255,0.65); border-radius: 999px; padding: 3px 9px; }
.chip b { font-family: var(--mono); color: var(--accent); font-weight: 600; margin-right: 3px; }
.history-samples { border-left: 1px solid var(--line); padding-left: 22px; }
.history-samples .hs-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.2px; color: var(--muted-2); margin-bottom: 8px; }
.history-samples ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.history-samples li { font-size: 12px; color: var(--ink-2); display: flex; gap: 7px; }
.history-samples li span { color: var(--muted-2); font-family: var(--mono); font-size: 9.5px; padding-top: 2px; white-space: nowrap; }
.history-samples .more { margin-top: 10px; font-size: 12px; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 28px; align-items: start; }
.about h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 22px; }
.about p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); max-width: 42em; }
.about .note { font-size: 11.5px; color: var(--muted-2); }
.about-side { background: rgba(255,255,255,0.55); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.about-side div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); font-size: 12px; }
.about-side div:last-child { border-bottom: 0; }
.about-side b { color: var(--ink); font-weight: 600; }
.about-side span { color: var(--muted); font-family: var(--mono); font-size: 10.5px; text-align: right; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 10px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-left { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.footer-left .mark { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--ink); color: #f7f4ee; font-family: var(--serif); font-size: 11px; }
.footer-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }
.footer-right a { color: var(--muted); }
.footer-right a:hover { color: var(--accent); }
.footer-right .sep { color: #cfc6b8; }

/* ---------- article page ---------- */
.article-top { padding: 22px 0 0; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.article-head { max-width: 830px; margin: 0 auto; padding: 38px 24px 24px; }
.article-head .tag-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.article-head h1 { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(30px, 4.4vw, 46px); line-height: 1.28; letter-spacing: .3px; color: #121a24; }
.article-head .dek { margin: 0; font-size: 14px; color: var(--muted); max-width: 44em; }
.article-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.article-cover { max-width: 980px; margin: 0 auto 8px; padding: 0 24px; }
.article-cover img { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.article-body { max-width: 830px; margin: 0 auto; padding: 18px 24px 60px; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  font-family: var(--serif); color: #121a24; line-height: 1.35; scroll-margin-top: 86px;
}
.article-body h1 { font-size: 28px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.article-body h2 { font-size: 22px; margin: 32px 0 12px; }
.article-body h3 { font-size: 18px; margin: 26px 0 10px; }
.article-body h4 { font-size: 16px; margin: 22px 0 8px; }
.article-body p { margin: 0 0 14px; font-size: 15px; color: var(--ink-2); }
.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 1.5em; color: var(--ink-2); }
.article-body li { margin-bottom: 5px; font-size: 14.5px; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(45,91,209,0.35); }
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body code {
  font-family: var(--mono); font-size: 12.5px; background: #f1ede5; border: 1px solid #e8e1d5;
  padding: 1px 5px; border-radius: 4px; color: #3d3326;
}
.article-body pre {
  background: #1e2632; color: #e8edf5; border-radius: 10px; padding: 16px 18px;
  overflow-x: auto; margin: 18px 0; font-size: 12.5px; line-height: 1.7;
}
.article-body pre code { background: transparent; border: 0; color: inherit; padding: 0; font-size: inherit; }
.article-body blockquote { margin: 18px 0; padding: 10px 18px; border-left: 3px solid var(--accent); background: rgba(45,91,209,0.045); color: var(--ink-2); }
.article-body img { border-radius: 10px; border: 1px solid var(--line); margin: 18px auto; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.article-body th { background: var(--paper-2); }
.article-body .math-display { overflow-x: auto; margin: 18px 0; font-size: 1.05em; }
.article-body .katex-display { margin: 18px 0; overflow-x: auto; overflow-y: hidden; }
.article-body .toc, .article-body .toc ul { font-size: 13px; }
.article-body .toc { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 20px 0; }
.article-body .toc ul { margin: 6px 0; padding-left: 1.2em; }
.article-end { max-width: 830px; margin: 0 auto; padding: 0 24px 60px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 18px; }
.article-end a { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.history-note { max-width: 830px; margin: 0 auto 0; padding: 0 24px 30px; font-size: 11.5px; color: var(--muted-2); }

/* ---------- history index ---------- */
.history-hero { padding: 44px 0 26px; }
.history-hero h1 { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); line-height: 1.18; }
.history-hero p { margin: 0; max-width: 44em; color: var(--muted); font-size: 14px; }
.hgroup { margin-top: 26px; }
.hgroup-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.hgroup-head h2 { margin: 0; font-family: var(--serif); font-size: 22px; }
.hgroup-head span { font-family: var(--mono); font-size: 10px; color: var(--muted-2); letter-spacing: 1px; }
.hlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.hitem { display: flex; align-items: baseline; gap: 10px; padding: 8px 2px; border-bottom: 1px dashed var(--line-2); min-width: 0; }
.hitem .hdate { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); flex: 0 0 auto; }
.hitem a { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.hitem a:hover { color: var(--accent); }
.hitem .harrow { margin-left: auto; color: var(--muted-2); font-size: 11px; }

/* ---------- 404 ---------- */
.nf { max-width: 760px; margin: 0 auto; padding: 80px 24px 100px; }
.nf .code { font-family: var(--serif); font-size: 80px; line-height: 1; color: var(--line); }
.nf h1 { margin: 8px 0 10px; font-family: var(--serif); font-size: 32px; }
.nf p { color: var(--muted); margin: 0 0 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { max-width: 560px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-card { grid-template-columns: 1fr; }
  .history-samples { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 16px; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar-inner { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .brand-text b { font-size: 15px; }
  .brand-text i { display: none; }
  .nav { order: 3; flex: 1 1 100%; margin-left: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 2px; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; padding: 5px 10px; font-size: 13px; }
  .top-meta { display: none; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(34px, 9vw, 48px); }
  .hero-lead { font-size: 15px; }
  .section { padding: 34px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .article-card { flex-direction: column; }
  .article-card .thumb { flex: 0 0 auto; aspect-ratio: 16/9; min-height: 0; }
  .article-card h3 { font-size: 18px; }
  .hero-stats { gap: 16px; }
  .history-card { padding: 18px; }
  .hlist { grid-template-columns: 1fr; }
  .article-head { padding: 26px 16px 18px; }
  .article-body { padding: 14px 16px 44px; }
  .article-cover { padding: 0 16px; }
  .article-end { padding: 16px 16px 40px; }
  .footer-inner { padding: 18px 16px; }
  .section-title h2 { font-size: 23px; }
  .featured { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn, .featured, .card .thumb img { transition: none; }
  .card:hover, .featured:hover { transform: none; }
}

/* ============================================================
   papers, project grid, and revised homepage bits
   ============================================================ */
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* project cards in a five-column row */
.grid-5 .card h3 { font-size: 15px; }
.grid-5 .card p { font-size: 11.5px; }
.grid-5 .card .body { padding: 12px 13px 13px; }

/* paper cards */
.paper-card .thumb { aspect-ratio: 16 / 8.5; background: #eef1f5; }
.paper-card .thumb img { object-fit: contain; background: #f8fafc; padding: 8px; }
.paper-card h3 { font-size: 16px; }
.paper-card p { font-size: 12px; }
.paper-card .paper-venue {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .5px;
  color: var(--muted-2);
}
.status-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--amber); margin-right: 5px; vertical-align: 1px;
}
.old-article-head {
  display: flex; align-items: center; gap: 12px; margin: 30px 0 13px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.2px; color: var(--muted-2);
}
.old-article-head::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* paper page */
.paper-head { max-width: 900px; }
.paper-head h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.32; }
.paper-subtitle {
  margin: 0 0 14px; font-size: 15px; line-height: 1.7; color: var(--ink-2);
  font-family: var(--serif);
}
.paper-authors { margin: 12px 0 6px; font-size: 13px; line-height: 1.9; color: var(--ink-2); }
.paper-authors sup { font-size: 9px; color: var(--accent); margin-left: 1px; }
.paper-authors .corr { color: var(--accent); font-weight: 700; margin-left: 1px; }
.paper-affiliations {
  margin: 8px 0 12px; padding-left: 1.3em; color: var(--muted);
  font-size: 11.5px; line-height: 1.7;
}
.paper-meta-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; color: var(--muted-2);
}
.paper-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.paper-body { max-width: 900px; }
.paper-body p { font-size: 14.5px; line-height: 1.85; }
.paper-body li { font-size: 14px; line-height: 1.8; }
.abstract-box {
  margin: 8px 0 20px; padding: 20px 22px;
  background: var(--paper-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
}
.abstract-title {
  margin: 0 0 10px !important; padding: 0 !important; border: 0 !important;
  font-family: var(--mono) !important; font-size: 10px !important;
  letter-spacing: 1.6px !important; color: var(--accent) !important;
}
.abstract-text { margin: 0 !important; font-size: 14px !important; line-height: 1.9 !important; color: var(--ink-2); }
.paper-keywords { margin: 12px 0 0 !important; font-size: 11.5px !important; color: var(--muted); }
.paper-keywords b { color: var(--ink-2); font-weight: 600; }
.paper-funding { margin: 8px 0 0 !important; font-size: 11px !important; color: var(--muted-2); }
.keypoints {
  margin: 16px 0 20px; padding: 15px 18px; border: 1px dashed var(--line);
  border-radius: 12px; background: #fffdf9;
}
.keypoints-title { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.4px; color: var(--amber); margin-bottom: 7px; }
.keypoints ul { margin: 0; padding-left: 1.2em; }
.keypoints li { font-size: 12.5px; line-height: 1.75; color: var(--ink-2); margin-bottom: 4px; }
.plain-summary {
  margin: 16px 0; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,0.6); padding: 10px 15px;
}
.plain-summary summary {
  cursor: pointer; font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  color: var(--muted);
}
.plain-summary p { margin: 10px 0 2px !important; font-size: 12.5px !important; line-height: 1.8 !important; color: var(--muted); }

.paper-toc {
  margin: 22px 0 26px; padding: 16px 20px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px;
}
.toc-title { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.5px; color: var(--accent); margin-bottom: 9px; }
.paper-toc ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 26px; }
.paper-toc li { break-inside: avoid; margin: 3px 0; }
.paper-toc a { font-size: 12px; color: var(--ink-2); text-decoration: none; }
.paper-toc a:hover { color: var(--accent); }
.paper-toc .toc-l1 { margin-top: 7px; }
.paper-toc .toc-l1 a { font-family: var(--serif); font-size: 13px; color: var(--ink); }
.paper-toc .toc-l3 { padding-left: 1em; }
.paper-toc .toc-l3 a { font-size: 11.5px; color: var(--muted); }

.paper-body figure, .paper-figure {
  margin: 24px 0; padding: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 1px 2px rgba(27,36,48,0.03);
}
.paper-fig-img {
  display: block; width: 100% !important; height: auto !important;
  margin: 0 !important; border: 0 !important; border-radius: 0 !important;
  background: #fff; padding: 8px;
}
.paper-body figcaption {
  padding: 10px 15px 13px; border-top: 1px solid var(--line-2);
  font-size: 11.5px; line-height: 1.75; color: var(--muted);
}
.paper-body .fig-number { color: var(--ink); font-weight: 600; font-family: var(--mono); font-size: 10px; }
.paper-body .math-display { font-size: 1.02em; }
.paper-body h1 { font-size: 26px; }
.paper-body h2 { font-size: 20px; }
.paper-body h3 { font-size: 16.5px; }
.paper-body table { font-size: 11.5px; }

@media (max-width: 1080px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid-5, .grid-3 { grid-template-columns: 1fr; }
  .paper-toc ul { columns: 1; }
  .abstract-box { padding: 16px; }
  .paper-head h1 { font-size: 26px; }
}

/* ============================================================
   paper layout: left TOC + bilingual toggle
   ============================================================ */
[hidden] { display: none !important; }

.paper-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 24px 30px;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}
.paper-side {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 4px 2px 2px;
  scrollbar-width: thin;
}
.paper-side .paper-toc {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.paper-side .toc-title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 10px;
}
.paper-side .paper-toc ul {
  columns: 1;
  column-gap: 0;
  margin: 0;
  padding: 0;
}
.paper-side .paper-toc li {
  margin: 0;
  border-left: 1px solid var(--line);
  padding: 2px 0 2px 10px;
}
.paper-side .paper-toc li.toc-l1 { margin-top: 7px; }
.paper-side .paper-toc a {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
  display: block;
  text-decoration: none;
}
.paper-side .paper-toc a:hover { color: var(--accent); }
.paper-side .toc-l1 a { font-family: var(--serif); font-size: 12.5px; color: var(--ink-2); }
.paper-side .toc-l3 { padding-left: 18px !important; }
.paper-side .toc-l3 a { font-size: 10.8px; color: var(--muted-2); }
.paper-main { min-width: 0; }
.paper-main .article-body {
  max-width: none;
  margin: 0;
  padding: 0;
}
.paper-main .paper-body h1:first-child { margin-top: 0; }
.paper-side-meta {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted-2);
}
.paper-side-meta span { display: block; }
.paper-side-meta b { display: block; margin-top: 3px; font-weight: 500; color: var(--muted); font-size: 10px; }

.lang-toggle { cursor: pointer; }
.ai-hint {
  font-size: 10px;
  color: var(--muted-2);
  align-self: center;
  margin-left: 2px;
}
.ai-translation-note {
  margin: 0 0 16px !important;
  padding: 9px 13px;
  border: 1px dashed #d8c9a8;
  border-radius: 8px;
  background: #fdfaf1;
  font-size: 11.5px !important;
  color: var(--muted) !important;
}
.paper-subtitle .lang-zh { font-family: var(--sans); font-size: 14px; color: var(--muted); }

@media (max-width: 900px) {
  .paper-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .paper-side {
    position: static;
    max-height: none;
    order: -1;
    padding: 12px 16px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .paper-side .paper-toc ul { columns: 2; column-gap: 20px; }
  .paper-side-meta { display: none; }
}
@media (max-width: 760px) {
  .paper-layout { padding: 4px 16px 24px; }
  .paper-side .paper-toc ul { columns: 1; }
  .paper-head { padding-left: 16px; padding-right: 16px; }
  .paper-authors, .paper-affiliations, .paper-meta-line { font-size: 11px; }
  .paper-actions .ai-hint { flex-basis: 100%; margin-left: 0; }
}

/* preprint badge / link */
.tag-preprint {
  color: #8a4b00;
  border-color: #e7c89c;
  background: #fff6e6;
}
.btn-preprint {
  border-color: #e7c89c;
  background: #fffaf0;
  color: #7a4a00;
}
.btn-preprint:hover { border-color: #d6ae6e; color: #5e3500; }
.preprint-line {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 9px 12px;
  background: #fffaf0;
  border: 1px solid #efe0c8;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.preprint-line a { color: #7a4a00; text-decoration: none; }
.preprint-line a:hover { color: var(--accent); }

/* homepage bottom technical support */
.tech-support {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line-2);
}
.footer-pet-link { flex: 0 0 auto; display: block; line-height: 0; }
.footer-pet {
  width: 92px;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(27,36,48,0.08));
  transition: transform .2s;
}
.footer-pet-link:hover .footer-pet { transform: translateY(-2px); }
.tech-support-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
}
.tech-support-text .tech-label { letter-spacing: 1px; color: var(--muted-2); }
.tech-support-text b { color: var(--ink-2); font-weight: 500; letter-spacing: .2px; }
.tech-support-text .pet-credit {
  font-size: 9px;
  color: #b9b0a2;
  text-decoration: none;
  border: 1px solid var(--line-2);
  padding: 1px 6px;
  border-radius: 999px;
}
.tech-support-text .pet-credit:hover { color: var(--accent); }
@media (max-width: 760px) {
  .tech-support { justify-content: center; padding: 12px 16px 16px; }
  .footer-pet { width: 72px; }
  .tech-support-text { justify-content: center; text-align: center; font-size: 10px; }
}

/* new combined footer with large mascot (homepage only) */
.footer-tech { margin-top: 10px; }
.footer-tech-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}
.footer-pet-large {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 16px rgba(27,36,48,0.10));
  transition: transform .22s;
}
.footer-pet-link:hover .footer-pet-large { transform: translateY(-3px); }
.footer-tech-copy { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.footer-tech-line1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 16px; color: var(--ink); }
.footer-tech-line1 .tech-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.5px; color: var(--muted-2); }
.footer-tech-line1 b { font-weight: 500; letter-spacing: .2px; }
.footer-tech-line2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.footer-tech-line2 a { color: var(--muted); text-decoration: none; }
.footer-tech-line2 a:hover { color: var(--accent); }
.footer-tech-line2 .sep { color: #cfc6b8; }
@media (max-width: 760px) {
  .footer-tech-inner { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 16px; }
  .footer-pet-large { width: 130px; height: 130px; }
  .footer-tech-copy { align-items: center; }
  .footer-tech-line1 { justify-content: center; font-size: 13px; }
  .footer-tech-line2 { justify-content: center; font-size: 9.5px; }
}
