/*
 * 默认主题样式
 *
 * 性能相关（Core Web Vitals）：
 * - .post-card__thumb img / .post__cover img 用 aspect-ratio 锁定比例，
 *   与模板里的 width/height 属性一致，图片加载前后占位不跳动（CLS ≈ 0）
 * - 首屏不加动画，避免拖慢 INP
 */

:root {
    --zq-color-bg: #ffffff;
    --zq-color-text: #1f2328;
    --zq-color-muted: #6b7280;
    --zq-color-line: #e5e7eb;
    --zq-color-brand: #1d4ed8;
    --zq-color-brand-weak: #eff6ff;
    --zq-radius: 6px;
    --zq-gap: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--zq-color-bg);
    color: var(--zq-color-text);
    font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
    color: var(--zq-color-brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

.wrap {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 键盘用户用的跳转链接：默认藏起来，获得焦点时露出 */
.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
    z-index: 99;
    padding: 8px 14px;
    background: #111827;
    color: #fff;
    border-radius: var(--zq-radius);
}

/* ── 页头 ───────────────────────────────────────────── */

.site-header {
    border-bottom: 1px solid var(--zq-color-line);
    background: #fff;
}

/* 高度写死，避免 logo 加载完成时把整页往下顶 */
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--zq-gap);
    height: 64px;
}

.site-header__logo {
    display: flex;
    align-items: center;
    height: 40px;
    font-size: 20px;
    font-weight: 700;
    color: var(--zq-color-text);
}

.site-header__logo img {
    max-height: 40px;
    width: auto;
}

.site-header__name {
    white-space: nowrap;
}

.nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav__link {
    display: block;
    padding: 6px 12px;
    border-radius: var(--zq-radius);
    color: var(--zq-color-text);
}

.nav__link:hover {
    background: var(--zq-color-brand-weak);
    text-decoration: none;
}

.nav__link.active {
    background: var(--zq-color-brand);
    color: #fff;
}

/* ── 主体两栏 ───────────────────────────────────────── */

.site-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--zq-gap);
    padding: 24px 16px 48px;
}

@media (min-width: 900px) {
    .site-body {
        grid-template-columns: minmax(0, 1fr) 300px;
        align-items: start;
    }
}

.site-body__main {
    min-width: 0;
}

/* ── 面包屑 ─────────────────────────────────────────── */

.breadcrumb {
    margin-bottom: 16px;
}

.breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: var(--zq-color-muted);
}

.breadcrumb__item + .breadcrumb__item::before {
    content: "/";
    margin-right: 8px;
    color: #d1d5db;
}

/* ── 标题 ───────────────────────────────────────────── */

.page-title {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.35;
}

@media (min-width: 900px) {
    .page-title {
        font-size: 32px;
    }
}

.page-intro {
    margin: 0 0 24px;
    color: var(--zq-color-muted);
}

.section {
    margin-top: 32px;
}

.section__title {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--zq-color-line);
    font-size: 20px;
}

/* ── 列表 ───────────────────────────────────────────── */

.post-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-card {
    padding: 20px 0;
    border-bottom: 1px solid var(--zq-color-line);
}

.post-card:first-child {
    padding-top: 0;
}

.post-card__title {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.5;
}

.post-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--zq-color-muted);
}

.post-card__thumb {
    display: block;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: var(--zq-radius);
    background: #f3f4f6;
}

/* 比例锁死：与模板里 width=640 height=360 一致 */
.post-card__thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.post-card__excerpt {
    margin: 0;
    color: #374151;
}

/* ── 文章页 ─────────────────────────────────────────── */

.post__title {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.4;
}

@media (min-width: 900px) {
    .post__title {
        font-size: 34px;
    }
}

.post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--zq-color-muted);
}

.post__cover {
    margin: 0 0 24px;
    overflow: hidden;
    border-radius: var(--zq-radius);
    background: #f3f4f6;
}

/* 比例锁死：与模板里 width=1200 height=675 一致 */
.post__cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.entry-content {
    font-size: 17px;
    line-height: 1.9;
    word-wrap: break-word;
}

.entry-content h2 {
    margin: 32px 0 16px;
    font-size: 22px;
}

.entry-content h3 {
    margin: 24px 0 12px;
    font-size: 19px;
}

.entry-content p {
    margin: 0 0 18px;
}

.entry-content img {
    border-radius: var(--zq-radius);
}

.entry-content blockquote {
    margin: 0 0 18px;
    padding: 12px 16px;
    border-left: 4px solid var(--zq-color-line);
    background: #f9fafb;
    color: var(--zq-color-muted);
}

.entry-content pre {
    padding: 14px 16px;
    overflow-x: auto;
    border-radius: var(--zq-radius);
    background: #0f172a;
    color: #e2e8f0;
}

