/* 内容详情页（JSP 公开页） */

.detail-app {
    min-height: 100vh;
    background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 28%, #ffffff 100%);
}

.detail-app .detail-page {
    display: block;
    width: 80%;
    max-width: none;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    padding: 1.25rem 1.5rem 3rem;
    box-sizing: border-box;
}

/* 头部：左 Logo · 中广告语 · 右下载 */
.detail-brand-bar {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(12rem, 1fr) minmax(0, auto);
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.25rem 1.75rem;
    margin-bottom: 1rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 24px rgba(7, 193, 96, 0.06);
}

.detail-brand-side {
    min-width: 0;
}

.detail-brand-side--right {
    justify-self: end;
}

.detail-brand {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: #0f172a;
    width: fit-content;
}

.detail-brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.detail-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.detail-brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.detail-brand-sub {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
}

/* 中部：静态广告语（无动画、无网络字体切换） */
.detail-brand-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    padding: 0 0.25rem;
    justify-self: center;
    width: 100%;
    max-width: 36rem;
    background: none;
    border: none;
}

.detail-brand-hero-bg,
.detail-brand-hero-pin,
.detail-brand-hero .fa-map-marker-alt,
.detail-brand-hero .fa-location-dot {
    display: none !important;
}

.detail-brand-tagline {
    margin: 0;
    padding: 0;
    text-align: center;
    line-height: 1.35;
    font-family: "STKaiti", "KaiTi", "FangSong", "PingFang SC", "Microsoft YaHei", serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    white-space: nowrap;
    color: #0f3d2e;
    animation: none;
    transition: none;
    background: none;
    -webkit-text-fill-color: #0f3d2e;
    filter: none;
}

.detail-download-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    flex-shrink: 0;
}

.detail-download-actions .download-btn-container {
    position: relative;
}

.detail-download-actions .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.35rem;
    font-size: 0.9375rem;
    border-radius: 10px;
}

/* 详情页：二维码弹层向下弹出（覆盖 styles.css 默认向上） */
.detail-app .detail-download-actions .qr-code-popup {
    top: 100%;
    bottom: auto;
    left: 50%;
    margin-bottom: 0;
    margin-top: 0.75rem;
    transform: translateX(-50%);
}

.detail-app .detail-download-actions .qr-code-popup::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #fff;
}

.detail-app .detail-download-actions .qr-code-popup.show {
    transform: translateX(-50%) translateY(4px);
}

.detail-state {
    padding: 2rem 0;
    text-align: center;
    color: #64748b;
}

.detail-state--empty i,
.detail-state--error i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.45;
}

.detail-skeleton--layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    text-align: left;
}

.detail-skel-gallery {
    aspect-ratio: 3 / 4;
    width: 100%;
    border-radius: 12px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: detail-shimmer 1.2s ease-in-out infinite;
}

.detail-skel-main {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-skel-line {
    display: block;
    height: 14px;
    border-radius: 4px;
    background: #e2e8f0;
}

.detail-skel-line.is-title {
    height: 22px;
    width: 70%;
}

.detail-skel-line.is-short {
    width: 45%;
}

@keyframes detail-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.detail-layout {
    --detail-gallery-height: none;
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.04);
}

.detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.detail-gallery-primary {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-gallery-main {
    width: 100%;
    max-height: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
}

.detail-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.detail-gallery-thumb {
    width: 52px;
    height: calc(52px * 4 / 3);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    background: #f1f5f9;
}

.detail-gallery-thumb.is-active {
    border-color: #07c160;
}

.detail-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-gallery-empty {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 100%;
    border-radius: 12px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 2rem;
}

.detail-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-height: var(--detail-gallery-height);
    overflow: hidden;
}

.detail-main-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.detail-main-scroll::-webkit-scrollbar {
    width: 6px;
}

.detail-main-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.detail-main-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.detail-main-head {
    flex-shrink: 0;
}

.detail-title {
    margin: 0 0 0.75rem;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
}

.detail-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
}

.detail-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.detail-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
}

.detail-tag {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.detail-content-text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 1.5rem;
}

.detail-comments {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 1.25rem;
}

.detail-comments-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.detail-comments-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.detail-comments-count {
    font-size: 0.8125rem;
    color: #64748b;
}

