/* ==========================================
   Tutorial Page  -  tutorial/index.html
========================================== */

/* ── Hero ─────────────────────────────── */
.tut-hero {
    position: relative; padding: 130px 5% 72px;
    text-align: center; overflow: hidden;
    background:
        radial-gradient(ellipse 80% 55% at 50% -5%, rgba(37,99,235,0.09) 0%, transparent 65%),
        radial-gradient(ellipse 45% 35% at 90% 80%, rgba(124,58,237,0.06) 0%, transparent 55%);
}
.tut-hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(circle, rgba(37,99,235,0.10) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 85% 70% at 50% 25%, black 5%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 25%, black 5%, transparent 100%);
}
/* Floating step number decorations */
.tut-deco {
    position: absolute; z-index: 2;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: var(--radius-full);
    font-size: 12.5px; font-weight: 600;
    background: white; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); color: var(--text-2);
    white-space: nowrap; pointer-events: none;
    animation: tutDecoFloat 4s ease-in-out infinite;
}
.tut-deco-num {
    font-family: var(--mono); font-size: 11px; font-weight: 800;
    color: white; background: var(--primary);
    padding: 1px 6px; border-radius: 4px;
}
.tut-deco-1 { top: 120px; left: 6%; animation-delay: 0s; }
.tut-deco-2 { top: 100px; right: 6%; animation-delay: 1s; }
.tut-deco-3 { bottom: 80px; left: 8%; animation-delay: 2s; }
.tut-deco-4 { bottom: 90px; right: 8%; animation-delay: 1.5s; }
@keyframes tutDecoFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

@media (max-width: 768px) {
    .tut-deco-1, .tut-deco-2, .tut-deco-3, .tut-deco-4 { display: none; }
}

/* Hero meta tags */
.tut-hero-meta {
    display: flex; justify-content: center; gap: 12px;
    flex-wrap: wrap; margin-top: 24px;
}
.tut-hero-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: var(--radius-full);
    background: var(--bg-2); border: 1px solid var(--border);
    font-size: 13px; font-weight: 600; color: var(--text-3);
}
.tut-hero-tag i { color: var(--primary); font-size: 12px; }

.tut-hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.tut-hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px; margin-bottom: 24px;
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-full); font-size: 13px;
    font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-xs);
}
.tut-hero h1 {
    font-size: clamp(32px, 5vw, 56px); font-weight: 900;
    line-height: 1.1; letter-spacing: -1.5px; margin-bottom: 18px; color: var(--text-1);
}
.tut-hero p {
    font-size: 16px; color: var(--text-3);
    line-height: 1.8; max-width: 540px; margin: 0 auto;
}

/* ── Jump Nav ─────────────────────────── */
.tut-jumpnav {
    background: white; border-bottom: 1px solid var(--border);
    position: sticky; top: 68px; z-index: 100; padding: 0 5%;
    margin-top: 40px;
}
.tut-jumpnav-inner {
    display: flex; gap: 0; overflow-x: auto;
    max-width: 1060px; margin: 0 auto;
    -ms-overflow-style: none; scrollbar-width: none;
}
.tut-jumpnav-inner::-webkit-scrollbar { display: none; }
.tut-jumptab {
    display: flex; align-items: center; gap: 7px;
    padding: 13px 18px; white-space: nowrap;
    border: none; border-bottom: 2px solid transparent;
    background: transparent; cursor: pointer; font-family: var(--font);
    font-size: 13.5px; font-weight: 500; color: var(--text-3);
    transition: var(--trans); margin-bottom: -1px; text-decoration: none;
}
.tut-jumptab i { font-size: 12px; }
.tut-jumptab:hover { color: var(--text-1); }
.tut-jumptab.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }

/* ── Tutorial Body ────────────────────── */
.tut-body {
    max-width: 820px; margin: 0 auto;
    padding: 0 5% 100px;
    overflow-x: hidden;
}

/* ── Tutorial Chapter ─────────────────── */
.tut-chapter { padding-top: 64px; margin-bottom: 0; }

.tut-chapter-hd {
    display: flex; align-items: flex-start; gap: 16px;
    margin-bottom: 36px; padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}
.tut-chapter-num {
    flex-shrink: 0; width: 44px; height: 44px;
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 900; font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: white;
}
.tut-chapter-info h2 {
    font-size: 22px; font-weight: 800; color: var(--text-1);
    letter-spacing: -0.4px; margin-bottom: 5px;
}
.tut-chapter-info p { font-size: 14px; color: var(--text-4); }

/* What you'll learn box */
.tut-learn {
    background: var(--primary-light);
    border: 1px solid rgba(37,99,235,0.15);
    border-radius: var(--radius-lg); padding: 18px 20px;
    margin-bottom: 32px; display: flex; gap: 12px; align-items: flex-start;
}
.tut-learn i { color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.tut-learn-content { font-size: 13.5px; color: var(--primary); line-height: 1.7; }
.tut-learn-content strong { font-weight: 700; display: block; margin-bottom: 4px; }
.tut-learn-content ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; }
.tut-learn-content ul li::before { content: '✓ '; font-weight: 700; }

/* ── Steps ────────────────────────────── */
.tut-steps { display: flex; flex-direction: column; gap: 0; }

.tut-step {
    display: grid; grid-template-columns: 48px 1fr;
    gap: 0 20px;
}
.tut-step-left { display: flex; flex-direction: column; align-items: center; }
.tut-step-num {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; font-family: var(--font-mono);
    background: white; border: 2px solid var(--border); color: var(--text-3);
    z-index: 1; margin-top: 4px;
    transition: var(--trans);
}
.tut-step:hover .tut-step-num {
    border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}
