/* dy_article_modern：白底详情 + 横向文件卡 + 原版 icoo + 蓝框预览 */
:root {
    --dy-text: #333;
    --dy-text-sub: #999;
    --dy-text-hint: #b0b0b0;
    --dy-border: #e8e8e8;
    --dy-blue: #3b7ddd;
    --dy-blue-light: #e8f2fc;
    --dy-red: #e53935;
    --dy-orange: #f57c00;
    --dy-green: #07c160;
    --dy-flag: #ff6b00;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --dy-bottom-stack-h: 140px;
}

.dy-mod-wrap {
    background: #fff;
    min-height: 100vh;
    color: var(--dy-text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.dy-mod-wrap * {
    box-sizing: border-box;
}

.dy-mod-page {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    padding-bottom: calc(var(--dy-bottom-stack-h) + 8px + var(--safe-bottom));
}

/* 顶栏：标题与返回、首页同一垂直中线 */
.dy-mod-header .m-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    line-height: 1.2;
    padding: 0 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.dy-mod-header .m-header .icon.goback {
    position: absolute;
    left: 10px;
    top: 50%;
    margin: 0;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
}

.dy-mod-header .m-header .title.dy-mod-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    margin: 0;
    padding: 0 6px;
    /* 覆盖 common.css 的 width:150px，保证品牌名完整展示 */
    width: auto !important;
    max-width: calc(100% - 68px) !important;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    text-align: center;
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    letter-spacing: 0;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

.dy-mod-header-link {
    position: absolute;
    right: 10px;
    top: 50%;
    line-height: 1;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
}

/* 标题区（沿用 asset-intro 大图标） */
.dy-mod-intro-block {
    padding: 14px 14px 10px;
    background: #fff;
    border-bottom: 8px solid #f5f5f5;
}

.dy-mod-intro-main {
    display: block;
}

.dy-mod-intro-text {
    width: 100%;
}

.dy-mod-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    color: #222;
    word-break: break-word;
}

.dy-mod-flag {
    color: var(--dy-flag);
    font-weight: 700;
    margin-right: 2px;
}

.dy-mod-meta-line {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--dy-text-sub);
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 2px;
}

.dy-mod-meta-line>span:not(.dy-mod-meta-sep) {
    flex-shrink: 0;
}

.dy-mod-meta-sep {
    margin: 0 6px;
    color: #ddd;
    flex-shrink: 0;
}

/* 预览区 */
.dy-mod-preview-section {
    padding: 12px 0 16px;
    background: #fff;
}

.dy-mod-files-tip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 14px 10px;
}

.dy-mod-files-tip {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--dy-text-sub);
}

.dy-mod-files-tip strong {
    color: var(--dy-blue);
    font-weight: 600;
}

.dy-mod-files-scroll-hint {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--dy-blue);
    white-space: nowrap;
}

/* 横向文件卡片 */
.dy-mod-asset-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 14px 12px;
    scrollbar-width: none;
}

.dy-mod-asset-scroll::-webkit-scrollbar {
    display: none;
}

.dy-mod-asset-track {
    display: inline-flex;
    gap: 10px;
    min-width: min-content;
}

.dy-mod-file-card {
    position: relative;
    flex: 0 0 auto;
    width: 128px;
    min-height: 0;
    padding: 8px 8px 8px 6px;
    border: 1px solid var(--dy-border);
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.dy-mod-file-card.is-active {
    border-color: var(--dy-blue);
    background: var(--dy-blue-light);
    box-shadow: 0 2px 8px rgba(59, 125, 221, 0.15);
}

/* 图标固定 40×50（按 375 宽屏基准换算 vw），PC/手机一致 */
.dy-mod-card-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 50px;
    overflow: hidden;
    line-height: 0;
    align-self: flex-start;
}

.dy-mod-file-card .dy-mod-card-icon .icon {
    display: inline-block !important;
    vertical-align: top !important;
    width: 40px !important;
    height: 50px !important;
    min-width: 40px !important;
    min-height: 50px !important;
    max-width: 40px !important;
    max-height: 50px !important;
    margin: 0 !important;
    transform: none !important;
    /* .icon 默认 background-size 为 vw，此处锁定为 375px 视口等效值 */
    background-size: 470px 427px !important;
}

