﻿/* ==========================================================
   上线性能与顺滑度增强引擎 (Smoothness & Performance Optimization)
   ========================================================== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* 硬件加速与流畅悬停 */
a, button, .media-news-card, .btn-media-primary, .btn-media-secondary, .faq-card, .intro-panel {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* 移动端平滑滚动与防抖 */
.table-wrapper, .table-container, .code-box, pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* 媒体图片防溢出与自适应 */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 消除点击高亮延迟 */
a, button, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* 蓝紫宇宙星云风格色彩体系 (Blue-Purple Cosmic Nebula Visual System) */
  --co-bg: #070913;              /* 宇宙极夜深空 */
  --co-card-bg: #0f1226;         /* 星云深蓝卡片 */
  --co-card-hover: #171b38;      /* 悬浮星云高亮 */
  --co-surface: #181d3d;         /* 表格与次级面板 */
  --co-border: rgba(147, 51, 234, 0.25); /* 星云紫边框 */
  --co-border-glow: #a855f7;     /* 发光紫 */
  
  --co-blue: #3b82f6;            /* 电光蓝 */
  --co-purple: #8b5cf6;          /* 璀璨星云紫 */
  --co-magenta: #d946ef;         /* 银河粉紫 */
  --co-accent: #10b981;          /* 安全翠绿 */
  
  --co-gradient-nebula: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #d946ef 100%);
  --co-gradient-card: linear-gradient(145deg, rgba(30, 27, 75, 0.8), rgba(15, 23, 42, 0.9));
  
  --co-text-main: #ffffff;       /* 纯白主字 */
  --co-text-muted: #94a3b8;      /* 星云说明灰 */
  --co-text-sub: #64748b;        /* 辅助灰 */
  
  --co-radius: 10px;
  --co-radius-lg: 18px;
  --co-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  --co-shadow-glow: 0 0 25px rgba(139, 92, 246, 0.35);
  --co-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --co-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --co-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--co-font);
  background-color: var(--co-bg);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.22) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(217, 70, 239, 0.12) 0%, transparent 60%);
  background-attachment: fixed;
  color: #e2e8f0;
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 顶部声明区 */
.cosmic-topbar {
  background: rgba(11, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--co-border);
  padding: 10px 0;
  font-size: 13px;
  color: #94a3b8;
}

.topbar-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.nebula-badge {
  display: inline-block;
  white-space: nowrap;
  background: var(--co-gradient-nebula);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-top: 1px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.topbar-text {
  flex: 1;
  line-height: 1.55;
}

/* 导航栏 */
.cosmic-header {
  background: rgba(7, 9, 19, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--co-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

.cosmic-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.cosmic-logo-orb {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--co-gradient-nebula);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.6);
}

.cosmic-brand-group {
  display: flex;
  flex-direction: column;
}

.cosmic-brand-title {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.cosmic-brand-title span {
  background: var(--co-gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cosmic-brand-sub {
  font-size: 11px;
  color: #a78bfa;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: var(--co-radius);
  transition: var(--co-transition);
}

.nav a:hover {
  color: #ffffff;
  background-color: rgba(139, 92, 246, 0.15);
}

.nav a.active {
  color: #ffffff;
  background: rgba(139, 92, 246, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

/* 宇宙星云 Hero 区域 (Cosmic Nebula Hero Section) */
.cosmic-hero-section {
  padding: 56px 0 46px;
  border-bottom: 1px solid var(--co-border);
}

.hero-cosmic-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
}

.hero-tag-nebula {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #c084fc;
  margin-bottom: 18px;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.cosmic-hero-section h1 {
  font-size: 38px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 18px;
  letter-spacing: -0.6px;
}

.cosmic-hero-section p.hero-cosmic-desc {
  font-size: 16px;
  color: var(--co-text-muted);
  line-height: 1.8;
  margin-bottom: 30px;
}

/* 双入口按钮 CTA (Nebula Action Buttons) */
.hero-cosmic-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.co-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 800;
  border-radius: var(--co-radius);
  text-decoration: none;
  transition: var(--co-transition);
  cursor: pointer;
}

.btn-nebula-glow {
  background: var(--co-gradient-nebula);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-nebula-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.8);
}

.btn-cosmic-outline {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border: 1px solid var(--co-border);
}

.btn-cosmic-outline:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-2px);
}

/* AI 对话框展示区 */
.cosmic-chat-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.cosmic-chat-svg {
  width: 100%;
  height: auto;
  max-width: 520px;
  filter: drop-shadow(0 15px 35px rgba(139, 92, 246, 0.25));
}

/* 星云指标条 (Cosmic Telemetry Ribbon) */
.cosmic-metric-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 36px;
  padding: 18px 24px;
  background: var(--co-card-bg);
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius-lg);
  box-shadow: var(--co-shadow);
}

