/* ===== 矢量集 VecSet ===== */
:root {
  --primary: #6d5efc;
  --primary-dark: #5748e0;
  --primary-soft: #efedff;
  --accent: #ff5e8a;
  --text: #1c1c28;
  --text-sub: #6b6b80;
  --bg: #f7f7fb;
  --card: #ffffff;
  --border: #e8e8f0;
  --shadow-sm: 0 2px 8px rgba(28, 28, 40, .06);
  --shadow-md: 0 8px 24px rgba(28, 28, 40, .1);
  --shadow-lg: 0 20px 48px rgba(28, 28, 40, .16);
  --radius: 14px;
  --radius-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

[hidden] { display: none !important; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { display: flex; }
.brand-name { font-size: 18px; font-weight: 700; }
.brand-name em { font-style: normal; color: var(--primary); font-size: 13px; margin-left: 4px; font-weight: 600; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 8px 14px; border-radius: 10px; text-decoration: none;
  color: var(--text-sub); font-size: 15px; transition: all .2s;
}
.main-nav a:hover { color: var(--text); background: var(--bg); }
.main-nav a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 200px 0 500px; background: #fff; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; }
.blob-1 { width: 480px; height: 480px; background: #c7c2ff; top: -160px; right: -80px; animation: float 10s ease-in-out infinite; }
.blob-2 { width: 380px; height: 380px; background: #ffd6e3; bottom: -180px; left: -60px; animation: float 12s ease-in-out infinite reverse; }
.blob-3 { width: 300px; height: 300px; background: #c4f0e8; top: 30%; left: 40%; animation: float 14s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.05); }
}

.hero-inner { position: relative; text-align: center; width: 100%; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 600; margin-bottom: 24px;
}
.hero-title { font-size: 48px; line-height: 1.25; font-weight: 800; letter-spacing: -1px; margin-bottom: 36px; }
.grad-text {
  background: linear-gradient(120deg, #6d5efc, #ff5e8a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-search {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto; padding: 6px 6px 6px 18px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-md); color: var(--text-sub);
}
.hero-search:focus-within { border-color: var(--primary); }

/* 搜索建议下拉 */
.search-suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  margin: 0; padding: 6px; list-style: none; text-align: left;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(17, 12, 46, .14);
}
.search-suggest li {
  padding: 10px 14px; border-radius: 9px; cursor: pointer;
  font-size: 14px; color: var(--text);
}
.search-suggest li:hover, .search-suggest li.active { background: #f4f2ff; color: var(--primary); }

/* 零结果时的「你是不是想找」 */
.suggest-line { margin: 10px 0 0; font-size: 14px; color: var(--text-sub); }
.suggest-word {
  border: none; background: none; cursor: pointer; padding: 0 2px;
  color: var(--primary); font-size: 14px; font-weight: 600; text-decoration: underline;
}
.hero-search input { flex: 1; border: none; outline: none; font-size: 15px; padding: 8px 0; }
.hero-search button {
  padding: 12px 26px; border-radius: 12px; font-size: 15px; font-weight: 600;
  color: #fff; background: linear-gradient(120deg, #6d5efc, #8a7bff);
  transition: transform .2s, box-shadow .2s;
}
.hero-search button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(109, 94, 252, .4); }

.hero-hot { margin-top: 20px; font-size: 14px; color: var(--text-sub); }
.hot-tag {
  margin-left: 8px; padding: 4px 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-sub); font-size: 13px;
  transition: all .2s;
}
.hot-tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.hero-stats { margin: -16px 0 28px; font-size: 15px; color: var(--text-sub); }

/* ===== 首页搜索结果 ===== */
.home-results { padding: 64px 24px 88px; }
.home-results-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.home-results-head h2 { font-size: 22px; }
.home-clear {
  margin-left: auto; color: var(--primary);
  font-size: 14px; font-weight: 600;
}
.home-clear:hover { text-decoration: underline; }

/* ===== 批次页（独立视图）===== */
#categories { padding-bottom: 72px; min-height: 62vh; }
.section-title { font-size: 22px; padding-top: 48px; }
.cat-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding: 20px 0 8px;
}
.cat-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 24px; border-radius: var(--radius-lg); background: var(--card);
  border: 1px solid var(--border); cursor: pointer; text-align: left;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.cat-card .cat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.cat-card h3 { font-size: 17px; }
.cat-card p { font-size: 13px; color: var(--text-sub); }

/* ===== 素材库 ===== */
.gallery-section { padding: 48px 24px 80px; min-height: 62vh; }

/* 批次详情面包屑 */
.gallery-crumb { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.crumb-back {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 600;
}
.crumb-back:hover { text-decoration: underline; }
.crumb-title { font-size: 22px; }
.crumb-count { font-size: 13px; color: var(--text-sub); }
.gallery-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 9px 20px; border-radius: 999px; font-size: 14px;
  background: #fff; border: 1px solid var(--border); color: var(--text-sub);
  transition: all .2s;
}
.tab:hover { color: var(--primary); border-color: var(--primary); }
.tab.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff; font-weight: 600;
}
.toolbar-right { display: flex; align-items: center; gap: 14px; }
.result-count { font-size: 16px; font-weight: 700; color: var(--text); }

/* 素材网格 */
.material-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
}
.mat-card {
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  animation: fadeUp .4s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.mat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.mat-thumb {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px; position: relative; overflow: hidden;
  background: #fff; border-bottom: 1px solid var(--border);
}
/* 纯图片卡片（首页搜索结果）：无标题栏，去掉分隔线 */
.mat-card-bare .mat-thumb { border-bottom: none; }

/* ===== 批次来源论文横幅 ===== */
.paper-banner {
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  padding: 0 0 10px; margin-bottom: 18px;
}
.paper-carousel { position: relative; display: flex; align-items: center; }
.paper-slides {
  width: 780px; max-width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden; border-radius: 8px;
}
.paper-track {
  display: flex; height: 100%;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
.paper-frame, .paper-shot {
  width: 100%; height: 100%; flex-shrink: 0;
  border: none; border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(30,27,75,.08);
}
.paper-shot { object-fit: contain; display: block; }
/* 裁掉浏览器内置 PDF 阅读器的顶部工具栏，只显示论文内容 */
.paper-frame-clip {
  width: 100%; height: 100%; flex-shrink: 0;
  position: relative; overflow: hidden;
  border-radius: 8px; background: #fff;
  box-shadow: 0 2px 12px rgba(30,27,75,.08);
}
.paper-frame-clip .paper-frame {
  position: absolute; left: 0; top: -48px;
  width: 100%; height: calc(100% + 48px);
  box-shadow: none; border-radius: 0;
}
.paper-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer; z-index: 2;
  background: rgba(255,255,255,.92); color: var(--primary);
  box-shadow: 0 2px 10px rgba(30,27,75,.18);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
}
.paper-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.paper-prev { left: -64px; }
.paper-next { right: -64px; }
.paper-dots { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
.paper-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: #d4d0e8; transition: background .25s, transform .25s;
}
.paper-dot.active { background: var(--primary); transform: scale(1.15); }
.paper-info { text-align: center; }
.paper-link {
  display: inline-block; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--primary); border-radius: 8px; padding: 7px 16px;
  text-decoration: none; transition: opacity .2s;
}
.paper-desc {
  width: 100%; margin: 26px 0 30px;
  font-size: 16px; line-height: 2; color: var(--text);
  text-align: justify;
}
.paper-link:hover { opacity: .88; }
.mat-thumb img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform .3s ease;
}
.mat-card:hover .mat-thumb img { transform: scale(1.06); }
.mat-thumb .thumb-overlay {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(28, 28, 40, .45); opacity: 0; transition: opacity .25s;
}
.mat-card:hover .thumb-overlay { opacity: 1; }
.thumb-overlay span {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: #fff; color: var(--text);
}
.mat-body { padding: 10px 12px 12px; }
.mat-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-meta { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; color: var(--text-sub); }
.mat-meta .cat-pill {
  padding: 2px 8px; border-radius: 6px; background: var(--primary-soft);
  color: var(--primary); font-weight: 600;
}
.mat-meta .spacer { flex: 1; }
.mat-meta svg { vertical-align: -2px; }

