/* ============================================
   子页面通用样式 — 文章排版与侧边栏
   ============================================ */

/* 页面头部 */
.page-header {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.page-header .volume-label {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.page-header .page-subtitle {
  font-size: 1rem;
  color: var(--ink-muted);
  font-style: italic;
}

/* 两栏布局 */
.page-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

/* 侧边栏目录 */
.sidebar {
  position: sticky;
  top: var(--space-lg);
  padding: var(--space-md);
  background: linear-gradient(145deg, #faf7f0, #f0ebe0);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--leather);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.3rem;
}

.sidebar-nav a {
  display: block;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border-radius: 3px;
  transition: var(--transition-smooth);
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--leather);
  background: rgba(184, 134, 11, 0.08);
  border-left-color: var(--gold);
}

/* 正文区域 */
.article-content {
  max-width: 100%;
}

/* 文章章节 */
.article-section {
  margin-bottom: var(--space-xl);
}

.article-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--border-light);
  position: relative;
}

.article-section h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--leather));
}

.article-section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink-light);
  margin: var(--space-lg) 0 var(--space-sm);
}

.article-section h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-light);
  margin: var(--space-md) 0 var(--space-xs);
}

.article-section p {
  margin-bottom: var(--space-sm);
  text-align: justify;
  text-indent: 2em;
}

.article-section p.no-indent {
  text-indent: 0;
}

/* 列表样式 */
.article-section ul,
.article-section ol {
  margin: var(--space-sm) 0 var(--space-sm) 2em;
  color: var(--ink-light);
}

.article-section li {
  margin-bottom: 0.5rem;
}

/* 强调与引用 */
.article-section strong {
  color: var(--leather);
  font-weight: 700;
}

.article-section em {
  color: var(--ink-light);
  font-style: italic;
}

/* 代码块 */
.code-block {
  background: #f0ece3;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 0 4px 4px 0;
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-sm) 0 var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-light);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 提示框 */
.tip-box {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.08), rgba(107, 68, 35, 0.05));
  border: 1px solid var(--gold-pale);
  border-radius: 4px;
  padding: var(--space-md);
  margin: var(--space-md) 0;
  position: relative;
}

.tip-box::before {
  content: '※';
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--parchment);
  padding: 0 8px;
  color: var(--gold);
  font-size: 1.2rem;
}

.tip-box p {
  text-indent: 0;
  margin: 0;
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  background: rgba(184, 134, 11, 0.1);
  color: var(--leather);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.data-table tr:hover td {
  background: rgba(184, 134, 11, 0.03);
}

/* 分页导航 */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.page-nav a {
  text-decoration: none;
  color: var(--leather);
  font-weight: 600;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.page-nav a:hover {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--ink);
}

/* 返回顶部 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 45px;
  height: 45px;
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--leather);
  font-size: 1.2rem;
  box-shadow: 0 2px 12px var(--shadow);
  transition: var(--transition-smooth);
  opacity: 0;
  visibility: hidden;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--gold-pale);
  color: var(--ink);
  transform: translateY(-2px);
}

/* 响应式 */
@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: relative;
    top: 0;
    margin-bottom: var(--space-lg);
  }
  
  .page-header h1 {
    font-size: 1.6rem;
  }
}