.metric-star-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--co-border);
}

.metric-star-item:last-child {
  border-right: none;
}

.metric-star-item .val {
  font-size: 18px;
  font-weight: 900;
  color: #c084fc;
}

.metric-star-item .lbl {
  font-size: 12px;
  color: var(--co-text-sub);
  margin-top: 2px;
}

/* 通用 Section 排版 */
.section {
  padding: 60px 0;
}

.section-alt {
  background: rgba(15, 18, 38, 0.7);
  border-top: 1px solid var(--co-border);
  border-bottom: 1px solid var(--co-border);
}

.section-head {
  text-align: center;
  margin-bottom: 44px;
}

.cosmic-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #c084fc;
  background: rgba(139, 92, 246, 0.15);
  padding: 3px 12px;
  border-radius: 4px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.section-head h2 {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 10px;
  letter-spacing: -0.4px;
}

.section-head p {
  font-size: 15px;
  color: var(--co-text-muted);
  max-width: 680px;
  margin: 0 auto;
}

/* 六宫格功能模块区 (Cosmic Cards with Glowing Borders) */
.grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cosmic-card {
  background: var(--co-card-bg);
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius-lg);
  padding: 28px 24px;
  transition: var(--co-transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--co-shadow);
  position: relative;
}

.cosmic-card:hover {
  transform: translateY(-4px);
  background: var(--co-card-hover);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.card-orb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-star-num {
  font-family: var(--co-font-mono);
  font-size: 12px;
  font-weight: 900;
  color: #c084fc;
  background: rgba(139, 92, 246, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
}

.card-tag-text {
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
}

.cosmic-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
  line-height: 1.4;
}

.cosmic-card p {
  font-size: 14px;
  color: var(--co-text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
  flex: 1;
}

.cosmic-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #c084fc;
  text-decoration: none;
  transition: var(--co-transition);
}

.cosmic-link:hover {
  color: #e879f9;
  text-decoration: underline;
}

/* 正文介绍区 (教程中心 + 我们提供什么) */
.intro-cosmic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.intro-cosmic-box {
  background: var(--co-card-bg);
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius-lg);
  padding: 36px 30px;
  box-shadow: var(--co-shadow);
}

.intro-cosmic-box h3 {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.intro-cosmic-box p {
  font-size: 14px;
  color: var(--co-text-muted);
  line-height: 1.75;
  margin-bottom: 18px;
}

.cosmic-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cosmic-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #cbd5e1;
}

.star-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
  margin-top: 8px;
  flex-shrink: 0;
}

/* 热门教程表格 */
.table-cosmic-wrap {
  background: var(--co-card-bg);
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius-lg);
  overflow: hidden;
  box-shadow: var(--co-shadow);
}

.cosmic-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cosmic-table th {
  background-color: var(--co-surface);
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  border-bottom: 1px solid var(--co-border);
}

.cosmic-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--co-text-muted);
  border-bottom: 1px solid rgba(147, 51, 234, 0.12);
  vertical-align: middle;
}

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

.cosmic-table tr:hover td {
  background-color: rgba(139, 92, 246, 0.08);
}

.badge-target-cosmic {
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--co-border);
}

