/* =============================================================================
   帮助中心（使用手册）
   
   设计参考：https://yingniu.10v.co/help
   配色策略：深色导航 + 浅色内容区 + 深色页脚
             （参考站即如此，导航 rgba(5,7,11,.82)、页脚 #05070b，
              内容区 --bg #f6f8fb。本页复用官网已有的深色导航与页脚，
              仅内容区切换为浅色，因此导航/页脚样式不在此文件重复定义。）
   
   与 site.css / mockups.css 的关系：本文件只作用于 .hp-* 命名空间，
   不改动官网其它页面。
   ============================================================================= */

/* ---------- 主题变量 ---------- */
.hp-page {
    --hp-bg:        #f6f8fb;
    --hp-bg-2:      #eef2f7;
    --hp-panel:     #ffffff;
    --hp-primary:   #007aff;
    --hp-primary-d: #0052c8;
    --hp-accent:    #00c9a7;
    --hp-accent-t:  #0b7d67;
    --hp-text:      #1a2333;
    --hp-body:      #2a3547;
    --hp-muted:     #4a5568;
    --hp-line:      rgba(15, 23, 42, .10);
    --hp-radius:    14px;
    --hp-shadow:    0 12px 40px rgba(15, 23, 42, .10);
    --hp-grad:      linear-gradient(135deg, #1e7dff 0%, #00c2a8 100%);

    background: var(--hp-bg);
    color: var(--hp-body);
    /* 导航为固定定位，正文需下移避让 */
    padding-top: var(--nav-h);
    min-height: 100vh;
    /* 导航与页脚是深色的，正文里不要继承暗色文字 */
    font-size: 15px;
    line-height: 1.75;
}

.hp-container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- 页头 ---------- */
.hp-head { padding: 64px 0 40px; }
.hp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--hp-accent-t);
}
.hp-eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--hp-grad); }
.hp-title {
    margin: 0 0 14px;
    font-size: clamp(28px, 4.4vw, 46px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 1px;
    color: var(--hp-text);
}
.hp-sub { margin: 0; font-size: 17px; color: var(--hp-muted); max-width: 720px; }

/* ---------- 两栏布局：左侧目录 + 右侧内容 ---------- */
.hp-body { padding-bottom: 80px; }
.hp-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

/* ---------- 左侧目录 ---------- */
.hp-side {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    max-height: calc(100vh - var(--nav-h) - 40px);
    overflow-y: auto;
    padding: 18px;
    background: var(--hp-panel);
    border: 1px solid var(--hp-line);
    border-radius: var(--hp-radius);
}
.hp-side::-webkit-scrollbar { width: 6px; }
.hp-side::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, .16); border-radius: 3px; }

.hp-search { display: flex; gap: 8px; margin-bottom: 14px; }
.hp-search input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--hp-text);
    background: var(--hp-bg-2);
    border: 1px solid var(--hp-line);
    border-radius: 8px;
    outline: none;
    transition: border-color .2s;
}
.hp-search input::placeholder { color: #94a3b8; }
.hp-search input:focus { border-color: var(--hp-primary); }

.hp-tree h4 {
    margin: 14px 0 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--hp-muted);
}
.hp-tree h4:first-child { margin-top: 0; }
.hp-tree a {
    display: block;
    padding: 7px 10px;
    margin-bottom: 1px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--hp-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: color .2s, background-color .2s;
}
.hp-tree a:hover { color: var(--hp-text); background: rgba(0, 122, 255, .08); }
.hp-tree a.on {
    color: var(--hp-primary-d);
    background: rgba(0, 122, 255, .12);
    font-weight: 600;
}
.hp-tree-empty { padding: 10px 0; font-size: 13px; color: #94a3b8; }

/* ---------- 右侧内容 ---------- */
.hp-main { min-width: 0; min-height: 400px; }

.hp-section { margin-bottom: 34px; }
.hp-sec-head { margin-bottom: 16px; }
.hp-sec-title {
    margin: 0 0 4px;
    padding-left: 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--hp-text);
    border-left: 3px solid var(--hp-primary);
}
.hp-sec-desc { margin: 6px 0 0 13px; font-size: 13px; color: #8c8c8c; }

.hp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.hp-card {
    display: block;
    padding: 24px;
    background: var(--hp-panel);
    border: 1px solid var(--hp-line);
    border-radius: var(--hp-radius);
    text-decoration: none;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
.hp-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 122, 255, .45);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
}
.hp-card-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--hp-text);
    transition: color .2s;
}
.hp-card:hover .hp-card-title { color: var(--hp-primary); }
.hp-card-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: #8c8c8c;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-empty { padding: 60px 0; text-align: center; color: #94a3b8; }

/* ---------- 文章详情 ---------- */
.hp-doc {
    padding: 36px 40px;
    background: var(--hp-panel);
    border: 1px solid var(--hp-line);
    border-radius: var(--hp-radius);
}
.hp-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #8c8c8c;
    border-bottom: 1px solid var(--hp-line);
}
.hp-doc-meta span { display: inline-flex; align-items: center; gap: 5px; }

.hp-doc-body { font-size: 16px; line-height: 1.8; color: var(--hp-body); }
.hp-doc-body > *:first-child { margin-top: 0; }

.hp-doc-body h1 { margin: 32px 0 14px; font-size: 28px; font-weight: 700; color: var(--hp-text); line-height: 1.4; }
.hp-doc-body h2 {
    margin: 32px 0 14px;
    padding-left: 12px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--hp-text);
    border-left: 3px solid var(--hp-primary);
}
.hp-doc-body h3 { margin: 24px 0 10px; font-size: 18px; font-weight: 600; color: var(--hp-text); }
/* 四级及以下属于细粒度小节，不加左侧装饰条，避免视觉噪声 */
.hp-doc-body h4 { margin: 20px 0 8px; font-size: 16px; font-weight: 600; color: var(--hp-text); }
.hp-doc-body h5 { margin: 18px 0 6px; font-size: 15px; font-weight: 600; color: var(--hp-text); }
.hp-doc-body h6 { margin: 16px 0 6px; font-size: 14px; font-weight: 600; color: var(--hp-muted); }

