/* ========================================
   考研复试全攻略 — 统一B站风格样式表
   ======================================== */

/* ===== 变量 ===== */
:root {
  --primary: #18191c;
  --accent: #e63946;
  --accent-light: #f28b8b;
  --bg: #f6f7f8;
  --bg-card: #ffffff;
  --text: #18191c;
  --text-light: #61666d;
  --text-muted: #9499a0;
  --border: #e3e5e7;
  --border-light: #f1f2f3;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.06);
  --max-width: 85%;
  --nav-height: 56px;
  --transition: all 0.2s ease;
}

/* ===== 基础 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Helvetica Neue",Arial,sans-serif;
  line-height: 1.6; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-height);
}

/* ===== 导航栏 ===== */
.main-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height); z-index: 1000;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center;
  padding: 0 12px;
  gap: 8px;
}
.nav-brand { display: none; }
.nav-links {
  display: flex; gap: 6px; list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  justify-content: center;
  padding: 0 4px;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block; padding: 5px 14px;
  color: var(--text-light); text-decoration: none;
  font-size: 0.82rem; font-weight: 600;
  border-radius: 50px;
  background: #fff;
  border: 1px solid var(--border);
  transition: all 0.25s ease; white-space: nowrap;
  flex-shrink: 0;
}
.nav-links a:hover {
  transform: scale(1.12);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(230,57,70,0.35);
}
.nav-links a.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(230,57,70,0.3);
}

/* 返回按钮 */
.nav-back-buttons {
  display: flex; gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.nav-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; background: linear-gradient(135deg, #e63946, #f28b8b);
  color: #fff; font-size: 0.85rem; font-weight: 600;
  border-radius: 50px; text-decoration: none; white-space: nowrap;
  transition: all 0.2s; box-shadow: 0 2px 8px rgba(230,57,70,0.25);
  flex-shrink: 0;
}
.nav-back-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(230,57,70,0.4);
  color: #fff;
}
.main-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height); z-index: 1000;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.nav-brand {
  font-size: 1.15rem; font-weight: 700; color: var(--accent);
  text-decoration: none; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.nav-brand .brand-accent { color: var(--accent-light); }
.nav-links {
  display: flex; gap: 4px; list-style: none;
}
.nav-links a {
  display: block; padding: 8px 14px;
  color: var(--text-light); text-decoration: none;
  font-size: 0.88rem; border-radius: 6px;
  transition: var(--transition); white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(230,57,70,0.08); color: var(--accent);
}

/* 返回按钮 */
.nav-back-buttons {
  display: flex; gap: 8px; margin-left: auto; margin-right: 12px;
  align-items: center;
}
.nav-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; background: linear-gradient(135deg, #e63946, #f28b8b);
  color: #fff; font-size: 0.85rem; font-weight: 600;
  border-radius: 50px; text-decoration: none; white-space: nowrap;
  transition: all 0.2s; box-shadow: 0 2px 8px rgba(230,57,70,0.25);
}
.nav-back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230,57,70,0.35);
  color: #fff;
}

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: var(--transition);
}

.mobile-nav {
  display: none; position: fixed; top: var(--nav-height);
  left: 0; right: 0; background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 999;
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
}
.mobile-nav.open { max-height: 600px; }
.mobile-nav a {
  display: block; padding: 14px 24px;
  color: var(--text-light); text-decoration: none;
  font-size: 0.95rem; border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.mobile-nav a:hover, .mobile-nav a.active {
  background: rgba(230,57,70,0.04); color: var(--accent);
}

/* ===== 容器 ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.page-content { padding-top: 16px; padding-bottom: 40px; }

/* ===== 面包屑 ===== */
.breadcrumb {
  background: #fff; padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-muted); margin: 0 8px; font-size: 0.8rem; }
.breadcrumb .current { color: var(--text); font-size: 0.85rem; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card); border-radius: 12px;
  box-shadow: var(--shadow); padding: 24px;
  margin-bottom: 20px; transition: var(--transition);
  border: 1px solid var(--border-light);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.card-title .icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}

/* ===== 网格 ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ===== 时间线 ===== */
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: ''; position: absolute; left: 15px; top: 0; bottom: 0;
  width: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-light));
  border-radius: 3px;
}
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: ''; position: absolute; left: -32px; top: 4px;
  width: 14px; height: 14px; background: var(--bg-card);
  border: 3px solid var(--accent); border-radius: 50%;
}
.timeline-date {
  font-size: 0.85rem; color: var(--accent); font-weight: 600;
  margin-bottom: 4px;
}
.timeline-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}