.dy-mod-file-card .icoo-sppt,
.dy-mod-file-card .icoo-spptx {
    background-position: -405px 0 !important;
}

.dy-mod-file-card .icoo-sdoc,
.dy-mod-file-card .icoo-sdocx,
.dy-mod-file-card .icoo-swps {
    background-position: -405px -165px !important;
}

.dy-mod-file-card .icoo-spdf {
    background-position: -398px -274px !important;
    width: 44px !important;
    max-width: 44px !important;
}

.dy-mod-file-card .icoo-srar {
    background-position: -360px -322px !important;
}

.dy-mod-file-card .icoo-smov,
.dy-mod-file-card .icoo-smp4,
.dy-mod-file-card .icoo-savi,
.dy-mod-file-card .icoo-sflv,
.dy-mod-file-card .icoo-svideo {
    background-position: -514px -323px !important;
}

.dy-mod-file-card .icoo-samr,
.dy-mod-file-card .icoo-saudio,
.dy-mod-file-card .icoo-smp3,
.dy-mod-file-card .icoo-sogg,
.dy-mod-file-card .icoo-sra,
.dy-mod-file-card .icoo-swav,
.dy-mod-file-card .icoo-swma {
    background-position: -405px -109px !important;
}

.dy-mod-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}

.dy-mod-card-type {
    font-size: 11px;
    font-weight: 600;
    color: var(--dy-blue);
    line-height: 1.2;
}

.dy-mod-file-card.is-active .dy-mod-card-type {
    color: #2a5fad;
}