.hp-doc-body p { margin: 0 0 16px; }
.hp-doc-body ul, .hp-doc-body ol { margin: 0 0 16px; padding-left: 24px; }
.hp-doc-body li { margin-bottom: 6px; }
.hp-doc-body a { color: var(--hp-primary); text-decoration: none; border-bottom: 1px solid rgba(0, 122, 255, .3); }
.hp-doc-body a:hover { color: var(--hp-primary-d); }
.hp-doc-body strong { color: var(--hp-text); font-weight: 600; }

.hp-doc-body blockquote {
    margin: 20px 0;
    padding: 14px 18px;
    color: var(--hp-muted);
    background: #f5f7fa;
    border-left: 3px solid var(--hp-primary);
    border-radius: 0 8px 8px 0;
}
.hp-doc-body blockquote p:last-child { margin-bottom: 0; }

.hp-doc-body code {
    padding: 2px 6px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    color: #c7254e;
    background: #f5f5f5;
    border-radius: 4px;
}
.hp-doc-body pre {
    margin: 20px 0;
    padding: 16px 18px;
    overflow-x: auto;
    background: #f5f5f5;
    border: 1px solid var(--hp-line);
    border-radius: 10px;
}
.hp-doc-body pre code { padding: 0; color: var(--hp-body); background: none; font-size: 13px; line-height: 1.7; }

.hp-doc-body table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    font-size: 14px;
}
.hp-doc-body th, .hp-doc-body td {
    padding: 10px 12px;
    text-align: center;
    border: 1px solid #e8e8e8;
}
.hp-doc-body th { background: #fafafa; font-weight: 600; color: var(--hp-text); }
.hp-doc-body tr:nth-child(even) td { background: #fcfcfc; }

/* 表格：窄屏横向滚动，避免撑破页面 */
.cj-table-wrap {
    margin: 20px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}
.cj-table-wrap table { margin: 0; border: none; min-width: 560px; }
/* 表头不换行：否则「所在页签」这类短表头会被拆成两行 */
.cj-table-wrap th { white-space: nowrap; }
/* 单元格设最小宽度：自动布局下含长文本的列会把短列挤到只剩一两字宽，
   导致「AI 模型」这种三字内容被迫折行 */
.cj-table-wrap td { min-width: 110px; word-break: break-word; }
.cj-table-wrap th, .cj-table-wrap td { border-width: 0 1px 1px 0; }
.cj-table-wrap th:last-child, .cj-table-wrap td:last-child { border-right: none; }
.cj-table-wrap tbody tr:last-child td { border-bottom: none; }

.hp-doc-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 22px auto;
    border-radius: 10px;
    cursor: zoom-in;
}
.hp-doc-body hr { margin: 28px 0; border: none; height: 1px; background: var(--hp-line); }

/* ---------- 上一篇 / 下一篇 ---------- */
.hp-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}
.hp-nav-item {
    display: block;
    padding: 16px 20px;
    background: var(--hp-panel);
    border: 1px solid var(--hp-line);
    border-radius: var(--hp-radius);
    text-decoration: none;
    transition: border-color .2s, transform .2s;
}
.hp-nav-item:hover { border-color: rgba(0, 122, 255, .45); transform: translateY(-2px); }
.hp-nav-item--next { text-align: right; }
.hp-nav-item.is-empty { background: transparent; border: none; }
.hp-nav-label { display: block; margin-bottom: 4px; font-size: 12px; color: #8c8c8c; }
.hp-nav-title { display: block; font-size: 14px; font-weight: 600; color: var(--hp-text); line-height: 1.5; }

/* ---------- 图片放大 ---------- */
.hp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(15, 23, 42, .88);
    cursor: zoom-out;
}
.hp-lightbox.is-open { display: flex; }
.hp-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

/* ---------- 移动端：侧栏改为可折叠抽屉 ---------- */
.hp-side-toggle {
    display: none;
    width: 100%;
    margin-bottom: 14px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--hp-text);
    background: var(--hp-panel);
    border: 1px solid var(--hp-line);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}
.hp-side-toggle::after { content: "▾"; float: right; color: var(--hp-muted); transition: transform .25s; }
.hp-side-toggle.is-open::after { transform: rotate(180deg); }

@media (max-width: 960px) {
    .hp-layout { grid-template-columns: 1fr; gap: 0; }
    .hp-side {
        position: static;
        max-height: none;
        margin-bottom: 20px;
    }
    .hp-side-toggle { display: block; }
    .hp-side { display: none; }
    .hp-side.is-open { display: block; }
    .hp-head { padding: 44px 0 28px; }
    .hp-doc { padding: 26px 22px; }
}

@media (max-width: 640px) {
    .hp-grid { grid-template-columns: 1fr; }
    .hp-container { padding: 0 20px; }
    .hp-nav { grid-template-columns: 1fr; }
    .hp-nav-item--next { text-align: left; }
    .hp-doc-body { font-size: 15px; }
    .hp-doc-body h2 { font-size: 19px; }
    .hp-doc-body h3 { font-size: 17px; }
    .hp-doc-body table { font-size: 13px; }
    .hp-doc-body th, .hp-doc-body td { padding: 8px; }
    .cj-table-wrap table { min-width: 460px; font-size: 12.5px; }
    .cj-table-wrap td { min-width: 88px; }
}