/* ===== 步骤卡片 ===== */
.step-card {
  background: var(--bg-card); border-radius: 12px;
  box-shadow: var(--shadow); padding: 24px;
  border-left: 4px solid var(--accent);
}
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; border-radius: 50%;
  font-weight: 700; font-size: 0.95rem; margin-right: 12px;
}

/* ===== 提示框 ===== */
.tip-box {
  background: #fff8e1; border: 1px solid #ffe082;
  border-radius: 6px; padding: 14px 16px; margin: 16px 0;
  font-size: 0.9rem; color: var(--text-light);
}
.tip-box.warning { background: #ffebee; border-color: #ffcdd2; }
.tip-box.info { background: #e3f2fd; border-color: #bbdefb; }
.tip-box.success { background: #e8f5e9; border-color: #c8e6c9; }
.tip-box .tip-title { font-weight: 700; margin-bottom: 4px; color: var(--text); font-size: 0.95rem; }

/* ===== 表格 ===== */
.data-table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 0.9rem; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th {
  background: #f1f2f3; color: var(--text);
  padding: 14px 16px; text-align: left; font-weight: 600;
}
.data-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tr:nth-child(even) { background: #fafbfc; }
.data-table tr:hover { background: var(--border-light); }

/* ===== 标签 ===== */
.tag {
  display: inline-block; padding: 4px 12px;
  border-radius: 50px; font-size: 0.8rem; font-weight: 500; margin: 2px;
}
.tag-primary { background: #fdf0f0; color: #e63946; }
.tag-accent { background: #fff3e0; color: #ff8f1f; }
.tag-success { background: #e8f5e9; color: #00b8a9; }
.tag-info { background: #e0f7fa; color: #00bcd4; }

/* ===== Q&A ===== */
.qa-item {
  background: var(--bg-card); border-radius: 12px;
  box-shadow: var(--shadow); margin-bottom: 16px;
  overflow: hidden; border: 1px solid var(--border-light);
}
.qa-question {
  padding: 18px 24px; font-weight: 700; color: var(--text);
  cursor: pointer; display: flex;
  justify-content: space-between; align-items: center;
  transition: var(--transition);
}
.qa-question:hover { background: var(--border-light); }
.qa-question .arrow {
  transition: var(--transition); color: var(--text-muted);
}
.qa-question.active .arrow { transform: rotate(180deg); }
.qa-answer {
  padding: 0 24px; max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.qa-answer.open { padding: 0 24px 20px; max-height: 2000px; }

/* ===== 星级 ===== */
.star-rating { color: #ff8f1f; font-size: 1.1rem; letter-spacing: 2px; }

/* ===== 分页 ===== */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.pagination a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: var(--bg-card);
  color: var(--text); text-decoration: none;
  border-radius: 6px; box-shadow: var(--shadow);
  font-weight: 600; transition: var(--transition);
  border: 1px solid var(--border);
}
.pagination a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== 导航卡片 ===== */
.nav-card {
  background: var(--bg-card); border-radius: 12px;
  box-shadow: var(--shadow); padding: 24px;
  text-decoration: none; color: var(--text);
  display: block; transition: var(--transition);
  border: 1px solid var(--border-light); position: relative; overflow: hidden;
}
.nav-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transform: scaleX(0); transition: var(--transition);
}
.nav-card:hover::before { transform: scaleX(1); }
.nav-card:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-4px);
}
.nav-card .card-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
}
.nav-card .card-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.nav-card .card-desc {
  font-size: 0.85rem; color: var(--text-light); line-height: 1.5;
}

/* ===== 回到顶部 ===== */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: var(--transition);
  z-index: 999; text-decoration: none;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-4px); }

/* ===== 高亮 ===== */
.highlight {
  background: linear-gradient(180deg, transparent 60%, rgba(230,57,70,0.25) 60%);
  padding: 0 2px;
}

/* ===== 代码块 ===== */
code {
  background: rgba(230,57,70,0.06);
  padding: 2px 8px; border-radius: 4px;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 0.88em; color: var(--accent);
}
pre {
  background: #1a2332; color: #e2e8f0;
  padding: 20px; border-radius: 12px;
  overflow-x: auto; margin: 16px 0;
  font-size: 0.88rem; line-height: 1.6;
}
pre code { background: none; color: inherit; padding: 0; }

/* ===== 锚点偏移 ===== */
[id] { scroll-margin-top: calc(var(--nav-height) + 20px); }

/* ===== 打印 ===== */
@media print {
  .main-nav, .mobile-nav, .back-to-top, .hamburger { display: none !important; }
  body { padding-top: 0; }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-back-buttons { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .timeline { padding-left: 30px; }
  .timeline::before { left: 10px; }
  .timeline-item::before { left: -26px; width: 12px; height: 12px; }
  .card { padding: 18px; overflow-x: auto; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 10px 12px; }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #fff; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== 选中文本 ===== */
::selection {
  background: rgba(230,57,70,0.3);
  color: var(--primary);
}

/* ===== 页脚（兼容旧版 .footer） ===== */
.site-footer, .footer {
  background: #fafbfc; color: var(--text-muted); text-align: center;
  padding: 32px 20px 24px; font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
.footer-inner, .footer .container {
  max-width: var(--max-width); margin: 0 auto; padding: 0 20px;
}
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 16px; margin-bottom: 16px;
}
.footer-links a {
  font-size: 0.85rem; color: var(--text-muted); transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-brand {
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.footer-desc {
  font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px;
}
.footer-author {
  font-size: 0.85rem; color: var(--accent); margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--border-light);
}

/* ===== 首页专用布局 ===== */
.bili-layout { display: flex; gap: 20px; align-items: flex-start; }
.bili-main { flex: 1; min-width: 0; }
.bili-aside {
  width: 260px; flex-shrink: 0; position: sticky; top: 72px;
  display: flex; flex-direction: column; gap: 16px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 24px;
}
.compact-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-card);
  border-radius: 10px; border: 1px solid var(--border-light);
  transition: var(--transition); text-decoration: none;
}
.compact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg); border-color: var(--accent);
}
.compact-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.compact-text { flex: 1; min-width: 0; }
.compact-title { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-meta { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aside-widget {
  background: var(--bg-card); border-radius: 6px;
  border: 1px solid var(--border); padding: 16px;
}
.aside-widget-title {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.aside-widget-item {
  padding: 8px 0; font-size: 0.88rem; color: var(--text-light);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; transition: var(--transition);
}
.aside-widget-item:last-child { border-bottom: none; }
.aside-widget-item:hover { color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-item { text-align: center; padding: 12px 4px; }
.stat-num { font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1.2; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.btn-back-home {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; background: #fff;
  border: 2px solid var(--accent); border-radius: 24px;
  color: var(--accent); font-size: 0.9rem; font-weight: 600;
  text-decoration: none; transition: all 0.2s; flex-shrink: 0;
}
.btn-back-home:hover {
  background: var(--accent); color: #fff; transform: scale(1.05);
}

@media (max-width: 900px) {
  .bili-layout { flex-direction: column; align-items: stretch; }
  .bili-aside { width: 100%; position: static; }
}
@media (max-width: 768px) {
  .compact-grid { gap: 8px; }
}

/* ===== hero 兼容（已被删除但保留样式防残留） ===== */
.hero { display: none; }

/* ===== section 兼容（子页面 main class="section"） ===== */
.section { padding: 0; }


/* ===== 复试板块主题增强 ===== */
.page-hero {
  background: linear-gradient(135deg, #a92122 0%, #e63946 100%);
  color: #fff;
  border: none;
  padding: 28px 24px;
  border-radius: 16px;
  margin-bottom: 22px;
  box-shadow: 0 6px 20px rgba(169, 33, 34, 0.22);
}
.page-hero .card-title {
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 12px;
}
.page-hero .card-title .icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.page-hero p {
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.95rem;
}
.page-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(169, 33, 34, 0.28);
}

.section h2 {
  position: relative;
  padding-left: 14px;
}
.section h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.22em;
  bottom: 0.22em;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, #a92122, #e63946);
}

.section h3 {
  margin-top: 24px;
  margin-bottom: 12px;
}

.tip-box {
  border-radius: 10px;
}

.card-title {
  letter-spacing: 0.2px;
}

@media (max-width: 768px) {
  .page-hero {
    padding: 22px 18px;
    border-radius: 14px;
  }
  .page-hero .card-title {
    font-size: 1.2rem;
  }
  .section h2 {
    font-size: 1.15rem;
  }
}