.detail-comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-comment-item {
    display: flex;
    gap: 0.75rem;
}

.detail-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}

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

.detail-comment-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.detail-comment-meta strong {
    color: #0f172a;
}

.detail-comment-meta time {
    color: #94a3b8;
}

.detail-comment-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #334155;
    word-break: break-word;
}

.detail-comment-replies {
    margin: 0.5rem 0 0;
    padding-left: 0.75rem;
    border-left: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-comment-empty {
    padding: 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

.detail-comment-more {
    text-align: center;
    padding: 0.75rem 0 0;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.detail-comment-more-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
}

.detail-comment-more-link:hover {
    background: #ecfdf5;
    color: #059669;
}

/* 推荐内容：更大卡片 */
.detail-recommend {
    padding: 1.75rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.04);
}

.detail-recommend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.detail-recommend-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    flex-shrink: 0;
}

.detail-recommend-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1 1 16rem;
    max-width: 28rem;
    margin-left: auto;
    padding: 0.55rem 0.85rem 0.55rem 1rem;
    background: #f8fafc;
    border-radius: 999px;
    border: 1px solid rgba(7, 193, 96, 0.45);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.detail-recommend-search:focus-within {
    border-color: #07c160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
    background: #fff;
}

.detail-recommend-search-icon {
    color: #94a3b8;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.detail-recommend-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    outline: none;
    color: #0f172a;
}

.detail-recommend-search-input::placeholder {
    color: #94a3b8;
}

.detail-recommend-search-ai {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 999px;
    background: #fff;
    font-size: 0.75rem;
    font-family: inherit;
    color: #64748b;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}

.detail-recommend-search-ai:hover {
    color: #059669;
    background: #ecfdf5;
}

.detail-recommend-empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #94a3b8;
}

.detail-recommend-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, calc((100% - 2 * 1.25rem) / 3)), 1fr));
    gap: 1.25rem;
}

.detail-recommend-card {
    display: flex;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    min-height: 112px;
    min-width: 0;
    container-type: inline-size;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fafbfc;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    box-sizing: border-box;
}

.detail-recommend-card:hover {
    border-color: #07c160;
    background: #fff;
    box-shadow: 0 8px 24px rgba(7, 193, 96, 0.14);
}

.detail-recommend-thumb {
    width: 5.625rem;
    height: auto;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.5rem;
}

.detail-recommend-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-recommend-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.detail-recommend-copy h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-recommend-copy p {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@container (max-width: 300px) {
    .detail-recommend-card {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
    }

    .detail-recommend-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 4;
    }
}

@media (max-width: 1024px) {
    .detail-brand-bar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-brand-side--left {
        justify-self: start;
    }

    .detail-brand-side--right {
        justify-self: stretch;
    }

    .detail-brand-hero {
        max-width: none;
        order: 0;
    }

    .detail-brand-tagline {
        white-space: normal;
        letter-spacing: 0.08em;
    }
}

@media (max-width: 768px) {
    .detail-app .detail-page {
        width: 100%;
        padding: 1rem 1rem 2rem;
    }

    .detail-brand-bar {
        padding: 1.25rem;
    }

    .detail-brand-tagline {
        font-size: 1.25rem;
        letter-spacing: 0.06em;
    }

    .detail-download-actions {
        justify-content: center;
        width: 100%;
    }

    .detail-skeleton--layout,
    .detail-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .detail-gallery-primary {
        align-items: flex-start;
    }

    .detail-main {
        max-height: none;
        overflow: visible;
    }

    .detail-main-scroll {
        overflow: visible;
        padding-right: 0;
    }

    .detail-recommend-head {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-recommend-search {
        max-width: none;
        margin-left: 0;
    }

    .detail-recommend-list {
        grid-template-columns: 1fr;
    }

    .detail-recommend-card {
        flex-direction: row;
        min-height: 96px;
    }

    .detail-recommend-thumb {
        width: 5.5rem;
        height: auto;
        aspect-ratio: 3 / 4;
    }

    /* 小屏仍向下弹出，避免与 styles 固定居中冲突 */
    .detail-app .detail-download-actions .qr-code-popup {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }

    .detail-app .detail-download-actions .qr-code-popup.show {
        transform: translateX(-50%) translateY(4px);
    }
}