/* 空状态 */
.empty-state { text-align: center; padding: 80px 0; color: var(--text-sub); }
.empty-state p { margin: 16px 0 20px; font-size: 15px; }
.btn-reset {
  padding: 10px 24px; border-radius: 10px; background: var(--primary);
  color: #fff; font-size: 14px; font-weight: 600;
}

/* ===== 页脚 ===== */
.site-footer { background: #17172a; color: rgba(255, 255, 255, .65); }
.footer-inner {
  display: grid; grid-template-columns: 1.2fr 2fr; gap: 48px;
  padding: 56px 24px 40px;
}
.footer-brand .brand-name { color: #fff; font-size: 20px; }
.footer-brand p { margin-top: 12px; font-size: 13px; max-width: 320px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-cols h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-cols a {
  display: block; color: rgba(255, 255, 255, .6); text-decoration: none;
  font-size: 13px; margin-bottom: 10px; transition: color .2s;
}
.footer-cols a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; padding-top: 20px; padding-bottom: 20px;
  border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12px;
}

/* ===== 预览弹窗 ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 15, 30, .6); backdrop-filter: blur(4px); }
.modal-dialog {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  width: 760px; max-width: 100%; max-height: 88vh; overflow: hidden;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); color: var(--text-sub);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: var(--primary); color: #fff; }
.modal-preview {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: var(--bg);
  min-height: 380px;
}
.modal-preview img { max-width: 100%; max-height: 380px; object-fit: contain; }
.modal-info { padding: 32px 28px; overflow-y: auto; }
.modal-cat {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 600; margin-bottom: 10px;
}
.modal-info h3 { font-size: 22px; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--text-sub); margin-bottom: 16px; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.modal-tags span {
  padding: 3px 12px; border-radius: 999px; font-size: 12px;
  background: var(--bg); color: var(--text-sub);
}
.modal-meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-sub); margin-bottom: 16px; }
.modal-meta #modalAuthor { font-weight: 600; color: var(--text); }
.modal-actions { display: flex; gap: 12px; }
.btn-primary {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: 12px; font-size: 15px; font-weight: 600;
  background: var(--primary); color: #fff; transition: background .2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-radius: 12px; font-size: 15px; font-weight: 600;
  border: 1.5px solid var(--border); color: var(--text); transition: all .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost.liked { border-color: var(--accent); color: var(--accent); background: #fff0f4; }
.btn-ghost.liked svg path { fill: var(--accent); stroke: var(--accent); }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%);
  z-index: 300; padding: 12px 24px; border-radius: 12px;
  background: #1c1c28; color: #fff; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .material-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-cards { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 38px; }
}
@media (max-width: 768px) {
  .main-nav { display: none; }
  .material-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-dialog { grid-template-columns: 1fr; overflow-y: auto; }
  .modal-preview { min-height: 260px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 480px) {
  .hero { padding: 56px 0 48px; }
  .hero-title { font-size: 30px; }
  .material-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
