/* ===== MEM 论文知识库 - 全局样式 ===== */
/* 复旦学术风 - Fudan Academic Theme */

:root {
  /* 背景 - 温润学术白 */
  --bg-primary: #fbfcfe;
  --bg-secondary: #f5f8fc;
  --bg-tertiary: #eef2f8;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f8fc;
  
  /* 文字 */
  --text-primary: #1a2b49;
  --text-secondary: #4a5a75;
  --text-tertiary: #6b7a90;
  --text-muted: #98a3b5;
  
  /* 主色调 - 复旦蓝 */
  --accent-primary: #003d79;
  --accent-hover: #0056b3;
  --accent-light: #c8ddf5;
  --accent-lighter: #eaf1fa;
  --accent-deep: #002855;
  
  /* 点缀色 - 复旦金 */
  --accent-gold: #b8860b;
  --accent-gold-light: #d4a84b;
  --accent-gold-lighter: #f5ebd6;
  
  /* 边框 */
  --border-color: #dbe4ee;
  --border-light: #eef2f8;
  --border-hover: #b8cde0;
  
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 61, 121, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 61, 121, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 61, 121, 0.1);
  
  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  /* 字体 */
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Monaco, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

::selection {
  background: var(--accent-gold-lighter);
  color: var(--accent-gold);
}

/* 复旦校徽风格装饰 */
body::after {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle at top right, 
    rgba(0, 61, 121, 0.04) 0%, 
    transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== 顶部导航 ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.menu-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--accent-gold-light);
  font-weight: 700;
  border: 2px solid var(--accent-gold);
  font-family: var(--font-serif);
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: var(--font-serif);
  color: var(--accent-primary);
}

.navbar-center {
  flex: 1;
  max-width: 360px;
  margin: 0 32px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 7px 14px 7px 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  transition: all 0.15s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-lighter);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 300;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* ===== 主容器 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Hero 区域 ===== */
.hero {
  padding: 96px 0 64px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  font-weight: 500;
  margin-bottom: 24px;
  text-transform: uppercase;
  font-family: var(--font-serif);
  position: relative;
  padding: 0 40px;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30px;
  height: 1px;
  background: var(--accent-gold);
  opacity: 0.5;
}

.hero-eyebrow::before {
  left: 0;
}

.hero-eyebrow::after {
  right: 0;
}

.hero-title {
  font-size: 50px;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-family: var(--font-serif);
  color: var(--accent-deep);
}

.hero-title .accent {
  color: var(--accent-primary);
  position: relative;
}

.hero-title .accent::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gold);
  opacity: 0.4;
  border-radius: 2px;
}

.hero-version {
  display: inline-block;
  background: var(--accent-primary);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.hero-subtitle {
  font-size: 19px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-weight: 500;
  font-family: var(--font-serif);
}

.hero-description {
  font-size: 15px;
  color: var(--text-tertiary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ===== 数据统计 ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 64px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 48px 0;
}

.stat-item {
  text-align: center;
  border-right: 1px solid var(--border-color);
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-size: 46px;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 10px;
  font-family: var(--font-serif);
}

.stat-label {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* ===== 卡片导航 ===== */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 56px 0;
}

.nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: block;
}

.nav-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.nav-card-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
  transition: all 0.2s;
}

.nav-card:hover .nav-card-icon {
  background: var(--accent-lighter);
}

.nav-card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.nav-card-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* ===== 侧边栏布局（论文详情页） ===== */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 40px 0;
}

.sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  padding: 0 10px;
  font-family: var(--font-serif);
}

.sidebar-links {
  list-style: none;
}

.sidebar-links li a {
  display: block;
  padding: 7px 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-weight: 450;
}

.sidebar-links li a:hover,
.sidebar-links li a.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ===== 内容区 ===== */
.content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 56px;
  border: 1px solid var(--border-color);
}

.content h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.4;
  font-family: var(--font-serif);
  color: var(--accent-deep);
}

.content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 18px;
  color: var(--accent-primary);
  padding-top: 8px;
  font-family: var(--font-serif);
  border-bottom: 2px solid var(--accent-gold-lighter);
  padding-bottom: 8px;
}

.content h3 {
  font-size: 17px;
  margin: 28px 0 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.content p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 15px;
}

.content ul, .content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.content li {
  margin-bottom: 8px;
  line-height: 1.7;
  font-size: 15px;
}

.content a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-light);
  transition: all 0.15s;
}

.content a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-primary);
}

.content blockquote {
  border-left: 3px solid var(--accent-gold);
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--accent-gold-lighter);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.content code {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent-hover);
}

.content pre {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border-color);
  font-size: 13px;
  line-height: 1.6;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.content th, .content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.content th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}

.content tr:hover td {
  background: var(--bg-secondary);
}

/* 论文元信息 */
.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.meta-tag .label {
  color: var(--accent-primary);
  font-weight: 600;
}

/* ===== 列表页 ===== */
.list-header {
  margin-bottom: 36px;
  padding-top: 16px;
}

.list-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.list-subtitle {
  color: var(--text-tertiary);
  font-size: 15px;
}

.year-group {
  margin-bottom: 44px;
}

.year-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--accent-gold);
  display: inline-block;
  font-family: var(--font-serif);
}

.paper-list {
  list-style: none;
}

.paper-item {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  margin-bottom: 2px;
}

.paper-item:hover {
  background: var(--bg-secondary);
}

.paper-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
}

.paper-item-title {
  font-size: 14px;
  font-weight: 450;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.paper-item:hover .paper-item-title {
  color: var(--text-primary);
}

.paper-item-author {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 20px;
  font-weight: 450;
}

/* ===== 页脚 ===== */
.footer {
  margin-top: 64px;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

.footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .nav-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }
  
  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 28px;
    padding-top: 28px;
  }
  
  .stat-item:nth-child(1),
  .stat-item:nth-child(2) {
    padding-top: 0;
  }
  
  .stat-item:nth-last-child(-n+2) {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--border-color);
  }
  
  .layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: none;
  }
  
  .hero-title {
    font-size: 36px;
  }
  
  .navbar-center {
    display: none;
  }
  
  .content {
    padding: 32px;
  }
  
  .menu-btn {
    display: block;
  }
}

@media (max-width: 600px) {
  .nav-cards {
    grid-template-columns: 1fr;
  }
  
  .stats {
    grid-template-columns: 1fr;
  }
  
  .stat-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    padding-top: 24px;
    border-right: none !important;
  }
  
  .stat-item:first-child {
    padding-top: 0;
  }
  
  .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .hero-title {
    font-size: 30px;
  }
  
  .stat-number {
    font-size: 36px;
  }
  
  .list-title {
    font-size: 26px;
  }
  
  .content {
    padding: 24px;
  }
  
  .hero {
    padding: 56px 0 40px;
  }
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: #d4d4d4;
}
