:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.05), 0 10px 30px rgba(0,0,0,0.08);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 20px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.7;
  font-size: 15px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

/* 侧边栏目录 */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 20px;
}
.sidebar h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}
.sidebar ul { list-style: none; }
.sidebar > ul > li { margin-bottom: 4px; }
.sidebar a {
  display: block;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 13.5px;
  transition: all 0.15s ease;
}
.sidebar a:hover { background: var(--bg-soft); color: var(--primary); }
.sidebar a.active {
  background: #dbeafe;
  color: var(--primary);
  font-weight: 600;
}

/* 主内容区 */
.content {
  padding: 40px 60px 80px;
  background: var(--bg);
  min-width: 0;
}

/* 头部 hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff;
  padding: 56px 60px;
  margin: -40px -60px 40px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}
.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.hero .subtitle {
  font-size: 16px;
  opacity: 0.92;
  position: relative;
  z-index: 1;
}
.hero .meta {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.hero .meta-item {
  background: rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  backdrop-filter: blur(10px);
}
.hero .meta-item strong { font-weight: 600; }

/* 提示框 */
.callout {
  background: #fef3c7;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 6px;
  margin: 16px 0 32px;
  font-size: 14px;
  color: #78350f;
}

/* 标题层级 */
h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 56px 0 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary);
  position: relative;
}
h3 {
  font-size: 20px;
  color: var(--text);
  margin: 32px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}
h4 {
  font-size: 16px;
  color: var(--text);
  margin: 24px 0 12px;
  font-weight: 600;
}

p { margin-bottom: 14px; }

strong { color: var(--primary-dark); font-weight: 600; }

/* 表格 */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead {
  background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
}
th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:hover { background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: none; }

/* 列表 */
ul, ol { margin: 12px 0 16px 24px; }
li { margin-bottom: 6px; }
ul li::marker { color: var(--primary); }

/* 引用 */
blockquote {
  border-left: 4px solid var(--primary);
  background: #eff6ff;
  padding: 14px 20px;
  margin: 16px 0;
  color: #1e3a8a;
  border-radius: 0 6px 6px 0;
}

/* 代码 */
code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #be185d;
  font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  transition: all 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.card-title {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 15px;
  margin-bottom: 6px;
}
.card-desc { font-size: 13px; color: var(--text-light); }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
}
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-green { background: #d1fae5; color: #065f46; }
.tag-orange { background: #fed7aa; color: #9a3412; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-gray { background: #f3f4f6; color: #374151; }

/* check / cross 图标 */
.check { color: var(--success); font-weight: 700; }
.cross { color: var(--danger); font-weight: 700; }
.star { color: var(--accent); }

/* 高亮行 */
.highlight-row { background: #fef3c7 !important; }
.highlight-row td:first-child { font-weight: 600; }

/* 推荐框 */
.recommend-box {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid var(--success);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
}
.recommend-box h4 {
  color: #065f46;
  margin-top: 0;
}

/* 风险提示 */
.risk-list {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 16px 0;
}
.risk-list h4 { color: #991b1b; margin-top: 0; }
.risk-list ol { margin-left: 20px; }
.risk-list li { color: #7f1d1d; }

/* 页脚 */
footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

/* 响应式 */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 24px 24px 60px; }
  .hero { padding: 36px 24px; margin: -24px -24px 24px; }
  .hero h1 { font-size: 26px; }
}

/* 打印优化 */
@media print {
  .sidebar { display: none; }
  .layout { grid-template-columns: 1fr; }
  .hero { background: #1e40af !important; -webkit-print-color-adjust: exact; }
  a { color: var(--text); text-decoration: none; }
}