.post__footer {
    margin-top: 32px;
}

.post-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--zq-color-line);
    font-size: 14px;
}

/* ── 侧边栏 ─────────────────────────────────────────── */

.widget {
    margin-bottom: 28px;
    padding: 16px;
    border: 1px solid var(--zq-color-line);
    border-radius: var(--zq-radius);
}

.widget__title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--zq-color-line);
    font-size: 16px;
}

.widget__list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.widget__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed #f0f1f3;
}

.widget__item:last-child {
    border-bottom: 0;
}

.widget__count {
    color: var(--zq-color-muted);
    font-size: 12px;
}

/* ── 相关内容 / 404 ─────────────────────────────────── */

.related-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-list__item {
    padding: 8px 0;
    border-bottom: 1px dashed var(--zq-color-line);
}

.related-list__item:last-child {
    border-bottom: 0;
}

.notfound__back {
    margin: 0 0 32px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--zq-radius);
    background: var(--zq-color-brand);
    color: #fff;
}

.btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

/* ── 分页 ───────────────────────────────────────────── */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 28px;
}

.pagination__link,
.pagination__current,
.pagination__off,
.pagination__gap {
    min-width: 38px;
    padding: 7px 12px;
    border: 1px solid var(--zq-color-line);
    border-radius: var(--zq-radius);
    font-size: 14px;
    text-align: center;
}

.pagination__link:hover {
    border-color: var(--zq-color-brand);
    text-decoration: none;
}

.pagination__current {
    border-color: var(--zq-color-brand);
    background: var(--zq-color-brand);
    color: #fff;
}

.pagination__off,
.pagination__gap {
    border-color: transparent;
    color: #9ca3af;
}

/* ── 标签云 ───────────────────────────────────────────── */

.tag-cloud {
    margin: 0 0 24px;
}

.tag-cloud__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tag-cloud__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--zq-color-line);
    border-radius: 999px;
    color: var(--zq-color-text);
    font-size: 14px;
}

.tag-cloud__link:hover {
    border-color: var(--zq-color-brand);
    color: var(--zq-color-brand);
    text-decoration: none;
}

.tag-cloud__link.active {
    background: var(--zq-color-brand);
    border-color: var(--zq-color-brand);
    color: #fff;
}

.tag-cloud__count {
    color: var(--zq-color-muted);
    font-size: 12px;
}

.tag-cloud__link.active .tag-cloud__count {
    color: #dbeafe;
}

/* ── 栏目专题富内容块（移植自 saas 主题，复用默认主题配色）── */
.cat-steps, .cat-advantages, .cat-effects, .cat-scenarios, .cat-faq { padding: 32px 0; }
.section__lead { max-width: 760px; margin: 0 0 24px; color: var(--zq-color-muted); font-size: 15px; }

