@charset "utf-8";
/* ==========================================================================
   应用方案页专用样式（批次二十三）
   --------------------------------------------------------------------------
   作用域：所有规则以 .app-page 开头，只在本页生效，不污染 style.css。
   涉及页面：/applications.html（列表）、/application/{slug}.html（详情）

   设计约束：
   1. 中文正文 17px / 行高 1.85，行宽控制在 50 字左右（中文最佳 40-50 字）；
   2. h2 与上文之间必须有 54px 呼吸，原来 margin 是 0，这是整页显乱的主因；
   3. 卡片一律 flex 等高，图片回到文档流，不再用 absolute 定位；
   4. 5 个品类用 flex 居中网格，最后一行 2 个自动居中，不留右侧空格。
   ========================================================================== */

/* ---------- 基础排版 ---------- */

.app-page {
    color: #3d3d52;
}

.app-page .app-lead {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.78;
    font-weight: 300;
    color: #2f2f45;
}

.app-page h2 {
    margin: 54px 0 20px;
    font-size: 29px;
    line-height: 1.4;
    font-weight: 400;
    color: #1a1a28;
    letter-spacing: .2px;
}

.app-page h2:first-child,
.app-page .app-lead + h2 {
    margin-top: 40px;
}

/* h2 上方细线，让段落层次一眼分得开 */
.app-page h2::before {
    content: '';
    display: block;
    width: 34px;
    height: 3px;
    margin-bottom: 18px;
    background: #3d29a4;
    border-radius: 2px;
}

.app-page h3 {
    margin: 36px 0 14px;
    font-size: 21px;
    line-height: 1.5;
    font-weight: 400;
    color: #1a1a28;
}

/* 富文本正文容器（$app.content 输出在这里） */
.app-page .app-body {
    font-size: 17px;
    line-height: 1.85;
    color: #3d3d52;
}

.app-page .app-body p,
.app-page .app-body ul,
.app-page .app-body ol {
    margin: 0 0 18px;
    font-size: 17px;
    line-height: 1.85;
}

.app-page .app-body p:last-child {
    margin-bottom: 0;
}

.app-page .app-body ul,
.app-page .app-body ol {
    padding-left: 22px;
}

.app-page .app-body li {
    margin-bottom: 9px;
    line-height: 1.85;
}

.app-page .app-body strong {
    font-weight: 600;
    color: #1a1a28;
}

.app-page .app-body a {
    color: #3d29a4;
    border-bottom: 1px dashed rgba(61, 41, 164, .45);
}

.app-page .app-body a:hover {
    border-bottom-style: solid;
}

/* 正文里的空段落是编辑器留下的，去掉它免得出现莫名其妙的大空档 */
.app-page .app-body p:empty {
    display: none;
}

/* ---------- 列表页：5 个品类卡片 ---------- */

.app-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;      /* 同一行卡片强制等高 */
    justify-content: center;
    gap: 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-grid > * {
    flex: 0 0 calc(33.3333% - 17.34px);
    max-width: calc(33.3333% - 17.34px);
}

/* 注意：这里不能写 height:100%。
   父容器 .app-grid 高度是 auto，百分比高度会解析成 auto 并让 flex 的
   stretch 失效，结果就是同一行卡片各自按内容撑高（实测 489/462/435）。
   交给 align-items:stretch 处理，卡片自然等高。 */
.app-card {
    display: flex;
    flex-direction: column;
    padding: 28px 26px 24px;
    background: #fff;
    border: 1px solid #e9e6f4;
    border-radius: 6px;
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.app-card:hover {
    border-color: #cfc7ee;
    box-shadow: 0 12px 32px rgba(61, 41, 164, .1);
    transform: translateY(-3px);
}

/* 图片区固定高度并居中，五张素材视觉重量不一致的问题靠这个统一 */
.app-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 128px;
    margin-bottom: 20px;
}

