/* ============================================================
 * font-detail.css —— 字体详情页补充样式（字体日记网）
 * ------------------------------------------------------------
 * 说明：
 *   1. 本文件与首页 css/index.css 配合使用（先引 index.css 再引本文件）
 *   2. 详情页 body 覆盖首页的 flex 居中布局
 *   3. 配色全部采用首页出现过的颜色：#333 背景、#fff12f 高亮、
 *      #222/#444/#555 组件底色、白色文字
 * ============================================================ */

/* 方案1 Banner 用字体：DM Serif Display（编号衬线大字）+ JetBrains Mono（标签等宽）+ Noto Sans SC（标题粗体） */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=JetBrains+Mono:wght@400;700&family=Noto+Sans+SC:wght@400;500;700;900&display=swap');

/* 覆盖首页 body 的 flex 居中布局 */
body {
    display: block;
    align-items: normal;
    background-color: #333;
    color: #fff;
}

/* ------- 1. 导航栏（与首页深色风格一致） ------- */
/* 吸顶：放在 #siteHeader（header模板容器）上，保证 sticky 生效 */
#siteHeader {
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-nav-wrap {
    width: 100%;
    background-color: #222;
    border-bottom: 2px solid #000;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.site-nav {
    max-width: 1226px; /*实际显示1206左右预留10px边距*/
    margin: 0 auto;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}