.steps__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; }
.step-card { background: #fff; border: 1px solid var(--zq-color-line); border-radius: var(--zq-radius); padding: 22px 20px; }
.step-card__num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 999px; background: var(--zq-color-brand); color: #fff; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.step-card__title { margin: 0 0 8px; font-size: 17px; color: var(--zq-color-text); }
.step-card__desc { margin: 0; color: var(--zq-color-muted); font-size: 14px; line-height: 1.7; }

.advantage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.advantage-card { background: #fff; border: 1px solid var(--zq-color-line); border-top: 3px solid var(--zq-color-brand); border-radius: var(--zq-radius); padding: 22px 20px; }
.advantage-card__title { margin: 0 0 8px; font-size: 17px; color: var(--zq-color-text); }
.advantage-card__desc { margin: 0; color: var(--zq-color-muted); font-size: 14px; line-height: 1.7; }

.cat-effects { background: #f8fafc; border-top: 1px solid var(--zq-color-line); border-bottom: 1px solid var(--zq-color-line); }
.effects-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.effect-card { background: #fff; border: 1px solid var(--zq-color-line); border-radius: var(--zq-radius); padding: 20px; text-align: center; }
.effect-card__value { display: block; font-size: 26px; font-weight: 700; color: var(--zq-color-brand); }
.effect-card__label { display: block; color: var(--zq-color-muted); font-size: 13px; margin-top: 2px; }
.effect-card__desc { margin: 10px 0 0; color: var(--zq-color-muted); font-size: 13px; line-height: 1.6; }

.scenario-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.scenario-card { background: #fff; border: 1px solid var(--zq-color-line); border-radius: var(--zq-radius); padding: 20px; }
.scenario-card__title { margin: 0 0 8px; font-size: 16px; color: var(--zq-color-text); }
.scenario-card__desc { margin: 0; color: var(--zq-color-muted); font-size: 14px; line-height: 1.7; }

.faq__list { display: flex; flex-direction: column; gap: 10px; }
.faq__item { background: #fff; border: 1px solid var(--zq-color-line); border-radius: var(--zq-radius); padding: 4px 16px; }
.faq__q { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--zq-color-text); position: relative; list-style: none; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--zq-color-brand); }
.faq__item[open] .faq__q::after { content: "\2212"; }
.faq__a { padding: 0 0 16px; color: var(--zq-color-muted); font-size: 14px; line-height: 1.8; }

/* ── 富内容块 + 页头 移动端适配 ── */
@media (max-width: 900px) {
    .steps__list, .advantage-grid, .effects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .steps__list, .advantage-grid, .effects-grid, .scenario-grid { grid-template-columns: 1fr; }
    .cat-steps, .cat-advantages, .cat-effects, .cat-scenarios, .cat-faq { padding: 26px 0; }
}
@media (max-width: 870px) {
    /* 断点取 870 而非 768：logo(205) + 导航(608) + gap(20) + wrap padding(32) = 865，
       窄于 865 时导航会折行，而页头当时仍写死 64px 高 → 第二行会溢出到正文上
       （实测 769~864 档 nav 底边比页头底边低 9px）。整段提前到 870 即可。 */
    .site-header__inner { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
    .nav__list { flex-wrap: wrap; }
}

/* ── 页脚 ───────────────────────────────────────────── */

.site-footer {
    padding: 28px 0;
    border-top: 1px solid var(--zq-color-line);
    background: #fafafa;
    font-size: 14px;
    color: var(--zq-color-muted);
}

.site-footer p {
    margin: 0 0 6px;
}

.site-footer__brand {
    font-weight: 700;
    color: var(--zq-color-text);
}

/* ── 栏目富内容网格：末行居中 ─────────────────────────────────
   原是 grid；条目数为奇数时（优势 5 项 / 步骤 5 项）末行只剩 2 个，
   靠左排列会在右侧空出整列（实测空 258px）。改 flex + 居中后，
   满行仍是 3 / 4 / 2 列，末行不足则整体居中。 */
.steps__list,
.advantage-grid,
.effects-grid,
.scenario-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* 3 列（gap 18px → 2 段间距） */
.steps__list > *,
.advantage-grid > * {
    flex: 0 1 calc((100% - 36px) / 3);
}

/* 4 列（gap 16px → 3 段间距） */
.effects-grid > * {
    flex: 0 1 calc((100% - 48px) / 4);
}

/* 2 列（gap 16px → 1 段间距） */
.scenario-grid > * {
    flex: 0 1 calc((100% - 16px) / 2);
}

@media (max-width: 900px) {
    .steps__list > *,
    .advantage-grid > *,
    .effects-grid > * {
        flex: 0 1 calc((100% - 18px) / 2);
    }
}

@media (max-width: 600px) {
    .steps__list > *,
    .advantage-grid > *,
    .effects-grid > *,
    .scenario-grid > * {
        flex: 0 1 100%;
    }
}


/* ===== 文章列表缩略图（AI 配图，2026-09-17 追加）=====================
   配图后 .post-card__thumb 从「不渲染」变为每张卡片都渲染满宽大图
   （实测 788x443、卡片高 605px、首页 9800px），信息密度过低。
   改为左浮动小图：桌面 240x135、窄屏 140x79，摘要自然绕排。
   主题原有 .post-card__thumb img{width:100%;height:auto;aspect-ratio:16/9;
   object-fit:cover} 保持不变 —— 16:9 与源图一致，不产生任何裁切。
   .post-card 加 overflow:hidden 形成 BFC，避免浮动溢出不参与父级高度。 */
.post-card{display:block;overflow:hidden}
.post-card__thumb{float:left;max-width:240px;margin:0 20px 12px 0}

@media (max-width:600px){
    /* 窄屏内容区约 343px，240px 浮图会把文字挤成一列，故缩到 140px */
    .post-card__thumb{max-width:140px;margin-right:12px}
}

.nav-toggle{display:none;background:none;border:0;cursor:pointer;padding:8px;color:inherit}
@media (max-width:720px){
  .site-header__inner{position:relative}
  .nav-toggle{display:block;margin-left:auto}
  .nav__list{display:none}
  .nav__list.open{display:flex;flex-direction:column;position:absolute;top:100%;right:0;background:#fff;box-shadow:0 12px 30px rgba(0,0,0,.12);padding:6px 0;z-index:60;min-width:180px}
  .nav__list.open .nav__item a{padding:12px 18px;border-top:1px solid rgba(0,0,0,.06)}
  .nav__list.open .nav__item:first-child a{border-top:0}
}
