/**
 * ============================================================
 *  个人所得税计算器 — 样式系统
 *  设计令牌 / 布局 / 组件 / 响应式
 * ============================================================
 */

/* ==================== CSS 变量 / 设计令牌 ==================== */
:root {
  /* 主色调 */
  --primary:       #1a73e8;
  --primary-dark:  #1557b0;
  --primary-light: #e8f0fe;
  --primary-50:    #f0f6ff;
  --primary-100:   #d2e3fc;
  --primary-600:   #1a56c4;
  --primary-700:   #0d47a1;

  /* 强调色 */
  --accent:        #ff6d00;
  --accent-light:  #fff3e0;
  --success:       #0f9d58;
  --success-light: #e6f4ea;
  --danger:        #d93025;
  --danger-light:  #fce8e6;
  --warning:       #f9ab00;
  --warning-light: #fef7e0;

  /* 灰色系统 */
  --gray-50:  #fafafa;
  --gray-100: #f5f7fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;

  /* 语义 */
  --text-primary:   var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted:     var(--gray-500);
  --bg-body:        #f5f7fa;
  --bg-card:        #ffffff;
  --border-color:   var(--gray-300);

  /* 排版 */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono:   "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* 间距 / 尺寸 */
  --sidebar-width:     240px;
  --header-height:     0px;
  --content-max-width: 1100px;
  --content-padding:   32px;
  --card-padding:      28px;
  --gap:               20px;
  --radius:            10px;
  --radius-lg:         14px;
  --radius-sm:         6px;

  /* 阴影 */
  --shadow-xs: 0 0 0 1px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

  /* 过渡 */
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ==================== 全局 Reset ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ==================== 侧边栏 ==================== */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.sidebar-header .logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #4a90d9);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  margin: 2px 8px;
  border-radius: 8px;
  font-size: 0.925rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* 侧边栏遮罩（移动端） */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}

/* ==================== 主内容区 ==================== */
#main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.page {
  display: none;
  animation: pageIn 0.3s ease;
}

.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--content-padding);
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.page-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ==================== 卡片组件 ==================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--card-padding);
  margin-bottom: var(--gap);
  border: 1px solid var(--gray-200);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-900);
}

/* ==================== 表单组件 ==================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label .unit {
  font-weight: 400;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: #fff;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

.form-input::placeholder { color: var(--gray-400); }

.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ==================== 按钮组件 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

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

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

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

.btn-danger:hover {
  background: #c62828;
}

.btn-lg {
  padding: 13px 32px;
  font-size: 1rem;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== 结果展示 ==================== */
.result-card {
  background: linear-gradient(135deg, var(--primary-50), #f0f8ff);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: var(--gap);
}

.result-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.result-amount {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.result-amount.tax {
  color: var(--danger);
}

.result-amount.net {
  color: var(--success);
}

.result-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.result-item {
  padding: 8px 0;
}

.result-item-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.result-item-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== 统计卡片（首页） ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue  { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--accent-light); color: var(--accent); }
.stat-icon.red   { background: var(--danger-light); color: var(--danger); }

.stat-info { flex: 1; min-width: 0; }

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==================== 表格 ==================== */
.rate-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rate-table thead {
  background: var(--primary-50);
}

.rate-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-800);
  border-bottom: 2px solid var(--primary-100);
  white-space: nowrap;
}

.rate-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--text-primary);
}

.rate-table tbody tr:hover {
  background: var(--gray-50);
}

.rate-table tbody tr:last-child td {
  border-bottom: none;
}

.rate-table .highlight-row {
  background: var(--warning-light);
}

.rate-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
}

