/* 阅读体验优化样式 - 提升间距、层次感和流程感 */

/* ==================== 基础间距优化 ==================== */

/* 页面内容区域增加呼吸空间 */
.vp-doc {
  line-height: 1.8;
}

/* 一级标题增加上下间距 */
.vp-doc h1 {
  margin-top: 0;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--vp-c-divider);
  font-size: 2.2rem;
  font-weight: 700;
}

/* 二级标题增加间距和视觉层次 */
.vp-doc h2 {
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--vp-c-divider);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--vp-c-text-1);
}

/* 三级标题 */
.vp-doc h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--vp-c-text-1);
}

/* 四级标题 */
.vp-doc h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--vp-c-text-2);
}

/* 段落间距 */
.vp-doc p {
  margin: 1.25rem 0;
  text-align: justify;
}

/* 列表间距 */
.vp-doc ul, .vp-doc ol {
  margin: 1.25rem 0;
  padding-left: 1.8rem;
}

.vp-doc li {
  margin: 0.6rem 0;
  line-height: 1.8;
}

/* 列表嵌套 */
.vp-doc li > ul, .vp-doc li > ol {
  margin: 0.5rem 0;
}

/* ==================== 引用块优化 ==================== */

/* 引用块增加视觉层次 */
.vp-doc blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg-alt) 100%);
  border-left: 4px solid var(--vp-c-brand);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.vp-doc blockquote p {
  margin: 0.75rem 0;
}

.vp-doc blockquote p:first-child {
  margin-top: 0;
}

.vp-doc blockquote p:last-child {
  margin-bottom: 0;
}

/* ==================== 分割线优化 ==================== */

/* 分割线增加呼吸感 */
.vp-doc hr {
  margin: 3rem 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--vp-c-divider), transparent);
}

/* ==================== 表格优化 ==================== */

/* 表格增加间距和视觉层次 */
.vp-doc table {
  margin: 2rem 0;
  font-size: 0.95rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.vp-doc th {
  background: var(--vp-c-bg-soft);
  padding: 14px 16px;
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--vp-c-divider);
}

.vp-doc td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--vp-c-divider-light);
}

.vp-doc tr:last-child td {
  border-bottom: none;
}

.vp-doc tr:hover {
  background: var(--vp-c-bg-soft);
}

/* ==================== 代码块优化 ==================== */

/* 代码块增加间距 */
.vp-doc div[class*="language-"] {
  margin: 2rem 0;
  border-radius: 8px;
}

/* 行内代码 */
.vp-doc code {
  padding: 0.2em 0.4em;
  background: var(--vp-c-bg-soft);
  border-radius: 4px;
  font-size: 0.9em;
}

/* ==================== 流程步骤卡片 ==================== */

/* 流程步骤容器 */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
  padding: 0;
  background: transparent;
}

/* 单个步骤 */
.flow-step {
  padding: 1.5rem;
  background: var(--vp-c-bg);
  border-radius: 12px;
  border: 1px solid var(--vp-c-divider);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.flow-step:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.flow-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--vp-c-brand);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.flow-step-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--vp-c-text-1);
}

.flow-step-desc {
  font-size: 0.9rem;
  color: var(--vp-c-text-2);
  line-height: 1.6;
}

/* ==================== 信息卡片 ==================== */

/* 信息卡片容器 */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* 单个信息卡片 */
.info-card {
  padding: 1.5rem;
  background: var(--vp-c-bg);
  border-radius: 12px;
  border: 1px solid var(--vp-c-divider);
  transition: all 0.3s ease;
}

.info-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.info-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.info-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--vp-c-text-1);
}

.info-card-content {
  font-size: 0.95rem;
  color: var(--vp-c-text-2);
  line-height: 1.7;
}

/* ==================== 高亮框 ==================== */

/* 高亮提示框 */
.highlight-box {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
}

.highlight-box-title {
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 警告提示框 */
.warning-box {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.1) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
}

