/* ============================================================================
   清晰文档中心 - 现代化亮色设计  
   与主网站设计系统统一
   ============================================================================ */

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

:root {
  --primary: #155eef;
  --primary-hover: #004ee6;
  --accent: #0ea5e9;
  --accent-light: #38bdf8;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --text: #10213a;
  --text-secondary: #475467;
  --muted: #667085;
  --border: #d7e0ea;
  --radius: 12px;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --code-bg: #f0f4f8;
  --code-text: #155eef;
  --shadow-sm: 0 8px 24px rgba(16,33,58,.05), 0 2px 6px rgba(16,33,58,.04);
  --shadow-md: 0 18px 42px rgba(16,33,58,.08), 0 6px 18px rgba(16,33,58,.05);
  --shadow-lg: 0 24px 48px rgba(16,33,58,.12);
}

html {
  font-size: 15px;
  line-height: 1.6;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(21,94,239,.08), transparent 28%),
              linear-gradient(180deg, #f8fbff 0%, var(--bg) 32%, #eef3f8 100%);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: none;
}

/* ============================================================================
   页头
   ============================================================================ */

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 68px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(215,224,234,.9);
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.header-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

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

nav {
  display: flex;
  gap: 28px;
  flex: 1;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 0;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

nav a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

nav a.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ============================================================================
   主容器
   ============================================================================ */

main {
  flex: 1;
  padding: 40px 28px 60px;
}

.container {
  max-width: 1000px;
  margin: 0 0 0 28px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

/* 侧边栏固定宽度，防止跳动 */
aside {
  width: 260px;
  flex-shrink: 0;
}

/* ============================================================================
   侧边栏
   ============================================================================ */

.sidebar-nav {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-nav h3 {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 16px 18px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

.sidebar-nav ul {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-nav a:hover {
  background-color: rgba(21,94,239,.06);
  color: var(--primary);
  padding-left: 20px;
}

.sidebar-nav a.active {
  background-color: rgba(21,94,239,.12);
  color: var(--primary);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
  font-weight: 600;
}
   ============================================================================ */

h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: -0.5px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin: 32px 0 16px;
  color: var(--text);
  letter-spacing: -0.3px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 12px;
}

h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 24px 0 12px;
  color: var(--primary);
  letter-spacing: -0.2px;
}

h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 10px;
  color: var(--text);
}

p {
  margin-bottom: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ============================================================================
   代码块
   ============================================================================ */

code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  font-weight: 500;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

pre code {
  background: none;
  padding: 0;
  color: var(--code-text);
  font-size: 14px;
}

/* ============================================================================
   列表
   ============================================================================ */

ul,
ol {
  margin: 16px 0 16px 24px;
  padding: 0;
}

li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================================
   表格
   ============================================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: var(--surface-soft);
  border-bottom: 2px solid var(--border);
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
  letter-spacing: 0.3px;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}

tbody tr:hover {
  background: var(--surface-soft);
}

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

/* ============================================================================
   卡片和容器
   ============================================================================ */

.card,
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.3s ease;
}

.card:hover,
.feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card h4,
.feature-card h3 {
  margin-top: 0;
}

.note,
.warning,
.success {
  padding: 16px;
  border-left: 4px solid;
  border-radius: 6px;
  margin: 16px 0;
  background: var(--surface-soft);
  font-size: 14px;
}

.note {
  border-color: var(--primary);
}

.note strong {
  color: var(--primary);
}

.warning {
  border-color: var(--warning);
}

.warning strong {
  color: var(--warning);
}

.success {
  border-color: var(--success);
}

.success strong {
  color: var(--success);
}

/* ============================================================================
   特殊区域
   ============================================================================ */

.page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--accent);
}

.page-header h1 {
  color: var(--primary);
  margin-bottom: 8px;
}

.page-header p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 48px 32px;
  border-radius: 12px;
  margin-bottom: 40px;
  text-align: center;
  color: white;
  box-shadow: var(--shadow-md);
}

.hero h1 {
  color: white;
  font-size: 36px;
  margin-bottom: 12px;
}

