﻿/* ==========================================================
   上线性能与顺滑度增强引擎 (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 {
  --bg-dark: #090d16;
  --bg-dark-secondary: #0d1424;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(139, 92, 246, 0.25);
  --glass-border-hover: rgba(168, 85, 247, 0.6);
  --glass-border-blue: rgba(59, 130, 246, 0.35);
  
  --primary-blue: #3b82f6;
  --primary-purple: #8b5cf6;
  --primary-pink: #ec4899;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --gradient-main: linear-gradient(135deg, #60a5fa 0%, #a855f7 50%, #f472b6 100%);
  --gradient-btn: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-btn-hover: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-shadow: 0 0 25px rgba(139, 92, 246, 0.25);
}

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

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

a { color: #60a5fa; text-decoration: none; font-weight: 600; }
a:hover { color: #93c5fd; text-decoration: underline; }

.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* 顶部玻璃声明条 */
.glass-topbar {
  background: rgba(13, 20, 36, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.glass-badge {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.4);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.topbar-text strong { color: #f1f5f9; }

/* 玻璃头部导航 */
.glass-header {
  background: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}
.brand-gradient-orb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gradient-main);
  box-shadow: 0 0 12px #a855f7;
}
.brand-title {
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.02em;
}
.brand-title span {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  color: var(--text-muted);
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all .2s ease;
}
.nav a:hover, .nav a.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(168, 85, 247, 0.5);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

/* 蓝紫玻璃 Hero */
.hero {
  padding: 56px 0 44px;
  text-align: center;
  position: relative;
}
.hero-glow-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
.hero h1 {
  font-size: clamp(26px, 4.2vw, 42px);
  font-weight: 950;
  line-height: 1.35;
  margin-bottom: 18px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 16.5px;
  color: var(--text-muted);
  max-width: 920px;
  margin: 0 auto 28px;
  line-height: 1.8;
}
.hero strong { color: #60a5fa; }

.hero-cta-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}
.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  font-size: 15.5px;
  font-weight: 800;
  border-radius: 8px;
  transition: all .25s ease;
}
.glass-btn.primary {
  background: var(--gradient-btn);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}
.glass-btn.primary:hover {
  background: var(--gradient-btn-hover);
  box-shadow: 0 6px 25px rgba(124, 58, 237, 0.6);
  text-decoration: none;
  transform: translateY(-2px);
}
.glass-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}
.glass-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-purple);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
  transform: translateY(-2px);
}

/* 通用 Section */
.section {
  padding: 48px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 26px;
}
.section-head h2 {
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 900;
  color: #ffffff;
}
.section-note {
  max-width: 480px;
  color: var(--text-dim);
  font-size: 14px;
}

/* 核心六宫格：蓝紫渐变玻璃卡片 */
.grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}
.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  opacity: 0.6;
  transition: opacity .25s ease;
}
.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
  box-shadow: 0 12px 36px 0 rgba(139, 92, 246, 0.22);
}
.glass-card:hover::before { opacity: 1; }

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}
.card-idx {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 700;
}
.glass-card h3 {
  font-size: 18.5px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
}
.glass-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}
.glass-card strong { color: #60a5fa; }

/* 正文介绍区 */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.intro-glass-box {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--glass-shadow);
}
.intro-glass-box h3 {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.intro-glass-box p {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.8;
}
.intro-list {
  list-style: none;
  display: grid;
  gap: 10px;
}
.intro-list li {
  font-size: 14px;
  color: #e2e8f0;
  padding-left: 20px;
  position: relative;
}
.intro-list li::before {
  content: "✦";
  color: #a855f7;
  position: absolute;
  left: 0;
  font-size: 12px;
}

/* 热门教程表格 */
.table-wrap {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: var(--glass-shadow);
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th, td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}
th {
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
  font-weight: 800;
  border-bottom: 2px solid var(--glass-border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.03); }
.level-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}
.level-badge.easy { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
.level-badge.medium { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.4); }
.level-badge.hard { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.4); }

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
}
details {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 18px 22px;
  transition: all .2s ease;
}
details:hover {
  border-color: var(--primary-purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}
summary {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 18px;
  color: #c084fc;
  font-weight: 900;
}
details[open] summary::after { content: "−"; }
details p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.8;
}

/* 子页文章 */
.article {
  max-width: 900px;
  margin: 36px auto;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 40px;
  box-shadow: var(--glass-shadow);
}
.article h1 {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 950;
  margin-bottom: 16px;
  line-height: 1.35;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.article-lead {
  background: rgba(139, 92, 246, 0.1);
  border-left: 4px solid var(--primary-purple);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 14.5px;
  color: #cbd5e1;
  border-radius: 0 6px 6px 0;
  line-height: 1.8;
}
.article h2 {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  margin: 28px 0 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.article p, .article li {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 12px;
  line-height: 1.8;
}
.article ul { margin-left: 20px; }
.article strong { color: #f1f5f9; }

/* 页脚 */
.glass-footer {
  margin-top: 50px;
  background: rgba(9, 13, 22, 0.95);
  border-top: 1px solid var(--glass-border);
  padding: 44px 0 24px;
  color: var(--text-dim);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 28px;
}
.footer-brand strong {
  display: block;
  font-size: 16px;
  color: #ffffff;
  margin: 6px 0 4px;
}
.footer-brand p {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 440px;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-nav a {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-nav a:hover {
  background: rgba(139, 92, 246, 0.25);
  color: #ffffff;
  border-color: var(--primary-purple);
  text-decoration: none;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 18px;
  font-size: 12.5px;
  text-align: center;
}

@media (max-width: 960px) {
  .header-inner { flex-direction: column; align-items: flex-start; padding: 12px 0; }
  .grid-6, .intro-grid { grid-template-columns: 1fr; }
  .section-head, .footer-top { flex-direction: column; align-items: flex-start; }
  .article { padding: 22px 16px; }
  .topbar-inner { flex-direction: column; align-items: flex-start; }
}