.app-card-media img {
    max-width: 100%;
    max-height: 128px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.app-card-title {
    margin: 0 0 12px;
    font-size: 19px;
    line-height: 1.45;
    font-weight: 400;
    color: #1a1a28;
}

.app-card-title a {
    color: inherit;
    text-decoration: none;
}

.app-card:hover .app-card-title {
    color: #3d29a4;
}

.app-card-text {
    flex: 1 1 auto;
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.82;
    color: #5c5c72;
}

.app-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    align-self: flex-start;
    font-size: 14px;
    line-height: 1.6;
    color: #3d29a4;
    text-decoration: none;
    transition: gap .2s ease;
}

.app-card-link:hover,
.app-card-link:focus {
    color: #d38a3b;
    text-decoration: none;
}

.app-card:hover .app-card-link {
    gap: 11px;
}

.app-card-link .arw {
    font-size: 15px;
    line-height: 1;
}

/* 列表页导语与网格式的间距 */
/* 列表页导语
   中文长段落居中后每行长短不齐，右边参差很明显，所以改成左对齐、容器居中。
   900px 在 19px 字号下约 47 字一行，落在中文舒适区间。 */
.app-hub-lead {
    max-width: 900px;
    margin: 0 auto 46px;
    text-align: left;
    font-size: 19px;
    line-height: 1.85;
    color: #4a4a60;
}

/* 列表页底部说明块 */
.app-hub-note {
    max-width: 860px;
    margin: 62px auto 0;
    padding-top: 42px;
    border-top: 1px solid #eae7f5;
}

.app-hub-note h2 {
    margin: 0 0 16px;
    font-size: 24px;
    line-height: 1.45;
}

/* 上面已经有分隔线，不用再叠一条色条 */
.app-hub-note h2::before {
    display: none;
}

/* ---------- 详情页：配方难点（四宫格） ---------- */

.app-pains {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0 0 8px;
}

.app-pain {
    flex: 0 0 calc(50% - 9px);
    max-width: calc(50% - 9px);
    box-sizing: border-box;
    padding: 20px 22px 20px 24px;
    background: #f8f7fc;
    border-left: 3px solid #3d29a4;
    border-radius: 0 4px 4px 0;
}

.app-pain h4 {
    margin: 0 0 9px;
    font-size: 16.5px;
    line-height: 1.55;
    font-weight: 600;
    color: #3d29a4;
}

.app-pain p {
    margin: 0;
    font-size: 15px;
    line-height: 1.8;
    color: #5c5c72;
}

/* ---------- 详情页：常用粉体清单 ---------- */

.app-powders {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
    border-top: 1px solid #eae7f5;
}

.app-powders li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin: 0;
    padding: 14px 2px;
    border-bottom: 1px solid #eae7f5;
    font-size: 16px;
    line-height: 1.7;
}

.app-powders .pw-name {
    flex: 0 0 auto;
    font-weight: 600;
    color: #3d29a4;
    text-decoration: none;
    border-bottom: 1px dashed rgba(61, 41, 164, .4);
}

.app-powders .pw-name:hover {
    color: #d38a3b;
    border-bottom-color: rgba(211, 138, 59, .55);
}

.app-powders .pw-role {
    flex: 1 1 240px;
    color: #5c5c72;
    font-size: 15px;
}

/* ---------- 详情页：常见问题 ---------- */

.app-faqs {
    margin: 0;
}

.app-faq {
    padding: 22px 0 21px;
    border-top: 1px solid #eae7f5;
}

.app-faq:last-child {
    border-bottom: 1px solid #eae7f5;
}

.app-faq .q {
    position: relative;
    margin: 0 0 10px;
    padding-left: 30px;
    font-size: 17px;
    line-height: 1.65;
    font-weight: 600;
    color: #1a1a28;
}

/* 问号标记 */
.app-faq .q::before {
    content: 'Q';
    position: absolute;
    left: 0;
    top: 1px;
    display: inline-block;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 20px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    background: #3d29a4;
    border-radius: 50%;
}

.app-faq .a {
    margin: 0;
    padding-left: 30px;
    font-size: 16px;
    line-height: 1.85;
    color: #5c5c72;
}

/* ---------- 详情页：右侧目录栏 ---------- */
/* 原来复用 .blog-aside（博客侧栏，带 translateY(-30px) 和 pointer-events:none），
   那套样式是为博客文章写的，放到这里导致侧栏永远比正文高 30px。这里整套重写。 */

