/* ============================================================
   闪连 — Global Stylesheet
   Responsive: Mobile-First, Breakpoints at 480px / 768px / 1024px
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #0ea5e9;
  --text: #1e293b;
  --text-secondary: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --max-width: 1100px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .2s;
}
a:hover {
  color: var(--primary-dark);
}

h1, h2, h3, h4 {
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p { margin-bottom: 1rem; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: .4rem; }

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 3rem 0;
}

/* --- Header & Navigation --- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}
.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.logo img {
  width: 32px;
  height: 32px;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}
.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: .95rem;
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: .3rem;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  color: var(--text-secondary);
  font-size: .9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}
.footer-col h4 {
  margin-bottom: .8rem;
  font-size: 1rem;
}
.footer-col ul {
  list-style: none;
  padding: 0;
}
.footer-col ul li { margin-bottom: .3rem; }
.footer-col a { color: var(--text-secondary); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  text-align: center;
  padding: 4rem 1rem;
}
.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 2rem;
}
.hero-badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: .7rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: background .2s, transform .15s, box-shadow .2s;
  text-align: center;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-lg {
  padding: .9rem 2rem;
  font-size: 1.05rem;
}
.btn-sm {
  padding: .4rem 1rem;
  font-size: .85rem;
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-icon {
  font-size: 2rem;
  margin-bottom: .8rem;
}
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--text-secondary); font-size: .95rem; }

/* --- Feature rows --- */
.feature-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.feature-row.reverse { flex-direction: row-reverse; }
.feature-text { flex: 1; min-width: 280px; }
.feature-img  { flex: 1; min-width: 280px; text-align: center; }
.feature-img img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* --- Download cards --- */
.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.download-card .platform-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.download-card h3 { margin-bottom: .3rem; }
.download-card .version {
  color: var(--text-secondary);
  font-size: .85rem;
  margin-bottom: 1rem;
}

/* --- FAQ --- */
.faq-list { max-width: 800px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .8rem;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: none;
  padding: 1rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-family: var(--font-sans);
}
.faq-question::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform .3s;
}
.faq-item.open .faq-question::after {
  content: "−";
  transform: rotate(180deg);
}
.faq-answer {
  display: none;
  padding: 0 1.2rem 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* --- Article --- */
.article-header {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
}
.article-meta {
  color: var(--text-secondary);
  font-size: .9rem;
  margin-bottom: .5rem;
}
.article-body {
  max-width: 750px;
  margin: 0 auto;
  padding: 1rem;
}
.article-body h2 {
  margin-top: 2rem;
  margin-bottom: .8rem;
}
.article-body h3 {
  margin-top: 1.5rem;
  margin-bottom: .5rem;
}
.article-body img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: .8rem 1.2rem;
  margin: 1.5rem 0;
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}
.article-nav {
  display: flex;
  justify-content: space-between;
  max-width: 750px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* --- Sitemap --- */
.sitemap-tree { max-width: 700px; margin: 0 auto; }
.sitemap-tree ul { list-style: none; padding-left: 1.2rem; }
.sitemap-tree > ul { padding-left: 0; }
.sitemap-tree li { margin-bottom: .5rem; }
.sitemap-tree a {
  display: inline-block;
  padding: .3rem 0;
  font-size: 1rem;
}
.sitemap-tree .dir {
  font-weight: 600;
  color: var(--text);
  margin-top: .8rem;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: .85rem;
  color: var(--text-secondary);
  padding: .8rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }

/* --- Steps --- */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.steps li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .95rem;
}

/* --- Table of Contents --- */
.toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
}
.toc h4 { margin-bottom: .6rem; }
.toc ol { margin-bottom: 0; font-size: .95rem; }

/* ============================================================
   RESPONSIVE — 768px breakpoint
   ============================================================ */
@media (max-width: 768px) {
  html { font-size: 15px; }

  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }

  .header-inner { height: 54px; }
  .nav-links {
    display: none;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--border);
    border-bottom: none;
  }
  .menu-toggle { display: block; }

  .hero { padding: 2.5rem 1rem; }
  .hero h1 { font-size: 1.7rem; }

  .feature-row { flex-direction: column; }
  .feature-row.reverse { flex-direction: column; }

  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}

/* ============================================================
   RESPONSIVE — 480px breakpoint
   ============================================================ */
@media (max-width: 480px) {
  html { font-size: 14px; }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }
  h3 { font-size: 1.05rem; }

  .section { padding: 1.8rem 0; }
  .hero { padding: 1.8rem .8rem; }
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: .95rem; }

  .container { padding: 0 .75rem; }

  .btn-lg { padding: .7rem 1.4rem; font-size: .95rem; }
  .card { padding: 1rem; }

  .article-body { padding: 0 .75rem; }
  .article-body h2 { font-size: 1.2rem; }

  .breadcrumb { font-size: .8rem; padding: .6rem .75rem; }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
