/* ==========================================================================
   Vabora · 长文与表单层（blog.css）
   --------------------------------------------------------------------------
   上线前精简（2026-09-21）：前台品牌层已由 site.css 的 x-* 组件接管，
   这里只保留**仍在页面中出现**的三类样式：

     1. 长文正文：markdown-body 及其内部的代码块 / 公式 / 图表 / 富媒体；
     2. 评论：comments / comment-* / 表单；
     3. 表单兜底：inquiry-*（对话式需求收集在无 JS 时的传统表单）与 fact-summary。

   删掉的是上一版主题的整套外壳（header / hero / 卡片 / 侧栏 / 分页 / 归档 /
   搜索 / 错误页 / 页脚 / case-* / svc-* 等，共 200+ 个选择器）——
   它们对应的类名在模板里已全部消失，留着只会让"改样式改不动"。
   精简前的完整文件见 backup/legacy/blog.css.20260921.bak。
   ========================================================================== */

/* ========================================================================== 
   设计令牌与基础重置
   ========================================================================== */
/* ==========================================================================
   Vabora开发极客 · 前台样式
   原生 CSS3（自定义属性 / Grid / Flex / 容器查询友好），零依赖、响应式、支持深色模式
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas,
        "Liberation Mono", "Courier New", monospace;

    --c-bg: #f6f7f9;
    --c-bg-soft: #eceef2;
    --c-surface: #ffffff;
    --c-surface-2: #f3f5f8;
    --c-border: #e3e6ec;
    --c-text: #1b1f27;
    --c-text-soft: #4b5361;
    --c-muted: #7b8494;
    --c-primary: #2f6df6;
    --c-primary-soft: #e8f0ff;
    --c-accent: #16a34a;
    --c-warn: #d97706;

    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgb(16 24 40 / 6%);
    --shadow: 0 4px 16px rgb(16 24 40 / 8%);
    --shadow-lg: 0 12px 32px rgb(16 24 40 / 12%);

    --maxw: 1180px;
    --header-h: 60px;

    --c-code-bg: #f5f7fa;
    --c-code-text: #24292f;
    --c-inline-code-bg: #eef1f6;
}

[data-theme="dark"] {
    --c-bg: #0d1117;
    --c-bg-soft: #010409;
    --c-surface: #151b23;
    --c-surface-2: #1c232c;
    --c-border: #262d38;
    --c-text: #e6edf3;
    --c-text-soft: #b7c0cc;
    --c-muted: #8b949e;
    --c-primary: #58a6ff;
    --c-primary-soft: #12243d;
    --c-accent: #3fb950;
    --c-warn: #d29922;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow: 0 4px 16px rgb(0 0 0 / 40%);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 50%);
    --c-code-bg: #0f151c;
    --c-code-text: #d5dbe3;
    --c-inline-code-bg: #1b232d;
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--c-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--c-accent);
}

h1,
h2,
h3,
h4 {
    line-height: 1.3;
    margin: 0 0 0.5em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 1em;
}

ul,
ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
}

:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection {
    background: var(--c-primary);
    color: #fff;
}

.site-main {
    flex: 1 0 auto;
    padding-bottom: 56px;
}

/* ========================================================================== 
   按钮（询价表单兜底用）
   ========================================================================== */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--c-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    color: #fff;
    box-shadow: var(--shadow);
}

/* ========================================================================== 
   Markdown 正文（长文阅读体验的核心）
   ========================================================================== */
/* ---------- Markdown 正文 ---------- */
.markdown-body {
    min-width: 0;
    font-size: 16px;
    color: var(--c-text);
    overflow-wrap: break-word;
}

.markdown-body h2 {
    font-size: 24px;
    margin: 2em 0 0.7em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--c-border);
    scroll-margin-top: calc(var(--header-h) + 20px);
}

.markdown-body h3 {
    font-size: 19px;
    margin: 1.6em 0 0.6em;
}

.markdown-body h4 {
    font-size: 16px;
    margin: 1.4em 0 0.5em;
}

