/* 算驿文档站点样式 */
:root {
  --primary: #16406E;
  --primary-hover: #0f2d52;
  --primary-light: #1d5a9e;
  --secondary: #2FA08C;
  --secondary-hover: #258a78;
  --accent: #2FA08C;
  --accent-light: #5ec4b0;
  --accent-glow: #00FFE0;
  --gradient: linear-gradient(135deg, #16406E, #2FA08C);
  --gradient-soft: linear-gradient(135deg, #eef4fb, #eef9f6);
  --gradient-hero: linear-gradient(135deg, #0a1628 0%, #16406E 50%, #1a5c4e 100%);
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1d2129;
  --text-secondary: #4e5969;
  --text-tertiary: #86909c;
  --border: #e5e6eb;
  --shadow: 0 4px 20px rgba(22, 64, 110, 0.08);
  --shadow-hover: 0 12px 40px rgba(22, 64, 110, 0.15);
  --shadow-glow: 0 0 40px rgba(47, 160, 140, 0.15);
  --sidebar-width: 280px;
  --header-height: 60px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: var(--shadow);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.logo-img {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.logo-sub {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  line-height: 1.2;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Layout */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-title {
  padding: 0 20px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-link {
  display: block;
  padding: 10px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-link.active {
  background: rgba(22, 64, 110, 0.06);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

/* Main Content */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px 48px;
  max-width: calc(100% - var(--sidebar-width));
}

.content {
  max-width: 800px;
  margin: 0 auto;
}

/* Typography */
h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
}

h2 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--primary);
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text);
}

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

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
}

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

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

.breadcrumb-sep {
  color: var(--border);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary);
}

/* Code blocks */
pre {
  background: #0a1628;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

code {
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 13px;
  color: var(--primary);
  border: 1px solid var(--border);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  border: none;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--primary);
  background: var(--bg);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

tr:hover {
  background: var(--bg);
}

/* Steps */
.step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--gradient);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(22,64,110,0.25);
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

/* TOC */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.toc-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary);
}

.toc-list {
  list-style: none;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

/* Navigation buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.nav-btn-next {
  margin-left: auto;
}

/* Alert */
.alert {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.alert-info {
  background: #eef9f6;
  border: 1px solid rgba(47, 160, 140, 0.3);
  color: #1a5c4e;
}

.alert-warning {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  color: #874d00;
}

/* Search */
.search-box {
  position: relative;
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 64, 110, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Footer */
.page-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 24px;
  background: var(--surface);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main {
    margin-left: 0;
    padding: 24px;
  }
}

/* Utility */
.text-muted {
  color: var(--text-secondary);
}

.mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; }
.mt-48 { margin-top: 48px; }

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.feature-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-6px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 22px;
  transition: all 0.3s;
}

.feature-card:hover .feature-icon {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.feature-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Quick links */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.quick-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.quick-link-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary);
  transition: all 0.3s;
}

.quick-link:hover .quick-link-icon {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.quick-link-text {
  font-size: 14px;
  font-weight: 500;
}

.quick-link-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: #e6f7f5;
  color: #1a5c4e;
}

.badge-warning {
  background: #fffbe6;
  color: #874d00;
}

.badge-info {
  background: #eef4fb;
  color: #16406E;
}

/* Image placeholder */
.img-placeholder {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  color: var(--text-secondary);
  margin: 16px 0;
  box-shadow: var(--shadow);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s;
  border-radius: 8px 8px 0 0;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
  background: var(--bg);
}

/* Checklist */
.checklist {
  list-style: none;
}

.checklist li {
  padding: 10px 0;
  padding-left: 28px;
  position: relative;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
  font-size: 16px;
}

/* Two column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0;
}

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

/* Top navigation */
.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}

.nav-link {
  padding: 6px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--bg);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(22, 64, 110, 0.06);
  font-weight: 500;
}

@media (max-width: 1024px) {
  .top-nav {
    display: none;
  }
}

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.metric-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.metric-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.metric-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}