/**
 * SSG 公共样式 - 文章正文 + 大纲
 *
 * 抽取自 ArticleContentTemplate(.content-body) 与 TutorialOverviewTemplate(.article-detail-content) 中几乎完全相同的正文/大纲样式。
 * 为避免改动现有 JS 中的类名引用，此处同时为两套类名提供相同样式。
 *
 * 字体大小参考: docs.trae.cn (正文15px 行高26px, H1:28px, H2:24px, H3:20px)
 * 配色风格参考: 暖黄温馨风 (#FA8C16 / #FFF7E6 / #FFE7BA)
 *
 * 依赖：auth.css（提供 --primary-color 变量）
 * 引入：SharedSnippet.cssTags()
 */

/* ---- 文章正文（同时适配 .content-body、.article-detail-content 与 .tutorial-intro-content）- 暖黄温馨风 ---- */
.content-body, .article-detail-content, .tutorial-intro-content {
    font-size: 15px;
    line-height: 26px;
    color: #3c3c43;
    word-break: break-word;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "noto sans", "Microsoft YaHei", "Helvetica Neue",
        Helvetica, Arial, sans-serif;
}

/* 标题层级 - 暖黄温馨风 */
.content-body h1, .article-detail-content h1, .tutorial-intro-content h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 34px;
    color: #1d2129;
    margin: 32px 0 18px;
    padding-left: 12px;
    border-left: 4px solid #FA8C16;
    scroll-margin-top: 80px;
}
.content-body h2, .article-detail-content h2, .tutorial-intro-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1d2129;
    margin: 24px 0 12px;
    padding-left: 12px;
    border-left: 4px solid #FA8C16;
    scroll-margin-top: 80px;
}
.content-body h3, .article-detail-content h3, .tutorial-intro-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1d2129;
    margin: 24px 0 12px;
    padding-left: 10px;
    border-left: 3px solid #FFE7BA;
    scroll-margin-top: 80px;
}
.content-body h4, .article-detail-content h4, .tutorial-intro-content h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1d2129;
    margin: 24px 0 12px;
    scroll-margin-top: 80px;
}
.content-body h5, .article-detail-content h5, .tutorial-intro-content h5 {
    font-size: 16px;
    font-weight: 700;
    color: #1d2129;
    margin: 24px 0 12px;
    scroll-margin-top: 80px;
}
.content-body h6, .article-detail-content h6, .tutorial-intro-content h6 {
    font-size: 15px;
    font-weight: 700;
    color: #1d2129;
    margin: 24px 0 12px;
    scroll-margin-top: 80px;
}

/* 段落 - docs.trae.cn 正文 15px/26px */
.content-body p, .article-detail-content p, .tutorial-intro-content p {
    margin: 6px 0 14px;
    font-size: 15px;
    line-height: 26px;
    color: #3c3c43;
}

/* 列表 */
.content-body ul, .content-body ol, .article-detail-content ul, .article-detail-content ol, .tutorial-intro-content ul, .tutorial-intro-content ol {
    padding-left: 24px;
    margin: 0 0 14px;
}
.content-body li, .article-detail-content li, .tutorial-intro-content li {
    margin: 6px 0;
    font-size: 15px;
    line-height: 26px;
}

/* 强调 */
.content-body strong, .article-detail-content strong, .tutorial-intro-content strong {
    color: #1d2129;
    font-weight: 700;
}

/* 图片 */
.content-body img, .article-detail-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 8px 0;
}

