/* ==========================================================================
   cvresearch.work
   简洁的学术站点样式表
   ========================================================================== */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #f1f3f7;
  --border: #e2e6ee;
  --border-strong: #cdd4e0;
  --text: #1a2233;
  --text-soft: #5a6580;
  --text-mute: #8b94a8;
  --accent: #2f5bd7;
  --accent-soft: #eaf0ff;
  --accent-dark: #1f3f9e;
  --accent-contrast: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 60, .05);
  --shadow: 0 2px 10px rgba(20, 32, 60, .07);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --surface: #191d27;
    --surface-alt: #1f2430;
    --border: #2a3040;
    --border-strong: #3a4256;
    --text: #e6e9f0;
    --text-soft: #a8b1c4;
    --text-mute: #78829a;
    --accent: #7f9ffb;
    --accent-soft: #1e2740;
    --accent-dark: #a8bdff;
    --accent-contrast: #10141f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- 顶栏 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #6d8ef7);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.5px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 650; font-size: 15.5px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--text-mute); font-family: var(--mono); }

.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 14.5px;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.nav-toggle {
  display: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 15px;
  cursor: pointer;
}

/* ---------- 首页 Hero ---------- */

.hero {
  padding: 62px 0 46px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 340px at 12% -10%, var(--accent-soft), transparent 70%),
    var(--surface);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4.4vw, 38px);
  line-height: 1.28;
  letter-spacing: -.4px;
}

.hero .latin {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: .3px;
  margin-bottom: 20px;
}

.hero p.lead {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 720px;
  margin: 0 0 14px;
}

.hero p { max-width: 760px; color: var(--text-soft); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.tag {
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

/* 可点击的方向标签：跳转到对应的论文筛选结果 */
a.tag-link {
  text-decoration: none;
  transition: .14s ease;
}
a.tag-link::after {
  content: " →";
  opacity: .45;
  font-size: 12px;
}
a.tag-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- 通用区块 ---------- */

.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head { margin-bottom: 26px; }

.section-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -.2px;
}

.section-head p { margin: 0; color: var(--text-soft); max-width: 760px; }

.page-head {
  padding: 44px 0 30px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.page-head h1 { margin: 0 0 8px; font-size: clamp(23px, 3.4vw, 29px); letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--text-soft); max-width: 780px; }

/* ---------- 卡片网格 ---------- */

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: -.1px; }
.card p { margin: 0; color: var(--text-soft); font-size: 14.5px; }

.card .en {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-mute);
  margin-bottom: 8px;
  letter-spacing: .2px;
}

.card-link { display: block; color: inherit; transition: .16s ease; }
.card-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.count-badge {
  float: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 9px;
  margin-top: -2px;
}

/* 统计数字 */
.stat { text-align: center; padding: 18px 10px; }
.stat .num {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  line-height: 1.2;
}
.stat .lbl { font-size: 13px; color: var(--text-soft); }

/* ---------- 论文列表 ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toolbar input[type="search"],
.toolbar select {
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  outline: none;
}
.toolbar input[type="search"] { flex: 1 1 240px; min-width: 180px; }
.toolbar input[type="search"]:focus,
.toolbar select:focus { border-color: var(--accent); }

.toolbar .result-count {
  font-size: 13.5px;
  color: var(--text-mute);
  font-family: var(--mono);
  margin-left: auto;
  white-space: nowrap;
}

.btn-reset {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 14px;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
}
.btn-reset:hover { background: var(--surface-alt); color: var(--text); }

.paper-list { list-style: none; margin: 0; padding: 0; }

.paper {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.paper:hover { border-color: var(--border-strong); }

.paper h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -.05px;
}

.paper .authors {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.6;
}

.paper .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-size: 12.5px;
}

.chip {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.chip.venue { background: var(--accent-soft); border-color: transparent; color: var(--accent-dark); font-weight: 600; }
.chip.year { color: var(--text); }

.paper .links { margin-left: auto; display: flex; gap: 12px; font-size: 13px; }
.paper .links a { white-space: nowrap; }

.topic-group { margin-bottom: 40px; }
.topic-group > h2 {
  font-size: 18px;
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.topic-group > h2 .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
  font-weight: 400;
}
.topic-group > p.desc { color: var(--text-soft); font-size: 14.5px; margin: 12px 0 18px; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-mute);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- 分页 ---------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}
.pager[hidden] { display: none; }

.pager button {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .14s ease;
}
.pager button:hover:not(:disabled):not([aria-current="page"]) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.pager button[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  cursor: default;
}
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.pager .ellipsis {
  color: var(--text-mute);
  padding: 0 4px;
  user-select: none;
}

.pager .pager-info {
  width: 100%;
  margin-top: 6px;
  text-align: center;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-mute);
}

@media (max-width: 720px) {
  .pager button { min-width: 34px; height: 34px; padding: 0 9px; font-size: 13.5px; }
}

/* 折叠更多 */
.show-more {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--accent);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.show-more:hover { background: var(--surface-alt); }

/* ---------- 正文排版（关于页等） ---------- */

.prose { max-width: 780px; }
.prose h2 { font-size: 19px; margin: 34px 0 10px; letter-spacing: -.2px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 16px; margin: 24px 0 8px; }
.prose p { color: var(--text-soft); margin: 0 0 14px; }
.prose ul, .prose ol { color: var(--text-soft); padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.note {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14.5px;
  color: var(--text-soft);
  margin: 0 0 18px;
}
.note strong { color: var(--text); }

/* dl 定义列表 */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 14.5px; }
.kv dt { color: var(--text-mute); }
.kv dd { margin: 0; color: var(--text-soft); }

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 34px 0 30px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 26px;
}

.site-footer h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text);
  letter-spacing: .3px;
  text-transform: uppercase;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--accent); }

.footer-bottom {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-size: 13px;
  color: var(--text-mute);
}
.footer-bottom .sep { color: var(--border-strong); }

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
  body { font-size: 15px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 18px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-header .wrap { position: relative; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero { padding: 42px 0 34px; }
  .section { padding: 36px 0; }
  .paper .links { margin-left: 0; width: 100%; margin-top: 8px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
}

/* 打印 */
@media print {
  .site-header, .site-footer, .toolbar, .show-more { display: none; }
  body { background: #fff; }
}