.markdown-body h2 > .heading-anchor,
.markdown-body h3 > .heading-anchor,
.markdown-body h4 > .heading-anchor {
    float: left;
    margin-left: -0.85em;
    padding-right: 0.35em;
    color: var(--c-border);
    font-weight: 400;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.markdown-body h2:hover > .heading-anchor,
.markdown-body h3:hover > .heading-anchor,
.markdown-body h4:hover > .heading-anchor {
    opacity: 1;
}

.markdown-body p {
    margin: 0 0 1.1em;
}

.markdown-body li {
    margin: 0 0 6px;
}

.markdown-body blockquote {
    margin: 1.2em 0;
    padding: 12px 18px;
    border-left: 3px solid var(--c-primary);
    background: var(--c-surface-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--c-text-soft);
}

.markdown-body blockquote p:last-child {
    margin-bottom: 0;
}

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--c-inline-code-bg);
    padding: 2px 6px;
    border-radius: 5px;
}

.markdown-body pre {
    background: var(--c-code-bg);
    color: var(--c-code-text);
    padding: 16px 18px;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    line-height: 1.6;
    margin: 0;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    font-size: 13.5px;
}

.code-block {
    margin: 1.4em 0;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--c-code-bg);
}

.code-block figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-border);
}

.code-lang {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.code-copy {
    border: 0;
    background: transparent;
    color: var(--c-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.code-copy:hover {
    color: var(--c-primary);
    background: var(--c-primary-soft);
}

.code-block pre {
    border-radius: 0;
}

/* highlight.js：沿用代码块自身的底色，只取语法配色 */
.code-block pre code.hljs {
    background: transparent;
    padding: 0;
}

/* 数学公式（KaTeX） */
.math-inline {
    padding: 0 1px;
}
.math-block {
    display: block;
    margin: 1.2em 0;
    overflow-x: auto;
    text-align: center;
}
.math-block .katex-display {
    margin: 0;
}

/* Mermaid 图表 */
.mermaid-block {
    display: flex;
    justify-content: center;
    padding: 14px 12px;
    overflow-x: auto;
    background: var(--c-surface);
}
.mermaid-block svg {
    max-width: 100%;
    height: auto;
}

.table-wrap {
    overflow-x: auto;
    margin: 1.4em 0;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.markdown-body th,
.markdown-body td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border);
    text-align: left;
}

.markdown-body th {
    background: var(--c-surface-2);
    font-weight: 600;
}

.markdown-body tbody tr:last-child td {
    border-bottom: 0;
}

.post-image {
    margin: 1.4em 0;
}

/* 正文富媒体：视频 / 音频（后台素材库插入） */
.markdown-body video,
.post-video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.4em 0;
    border-radius: 12px;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-border);
}

.markdown-body audio,
.post-audio {
    display: block;
    width: 100%;
    margin: 1.2em 0;
}

.markdown-body hr {
    border: 0;
    border-top: 1px solid var(--c-border);
    margin: 2em 0;
}

.post-footer {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
    font-size: 13px;
    color: var(--c-muted);
}

.post-footer p {
    margin: 0 0 6px;
}

/* ========================================================================== 
   评论
   ========================================================================== */
/* ==========================================================================
   评论
   ========================================================================== */

.comments {
    margin: 40px 0 8px;
}

.comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    margin-left: 8px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.comment-flash {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
    background: var(--c-surface-2);
    color: var(--c-text-soft);
    font-size: 14px;
}

.comment-flash--success {
    border-color: color-mix(in srgb, var(--c-accent) 40%, transparent);
    background: color-mix(in srgb, var(--c-accent) 10%, transparent);
    color: var(--c-accent);
}

.comment-flash--error {
    border-color: color-mix(in srgb, var(--c-warn) 45%, transparent);
    background: color-mix(in srgb, var(--c-warn) 12%, transparent);
    color: var(--c-warn);
}

.comments-empty {
    color: var(--c-muted);
    font-size: 14px;
}

.comment-list,
.comment-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--c-border);
}

.comment-item:last-child {
    border-bottom: 0;
}

.comment-children {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 2px solid var(--c-border);
}

.comment-item--reply {
    padding: 12px 0 4px;
    border-bottom: 0;
}