/* 教程介绍页图片：680px宽度 + 居中 + 阴影卡片效果（方案1+方案3组合） */
.tutorial-intro-content img {
    max-width: 680px !important;
    width: 100% !important;
    display: block !important;
    margin: 28px auto !important;
    border-radius: 12px !important;
    box-shadow:
        0 4px 20px rgba(15, 23, 42, 0.08),
        0 8px 32px rgba(15, 23, 42, 0.06),
        0 16px 48px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.tutorial-intro-content img:hover {
    box-shadow:
        0 6px 24px rgba(15, 23, 42, 0.10),
        0 12px 40px rgba(15, 23, 42, 0.08),
        0 24px 64px rgba(15, 23, 42, 0.06);
    transform: translateY(-2px);
}

/* 代码块 - GitHub 浅色风：F6F8FA 背景 + 三圆点装饰栏 + 细边框 + 圆角8px + 行号 + 高亮 */
.content-body pre, .article-detail-content pre, .tutorial-intro-content pre {
    position: relative;
    background: #F6F8FA;
    padding: 44px 0 18px; /* 左右内边距由 code 和 line-number 控制 */
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.65;
    margin: 16px 0;
    border: 1px solid #E1E4E8;
    box-shadow: 0 1px 2px rgba(27,31,35,0.04);
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* 顶部装饰栏：mac 风格三个小圆点 + 浅色横条 */
.content-body pre::before, .article-detail-content pre::before, .tutorial-intro-content pre::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 32px;
    background: #F1F3F5;
    border-bottom: 1px solid #E1E4E8;
    border-radius: 8px 8px 0 0;
}
.content-body pre::after, .article-detail-content pre::after, .tutorial-intro-content pre::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 11px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FF5F56;
    box-shadow:
        18px 0 0 #FFBD2E,
        36px 0 0 #27C93F;
    z-index: 1;
}

/* 代码块复制按钮 */
.content-body pre .copy-btn,
.article-detail-content pre .copy-btn,
.tutorial-intro-content pre .copy-btn {
    position: absolute;
    top: 6px;
    right: 10px;
    z-index: 10;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1;
    color: #656D76;
    background: rgba(255,255,255,0.7);
    border: 1px solid #E1E4E8;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, color 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    user-select: none;
    -webkit-user-select: none;
}
.content-body pre:hover .copy-btn,
.article-detail-content pre:hover .copy-btn,
.tutorial-intro-content pre:hover .copy-btn {
    opacity: 1;
}
.content-body pre .copy-btn:hover,
.article-detail-content pre .copy-btn:hover,
.tutorial-intro-content pre .copy-btn:hover {
    background: #FA8C16;
    color: #fff;
    border-color: #FA8C16;
}
.content-body pre .copy-btn.copied,
.article-detail-content pre .copy-btn.copied,
.tutorial-intro-content pre .copy-btn.copied {
    background: #27C93F;
    color: #fff;
    border-color: #27C93F;
    opacity: 1;
}

