/**
 * docs-md.css - Markdown 渲染内容样式（暗色主题适配）
 */

/* ???????????????? */
.doc-md-body {
    line-height: 1.9;
    color: #c8d4e0;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    padding-top: 1.2rem;
}

/* ?????????????????? */
.doc-md-body img {
    max-width: min(100%, 700px);
    max-height: 380px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ???? */
.doc-md-body h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-md-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.8rem 0 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-md-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2rem 0 0.6rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--primary-color);
    letter-spacing: 0.01em;
}

.doc-md-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 1.2rem 0 0.4rem;
}

/* 段落 */
.doc-md-body p {
    margin-bottom: 1rem;
}

/* 列表 */
.doc-md-body ul,
.doc-md-body ol {
    padding-left: 2rem;
    margin-bottom: 1.2rem;
}

.doc-md-body li {
    margin-bottom: 0.4rem;
}

/* 行内代码 */
.doc-md-body code {
    background: rgba(0, 255, 136, 0.1);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 代码块 */
.doc-md-body pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    overflow-x: auto;
    max-width: 100%;
    margin: 1.5rem 0;
}

.doc-md-body pre code {
    background: none;
    color: var(--text-primary);
    padding: 0;
    font-size: 0.9rem;
    line-height: 1.7;
    word-break: normal;
    overflow-wrap: normal;
    white-space: pre;
}

/* 引用块（用于提示/警告/成功） */
.doc-md-body blockquote {
    border-left: 3px solid var(--secondary-color);
    background: rgba(0, 102, 255, 0.08);
    padding: 0.8rem 1.2rem;
    border-radius: 0 6px 6px 0;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.doc-md-body blockquote p {
    margin: 0;
}

/* 水平线 */
.doc-md-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* 链接 */
.doc-md-body a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
    word-break: break-all;
}

.doc-md-body a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* strong */
.doc-md-body strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* 必须/可选 标签 */
.doc-md-body .doc-required {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1em 0.55em;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.5em;
    background: rgba(255, 51, 102, 0.15);
    color: #ff6688;
    border: 1px solid rgba(255, 51, 102, 0.3);
    letter-spacing: 0.03em;
}

/* 表格 */
.doc-md-body table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    display: block;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.6;
}

.doc-md-body th,
.doc-md-body td {
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: top;
}

/* 表头：固定不换行，背景稍强 */
.doc-md-body th {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* 第一列：技术词不断行 */
.doc-md-body td:first-child {
    white-space: nowrap;
    color: var(--text-primary);
    font-weight: 500;
}

/* 隔行浅色，方便对齐阅读 */
.doc-md-body tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.025);
}

.doc-md-body td strong {
    color: rgba(210, 220, 240, 0.95);
    font-weight: 600;
}

/* 章节折叠 */
.doc-md-body .collapsible-heading {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.doc-md-body .collapsible-heading:hover .section-toggle-icon {
    color: var(--primary-color);
}

.doc-md-body .section-toggle-icon {
    font-size: 0.6em;
    color: var(--text-secondary);
    transition: transform 0.25s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.doc-md-body .section-collapsible-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
}