.warning-box-title {
  font-weight: 600;
  color: #d97706;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 成功提示框 */
.success-box {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
}

.success-box-title {
  font-weight: 600;
  color: #059669;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==================== 时间线 ==================== */

/* 时间线容器 */
.timeline {
  position: relative;
  margin: 2rem 0;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--vp-c-divider);
}

/* 时间线项目 */
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  background: var(--vp-c-brand);
  border-radius: 50%;
  border: 2px solid var(--vp-c-bg);
  box-shadow: 0 0 0 2px var(--vp-c-brand);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--vp-c-text-3);
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--vp-c-text-1);
}

.timeline-content {
  color: var(--vp-c-text-2);
  line-height: 1.7;
}

/* ==================== 标签样式 ==================== */

/* 标签组 */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  background: var(--vp-c-bg-soft);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--vp-c-text-2);
  border: 1px solid var(--vp-c-divider);
}

.tag-primary {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.2);
}

.tag-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

/* ==================== 数据指标卡片 ==================== */

/* 指标卡片组 */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* 单个指标卡片 */
.metric-card {
  text-align: center;
  padding: 1.5rem;
  background: var(--vp-c-bg);
  border-radius: 12px;
  border: 1px solid var(--vp-c-divider);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--vp-c-brand);
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--vp-c-text-2);
}

.metric-change {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.metric-change.positive {
  color: #059669;
}

.metric-change.negative {
  color: #dc2626;
}

/* ==================== 原有架构图样式优化 ==================== */

/* 架构图容器优化 */
.architecture {
  margin: 2.5rem 0;
  padding: 2rem;
  background: var(--vp-c-bg-soft);
  border-radius: 16px;
}

.arch-section {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--vp-c-bg);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.arch-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--vp-c-text-2);
}

.arch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.arch-item {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
}

.arch-arrow {
  text-align: center;
  font-size: 1.5rem;
  color: var(--vp-c-text-3);
  margin: 0.5rem 0;
}

/* 流程图优化 - 横向步骤条 */
.flowchart {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin: 2rem 0;
  padding: 2rem 1.5rem;
  background: var(--vp-c-bg-soft);
  border-radius: 12px;
  overflow-x: auto;
}

.flow-step {
  flex: 1;
  min-width: 120px;
  padding: 1rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
  color: white;
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* 步骤之间的箭头 */
.flow-arrow {
  flex-shrink: 0;
  padding: 0 0.5rem;
  font-size: 1.2rem;
  color: var(--vp-c-text-3);
  font-weight: 600;
}

/* 响应式：小屏幕允许横向滚动 */
@media (max-width: 768px) {
  .flowchart {
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 1.5rem 1rem;
  }
  
  .flow-step {
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0.875rem 0.5rem;
  }
}

/* ==================== 响应式优化 ==================== */

@media (max-width: 768px) {
  .vp-doc h1 {
    font-size: 1.8rem;
  }
  
  .vp-doc h2 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
  }
  
  .vp-doc h3 {
    font-size: 1.15rem;
  }
  
  .flow-steps,
  .info-cards {
    grid-template-columns: 1fr;
  }
  
  .flow-step {
    min-width: 100%;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .architecture {
    padding: 1rem;
  }
  
  .arch-items {
    justify-content: center;
  }
}

/* ==================== 打印优化 ==================== */

@media print {
  .vp-doc h2 {
    page-break-before: auto;
    page-break-after: avoid;
  }
  
  .info-card,
  .flow-step,
  .metric-card {
    break-inside: avoid;
  }
}

/* ==================== 流程图样式修复 ==================== */

/* 修复流程步骤的颜色对比度问题 */
.process-flow {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--vp-c-bg-soft);
  border-radius: 12px;
}

.process-group {
  margin-bottom: 1.5rem;
}

.process-group:last-child {
  margin-bottom: 0;
}