/* 代码块内部布局：左侧行号 + 右侧代码 */
.content-body pre .code-block-wrapper,
.article-detail-content pre .code-block-wrapper,
.tutorial-intro-content pre .code-block-wrapper {
    display: flex;
    padding: 0 20px;
}
.content-body pre .code-block-wrapper .line-numbers,
.article-detail-content pre .code-block-wrapper .line-numbers,
.tutorial-intro-content pre .code-block-wrapper .line-numbers {
    flex-shrink: 0;
    width: 40px;
    padding-right: 16px;
    margin-right: 16px;
    text-align: right;
    color: #8C959F;
    user-select: none;
    border-right: 1px solid #E1E4E8;
    line-height: 1.65;
}
.content-body pre .code-block-wrapper .line-numbers span,
.article-detail-content pre .code-block-wrapper .line-numbers span,
.tutorial-intro-content pre .code-block-wrapper .line-numbers span {
    display: block;
}
.content-body pre .code-block-wrapper code,
.article-detail-content pre .code-block-wrapper code,
.tutorial-intro-content pre .code-block-wrapper code {
    flex: 1;
    min-width: 0;
    white-space: pre;
    background: transparent;
    padding: 0;
    border: none;
    color: #24292E;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

/* highlight.js GitHub 主题样式 (内嵌，避免依赖外部CSS文件) */
.hljs {
    color: #24292E;
    background: transparent;
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.hljs-comment, .hljs-quote {
    color: #6A737D;
    font-style: italic;
}
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link {
    color: #D73A49;
}
.hljs-function, .hljs-title, .hljs-name {
    color: #6F42C1;
}
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-bullet, .hljs-addition {
    color: #22863A;
}
.hljs-number, .hljs-meta, .hljs-built_in, .hljs-builtin-name, .hljs-variable, .hljs-template-variable, .hljs-type {
    color: #005CC5;
}
.hljs-tag, .hljs-params {
    color: #22863A;
}
.hljs-deletion {
    color: #B31D28;
    background: #FFDCE0;
}
.hljs-addition {
    background: #F0FFF4;
}
.hljs-emphasis {
    font-style: italic;
}
.hljs-strong {
    font-weight: bold;
}

/* 行内 code：GitHub 风 */
.content-body code, .article-detail-content code, .tutorial-intro-content code {
    background: #EFF1F3;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 13.5px;
    color: #24292E;
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    border: 1px solid rgba(27,31,35,0.06);
}
.content-body pre code, .article-detail-content pre code, .tutorial-intro-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #24292E;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
}

/* 引用块 - 暖黄左边框 */
.content-body blockquote, .article-detail-content blockquote, .tutorial-intro-content blockquote {
    margin: 14px 0;
    padding: 12px 18px;
    background: #FFF7E6;
    border-left: 4px solid #FA8C16;
    color: #4e5969;
    border-radius: 0 6px 6px 0;
}

/* 表格 - 暖黄温馨风：去竖线、底部横线、斑马纹、圆角 */
.content-body table, .article-detail-content table, .tutorial-intro-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #FFE7BA;
    box-shadow: 0 1px 3px rgba(250,140,22,0.04);
}
.content-body th, .content-body td, .article-detail-content th, .article-detail-content td, .tutorial-intro-content th, .tutorial-intro-content td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    border-bottom: 1px solid #FFE7BA;
    border-right: none;
    border-left: none;
    border-top: none;
}
.content-body tr:last-child td, .article-detail-content tr:last-child td, .tutorial-intro-content tr:last-child td {
    border-bottom: none;
}
.content-body th, .article-detail-content th, .tutorial-intro-content th {
    background: #FFF7E6;
    font-weight: 600;
    color: #3e2723;
    border-bottom: 2px solid #FA8C16;
}
/* 斑马纹 */
.content-body tbody tr:nth-child(even) td,
.article-detail-content tbody tr:nth-child(even) td,
.tutorial-intro-content tbody tr:nth-child(even) td {
    background: #FFFBF3;
}
/* hover 行高亮 */
.content-body tbody tr:hover td,
.article-detail-content tbody tr:hover td,
.tutorial-intro-content tbody tr:hover td {
    background: #FFF7E6;
}

/* 链接 */
.content-body a, .article-detail-content a, .tutorial-intro-content a {
    color: #FA8C16;
    text-decoration: none;
    transition: color 0.2s;
}
.content-body a:hover, .article-detail-content a:hover, .tutorial-intro-content a:hover {
    color: #D46B08;
    text-decoration: underline;
}

/* 水平分隔线 */
.content-body hr, .article-detail-content hr, .tutorial-intro-content hr {
    border: none;
    border-top: 1px solid #FFE7BA;
    margin: 24px 0;
}

/* ---- 右侧大纲（暖黄温馨风，字号对齐正文15px） ---- */
.outline-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px 14px;
    box-shadow: 0 1px 3px rgba(250,140,22,0.06);
    border: 1px solid #FFE7BA;
}
.outline-title {
    font-size: 15px;
    font-weight: 700;
    color: #D46B08;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 2px solid #FFE7BA;
}
.outline-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.outline-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    font-size: 15px;
    color: #4e5969;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.18s;
    gap: 8px;
    border-radius: 0 5px 5px 0;
    margin: 1px 0;
    line-height: 1.55;
}
.outline-item:hover {
    color: #FA8C16;
    border-left-color: #FFE7BA;
    background: #FFFBF3;
}
.outline-item.active {
    color: #D46B08;
    border-left-color: #FA8C16;
    background: #FFF7E6;
    font-weight: 500;
}
.outline-item.level-3 {
    padding-left: 28px;
    font-size: 14px;
    color: #67676c;
}
.outline-item.level-3.active {
    color: #D46B08;
}
.outline-bar {
    width: 4px;
    height: 4px;
    background: #FFC069;
    border-radius: 50%;
    flex-shrink: 0;
}
.outline-item.active .outline-bar {
    background: #FA8C16;
}
.outline-item:hover .outline-bar {
    background: #D46B08;
}
.outline-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.outline-empty {
    color: #BFBFBF;
    font-size: 14px;
    text-align: center;
    padding: 16px 0;
}
