/* =========================================
   tutorial.css — 教程页
========================================= */

/* 覆盖 style.css 的 snap-scroll 基础设定 */
html {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    scroll-padding-top: 96px;
}
body {
    overflow: visible;
    height: auto;
    padding-top: 80px;
}

/* =========================================
   页面顶部 Hero
========================================= */
.tut-header {
    background: var(--color-black);
    padding: 64px 40px 72px;
    position: relative; overflow: hidden;
}
.tut-header-inner {
    max-width: 1200px; margin: 0 auto;
    position: relative; z-index: 1;
}
.tut-header-label {
    font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--brand-cyan); margin-bottom: 16px; display: block;
}
.tut-header-title {
    font-size: 64px; font-weight: 900;
    letter-spacing: -2.5px; line-height: 1.05;
    color: var(--color-white); margin-bottom: 16px;
}
.tut-header-desc {
    font-size: 16px; font-weight: 500;
    color: #71717A; line-height: 1.6;
    max-width: 560px; margin-bottom: 40px;
}

/* 步骤预览条 */
.tut-steps-strip {
    display: flex; gap: 1px;
    background: #1c1c1e;
    border: 1px solid #1c1c1e;
    border-radius: 14px; overflow: hidden;
    max-width: 800px;
}
.tut-step-pill {
    flex: 1; display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; background: #09090B;
    text-decoration: none; transition: var(--transition);
    position: relative;
}
.tut-step-pill:hover { background: #111113; }
.tut-step-pill-num {
    width: 24px; height: 24px; border-radius: 8px;
    background: var(--brand-gradient);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 900; color: white;
    flex-shrink: 0;
}
.tut-step-pill-label {
    font-size: 12px; font-weight: 700; color: #A1A1AA;
    line-height: 1.3;
}
.tut-step-pill:hover .tut-step-pill-label { color: white; }

/* =========================================
   布局：左侧目录 + 右侧内容
========================================= */
.tut-layout {
    max-width: 1200px; margin: 0 auto;
    padding: 56px 40px 100px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 56px; align-items: start;
}

/* ── 左侧粘性目录 ── */
.tut-sidebar {
    position: sticky;
    top: 96px;
    align-self: start;           /* CSS Grid 中 sticky 生效的关键 */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
}
.tut-sidebar::-webkit-scrollbar { display: none; }
.tut-sidebar-title {
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-secondary); margin-bottom: 16px;
}
.tut-nav { list-style: none; padding: 0; margin: 0; }
.tut-nav li + li { margin-top: 2px; }
.tut-nav a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary); text-decoration: none;
    transition: var(--transition);
}
.tut-nav a:hover { color: var(--brand-blue); background: #EFF6FF; }
.tut-nav a.active { color: var(--brand-blue); background: #EFF6FF; font-weight: 800; }
.tut-nav-num {
    width: 18px; height: 18px; border-radius: 5px;
    background: var(--color-bg-alt); border: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 900; flex-shrink: 0;
    color: var(--text-secondary);
}
.tut-nav a.active .tut-nav-num {
    background: var(--brand-gradient); border-color: transparent; color: white;
}
.tut-nav-sub { padding-left: 26px; }
.tut-nav-sub a { font-size: 12px; color: #94A3B8; padding: 5px 8px; }
.tut-nav-sub a:hover { color: var(--brand-blue); background: #EFF6FF; }

/* ── 右侧内容 ── */
.tut-content { min-width: 0; }

/* =========================================
   教程章节
========================================= */
.tut-section {
    padding-bottom: 64px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 64px;
    scroll-margin-top: 96px;
}
.tut-section:last-child { border-bottom: none; margin-bottom: 0; }

.tut-section-num {
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--brand-blue); margin-bottom: 8px; display: block;
}
.tut-section-title {
    font-size: 40px; font-weight: 900;
    letter-spacing: -1.5px; line-height: 1.1;
    color: var(--text-primary); margin-bottom: 12px;
}
.tut-section-lead {
    font-size: 15px; color: var(--text-secondary);
    font-weight: 500; line-height: 1.7;
    max-width: 640px; margin-bottom: 36px;
}

/* =========================================
   步骤卡片（带序号）
========================================= */
.step-cards { display: flex; flex-direction: column; gap: 16px; }

.step-card {
    display: flex; gap: 20px;
    padding: 24px 28px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 16px; transition: var(--transition);
    overflow-wrap: break-word;
}
.step-card:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 8px 24px var(--brand-glow);
    background: white; transform: translateY(-2px);
}
.step-card-num {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--brand-gradient);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 900; color: white;
    flex-shrink: 0; box-shadow: 0 4px 12px var(--brand-glow);
}
.step-card-body { flex: 1; min-width: 0; }
.step-card-title {
    font-size: 16px; font-weight: 800;
    color: var(--text-primary); margin: 0 0 6px;
}
.step-card-desc {
    font-size: 14px; color: var(--text-secondary);
    line-height: 1.7; margin: 0;
}
.step-card-desc code {
    font-family: var(--font-mono); font-size: 12px;
    background: white; border: 1px solid var(--color-border);
    padding: 2px 6px; border-radius: 5px; color: var(--brand-blue);
    word-break: break-all;
}
.step-card-desc { overflow-wrap: break-word; word-break: break-word; }
.step-card-desc a { color: var(--brand-blue); text-decoration: none; font-weight: 700; }
.step-card-desc a:hover { text-decoration: underline; }

/* =========================================
   提示框变体
========================================= */
.tut-tip {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 16px 18px; border-radius: 12px;
    font-size: 13px; font-weight: 500; line-height: 1.6;
    margin: 16px 0;
}
.tut-tip i { font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.tut-tip strong { font-weight: 800; display: block; margin-bottom: 2px; }

.tut-tip--info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.tut-tip--info i  { color: #3B82F6; }
.tut-tip--warn    { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.tut-tip--warn i  { color: #F59E0B; }
.tut-tip--success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.tut-tip--success i { color: #22C55E; }

/* =========================================
   平台选择卡片（章节一）
========================================= */
.platform-cards {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    margin-bottom: 24px;
}
.platform-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 14px; padding: 20px;
    display: flex; flex-direction: column; gap: 8px;
    text-decoration: none; transition: var(--transition);
}
.platform-card:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 6px 18px var(--brand-glow);
    transform: translateY(-2px); background: white;
}
.platform-card-icon { font-size: 24px; }
.platform-card.win  .platform-card-icon { color: #60A5FA; }
.platform-card.mac  .platform-card-icon { color: #9CA3AF; }
.platform-card.and  .platform-card-icon { color: #4ADE80; }
.platform-card.ios  .platform-card-icon { color: #F9A8D4; }
.platform-card.lnx  .platform-card-icon { color: #FDE68A; }
.platform-card-name { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.platform-card-app  { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* =========================================
   代码块 / 命令行
========================================= */
.tut-code {
    background: #020617;
    border: 1px solid #1E293B;
    border-radius: 12px; padding: 20px 24px;
    font-family: var(--font-mono); font-size: 13px;
    line-height: 2; color: #94A3B8;
    overflow-x: auto; margin: 12px 0;
}
.tut-code .cmd { color: #38BDF8; font-weight: 800; }
.tut-code .val { color: #86EFAC; }
.tut-code .c   { color: #475569; }
.tut-code .key { color: #F9A8D4; }

/* =========================================
   配置示例卡片
========================================= */
.config-example {
    background: var(--color-black);
    border-radius: 16px; overflow: hidden;
    margin: 16px 0;
}
.config-example-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid #1E293B;
    background: #0A0A0D;
}
.config-example-bar span {
    font-size: 12px; font-weight: 700; color: #52525B;
}
.config-example-bar i { color: var(--brand-cyan); }
.config-example pre {
    margin: 0; padding: 20px 24px;
    font-family: var(--font-mono); font-size: 12px;
    line-height: 1.9; color: #94A3B8;
    overflow-x: auto;
}
.config-example .k { color: #F9A8D4; }
.config-example .v { color: #86EFAC; }
.config-example .s { color: #FDE68A; }
.config-example .c { color: #475569; }

/* =========================================
   模式对比表格
========================================= */
.mode-table-wrap {
    margin: 12px 0;
    border-radius: 12px;
    overflow: hidden; /* 只裁切圆角，不做滚动 */
}
.mode-table {
    width: 100%; border-collapse: collapse;
    margin: 0; border-radius: 12px; overflow: hidden;
    font-size: 13px;
}
.mode-table th {
    background: var(--color-black); color: #A1A1AA;
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1px; padding: 12px 16px; text-align: left;
}
.mode-table td {
    padding: 13px 16px; border-bottom: 1px solid var(--color-border);
    color: var(--text-primary); background: white;
}
.mode-table tr:last-child td { border-bottom: none; }
.mode-table tr:hover td { background: #F8FAFC; }
.badge-yes { color: #16A34A; font-weight: 800; }
.badge-no  { color: #DC2626; font-weight: 800; }
.badge-partial { color: #D97706; font-weight: 800; }

/* =========================================
   FAQ 折叠
========================================= */
.tut-faq { display: flex; flex-direction: column; gap: 10px; }
.tut-faq-item {
    border: 1px solid var(--color-border);
    border-radius: 12px; overflow: hidden;
    background: white;
}
.tut-faq-q {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 16px 20px;
    font-size: 14px; font-weight: 800;
    color: var(--text-primary); cursor: pointer;
    transition: var(--transition); list-style: none;
    user-select: none;
}
.tut-faq-q:hover { background: #F8FAFC; }
.tut-faq-q::-webkit-details-marker { display: none; }
.tut-faq-q i { color: var(--text-secondary); transition: var(--transition); font-size: 12px; }
details[open] .tut-faq-q i { transform: rotate(180deg); color: var(--brand-blue); }
details[open] .tut-faq-q { color: var(--brand-blue); }
.tut-faq-a {
    padding: 0 20px 16px;
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.7; font-weight: 500;
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
}
.tut-faq-a code {
    font-family: var(--font-mono); font-size: 11px;
    background: var(--color-bg-alt); border: 1px solid var(--color-border);
    padding: 2px 6px; border-radius: 4px;
}
.tut-faq-a strong { font-weight: 800; color: var(--text-primary); }

/* =========================================
   Responsive
========================================= */
@media (max-width: 1024px) {
    .tut-layout { grid-template-columns: 1fr; gap: 32px; padding: 40px 24px 80px; }
    .tut-sidebar { position: static; display: none; }
    .tut-header { padding: 48px 24px 56px; }
    .tut-header-title { font-size: 48px; }
    .tut-steps-strip { flex-wrap: wrap; }
    .tut-step-pill { flex: 0 0 calc(50% - 1px); }
    .platform-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { padding-top: 60px; }
    html { scroll-padding-top: 76px; }

    /* Header */
    .tut-header { padding: 36px 20px 44px; }
    .tut-header-title { font-size: 32px; letter-spacing: -1.5px; margin-bottom: 12px; }
    .tut-header-desc  { font-size: 14px; margin-bottom: 24px; }

    /* 章节导航条：横向滚动，不折行 */
    .tut-steps-strip {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
        /* 隐藏滚动条 */
        scrollbar-width: none;
    }
    .tut-steps-strip::-webkit-scrollbar { display: none; }
    .tut-step-pill {
        flex: 0 0 auto;
        min-width: 110px;
        scroll-snap-align: start;
        padding: 12px 14px;
    }
    .tut-step-pill-label { font-size: 11px; }

    /* 主体布局 */
    .tut-layout { padding: 28px 20px 60px; }

    /* 章节标题 */
    .tut-section { padding-bottom: 40px; margin-bottom: 40px; }
    .tut-section-title { font-size: 26px; letter-spacing: -0.5px; }
    .tut-section-lead  { font-size: 14px; margin-bottom: 24px; }

    /* 平台卡片：横向滚动条，不折行 */
    .platform-cards {
        display: flex;
        grid-template-columns: unset;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 4px;
        margin-bottom: 20px;
        scrollbar-width: none;
    }
    .platform-cards::-webkit-scrollbar { display: none; }
    .platform-card {
        flex: 0 0 auto;
        width: 108px;
        padding: 14px 12px;
        gap: 6px;
        border-radius: 12px;
        scroll-snap-align: start;
    }
    .platform-card-icon { font-size: 20px; }
    .platform-card-name { font-size: 13px; }
    .platform-card-app  { font-size: 11px; }

    /* 步骤卡片：去掉"卡片感"，改为带分割线的文档列表 */
    .step-cards { gap: 0; }
    .step-card {
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
        background: transparent;
        border: none;
        border-radius: 0;
        border-bottom: 1px solid var(--color-border);
        padding: 18px 0;
        box-shadow: none;
        transform: none !important;
    }
    .step-card:last-child { border-bottom: none; padding-bottom: 4px; }
    .step-card:hover { background: transparent; box-shadow: none; transform: none; }
    .step-card-num { flex-shrink: 0; width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
    .step-card-title { font-size: 15px; margin-bottom: 4px; }
    .step-card-desc  { font-size: 13px; }

    /* 提示框 */
    .tut-tip { padding: 12px 14px; font-size: 12px; border-radius: 10px; }

    /* 代码块 */
    .tut-code { font-size: 12px; padding: 14px 16px; line-height: 1.8; }
    .config-example pre { font-size: 11px; padding: 14px 16px; }

    /* 模式对比表格：移动端不做横向滚动，缩小间距让内容自动折行适配屏幕 */
    .mode-table { font-size: 11px; width: 100%; }
    .mode-table th { padding: 10px 8px; font-size: 10px; letter-spacing: 0; }
    .mode-table td { padding: 10px 8px; white-space: normal; line-height: 1.4; }
    /* 模式列固定宽度，避免太宽 */
    .mode-table th:first-child,
    .mode-table td:first-child { width: 28%; }
    .mode-table th:nth-child(2),
    .mode-table td:nth-child(2) { width: 36%; }
    /* 后三列等宽 */
    .mode-table th:nth-child(n+3),
    .mode-table td:nth-child(n+3) { width: 12%; text-align: center; }

    /* FAQ */
    .tut-faq-q { font-size: 13px; padding: 14px 16px; }
    .tut-faq-a { font-size: 12px; padding: 12px 16px; }
}

@media (max-width: 480px) {
    .tut-header-title { font-size: 26px; letter-spacing: -1px; }
    .tut-section-title { font-size: 22px; }
    .tut-step-pill { min-width: 96px; }
}