.app-aside {
    position: static;
    transform: none;
    margin: 0;
    padding: 0;
    pointer-events: auto;
}

.app-aside + .app-aside {
    margin-top: 24px;
}

.app-aside-box {
    padding: 22px 22px 18px;
    background: #fff;
    border: 1px solid #e9e6f4;
    border-radius: 6px;
}

.app-aside-title {
    margin: 0 0 14px;
    padding-bottom: 11px;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 600;
    color: #1a1a28;
    letter-spacing: .3px;
    border-bottom: 1px dashed #e0dcf0;
}

.app-aside-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-aside-list li {
    margin: 0;
    padding: 0;
}

.app-aside-list a {
    display: block;
    position: relative;
    padding: 7px 0 7px 15px;
    font-size: 15px;
    line-height: 1.65;
    color: #56566c;
    text-decoration: none;
    border-radius: 3px;
    transition: color .18s ease, padding-left .18s ease;
}

.app-aside-list a::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    background: #c9c4e0;
    border-radius: 50%;
}

.app-aside-list a:hover {
    color: #3d29a4;
    padding-left: 19px;
}

.app-aside-list a:hover::before {
    background: #3d29a4;
}

.app-aside-list a.active {
    font-weight: 600;
    color: #3d29a4;
}

.app-aside-list a.active::before {
    background: #3d29a4;
    box-shadow: 0 0 0 3px rgba(61, 41, 164, .16);
}

/* 侧栏里想索取样品的小入口 */
.app-aside-cta {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e0dcf0;
}

/* 侧栏里的索样入口
   全宽实心紫块在 300px 窄栏里太重，压过了上面的目录，改成描边按钮。 */
.app-aside-cta .btn-sample {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    background: transparent;
    border: 1px solid #3d29a4;
    border-radius: 2px;
    color: #3d29a4 !important;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s ease, color .2s ease;
}

.app-aside-cta .btn-sample:hover,
.app-aside-cta .btn-sample:focus {
    background: #3d29a4;
    color: #fff !important;
}

/* ---------- 详情页：没有侧栏时的兜底（老页面用 CJK 名称） ---------- */

.app-page .app-main-narrow {
    max-width: 860px;
    margin: 0 auto;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1199px) {
    .app-page h2 {
        font-size: 26px;
        margin: 44px 0 17px;
    }
    .app-page .app-body,
    .app-page .app-body p,
    .app-page .app-body ul,
    .app-page .app-body ol {
        font-size: 16.5px;
    }
    .app-grid > * {
        flex: 0 0 calc(50% - 13px);
        max-width: calc(50% - 13px);
    }
    .app-page .app-hub-lead {
        margin-bottom: 38px;
    }
}

@media (max-width: 767px) {
    .app-page h2 {
        font-size: 23px;
        margin: 36px 0 15px;
        line-height: 1.45;
    }
    .app-page h2::before {
        margin-bottom: 14px;
    }
    .app-page .app-lead,
    .app-page .app-hub-lead {
        font-size: 17px;
        line-height: 1.8;
    }
    .app-page .app-body,
    .app-page .app-body p,
    .app-page .app-body ul,
    .app-page .app-body ol {
        font-size: 16px;
        line-height: 1.85;
    }
    .app-pain {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .app-faq .q {
        padding-left: 27px;
        font-size: 16px;
    }
    .app-faq .a {
        padding-left: 27px;
        font-size: 15.5px;
    }
    .app-powders li {
        padding: 12px 0;
    }
    .app-powders .pw-role {
        flex: 1 1 100%;
    }
    .app-card {
        padding: 22px 20px 20px;
    }
    .app-card-media {
        height: 108px;
        margin-bottom: 16px;
    }
    .app-card-media img {
        max-height: 108px;
    }
    .app-aside + .app-aside {
        margin-top: 18px;
    }
}

@media (max-width: 575px) {
    .app-grid > * {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .app-grid {
        gap: 18px;
    }
    .app-page .app-hub-lead {
        text-align: left;
        margin-bottom: 30px;
    }
}
