/* ============================================
   文档文库 - 全站样式
   软立体 / 新拟态风格
   主色: #1075FF (亮蓝), 基调: 淡蓝
   ============================================ */

/* ---------- 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #2c3e50;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 50%, #dff0fb 100%);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

img, svg { max-width: 100%; display: block; }

:root {
  --primary: #1075ff;
  --primary-light: #5ba3ff;
  --primary-dark: #0a5fd6;
  --primary-soft: #d6e8ff;
  --bg-1: #f0f7ff;
  --bg-2: #e8f4fd;
  --bg-3: #dff0fb;
  --card: #ebf4ff;
  --card-white: #ffffff;
  --accent-1: #b8dff5;
  --accent-2: #7ec8e3;
  --accent-3: #a8d8f0;
  --accent-4: #d6ecfa;
  --text: #2c3e50;
  --text-soft: #4a5568;
  --text-muted: #6b7a8a;
  --border: #cfe0f0;
  --shadow-dark: rgba(150, 185, 220, 0.45);
  --shadow-light: rgba(255, 255, 255, 0.95);
  --shadow-dark-soft: rgba(150, 185, 220, 0.3);
  --shadow-light-soft: rgba(255, 255, 255, 0.8);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-convex: 8px 8px 18px var(--shadow-dark),
    -8px -8px 18px var(--shadow-light);
  --shadow-convex-sm: 5px 5px 12px var(--shadow-dark),
    -5px -5px 12px var(--shadow-light);
  --shadow-concave: inset 4px 4px 10px var(--shadow-dark),
    inset -4px -4px 10px var(--shadow-light);
  --shadow-concave-sm: inset 2px 2px 5px var(--shadow-dark-soft),
    inset -2px -2px 5px var(--shadow-light-soft);
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-title p {
  color: var(--text-muted);
  font-size: 16px;
}

/* ---------- 占位空状态 ---------- */
.empty-placeholder {
  padding: 60px 40px;
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-concave-sm);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-text {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

.empty-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.7;
}

/* ---------- 顶部导航 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(235, 244, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 28px;
  margin: 0 auto;
  max-width: 1240px;
  border-radius: 18px;
  background: rgba(235, 244, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 8px 8px 20px rgba(150, 185, 220, 0.25),
    -8px -8px 20px rgba(255, 255, 255, 0.5);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 3px 3px 6px rgba(16, 117, 255, 0.35),
    -3px -3px 6px rgba(255, 255, 255, 0.7);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

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

.nav-links a {
  padding: 8px 18px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.5);
}

/* 搜索框 */
.search-box {
  position: relative;
  width: 280px;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 40px;
  border: none;
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  box-shadow: var(--shadow-concave-sm);
}

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

.search-input:focus {
  box-shadow: 0 0 0 2px var(--primary),
    inset 2px 2px 5px rgba(150, 185, 220, 0.3),
    inset -2px -2px 5px rgba(255, 255, 255, 0.9);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* 搜索下拉结果 */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 12px 12px 28px rgba(150, 185, 220, 0.3),
    -12px -12px 28px rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: none;
  z-index: 200;
}

.search-results.show { display: block; }

.search-item {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.search-item:hover,
.search-item.active {
  background: rgba(16, 117, 255, 0.1);
}

.search-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.search-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-id {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-left: 8px;
  flex-shrink: 0;
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.search-item-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.search-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Hero 区域 ---------- */
.hero {
  padding-top: 140px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero-text h1 span {
  color: var(--primary);
  position: relative;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 36px;
  max-width: 520px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 6px 6px 14px rgba(16, 117, 255, 0.35),
    -6px -6px 14px rgba(255, 255, 255, 0.7);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 18px rgba(16, 117, 255, 0.4),
    -8px -8px 18px rgba(255, 255, 255, 0.8);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 3px 3px 8px rgba(16, 117, 255, 0.3),
    -3px -3px 8px rgba(255, 255, 255, 0.6);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-convex-sm);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  color: var(--primary);
}

/* Hero 书架图示 */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.bookshelf-wrap {
  width: 100%;
  max-width: 480px;
  position: relative;
}

.bookshelf {
  width: 100%;
  height: auto;
  filter: drop-shadow(10px 10px 20px rgba(150, 185, 220, 0.4));
}

.floating-badge {
  position: absolute;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(235, 244, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 6px 6px 14px rgba(150, 185, 220, 0.35),
    -6px -6px 14px rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.badge-1 { top: 10%; left: -10px; }
.badge-2 { bottom: 15%; right: -10px; }

/* ---------- 分类区域 ---------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.category-card {
  padding: 30px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-convex);
  transition: var(--transition);
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 12px 12px 24px var(--shadow-dark),
    -12px -12px 24px var(--shadow-light);
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-concave-sm);
}

.category-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.category-meta {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
}

.category-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- 文档列表 ---------- */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.doc-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--card-white);
  box-shadow: var(--shadow-convex-sm);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-convex);
}

.doc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doc-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 8px;
  flex-shrink: 0;
}

