﻿/* ==========================================================
   上线性能与顺滑度增强引擎 (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: #0b0f19;
  --surface: #131b2e;
  --surface-hover: #1c2640;
  --surface-subtle: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --line: #1e293b;
  --border-card: #273552;
  
  --brand-primary: #38bdf8;
  --brand-blue: #0284c7;
  --brand-indigo: #6366f1;
  --brand-emerald: #10b981;
  --brand-amber: #f59e0b;
  --brand-rose: #f43f5e;
}

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

body {
  background: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.7;
}

a { color: var(--brand-primary); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }

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

/* 顶部声明栏 */
.notice {
  background: #0f172a;
  border-bottom: 1px solid var(--line);
  color: #94a3b8;
  font-size: 13px;
  padding: 10px 0;
}
.notice-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notice-badge {
  background: #1e293b;
  color: #38bdf8;
  border: 1px solid #334155;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* 导航栏 */
.site-header {
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 20px;
  font-weight: 900;
  border-bottom: none;
}
.brand-bento {
  color: var(--brand-primary);
  font-size: 24px;
}
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav a {
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  transition: all .2s ease;
}
.nav a:hover {
  background: var(--surface-hover);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  text-decoration: none;
}

/* 首屏 Hero */
.hero {
  padding: 56px 0 44px;
  background: radial-gradient(circle at 50% 0%, #1e293b 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--line);
}
.bento-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 950;
  line-height: 1.18;
  letter-spacing: -0.04em;
  color: #ffffff;
  margin-bottom: 18px;
  max-width: 960px;
}
.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 860px;
  line-height: 1.7;
}
.hero strong { color: #ffffff; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
  margin-bottom: 38px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 16px;
  transition: all .2s ease;
}
.button.primary {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #0b0f19;
  border: 1px solid #38bdf8;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.3);
}
.button.primary:hover {
  background: #38bdf8;
  text-decoration: none;
}
.button.secondary {
  background: var(--surface);
  color: #ffffff;
  border: 1px solid var(--border-card);
}
.button.secondary:hover {
  background: var(--surface-hover);
  border-color: #475569;
  text-decoration: none;
}

/* 核心 Bento Grid 功能入口展区 */
.bento-showcase {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 10px;
}
.bento-item {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.bento-item:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.12);
}
.bento-item.col-8 { grid-column: span 8; }
.bento-item.col-4 { grid-column: span 4; }
.bento-item.col-6 { grid-column: span 6; }
.bento-item.col-12 { grid-column: span 12; }

.bento-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.bento-icon {
  font-size: 26px;
  display: inline-flex;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}
.bento-status {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(56, 189, 248, 0.2);
}
.bento-item h3 {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
}
.bento-item p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}
.bento-features {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.bento-features li {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.bento-features li strong { color: var(--text-main); }

/* 通用 Section */
.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: clamp(26px, 3.8vw, 36px);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
}
.section-note {
  max-width: 480px;
  color: var(--text-dim);
  font-size: 15px;
}

/* 六宫格功能模块区 */
.grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 24px;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}
.card-num {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 700;
}
.card h3 {
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 10px;
  color: #ffffff;
}
.card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.card strong { color: var(--text-main); }

/* 正文介绍区 */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.intro-box {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 30px;
}
.intro-box h3 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 14px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.intro-box p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 14px;
}
.intro-box ul {
  list-style: none;
  display: grid;
  gap: 10px;
}
.intro-box li {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
}
.intro-box li::before {
  content: "⊞";
  position: absolute;
  left: 0;
  color: var(--brand-primary);
  font-size: 14px;
}

/* 热门教程表格 */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  overflow-x: auto;
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-hover); }
.level-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.level-badge.easy { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.level-badge.medium { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.level-badge.hard { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

/* FAQ 区域 */
.faq-list {
  display: grid;
  gap: 12px;
}
details {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 18px 22px;
}
summary {
  font-size: 17px;
  font-weight: 900;
  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: 20px;
  color: var(--brand-primary);
  font-weight: 900;
}
details[open] summary::after {
  content: "−";
}
details p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

/* 子页面文章样式 */
.article {
  max-width: 900px;
  margin: 44px auto;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 42px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.article h1 {
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 950;
  color: #ffffff;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
  line-height: 1.25;
}
.article-lead {
  font-size: 16px;
  color: var(--text-muted);
  border-left: 4px solid var(--brand-primary);
  padding: 12px 18px;
  margin-bottom: 28px;
  background: #0f172a;
  border-radius: 0 8px 8px 0;
}
.article h2 {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  margin: 32px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.article p, .article li {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 14px;
  line-height: 1.8;
}
.article ul { margin-left: 20px; }
.article .bento-note {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  color: #38bdf8;
  font-size: 14px;
}
.article .bento-note strong { color: #e0f2fe; }

/* 页脚 */
.site-footer {
  margin-top: 56px;
  background: #070a12;
  color: #94a3b8;
  padding: 48px 0 32px;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 30px;
}
.footer-brand strong {
  display: block;
  font-size: 17px;
  color: #ffffff;
  margin: 8px 0 4px;
}
.footer-brand p {
  font-size: 13px;
  color: #64748b;
  max-width: 440px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-links a {
  color: #cbd5e1;
  background: #1e293b;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #334155;
}
.footer-links a:hover {
  background: var(--brand-primary);
  color: #0b0f19;
  border-color: var(--brand-primary);
  text-decoration: none;
}
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 20px;
  font-size: 13px;
  color: #475569;
  text-align: center;
}

/* 响应式断点 */
@media (max-width: 960px) {
  .bento-item.col-8, .bento-item.col-4, .bento-item.col-6 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .header-inner { flex-direction: column; align-items: flex-start; padding: 14px 0; }
  .grid-6, .intro-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .footer-top { flex-direction: column; }
  .article { padding: 24px 18px; }
  .notice-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .bento-features { grid-template-columns: 1fr; }
}