.dy-mod-card-name {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

/* 隐藏 dw 列表，保留给 zydown.js */
.dy-mod-dw-list {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* 大图预览 */
.dy-mod-gallery {
    margin: 0 12px;
    padding: 0;
}

.dy-mod-gallery--text {
    padding: 8px 0;
}

.dy-mod-slide {
    position: relative;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.dy-mod-slide:last-child {
    margin-bottom: 0;
}

.dy-mod-slide-img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
}

.dy-mod-slide-video {
    width: 100%;
    display: block;
    background: #111;
}

.dy-mod-page-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.4;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 10px;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

.dy-mod-preview-more {
    margin: 2px 0 10px;
    padding: 14px 12px 16px;
    text-align: center;
    border-top: 1px solid #eef1f5;
    background: linear-gradient(180deg, #fafbfd 0%, #fff 100%);
}

.dy-mod-preview-more-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 13px;
    line-height: 1.5;
    color: #3b7ddd;
}

.dy-mod-preview-more-text strong {
    font-weight: 600;
    color: #3b7ddd;
}

.dy-mod-empty-hint {
    margin: 0 14px 12px;
    font-size: 12px;
    color: var(--dy-text-sub);
}

.dy-mod-fallback-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #444;
}

.dy-mod-intro-rich {
    margin: 16px 14px 0;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.dy-mod-subtitle {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.dy-mod-intro-body {
    font-size: 14px;
    color: #555;
    line-height: 1.65;
    word-break: break-word;
}

.dy-mod-intro-body img {
    max-width: 100%;
    height: auto;
}

.dy-mod-page-spacer {
    height: 16px;
}

/* 底栏 */
.dy-mod-bottom-stack {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 480px;
    z-index: 100;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.dy-mod-bottom-tip {
    padding: 6px 14px;
    font-size: 11px;
    color: #b8860b;
    background: linear-gradient(90deg, #fff8e8, #fff3d6);
    text-align: center;
    border-top: 1px solid #ffe8b8;
}

.dy-mod-bottom-tip--vip {
    display: block;
    width: 100%;
    border: none;
    border-top: 1px solid #ffe8b8;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dy-mod-bottom-tip--vip:active {
    background: linear-gradient(90deg, #fff3d6, #ffecc0);
}

.dy-mod-bottom-save {
    color: #e53935;
    font-weight: 700;
}

.dy-mod-bottom-bar {
    display: flex;
    align-items: stretch;
    min-height: 50px;
    padding: 8px 12px calc(8px + var(--safe-bottom));
    gap: 0;
    background: #fff;
}

.dy-mod-bottom-split .nav-item {
    flex: 1;
    width: 50%;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 46px;
    height: 46px;
    text-align: center;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border: none;
}

/* 左右各半：左红（下载）右蓝（VIP），中间无缝拼接 */
.dy-mod-bottom-split .dy-mod-btn-red {
    background: var(--dy-red) !important;
    border-radius: 23px 0 0 23px;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.12);
}

.dy-mod-bottom-split .dy-mod-btn-blue {
    background: var(--dy-blue) !important;
    border-radius: 0 23px 23px 0;
    box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.06);
}

.dy-mod-bottom-split .nav-item:active {
    opacity: 0.9;
    filter: brightness(0.95);
}

/* 覆盖 app.css 在详情页上的干扰 */
.dy-mod-wrap .main-wrapper,
.dy-mod-wrap .container .ul_box .attribute-tit {
    display: none;
}

.dy-mod-wrap body,
#whole-wrap .dy-mod-wrap {
    background: #fff;
}

@media (max-width: 340px) {
    .dy-mod-header .m-header .title.dy-mod-brand {
        font-size: 12px;
        max-width: calc(100% - 62px) !important;
        white-space: normal;
        line-height: 1.25;
    }

    .dy-mod-header .m-header {
        height: 48px;
    }
}

@media (min-width: 481px) {
    .dy-mod-header .m-header .title.dy-mod-brand {
        font-size: 15px;
        max-width: none !important;
    }

    .dy-mod-page {
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.06);
    }

    .dy-mod-asset-scroll {
        padding: 0 16px 14px;
        scrollbar-width: thin;
        scrollbar-color: #c5d4e8 transparent;
    }

    .dy-mod-asset-scroll::-webkit-scrollbar {
        display: block;
        height: 5px;
    }

    .dy-mod-asset-scroll::-webkit-scrollbar-thumb {
        background: #c5d4e8;
        border-radius: 3px;
    }

    .dy-mod-file-card {
        width: 136px;
    }

    .dy-mod-files-scroll-hint::after {
        content: " →";
    }
}

/* 悬浮客服（/t/ 详情） */
.dy-article-service-fab {
    position: fixed;
    right: 14px;
    bottom: calc(var(--dy-bottom-stack-h) + var(--safe-bottom));
    z-index: 150;
    width: 58px;
    height: 58px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: none;
    transition:
        transform 0.38s cubic-bezier(0.34, 1.2, 0.64, 1),
        opacity 0.32s ease,
        filter 0.32s ease,
        right 0.32s ease;
    will-change: transform, opacity, filter;
}

.dy-article-service-fab.is-scrolling {
    right: 6px;
    transform: translateX(26px) scale(0.68);
    opacity: 0.52;
    filter: grayscale(0.92) brightness(0.95);
}

.dy-article-service-photo {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 4px 16px rgba(42, 108, 198, 0.28);
    background: #dde5f0 center/cover no-repeat;
    transition: box-shadow 0.32s ease;
}

.dy-article-service-fab.is-scrolling .dy-article-service-photo {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.dy-article-service-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dy-article-service-badge {
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    padding: 2px 9px 3px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--dy-blue);
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(42, 108, 198, 0.4);
    transition: opacity 0.25s ease, transform 0.32s ease;
}

.dy-article-service-fab.is-scrolling .dy-article-service-badge {
    opacity: 0;
    transform: translateX(-50%) scale(0.6);
    pointer-events: none;
}

.dy-mc-weixin-dialog {
    padding: 8px 4px 4px;
    text-align: center;
}

.dy-mc-weixin-dialog h4 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 800;
}

.dy-mc-weixin-dialog .line {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.dy-mc-weixin-dialog .wx-id {
    font-size: 22px;
    font-weight: 800;
    color: #222;
    margin: 12px 0 18px;
    word-break: break-all;
}

.dy-mc-weixin-dialog .copy-btn {
    display: inline-block;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--dy-blue);
    border: none;
    border-radius: 22px;
    cursor: pointer;
}

.dy-mc-weixin-dialog .hint {
    margin-top: 12px;
    font-size: 12px;
    color: #999;
}