.comment-avatar {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c-primary), #7c3aed);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.comment-avatar--sm {
    width: 30px;
    height: 30px;
    font-size: 13px;
}

.comment-main {
    min-width: 0;
    flex: 1;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--c-muted);
}

.comment-author {
    color: var(--c-text);
    font-weight: 600;
}

.comment-reply-flag {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--c-surface-2);
    font-size: 12px;
}

.comment-reply-link {
    margin-left: auto;
    font-size: 12px;
    color: var(--c-primary);
    text-decoration: none;
}

.comment-reply-link:hover {
    text-decoration: underline;
}

.comment-content {
    margin-top: 6px;
    color: var(--c-text-soft);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
    word-break: break-word;
}

.comment-form {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-surface);
}

.comment-form-title {
    margin: 0 0 12px;
    font-size: 16px;
}

.comment-form-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--c-muted);
}

.comment-form-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.comment-form-row .comment-field {
    flex: 1 1 220px;
}

.comment-field {
    display: block;
    margin-bottom: 14px;
}

.comment-field > span {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--c-text-soft);
}

.comment-field input,
.comment-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-bg);
    color: var(--c-text);
    font: inherit;
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.comment-field input:focus,
.comment-field textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 18%, transparent);
}

/* 浏览器自动填充：用主题底色覆盖 UA 的黄色（评论表单的昵称/邮箱会被自动填入） */
.comment-field input:-webkit-autofill,
.comment-field input:-webkit-autofill:hover,
.comment-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--c-text);
    box-shadow: 0 0 0 1000px var(--c-bg) inset;
    transition: background-color 9999s ease-out 0s;
}
.comment-field input:autofill {
    background-color: var(--c-bg);
    color: var(--c-text);
}

.comment-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.comment-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.comment-submit {
    padding: 10px 20px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--c-primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: filter .18s ease;
}

.comment-submit:hover {
    filter: brightness(1.08);
}

.comment-form-tip {
    font-size: 12px;
    color: var(--c-muted);
}

/* ========================================================================== 
   询价表单
   ========================================================================== */
.process-list strong { display: block; font-size: 15px; margin-bottom: 2px; }
.process-list span { font-size: 13px; color: var(--c-text-soft); }

.inquiry {
    margin: 34px 0 10px;
    padding: 26px 28px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    scroll-margin-top: calc(var(--header-h) + 16px);
}

.inquiry-title { margin: 0 0 6px; font-size: 20px; }
.inquiry-desc { margin: 0 0 18px; font-size: 14px; color: var(--c-text-soft); }
.inquiry-form { display: flex; flex-direction: column; gap: 14px; }
.inquiry-row { display: flex; flex-direction: column; gap: 6px; }
.inquiry-row--split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inquiry-label { font-size: 13px; color: var(--c-text-soft); }
.inquiry-label em { color: #dc2626; font-style: normal; }

.inquiry-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-bg-soft);
    color: var(--c-text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .16s ease, background .16s ease;
}

.inquiry-input:focus { outline: none; border-color: var(--c-primary); background: var(--c-surface); }
.inquiry-textarea { resize: vertical; min-height: 110px; }
.inquiry-errors { margin: 0; padding: 10px 14px; list-style: none; background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm); color: #b91c1c; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.inquiry-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.inquiry-tip { font-size: 12px; color: var(--c-muted); line-height: 1.5; }

.inquiry-flash {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid transparent;
}

.inquiry-flash--success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.inquiry-flash--error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* ========================================================================== 
   事实摘要
   ========================================================================== */
/* 事实摘要：给 AI 抓取用的"可引用段落"（人也能读） */
.fact-summary {
    padding: 18px 20px;
    border-left: 3px solid var(--c-brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--c-surface-2);
}
.fact-summary h2 { margin: 0 0 10px; font-size: 1rem; }
.fact-summary dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 13.5px; }
.fact-summary dt { color: var(--c-muted); }
.fact-summary dd { margin: 0; }

/* ========================================================================== 
   小屏
   ========================================================================== */
@media (max-width: 768px) {
    .inquiry { padding: 20px 18px; }
    .inquiry-row--split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .fact-summary dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
    .fact-summary dt { margin-top: 6px; }
}