.hero p {
  color: rgba(255,255,255,.9);
  margin: 8px 0;
  font-size: 16px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.feature-card {
  text-align: center;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card h3 {
  margin: 0;
  font-size: 20px;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================================================
   按钮
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  gap: 8px;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 16px rgba(21,94,239,.25);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--primary);
}

/* ============================================================================
   页脚
   ============================================================================ */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: auto;
}

footer p {
  margin: 4px 0;
}

footer a {
  color: var(--primary);
  font-weight: 500;
}

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

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  header {
    padding: 0 12px;
    min-height: 60px;
  }

  .header-container {
    gap: 8px;
  }

  .logo {
    font-size: 16px;
  }

  nav {
    gap: 12px;
    flex: 1;
  }

  nav a {
    font-size: 13px;
    padding: 6px 0;
  }

  header a[title="返回主平台"] {
    padding: 6px 12px;
    font-size: 13px;
  }

  main {
    padding: 24px 12px 40px;
  }

  .container {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 24px;
  }

  aside {
    width: 100%;
  }

  .sidebar-nav {
    position: static;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
    margin-top: 24px;
  }

  h3 {
    font-size: 16px;
    margin-top: 18px;
  }

  .hero {
    padding: 32px 20px;
    margin-bottom: 24px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  table {
    font-size: 13px;
    margin: 16px 0;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

/* ============================================================================
   工具类
   ============================================================================ */

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.mt-4 {
  margin-top: 32px;
}

.mb-4 {
  margin-bottom: 32px;
}

.mt-2 {
  margin-top: 16px;
}

.mb-2 {
  margin-bottom: 16px;
}

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.copy-button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.copy-button.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* ============================================================================
   首页布局增强
   ============================================================================ */

.doc-homepage .feature-grid {
  grid-template-columns: repeat(3, 1fr);
}

.doc-homepage .card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  justify-content: flex-start;
}

.doc-homepage .card h3 {
  margin-top: 0;
  font-size: 18px;
  line-height: 1.4;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-homepage .card p {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-homepage .card .btn {
  margin-top: auto;
  width: 100%;
}

/* 统一特性卡片高度 */
.doc-homepage .feature-box {
  min-height: 160px;
}

/* 英雄区样式优化 */
.doc-homepage .hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 56px 40px;
  border-radius: 14px;
  margin-bottom: 48px;
  text-align: center;
  color: white;
  box-shadow: 0 20px 40px rgba(21, 94, 239, 0.2);
}

.doc-homepage .hero h1 {
  font-size: 40px;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.6px;
}

.doc-homepage .hero > p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 18px;
  margin: 0 0 8px;
  letter-spacing: -0.2px;
}

.doc-homepage .hero > p:last-of-type {
  font-size: 15px;
  opacity: 0.9;
}

/* 在移动端改进布局 */
@media (max-width: 768px) {
  .doc-homepage .feature-grid {
    grid-template-columns: 1fr;
  }

  .doc-homepage .hero {
    padding: 40px 24px;
  }

  .doc-homepage .hero h1 {
    font-size: 28px;
  }

  .doc-homepage .hero > p {
    font-size: 16px;
  }
}

/* ============================================================================
   指南和场景页面优化
   ============================================================================ */

.container main {
  max-width: 900px;
}

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

.page-header h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 16px;
}

/* 特性卡片网格 - 增强自适应 */
main .feature-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 28px 0;
}

main .card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 24px;
}

main .card h4 {
  margin: 0 0 12px;
  font-size: 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

main .card p {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
}

main .card .btn {
  margin-top: 16px;
  align-self: flex-start;
}

/* 场景导航表格优化 */
main table {
  font-size: 14px;
  line-height: 1.6;
}

main th {
  font-weight: 700;
  padding: 16px;
  background: var(--surface-soft);
}

main td {
  padding: 16px;
  vertical-align: top;
}

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

/* 移动端优化 */
@media (max-width: 768px) {
  main .feature-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .page-header h1 {
    font-size: 26px;
  }

  main table {
    font-size: 13px;
  }

  main th,
  main td {
    padding: 12px;
  }
}