.process-group-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--vp-c-text-1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.process-phase {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
}

.process-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--vp-c-bg);
  border-radius: 8px;
}

.process-step {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  white-space: nowrap;
}

.process-arrow {
  font-size: 1.2rem;
  color: var(--vp-c-text-3);
  font-weight: 600;
}

.process-group-arrow {
  text-align: center;
  font-size: 1.5rem;
  color: var(--vp-c-text-3);
  margin: 0.75rem 0;
}

/* 横向流程图优化 - 改为纵向时间线样式 */
.flowchart-vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--vp-c-bg-soft);
  border-radius: 12px;
}

.flowchart-vertical .flow-step {
  position: relative;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  font-weight: 500;
  color: white;
  text-align: center;
}

.flowchart-vertical .flow-step:last-child {
  margin-bottom: 0;
}

.flowchart-vertical .flow-step::after {
  content: '';
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 2rem;
  background: var(--vp-c-divider);
}

.flowchart-vertical .flow-step:last-child::after {
  display: none;
}

/* 简洁的纵向流程图 - 优化样式 */
.flowchart-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0;
  padding: 0;
  background: transparent;
}

.flowchart-grid .flow-step {
  padding: 1rem 1.25rem;
  font-weight: 400;
  color: var(--vp-c-text-1);
  text-align: left;
  background: var(--vp-c-bg-soft);
  border-radius: 8px;
  border-left: 3px solid var(--vp-c-brand);
  transition: all 0.2s ease;
}

.flowchart-grid .flow-step:hover {
  background: var(--vp-c-bg);
  transform: translateX(4px);
}

/* 步骤标题 */
.flowchart-grid .flow-step strong,
.flowchart-grid .flow-step .step-title {
  display: block;
  font-weight: 600;
  color: var(--vp-c-text-1);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* 步骤描述 */
.flowchart-grid .flow-step .step-desc {
  font-size: 0.9rem;
  color: var(--vp-c-text-2);
  line-height: 1.6;
}

/* 修复原有流程图的颜色 */
.flowchart .flow-step,
.process-steps .process-step {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 确保所有流程步骤文字清晰可读 */
.flow-step,
.process-step {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==================== 带箭头的横向流程图 ==================== */

.service-flow {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--vp-c-bg-soft);
  border-radius: 12px;
  overflow-x: auto;
}

.service-step {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.75rem;
  background: var(--vp-c-bg);
  border-radius: 8px;
  position: relative;
  margin-right: 2rem;
}

.service-step:last-child {
  margin-right: 0;
}

/* 箭头 */
.service-step::after {
  content: '';
  position: absolute;
  right: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 16px solid var(--vp-c-brand);
}

.service-step:last-child::after {
  display: none;
}

.service-step-number {
  width: 36px;
  height: 36px;
  background: var(--vp-c-brand);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.service-step-title {
  font-weight: 600;
  color: var(--vp-c-text-1);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.service-step-desc {
  font-size: 0.85rem;
  color: var(--vp-c-text-2);
  line-height: 1.5;
}

/* 响应式 */
@media (max-width: 768px) {
  .service-flow {
    flex-direction: column;
    gap: 1rem;
  }
  
  .service-step {
    margin-right: 0;
    margin-bottom: 1.5rem;
    width: 100%;
    flex-direction: row;
    text-align: left;
    padding: 1rem;
  }
  
  .service-step:last-child {
    margin-bottom: 0;
  }
  
  /* 移动端改为向下箭头 */
  .service-step::after {
    right: 50%;
    top: auto;
    bottom: -1.25rem;
    transform: translateX(50%) rotate(90deg);
    border-left-width: 12px;
    border-top-width: 10px;
    border-bottom-width: 10px;
  }
  
  .service-step-number {
    margin-bottom: 0;
    margin-right: 1rem;
    flex-shrink: 0;
  }
  
  .service-step-content {
    flex: 1;
  }
}