.badge-diff-cosmic {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.diff-easy {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.diff-med {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.diff-hard {
  background: rgba(217, 70, 239, 0.2);
  color: #f472b6;
}

/* FAQ 常见问答 */
.faq-cosmic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.faq-cosmic-card {
  background: var(--co-card-bg);
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius-lg);
  padding: 24px 22px;
}

.faq-cosmic-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-cosmic-q {
  color: #c084fc;
  font-weight: 900;
}

.faq-cosmic-card p {
  font-size: 14px;
  color: var(--co-text-muted);
  line-height: 1.7;
}

/* 延伸阅读区 */
.extended-cosmic-box {
  margin-top: 40px;
  background: var(--co-card-bg);
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius-lg);
  padding: 24px 28px;
}

.extended-cosmic-box h4 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
}

.extended-cosmic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.extended-cosmic-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--co-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #c084fc;
  text-decoration: none;
  transition: var(--co-transition);
}

.extended-cosmic-links a:hover {
  background: #8b5cf6;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

/* 页脚 */
.cosmic-footer {
  background: #05070e;
  color: #94a3b8;
  padding: 50px 0 30px;
  border-top: 1px solid var(--co-border);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  max-width: 520px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 16px;
}

.footer-orb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--co-gradient-nebula);
  color: #fff;
  border-radius: 6px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  max-width: 440px;
}

.footer-nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  transition: var(--co-transition);
}

.footer-nav a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #475569;
}

/* 子页面排版 */
.subpage-cosmic-hero {
  padding: 48px 0 36px;
  background: rgba(15, 18, 38, 0.85);
  border-bottom: 1px solid var(--co-border);
}

.subpage-cosmic-hero h1 {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 10px;
  letter-spacing: -0.4px;
}

.subpage-cosmic-hero p {
  font-size: 15px;
  color: var(--co-text-muted);
}

.article-cosmic-wrap {
  padding: 48px 0;
}

.article-cosmic-card {
  background: var(--co-card-bg);
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius-lg);
  padding: 40px;
  box-shadow: var(--co-shadow);
}

.article-cosmic-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--co-border);
}

.article-cosmic-card h2:first-child {
  margin-top: 0;
}

.article-cosmic-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #c084fc;
  margin: 24px 0 12px;
}

.article-cosmic-card p {
  font-size: 15px;
  color: var(--co-text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.article-cosmic-card ul, .article-cosmic-card ol {
  margin: 0 0 20px 24px;
  color: var(--co-text-muted);
}

.article-cosmic-card li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.cosmic-callout {
  background: rgba(139, 92, 246, 0.12);
  border-left: 4px solid #8b5cf6;
  padding: 16px 20px;
  border-radius: 0 var(--co-radius) var(--co-radius) 0;
  margin-bottom: 24px;
  font-size: 14px;
  color: #e0e7ff;
}

.code-box-cosmic {
  background: #05070e;
  color: #f8fafc;
  padding: 18px 22px;
  border-radius: var(--co-radius);
  font-family: var(--co-font-mono);
  font-size: 13px;
  overflow-x: auto;
  margin-bottom: 20px;
  line-height: 1.6;
  border: 1px solid rgba(147, 51, 234, 0.2);
}

@media (max-width: 900px) {
  .hero-cosmic-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-cosmic-cta {
    justify-content: center;
  }
  .grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  .intro-cosmic-grid, .faq-cosmic-grid {
    grid-template-columns: 1fr;
  }
  .cosmic-metric-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-star-item:nth-child(2) {
    border-right: none;
  }
}

@media (max-width: 640px) {
  .grid-6 {
    grid-template-columns: 1fr;
  }
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 14px 0;
    gap: 12px;
  }
  .cosmic-hero-section h1 {
    font-size: 26px;
  }
  .footer-top {
    flex-direction: column;
  }
  .cosmic-metric-bar {
    grid-template-columns: 1fr;
  }
  .metric-star-item {
    border-right: none;
    border-bottom: 1px solid var(--co-border);
  }
  .metric-star-item:last-child {
    border-bottom: none;
  }
}