.tut-step-line {
    width: 2px; flex: 1; min-height: 24px;
    background: linear-gradient(180deg, var(--border), transparent);
    margin: 4px 0;
}
.tut-step:last-child .tut-step-line { display: none; }

.tut-step-body { padding: 4px 0 32px; min-width: 0; }
.tut-step-title {
    font-size: 16px; font-weight: 800; color: var(--text-1);
    margin-bottom: 10px; letter-spacing: -0.2px;
}
.tut-step-desc {
    font-size: 14.5px; color: var(--text-3); line-height: 1.85;
}
.tut-step-desc p { margin-bottom: 10px; }
.tut-step-desc p:last-child { margin-bottom: 0; }
.tut-step-desc strong { color: var(--text-2); font-weight: 700; }
.tut-step-desc a { color: var(--primary); font-weight: 600; }
.tut-step-desc a:hover { text-decoration: underline; }
.tut-step-desc ul {
    list-style: none; margin: 10px 0; padding: 0;
    display: flex; flex-direction: column; gap: 7px;
}
.tut-step-desc ul li { padding-left: 16px; position: relative; }
.tut-step-desc ul li::before {
    content: ''; position: absolute; left: 0; top: 9px;
    width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}

/* Code block */
.tut-code {
    margin: 14px 0;
    background: #0f172a; border-radius: var(--radius-md);
    padding: 16px 18px;
    overflow: hidden; /* 不在此滚动，交由 pre 处理 */
    font-family: var(--font-mono); font-size: 13px; line-height: 1.75;
    max-width: 100%;
}
.tut-code-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    /* 头部栏宽度固定不参与横向滚动 */
}
.tut-code-lang { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.3); letter-spacing: 1px; text-transform: uppercase; }
.tut-code-copy {
    font-size: 11px; color: rgba(255,255,255,0.35); cursor: pointer;
    background: none; border: none; font-family: var(--font); padding: 0;
    transition: color 0.2s;
}
.tut-code-copy:hover { color: rgba(255,255,255,0.7); }
/* 只让 pre 横向滚动，头部栏保持不动 */
.tut-code pre {
    margin: 0; white-space: pre; color: #e2e8f0;
    overflow-x: auto; padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.tut-code pre::-webkit-scrollbar { height: 4px; }
.tut-code pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.tut-code .kw  { color: #93c5fd; }
.tut-code .val { color: #86efac; }
.tut-code .str { color: #fca5a5; }
.tut-code .cmt { color: rgba(255,255,255,0.3); font-style: italic; }
.tut-code .num { color: #fde68a; }

/* Tip / Warning / Info boxes */
.tut-tip {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; border-radius: var(--radius-md);
    font-size: 13.5px; line-height: 1.65; margin: 14px 0;
}
.tut-tip i { margin-top: 2px; flex-shrink: 0; }
.tut-tip.tip-info   { background: var(--primary-light);          color: var(--primary); }
.tut-tip.tip-warn   { background: rgba(245,158,11,0.1);          color: var(--warning); }
.tut-tip.tip-ok     { background: rgba(16,185,129,0.1);          color: var(--success); }
.tut-tip.tip-danger { background: rgba(239,68,68,0.1);           color: var(--danger);  }

/* Platform badge */
.platform-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pb {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: var(--radius-full);
    font-size: 12px; font-weight: 700; border: 1px solid var(--border);
    background: var(--bg-3); color: var(--text-3);
}
.pb.win    { background: rgba(37,99,235,0.08); color: var(--primary);  border-color: rgba(37,99,235,0.18); }
.pb.mac    { background: rgba(124,58,237,0.08); color: var(--accent);   border-color: rgba(124,58,237,0.18); }
.pb.linux  { background: rgba(245,158,11,0.08); color: var(--warning);  border-color: rgba(245,158,11,0.18); }
.pb.android{ background: rgba(16,185,129,0.08); color: var(--success);  border-color: rgba(16,185,129,0.18); }

/* Chapter divider */
.tut-divider {
    border: none; border-top: 1px solid var(--border);
    margin: 0; padding: 0;
}

/* ── Help CTA ─────────────────────────── */
.tut-cta {
    background: var(--bg-2); border-top: 1px solid var(--border);
    padding: 72px 5%; text-align: center;
}
.tut-cta h2 {
    font-size: clamp(22px, 3vw, 32px); font-weight: 800;
    letter-spacing: -0.5px; margin-bottom: 10px; color: var(--text-1);
}
.tut-cta p { font-size: 15px; color: var(--text-3); max-width: 420px; margin: 0 auto 32px; line-height: 1.7; }
.tut-cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Responsive ───────────────────────── */
@media (max-width: 768px) {
    .tut-hero { padding: 88px 5% 48px; }
    .tut-body { padding: 40px 5% 60px; }
    .tut-chapter { padding-top: 48px; }
    .tut-cta { padding: 60px 5%; }
}

@media (max-width: 640px) {
    .tut-hero { padding: 80px 5% 40px; }
    .tut-chapter-hd { flex-direction: column; gap: 12px; }
    .tut-jumptab { padding: 11px 12px; font-size: 12.5px; }
    .tut-step { grid-template-columns: 36px 1fr; gap: 0 14px; }
    .tut-step-num { width: 30px; height: 30px; font-size: 12px; }
    .tut-cta-btns { flex-direction: column; align-items: stretch; }
    .tut-cta-btns .btn { text-align: center; justify-content: center; }
}

@media (max-width: 480px) {
    .tut-hero { padding: 76px 5% 36px; }
    .tut-code { font-size: 12px; }
}