.rate-badge.low    { background: #e8f5e9; color: #2e7d32; }
.rate-badge.medium { background: #fff3e0; color: #e65100; }
.rate-badge.high   { background: #fce4ec; color: #c62828; }

/* ==================== Tab 切换 ==================== */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 0.925rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==================== Accordion（折叠面板） ==================== */
.accordion { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; }

.accordion-item { border-bottom: 1px solid var(--gray-200); }
.accordion-item:last-child { border-bottom: none; }

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background var(--transition);
  user-select: none;
}

.accordion-header:hover { background: var(--gray-50); }

.accordion-header .accordion-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.accordion-item.open .accordion-header .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 16px 20px;
  background: var(--gray-50);
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.accordion-item.open .accordion-body { display: block; }

/* ==================== 代码块 ==================== */
.code-block {
  position: relative;
  background: var(--gray-900);
  color: #e0e0e0;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 12px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  font-size: 0.78rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition);
}

.code-block .copy-btn:hover {
  background: rgba(255,255,255,0.25);
}

.code-block .copy-btn.copied {
  background: var(--success);
}

.code-block .code-comment { color: #8ab4f8; }
.code-block .code-func    { color: #fdd835; }
.code-block .code-string  { color: #81c784; }

/* ==================== 资讯列表 ==================== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all var(--transition);
  cursor: pointer;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-100);
}

.news-card .news-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  margin-right: 8px;
}

.news-tag.policy   { background: var(--primary-light); color: var(--primary); }
.news-tag.guide    { background: var(--success-light); color: var(--success); }
.news-tag.reminder { background: var(--warning-light); color: #e65100; }

.news-card .news-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 8px 0 6px;
}

.news-card .news-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.news-card .news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==================== 快捷入口网格 ==================== */
.quick-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

@media (max-width: 1024px) {
  .quick-entry-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .quick-entry-grid { grid-template-columns: 1fr; }
}

.quick-entry {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.quick-entry:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-3px);
}

.quick-entry .entry-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.quick-entry .entry-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.quick-entry .entry-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==================== 年终奖对比表 ==================== */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  text-align: center;
  border: 1px solid var(--gray-200);
}

.compare-table th {
  background: var(--gray-100);
  font-weight: 600;
}

.compare-table .winner {
  background: var(--success-light);
  font-weight: 600;
}

.recommend-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--success-light);
  color: var(--success);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ==================== 警告/提示框 ==================== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 12px 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.alert-info {
  background: var(--primary-light);
  color: var(--primary-700);
  border: 1px solid var(--primary-100);
}

.alert-warning {
  background: var(--warning-light);
  color: #994d00;
  border: 1px solid #ffe082;
}

.alert-danger {
  background: var(--danger-light);
  color: #b71c1c;
  border: 1px solid #ffcdd2;
}

.alert-success {
  background: var(--success-light);
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

/* ==================== 汉堡菜单（移动端） ==================== */
#sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: #fff;
  font-size: 1.2rem;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* ==================== 响应式 ==================== */

/* 平板及以下：收起侧边栏为抽屉 */
@media (max-width: 768px) {
  :root {
    --content-padding: 20px;
    --card-padding: 18px;
  }

  #main-content {
    margin-left: 0;
  }

  #sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open #sidebar {
    transform: translateX(0);
  }

  body.sidebar-open #sidebar-overlay {
    display: block;
  }

  #sidebar-toggle {
    display: flex;
  }

  .page-container {
    padding-top: 60px; /* 给汉堡按钮留空间 */
  }

  .page-title { font-size: 1.4rem; }

  .result-details {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .result-details {
    grid-template-columns: 1fr;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .result-amount {
    font-size: 1.75rem;
  }
}

/* ==================== 工具样式 ==================== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.font-mono { font-family: var(--font-mono); }
.fw-600 { font-weight: 600; }

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ==================== SEO 增强样式 ==================== */

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

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

.breadcrumb .separator {
  color: var(--gray-400);
  user-select: none;
}

.breadcrumb .current {
  color: var(--primary);
  font-weight: 500;
}

/* 文章/结构化内容 */
article {
  line-height: 1.8;
}

article h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

article h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 20px 0 10px;
}

article p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

article ul, article ol {
  margin: 8px 0 12px 20px;
  color: var(--text-secondary);
}

article ul li, article ol li {
  margin-bottom: 6px;
  list-style: disc;
}

article ol li {
  list-style: decimal;
}

/* SEO关键词语义高亮 */
.keyword-highlight {
  font-weight: 600;
  color: var(--primary);
}

/* 结构化数据标签（用于 Schema markup 的视觉呈现） */
.schema-tag {
  display: none; /* 仅用于搜索引擎，不展示 */
}

/* 相关链接 */
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.related-link {
  display: inline-block;
  padding: 8px 16px;
  background: var(--gray-100);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.related-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px;
  margin-top: 32px;
  border-top: 1px solid var(--gray-200);
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

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

/* ==================== 打印样式 ==================== */
@media print {
  #sidebar, #sidebar-toggle, #sidebar-overlay { display: none !important; }
  #main-content { margin-left: 0; }
  .page { display: block !important; break-inside: avoid; }
}