.doc-tag {
  font-size: 12px;
  color: var(--accent-2);
  background: var(--accent-4);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 500;
}

.doc-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.doc-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---------- 统计区域 ---------- */
.stats-wrap {
  padding: 50px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow-concave);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.stat-item {
  text-align: center;
  padding: 30px 20px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-convex-sm);
}

.stat-number {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 500;
}

/* ---------- 关于区域 ---------- */
.about-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-visual {
  display: flex;
  justify-content: center;
}

.about-card {
  padding: 40px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-convex);
}

.about-card h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.about-card p {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.9;
  margin-bottom: 14px;
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.about-badge {
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow-concave-sm);
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}

/* ---------- 页脚 ---------- */
.footer {
  padding: 60px 0 30px;
  background: linear-gradient(to bottom, transparent, rgba(214, 232, 250, 0.6));
  margin-top: 40px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-top: 16px;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}

.footer-col a {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.footer-bottom {
  text-align: center;
  padding-top: 28px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-bottom strong {
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 搜索结果页专用 ---------- */
.search-page {
  padding-top: 140px;
  padding-bottom: 80px;
  min-height: 100vh;
}

.search-page-head {
  text-align: center;
  margin-bottom: 40px;
}

.search-page-head h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.search-page-head p {
  font-size: 16px;
  color: var(--text-muted);
}

.search-page-form {
  max-width: 640px;
  margin: 0 auto 50px;
  position: relative;
}

.search-page-input {
  width: 100%;
  height: 60px;
  padding: 0 150px 0 56px;
  border: none;
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  box-shadow: var(--shadow-concave);
}

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

.search-page-input:focus {
  box-shadow: 0 0 0 3px var(--primary-soft),
    inset 3px 3px 6px rgba(150, 185, 220, 0.3),
    inset -3px -3px 6px rgba(255, 255, 255, 0.9);
}

.search-page-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-page-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  padding: 0 28px;
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 4px 4px 10px rgba(16, 117, 255, 0.3),
    -4px -4px 10px rgba(255, 255, 255, 0.7);
}

.search-page-btn:hover {
  transform: translateY(-50%) translateY(-2px);
  box-shadow: 6px 6px 14px rgba(16, 117, 255, 0.4),
    -6px -6px 14px rgba(255, 255, 255, 0.8);
}

.search-page-btn:active {
  transform: translateY(-50%) translateY(1px);
}

.search-result-summary {
  max-width: 800px;
  margin: 0 auto 20px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 0 4px;
}

.search-result-summary strong {
  color: var(--primary);
  font-weight: 700;
}

.search-results-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-card {
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--card-white);
  box-shadow: var(--shadow-convex-sm);
  transition: var(--transition);
  cursor: pointer;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-convex);
}

.result-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.result-card-title mark {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}

.result-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.result-card-id {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.result-card-snippet {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
}

.result-card-snippet mark {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

.search-page-empty {
  max-width: 600px;
  margin: 60px auto;
  text-align: center;
  padding: 50px 30px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-concave-sm);
}

.search-page-empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.search-page-empty h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}

.search-page-empty p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .docs-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .about-wrap { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}

@media (max-width: 600px) {
  .section { padding: 50px 0; }
  .hero { padding-top: 100px; padding-bottom: 50px; }
  .hero-text h1 { font-size: 30px; }
  .search-box { width: 180px; }
  .categories-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .stat-number { font-size: 32px; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .navbar-inner { padding: 0 16px; }
  .logo-text { display: none; }
  .search-page-input {
    height: 52px;
    padding: 0 90px 0 48px;
    font-size: 14px;
  }
  .search-page-btn {
    padding: 0 16px;
    height: 38px;
    font-size: 13px;
  }
  .search-page-btn .btn-text { display: none; }
  .result-card { padding: 18px 20px; }
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb {
  background: var(--accent-1);
  border-radius: 5px;
  border: 2px solid var(--bg-1);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }
