* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #0f1117;
    color: #e4e6ed;
    line-height: 1.7;
    font-size: 15px;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: 280px; height: 100vh;
    background: #1a1d27;
    border-right: 1px solid #2a2d3a;
    overflow-y: auto; z-index: 100;
    padding: 24px 0;
    transition: transform .3s;
}
.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #2a2d3a;
    margin-bottom: 12px;
}
.sidebar-header h1 {
    font-size: 16px; font-weight: 700;
    background: linear-gradient(135deg, #6c8cff, #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}
.sidebar-header p { font-size: 12px; color: #8b8fa3; }

.sidebar a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px; color: #8b8fa3;
    text-decoration: none; font-size: 13px;
    border-left: 3px solid transparent;
    transition: all .2s;
}
.sidebar a:hover { color: #e4e6ed; background: rgba(108,140,255,.06); }
.sidebar a.active {
    color: #6c8cff; background: rgba(108,140,255,.08);
    border-left-color: #6c8cff; font-weight: 600;
}
.sidebar a .num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px; font-size: 11px;
    background: rgba(108,140,255,.12); color: #6c8cff; flex-shrink: 0;
}
.sidebar a.active .num { background: #6c8cff; color: #fff; }

/* ── Mobile toggle ── */
.menu-btn {
    display: none; position: fixed; top: 14px; left: 14px; z-index: 200;
    width: 40px; height: 40px; border-radius: 10px;
    background: #1a1d27; border: 1px solid #2a2d3a;
    color: #e4e6ed; font-size: 20px; cursor: pointer;
    align-items: center; justify-content: center;
}

/* ── Main ── */
.main {
    margin-left: 280px;
    padding: 40px 48px 120px;
}

/* ── Hero ── */
.hero {
    text-align: center; padding: 48px 0 40px;
    border-bottom: 1px solid #2a2d3a; margin-bottom: 48px;
}
.hero h1 {
    font-size: 36px; font-weight: 800;
    background: linear-gradient(135deg, #6c8cff, #a78bfa, #34d399);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}
.hero p { color: #8b8fa3; font-size: 16px; max-width: 520px; margin: 0 auto; }
.hero .badge {
    display: inline-block; margin-top: 16px; padding: 6px 16px;
    border-radius: 20px; font-size: 12px; font-weight: 600;
    background: rgba(108,140,255,.12); color: #6c8cff;
}

/* ── Sections ── */
.section { margin-bottom: 56px; scroll-margin-top: 24px; }
.section h2 {
    font-size: 24px; font-weight: 700; margin-bottom: 24px;
    padding-bottom: 12px; border-bottom: 1px solid #2a2d3a;
    display: flex; align-items: center; gap: 12px;
}
.section h2 .icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px; font-size: 18px; flex-shrink: 0;
}
.section h3 {
    font-size: 17px; font-weight: 600; margin: 28px 0 14px;
    color: #a78bfa;
}
.section p { margin-bottom: 12px; }
.section strong { color: #fff; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border-radius: 12px; border: 1px solid #2a2d3a; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left; padding: 12px 16px; font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: .5px; color: #8b8fa3;
    background: rgba(108,140,255,.06); border-bottom: 1px solid #2a2d3a;
}
td { padding: 11px 16px; border-bottom: 1px solid #2a2d3a; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(108,140,255,.03); }

/* ── Code ── */
pre {
    background: #141720; border: 1px solid #2a2d3a;
    border-radius: 12px; padding: 18px 20px;
    overflow-x: auto; margin: 14px 0 20px; font-size: 13px; line-height: 1.65;
}
code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 13px;
}
:not(pre) > code {
    background: rgba(108,140,255,.1); padding: 2px 7px;
    border-radius: 5px; color: #6c8cff; font-size: 13px;
}
.code-lang {
    display: block; font-size: 11px; color: #8b8fa3;
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px;
}

/* ── Cards ── */
.card-grid { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0 24px; }
.card {
    flex: 1 1 260px;
    background: #1a1d27; border: 1px solid #2a2d3a;
    border-radius: 12px; padding: 20px;
    transition: border-color .2s, transform .2s;
}
.card:hover { border-color: #6c8cff; transform: translateY(-2px); }
.card h4 { font-size: 15px; margin-bottom: 8px; }
.card p { font-size: 13px; color: #8b8fa3; margin: 0; }

/* ── Home page cards ── */
.card-grid > a.card {
  text-decoration: none;
  color: inherit;
}
.card-grid > a.card h4 {
  color: #e4e6ed;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-grid > a.card:hover h4 {
  color: #6c8cff;
}
.card-grid > a.card .card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(108,140,255,.12);
  color: #6c8cff;
  flex-shrink: 0;
}

/* ── Alert / Tip boxes ── */
.tip, .warn, .info-box {
    border-radius: 12px; padding: 16px 20px;
    margin: 16px 0 24px; font-size: 14px;
    border-left: 4px solid;
}
.tip { background: rgba(52,211,153,.06); border-color: #34d399; }
.tip::before {
    content: '\f0eb';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    color: #34d399;
}
.warn { background: rgba(248,113,113,.06); border-color: #f87171; }
.warn::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    color: #f87171;
}
.info-box { background: rgba(108,140,255,.06); border-color: #6c8cff; }
.info-box::before {
    content: '\f08d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    color: #6c8cff;
}

/* ── Steps ── */
.steps { counter-reset: step; margin: 16px 0 24px; }
.step {
    display: flex; gap: 16px; margin-bottom: 18px; align-items: flex-start;
}
.step::before {
    counter-increment: step; content: counter(step);
    display: flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, #6c8cff, #a78bfa);
    color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
    margin-top: 2px;
}
.step-content { flex: 1; }
.step-content h4 { font-size: 15px; margin-bottom: 6px; color: #fff; }
.step-content p, .step-content ul { font-size: 14px; color: #8b8fa3; margin: 0; }
.step-content ul { padding-left: 18px; }
.step-content li { margin-bottom: 4px; }

/* ── Checklist ── */
.checklist { list-style: none; margin: 16px 0 24px; }
.checklist li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid #2a2d3a;
    font-size: 14px; color: #8b8fa3;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
    content: ''; width: 20px; height: 20px; border-radius: 5px;
    border: 2px solid #2a2d3a; flex-shrink: 0;
}

/* ── Comparison ── */
.compare {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin: 16px 0 24px;
}
.compare-item {
    background: #1a1d27; border: 1px solid #2a2d3a;
    border-radius: 12px; padding: 20px; text-align: center;
}
.compare-item h4 { margin-bottom: 8px; }
.compare-item p { font-size: 13px; color: #8b8fa3; }

/* ── Tree ── */
.tree {
    background: #141720; border: 1px solid #2a2d3a;
    border-radius: 12px; padding: 20px; margin: 16px 0 24px;
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 13px; line-height: 1.8; color: #34d399;
}

/* ── Scroll to top ── */
.scroll-top {
    position: fixed; bottom: 30px; right: 30px; z-index: 100;
    width: 44px; height: 44px; border-radius: 12px;
    background: #6c8cff; color: #fff; border: none;
    font-size: 20px; cursor: pointer; display: none;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(108,140,255,.3);
    transition: transform .2s;
}
.scroll-top:hover { transform: scale(1.1); }
.scroll-top.show { display: flex; }

/* ── Progress bar ── */
.progress {
    position: fixed; top: 0; left: 280px; right: 0;
    height: 3px; background: rgba(108,140,255,.2); z-index: 99;
}
.progress-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #6c8cff, #a78bfa);
    transition: width .15s;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .menu-btn { display: flex; }
    .main { margin-left: 0; padding: 80px 20px 100px; }
    .progress { left: 0; }
    .compare { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
}

a { color: inherit; text-decoration: none; }

/* ── Images ── */
.img-full {
    width: 100%; max-width: 100%;
    border-radius: 10px;
    border: 1px solid #2a2d3a;
    margin-top: 12px;
    display: block;
}

/* ── Color helpers ── */
.c-blue { background: rgba(108,140,255,.12); color: #6c8cff; }
.c-purple { background: rgba(167,139,250,.12); color: #a78bfa; }
.c-green { background: rgba(52,211,153,.12); color: #34d399; }
.c-amber { background: rgba(245,158,11,.12); color: #f59e0b; }
.c-red { background: rgba(248,113,113,.12); color: #f87171; }

/* ── Version badges ── */
.ver { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.ver-best { background: rgba(52,211,153,.12); color: #34d399; }
.ver-ok { background: rgba(108,140,255,.12); color: #6c8cff; }
.ver-old { background: rgba(245,158,11,.12); color: #f59e0b; }
.ver-bad { background: rgba(248,113,113,.12); color: #f87171; }