/* 学霸导航网 - 详情页样式 */
/* 全部本地资源，无外部CDN */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #0d9488;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg: #f9fafb;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

/* ===== 导航栏 ===== */
.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

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

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-search input {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  width: 170px;
  outline: none;
  transition: all 0.2s;
}

.nav-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.nav-search button {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}

/* ===== 汉堡菜单按钮（移动端） ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .25s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== 移动端下拉菜单 ===== */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.mobile-menu.open {
  max-height: 600px;
}

.mobile-menu a {
  padding: 12px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid var(--bg);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu a:hover,
.mobile-menu a:active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 8px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

/* ===== 主内容区 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.main-content {
  min-width: 0;
}

/* ===== 站点信息卡片 ===== */
.site-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.site-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.site-favicon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
}

.site-title-info h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.site-tagline {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.site-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
}

.tag:hover {
  background: var(--primary);
  color: #fff;
}

.site-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* ===== 信息表 ===== */
.info-table {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.info-table h2 {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
  color: var(--text);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 13px;
  color: var(--text-muted);
}

.info-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

.info-value a {
  color: var(--primary);
  text-decoration: none;
}

/* ===== 文章内容区 ===== */
.article-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.article-content h2 {
  font-size: 22px;
  margin: 32px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.article-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-content h3 {
  font-size: 18px;
  margin: 24px 0 12px;
  color: var(--text);
}

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

.article-content ul,
.article-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article-content strong {
  color: var(--text);
}

/* ===== FAQ 区域 ===== */
.faq-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.faq-section h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--text);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-q::before {
  content: "Q";
  width: 24px;
  height: 24px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.faq-a {
  padding-left: 32px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

/* ===== 侧边栏 ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.sidebar-card h3 {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
  color: var(--text);
}

/* 相关推荐 */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.related-item:hover {
  background: var(--bg);
  border-color: var(--border);
}

.related-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.related-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.related-info p {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* 快速导航 */
.quick-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-nav a {
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-nav a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== 页脚 ===== */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 40px 20px 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

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

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
}

.footer-col a:hover {
  color: var(--primary);
}

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

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  /* 移动端隐藏导航搜索框，避免挤压logo（Hero区有搜索） */
  .nav-search {
    display: none;
  }

  /* 显示汉堡菜单 */
  .nav-toggle {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .logo {
    font-size: 19px;
    white-space: nowrap;
  }

  .site-header {
    flex-direction: column;
  }
  
  .site-favicon {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
  
  .site-title-info h1 {
    font-size: 22px;
  }
  
  .article-content {
    padding: 20px;
  }
}

/* ===== 打印优化 ===== */
@media print {
  .navbar, .sidebar, .footer, .site-actions {
    display: none;
  }
  
  .container {
    grid-template-columns: 1fr;
  }
  
  .article-content {
    box-shadow: none;
    border: none;
  }
}
