/* CVPR 2026 论文索引 — 静态页面样式
   主题:浅色(默认)/深色,响应式侧边栏布局。 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  --radius: 10px;
  --topbar-h: 61px;
  --footer-h: 44px;
  --grade-oral: #d97706;
  --grade-highlight: #2563eb;
  --grade-poster: #059669;
  --grade-findings: #7c3aed;
  --grade-other: #6b7280;
}

[data-theme="dark"] {
  --bg: #15171c;
  --surface: #1e2128;
  --surface-2: #272b34;
  --border: #343a45;
  --text: #e6e8ec;
  --text-muted: #9aa0ac;
  --accent: #818cf8;
  --accent-soft: #2a2f3d;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-bottom: var(--footer-h);
}

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

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
  letter-spacing: .2px;
}
.brand-sub { font-weight: 400; color: var(--text-muted); font-size: 16px; }
.count-pill {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.icon { padding: 7px 10px; }
.btn.block { width: 100%; justify-content: center; }
.btn.danger { color: #dc2626; border-color: transparent; background: transparent; }
.btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
[data-theme="dark"] .btn.danger:hover { background: #3a1d1d; }
.link-btn {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 12px; padding: 0;
}

/* 布局 */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--topbar-h) - var(--footer-h));
}

/* 侧边栏 */
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h) - var(--footer-h));
  overflow-y: auto;
}
.sidebar-inner {
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.favorites-block-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.filter-block { margin-bottom: 18px; }
.filter-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.filter-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.filter-head .filter-label { margin-bottom: 0; }
.muted { color: var(--text-muted); font-weight: 400; }

input[type="search"], select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
input[type="search"]:focus, select:focus { border-color: var(--accent); }

.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.fav-filter-row { margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}
.chip:hover { border-color: var(--accent); }
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }

/* 分类列表 */
.category-list {
  max-height: 420px;
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: var(--surface-2);
}
.cat-group { margin-bottom: 2px; }
.cat-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 6px 6px 2px;
}
.cat-item {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background .1s;
}
.cat-item:hover { background: var(--accent-soft); }
.cat-item input { accent-color: var(--accent); cursor: pointer; }
.cat-item .cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item .cat-count { color: var(--text-muted); font-size: 11px; }
.cat-item.checked { color: var(--accent); font-weight: 600; }

/* 主内容 */
.main { padding: 20px 24px 40px; min-width: 0; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.result-count { font-size: 14px; }
.result-count b { font-size: 16px; }
.active-filters { margin-left: 10px; font-size: 12px; color: var(--text-muted); }
.state-msg { padding: 60px 0; text-align: center; color: var(--text-muted); }

/* 论文卡片 */
.results { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.card:hover { border-color: var(--accent); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.card-head-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}
.badge.grade-Oral { background: rgba(217,119,6,.14); color: var(--grade-oral); }
.badge.grade-Highlight { background: rgba(37,99,235,.14); color: var(--grade-highlight); }
.badge.grade-Poster { background: rgba(5,150,105,.14); color: var(--grade-poster); }
.badge.grade-Findings { background: rgba(124,58,237,.14); color: var(--grade-findings); }
.badge.grade-Other { background: rgba(107,114,128,.14); color: var(--grade-other); }
.badge.cat { background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.badge.cat:hover { text-decoration: none; opacity: .8; }
.resource-links { display: flex; gap: 4px; flex-shrink: 0; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
button.res-link.favorite-btn {
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
}
button.res-link.favorite-btn.active {
  border-color: #f59e0b;
  color: #f59e0b;
}
button.res-link.favorite-btn:hover {
  border-color: #f59e0b;
  color: #f59e0b;
}
.fav-actions { display: grid; gap: 8px; margin-top: 10px; }
.fav-hint {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--footer-h) + 16px);
  transform: translateX(-50%) translateY(12px);
  z-index: 120;
  max-width: min(92vw, 420px);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 版本更新提示 */
.update-notice {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 20px;
  z-index: 110;
  width: min(92vw, 380px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.update-notice.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.update-notice-title {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.update-notice-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.update-notice-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-start;
}
.update-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
}
.update-modal.show { display: block; }
.update-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
}
.update-modal-panel {
  position: relative;
  width: min(92vw, 520px);
  max-height: min(80vh, 640px);
  margin: 8vh auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.update-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.update-modal-header h2 {
  margin: 0;
  font-size: 18px;
}
.update-modal-body {
  padding: 8px 18px 18px;
  overflow-y: auto;
}
.update-current {
  margin: 10px 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.changelog-entry {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.changelog-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.changelog-version {
  margin: 0 0 8px;
  font-size: 15px;
}
.changelog-date {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.changelog-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}
.changelog-list li + li { margin-top: 4px; }

@media (max-width: 900px) {
  .update-notice {
    left: 16px;
    right: 16px;
    width: auto;
  }
}
.res-link {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.res-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.card-title { margin: 2px 0 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-title-zh { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.card-authors { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag {
  font-size: 11px; color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 8px; border-radius: 5px; cursor: pointer;
  border: 1px solid transparent;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

.card-abstract {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.expand-btn {
  background: none; border: none; color: var(--accent);
  font-size: 12px; cursor: pointer; padding: 4px 0; margin-top: 8px;
}
.expand-btn:hover { text-decoration: underline; }
.abs-loading { color: var(--text-muted); font-style: italic; }

/* 分页 */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; margin-top: 28px; flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 13px; padding: 0 10px;
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: default; }
.page-ellipsis { padding: 0 4px; color: var(--text-muted); }

/* 浮动按钮(移动端打开侧栏) */
.fab {
  display: none;
  position: fixed;
  bottom: calc(var(--footer-h) + 16px);
  right: 20px;
  z-index: 90;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; background: var(--accent); color: #fff;
  font-size: 22px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* 页脚 — 固定在视口底部 */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, .06);
}
[data-theme="dark"] .footer {
  box-shadow: 0 -1px 3px rgba(0, 0, 0, .35);
}

/* 响应式 */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .fab { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    height: 100vh; width: 86%; max-width: 320px;
    z-index: 200; transform: translateX(-100%);
    transition: transform .25s; box-shadow: 2px 0 16px rgba(0,0,0,.2);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 16px; }
  .brand-sub { display: none; }
}

/* 遮罩(移动端) */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 150;
}
.overlay.show { display: block; }

/* 滚动条 */
.sidebar::-default { width: 8px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