/* 左：logo + slogan */
.site-nav-logo {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.site-nav-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
/* logo 始终保持 1:1 比例，不随窗口拉伸 */
.site-nav-logo img {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: contain;
}
.nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.nav-site-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.nav-slogan {
    font-size: 11px;
    font-weight: 400;
    color: #aaa;
    letter-spacing: 1px;
}
/* 中：文字菜单（横向居中） */
.site-nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
    justify-content: center;
}
.site-nav-menu li a {
    display: block;
    padding: 8px 12px;
    border-radius: 5px;
    color: #fff;
    font-size: 15px;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.site-nav-menu li a:hover {
    background-color: #fff12f;
    color: #000;
}
/* 右：捐赠区（垂直居中） */
.site-nav-donate {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.site-nav-donate .donate-btn {
    display: inline-block;
    background-color: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.site-nav-donate .donate-btn:hover {
    color: #fff12f;
    border-color: #fff12f;
    background-color: rgba(0,0,0,.5);
}

/* ------- 2. Banner 区（保持蓝色渐变不变） ------- */
.hero {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
    color: #fff;
    padding: 44px 20px 48px;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px),
        radial-gradient(circle at 85% -10%, rgba(255,212,59,.12) 0%, transparent 65%);
    background-size: 26px 26px, 100% 100%;
}
.hero-inner {
    position: relative;
    max-width: 1226px; /*实际显示1206左右预留10px边距*/
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "breadcrumb download"
        "code download"
        "title download"
        "subtitle download";
    gap: 0 60px;
    align-items: end;
    text-align: left;
    padding:0 10px;
}
.breadcrumb {
    grid-area: breadcrumb;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #bfdbfe;
    margin-bottom: 25px;
}
.breadcrumb a { color: #bfdbfe; text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: none; }
.breadcrumb .sep { color: #60a5fa; }
.breadcrumb .current { color: #fde047; font-weight: 600; }
.hero-code {
    grid-area: code;
    display: block;
    font-family: "DM Serif Display", Georgia, "Times New Roman", serif;
    font-size: 80px;
    font-weight: 400;
    line-height: 1;
    color: #fde047;
    letter-spacing: -2px;
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
    margin-bottom: 4px;
    width: fit-content;
}
.hero-title {
    grid-area: title;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: #fff;
    margin: 5px 0 12px;
    text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.hero-title .hl {
    color: #fde047;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    line-height: inherit;
}
.hero-subtitle {
    grid-area: subtitle;
    font-size: 17px;
    color: #dbeafe;
    max-width: 600px;
    margin: 0;
    line-height: 1.7;
    padding-left: 0;
    border-left: none;
}
.hero-download {
    grid-area: download;
    text-align: center;
    min-width: 380px;
    padding: 30px 28px 25px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    backdrop-filter: blur(10px);
}

/* ------- 下载按钮 ------- */
.download-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 300px;
    background: #ff9500;
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 14px;
    transition: all 0.2s;
    box-shadow: 0 4px 18px rgba(255, 149, 0, 0.4);
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}
.download-main::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.download-main:hover {
    background: #ffa920;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255, 149, 0, 0.5);
}
.download-main.disabled { opacity: .5; pointer-events: none; }
.download-disks {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}
/* 网盘标签：方案1白色半透明风格 */
.disk-btn {
    flex: 1;
    padding: 8px 8px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}
.disk-btn:hover {
    background: rgba(255,255,255,0.2);
}
.disk-btn.active {
    background: #fff;
    border-color: #fff;
    color: #1e40af;
    font-weight: 600;
}
.disk-btn.disabled { opacity: .4; pointer-events: none; }
.disk-quark { border-color: rgba(255,255,255,0.35); }
.disk-baidu { border-color: rgba(255,255,255,0.3); }
.disk-xunlei { border-color: rgba(255,255,255,0.25); }
.download-tip {
    font-size: 12.5px;
    color: #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 0;
}

/* ------- 3. 文章主体：左右布局 ------- */
.container {
    max-width: 1226px; /*实际显示1206左右预留10px边距*/
    margin: 0 auto;
    padding: 30px 10px 0;
}
.main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}

/* 文章卡片（深色，与首页一致） */
.article {
    background: #444;
    border-radius: 8px;
    padding: 32px 36px;
    border: 1px solid #000;
}
.article-section { margin-bottom: 40px; }
.article-section:last-child { margin-bottom: 0; }
.article-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    padding-left: 14px;
    border-left: 4px solid #fff12f;
    line-height: 1.4;
}
.article-section p {
    margin-bottom: 14px;
    color: #ddd;
    font-size: 16px;
    line-height: 1.8;
}
.article-section p strong { color: #fff; }

/* 文章图片：一行只显示一张 */
.article-img { margin: 18px 0; text-align: center; }
.article-img img {
    border-radius: 8px;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    display: block;
}
.img-caption {
    font-size: 13px;
    color: #aaa;
    text-align: center;
    margin-top: 8px;
}

/* 特点列表 */
.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li {
    padding: 10px 16px;
    margin-bottom: 10px;
    background: #333;
    border-radius: 6px;
    border-left: 3px solid #fff12f;
    color: #ddd;
}
.feature-list li strong { color: #fff12f; }

/* 案例网格：一行一张 */
.case-list { list-style: none; margin: 0; padding: 0; }
.case-item {
    margin-bottom: 18px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #000;
    background: #333;
}
.case-item img {
    width: 100%;
    /*max-height: 560px;*/
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* 授权列表 */
.license-list { list-style: none; margin: 0; padding: 0; }
.license-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #555;
    color: #ddd;
}
.license-list li:last-child { border-bottom: none; }
.license-list li strong { color: #fff; }
.license-tip {
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(255,241,47,.12);
    border-radius: 6px;
    color: #fff12f;
    border-left: 3px solid #fff12f;
}

/* 字体查找提示 */
.find-tip {
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(255,241,47,.12);
    border-radius: 6px;
    color: #fff12f;
    border-left: 3px solid #fff12f;
    font-size: 14px;
    line-height: 1.7;
}

/* 下载区块 */
.download-box {
    text-align: center;
    background: #333;
    border-radius: 8px;
    padding: 30px 20px;
    margin-top: 16px;
    border: 1px solid #555;
}
.download-box .download-main { font-size: 18px; }
.download-box .download-tip { color: #bbb; margin-bottom: 0px}

/* 收录说明 */
#record { background: #333; border-radius: 8px; padding: 20px; border: 1px solid #555; }
.record-meta {
    font-size: 13px;
    color: #aaa;
    border-top: 1px solid #555;
    padding-top: 12px;
    margin-top: 12px;
}

/* SEO 关键词墙 */
.keyword-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.keyword-wall a {
    display: inline-block;
    padding: 7px 16px;
    background: #555;
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid #666;
    text-decoration: none;
    transition: all .2s;
}
.keyword-wall a:hover {
    background: #fff12f;
    color: #000;
    border-color: #fff12f;
}

/* ------- 侧边栏 ------- */
.sidebar {
    position: sticky;
    top: 70px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.side-box {
    background: #444;
    border-radius: 8px;
    padding: 18px;
    border: 1px solid #000;
}
.side-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #fff12f;
    display: inline-block;
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { margin-bottom: 4px; }
.side-list li a {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 10px;
    border-radius: 5px;
    color: #ddd;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s;
}
.side-list li a:hover {
    background: #fff12f;
    color: #000;
    padding-left: 14px;
}
.side-list .font-id-tag {
    display: inline-block;
    min-width: 38px;
    padding: 2px 6px;
    margin-right: 8px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 4px;
    color: rgba(255,255,255,.85);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    flex-shrink: 0;
    transition: all .2s;
}
.side-list li a:hover .font-id-tag {
    background: rgba(255,255,255,.28);
    color: #000;
    border-color: rgba(0,0,0,.3);
}
.side-list .free-tag {
    font-size: 10px;
    color: #fff12f;
    border: 1px solid rgba(255,241,47,0.5);
    border-radius: 3px;
    padding: 1px 5px;
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}
.side-list li a:hover .free-tag {
    color: #000;
    border-color: rgba(0,0,0,0.4);
}
.side-gzh { text-align: center; }
.side-gzh .side-title { display: block; text-align: left; }
.gzh-qr {
    width: 150px;
    height: 150px;
    margin: 10px auto;
    border-radius: 6px;
    border: 1px solid #555;
    object-fit: contain;
    display: block;
}
.gzh-tip {
    font-size: 14px;
    color: #ccc;
    line-height: 1.6;
}

/* ------- 响应式 ------- */
@media (max-width: 992px) {
    .main-layout { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        order: 2;
    }
    .hero-inner { gap: 8px 32px; }
    .hero-download { min-width: 250px; padding: 22px 18px; }
    .hero-title { font-size: 34px; }
    .hero-subtitle { font-size: 15px; }
    .download-main { min-width: 0; font-size: 15px; padding: 12px 16px; }
    .nav-slogan { display: none; }
    .site-nav-menu li a { padding: 6px 10px; font-size: 13px; }
    .site-nav-logo a { font-size: 17px; }
    .site-nav-logo img { width: 36px; height: 36px; }
    .nav-site-name { font-size: 16px; }
}

@media (max-width: 768px) {
    .site-nav {
        height: auto;
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 4px;
    }
    /* 移动端：logo 整块居中显示 */
    .site-nav-logo {
        flex: 1 0 100%;
        justify-content: center;
        order: 1;
    }
    .site-nav-logo a { font-size: 16px; gap: 8px; }
    .site-nav-logo img { width: 26px; height: 26px; }
    .nav-site-name { font-size: 18px; }
    /* 移动端：导航栏捐赠按钮固定到底部，与首页 donate-btn-wrap 样式完全一致 */
    .site-nav-donate {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        padding: 10px 10px 15px 10px;
        background-color: #444;
        width: 100%;
        height: 63px;
        border: 10px solid #444;
        border-bottom: 15px solid #444;
        border-radius: 0;
        z-index: 999;
        box-sizing: border-box;
        flex: none;
        justify-content: center;
    }
    .site-nav-donate .donate-btn {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #FF5722;
        color: white;
        border: none;
        padding: 10px 20px;
        font-size: 14px;
        width: 94%;
        text-align: center;
        border-radius: 5px;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        margin: 0;
        box-sizing: border-box;
        white-space: normal;
    }
    .site-nav-donate .donate-btn:hover {
        background-color: #cc0f0f;
        color: white;
        border-color: transparent;
    }
    /* 菜单居中 */
    .site-nav-menu {
        order: 2;
        flex: 1 0 100%;
        justify-content: center;
        gap: 2px;
    }
    .site-nav-menu li a { padding: 6px 10px; font-size: 13px; }
    /* 小屏手机隐藏"首页"菜单，避免菜单栏整体溢出 */
    /*.site-nav-menu li:first-child { display: none; }*/
    /* 移动端取消导航hover，避免触摸点击后视觉停留 */
    .site-nav-menu li a:hover { background-color: transparent; color: #fff; }
    .site-nav-donate .donate-btn:hover { background-color: #FF5722; color: #fff; border-color: transparent; }
    .hero { padding: 28px 20px 32px; }
    .hero-inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "breadcrumb"
            "code"
            "title"
            "subtitle"
            "download";
        gap: 0;
        text-align: center;
        align-items: stretch;
    }
    .breadcrumb { justify-content: center; flex-wrap: wrap; font-size: 12px; margin-bottom: 12px; }
    .hero-code {
        margin: 0 auto 4px auto;
        font-size: 56px;
    }
    .hero-subtitle {
        margin: 0 auto;
        max-width: 100%;
        font-size: 13.5px;
        padding-left: 0;
        padding-top: 0;
        border-left: none;
        border-top: none;
        text-align: center;
        line-height: 1.6;
    }
    .hero-download { min-width: 0; width: 100%; padding: 18px 20px; margin-top: 16px; box-sizing: border-box; }
    .hero-title { font-size: 26px; text-align: center; margin-bottom: 10px; }
    .download-main { width: 100%; min-width: 0; font-size: 14.5px; padding: 12px 16px; white-space: normal; }
    .disk-btn { font-size: 11.5px; padding: 6px 4px; }
    .download-tip { font-size: 11.5px; }
    .article { padding: 22px 16px; }
    .article-section h2 { font-size: 20px; }
    .container { padding: 20px 8px 0; }
}

/* ===== 详情页 footer 修复：#siteFooter 注入导致 margin 塌陷，用 padding 代替 ===== */
#siteFooter .footer_top {
    padding-top: 1px; /* 建立BFC边界，阻止 .footer 的 margin-top 塌陷 */
}
#siteFooter .footer {
    margin-top: 19px; /* 20px - 1px padding-top = 视觉上与首页一致的20px间距 */
}

/* ===== 广告位（由 global_ad.js 统一管理内容和开关） ===== */
.ad-slot {
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #444;
}
.ad-slot:empty { display: none; } /* 未配置广告时自动隐藏 */
.ad-slot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ad-slot a { display: block; width: 100%; height: 100%; }
/* 广告位1：文章底部通栏横幅 PC 1206x112 */
.ad-banner {
    height: 112px;
    margin: 0 0 30px 0;
}
/* 广告位2：侧边栏广告（复用.side-box样式，标题+图片+说明） */
.ad-sidebar {
    margin: 0 0 16px;
}
.ad-sidebar img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}
.ad-sidebar .gzh-tip {
    margin-bottom: 0;
}
/* 移动端：通栏高度变为80px */
@media (max-width: 768px) {
    .ad-banner { height: 80px; }
}
