/* =========================================================
   使用说明（Guide）页面样式
   基于 style.css 的设计变量扩展
   ========================================================= */

.guide-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 40px 0 80px;
    position: relative;
    z-index: 1;
}

/* ---------- 侧边栏 ---------- */
.guide-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 14px;
}

.guide-sidebar::-webkit-scrollbar {
    width: 6px;
}

.guide-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.guide-cat {
    margin-bottom: 22px;
}

.guide-cat:last-child {
    margin-bottom: 0;
}

.guide-cat-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    padding: 0 10px;
    margin-bottom: 8px;
}

.guide-cat ul {
    list-style: none;
}

.guide-cat a {
    display: block;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.45;
    transition: all 0.15s;
    border-left: 2px solid transparent;
}

.guide-cat a:hover {
    color: var(--text-primary);
    background: rgba(74, 140, 255, 0.08);
}

.guide-cat a.active {
    color: var(--accent);
    background: rgba(74, 140, 255, 0.12);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* 移动端侧边栏开关 */
.sidebar-toggle {
    display: none;
    width: 100%;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    text-align: left;
}

/* ---------- 正文区域 ---------- */
.guide-main {
    flex: 1;
    min-width: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 48px 56px;
}

.guide-article {
    display: none;
    animation: articleFade 0.25s ease;
}

.guide-article.active {
    display: block;
}

@keyframes articleFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 文章排版 */
.guide-article h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.guide-article h2 {
    font-size: 21px;
    font-weight: 700;
    margin: 36px 0 14px;
    color: var(--text-primary);
    padding-left: 12px;
    border-left: 3px solid var(--accent);
}

.guide-article h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 26px 0 10px;
    color: var(--accent-hover);
}

.guide-article p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.85;
    margin-bottom: 12px;
}

.guide-article ul,
.guide-article ol {
    margin: 0 0 14px 0;
    padding-left: 24px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.85;
}

.guide-article li {
    margin-bottom: 6px;
}

.guide-article strong {
    color: var(--text-primary);
}

.guide-article a {
    color: var(--accent);
    text-decoration: none;
}

.guide-article a:hover {
    text-decoration: underline;
}

.guide-article code {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13.5px;
    color: #7ec8ff;
    word-break: break-all;
}

.guide-article pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    overflow-x: auto;
    margin: 0 0 16px;
}

.guide-article pre code {
    background: none;
    border: none;
    padding: 0;
}

/* 提示卡片（callout） */
.callout {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0 20px;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.callout-title {
    display: block;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
    font-size: 14px;
}

.callout.warn {
    border-left-color: #e5a648;
}

.callout.warn .callout-title {
    color: #e5a648;
}

.callout.danger {
    border-left-color: #e05252;
}

.callout.danger .callout-title {
    color: #e05252;
}

.callout.success {
    border-left-color: #3fb26f;
}

.callout.success .callout-title {
    color: #3fb26f;
}

/* 表格 */
.guide-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 22px;
    font-size: 14px;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.guide-article th,
.guide-article td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
    color: var(--text-secondary);
    line-height: 1.6;
}

.guide-article th {
    background: rgba(74, 140, 255, 0.1);
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* 文档配图 */
.doc-img {
    margin: 14px 0 22px;
    text-align: center;
}

.doc-img img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.doc-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin: 16px 0 22px;
}

.doc-img-grid img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    display: block;
}

/* 步骤流程条（双开固件三步） */
.step-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 24px;
}

.step-flow .step-node {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.step-flow .step-node b {
    color: var(--accent);
    margin-right: 6px;
}

.step-flow .step-arrow {
    color: var(--accent);
    font-size: 18px;
}

/* 首页卡片 */
.guide-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin: 18px 0 30px;
}

.guide-home-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.guide-home-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(74, 140, 255, 0.1);
}

.guide-home-card .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(74, 140, 255, 0.15);
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
}

.guide-home-card h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.guide-home-card p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.65;
}

/* 返回顶部 */
.back-top {
    display: inline-block;
    margin-top: 40px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    width: 100%;
    color: var(--text-secondary);
    font-size: 13.5px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .guide-layout {
        flex-direction: column;
        padding: 24px 0 60px;
    }

    .sidebar-toggle {
        display: block;
    }

    .guide-sidebar {
        display: none;
        position: static;
        width: 100%;
        max-height: none;
    }

    .guide-sidebar.open {
        display: block;
    }

    .guide-main {
        padding: 28px 22px 40px;
    }

    .guide-article h1 {
        font-size: 23px;
    }

    .guide-article table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
