/* D4 其余页面统一收口：仅覆盖视觉与响应式，不改变业务功能。 */

.d4-page :is(input, select, textarea, button, a) {
    box-sizing: border-box;
}

.d4-page :is(input, select, textarea) {
    min-width: 0;
    min-height: 3rem;
}

.d4-page textarea {
    min-height: 8rem;
    resize: vertical;
}

.d4-page :is(button, [type="submit"], .blue-gradient-bg) {
    min-height: 2.75rem;
}

/* 产品中心 */
.products-page > section.sticky,
.nest-detail-page > section.sticky {
    top: var(--fidelity-header-height) !important;
}

.products-page > section.sticky {
    z-index: 45 !important;
    isolation: isolate;
    min-height: 5.25rem;
    background: rgba(8, 15, 27, .98) !important;
    background-image: none !important;
    border-top: 1px solid rgba(5, 217, 239, .1) !important;
    border-bottom: 1px solid rgba(5, 217, 239, .16) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}

.products-page > section.sticky .tab-btn {
    position: relative;
    z-index: 1;
    min-height: 2.5rem;
    padding: .5rem .75rem;
    color: rgba(203, 213, 225, .76) !important;
    opacity: 1 !important;
}

.products-page > section.sticky .tab-btn.active {
    color: #f8fafc !important;
    text-shadow: 0 0 14px rgba(5, 217, 239, .2);
}

.products-page > section.sticky .tab-btn > span:first-child {
    opacity: .82;
}

.products-page > section.sticky > div,
.products-page > section.sticky > div > div {
    position: relative;
    z-index: 2;
    opacity: 1 !important;
    transform: none !important;
}

.products-page > section.sticky + section {
    position: relative;
    z-index: 1;
    padding-top: 4rem !important;
}

.products-page .tab-content > .grid {
    align-items: stretch;
}

.products-page .tab-content.active {
    padding-top: 1.5rem;
}

.products-page .product-card {
    height: 100%;
    border-radius: var(--fidelity-radius-card) !important;
}

.products-page .product-card .gradient-cover {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
}

.products-page .product-card h3 {
    min-height: 3.1rem;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.products-page .product-card .p-6 > p:last-of-type {
    min-height: 4.8em;
}

.products-page .product-card .border-t {
    min-height: 4.25rem;
    gap: .75rem;
}

.products-page .product-card .border-t :is(a, button) {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 表演套餐详情 */
.performance-order-page #package-list {
    align-items: stretch;
}

.performance-order-page #package-list > * {
    display: flex;
    min-height: 15rem;
    flex-direction: column;
    border-radius: var(--fidelity-radius-card) !important;
}

.performance-order-page main .sticky {
    top: calc(var(--fidelity-header-height) + 1.5rem) !important;
}

.performance-order-page #contact-form > *,
.booking-page #bookingForm > * {
    min-width: 0;
}

.performance-order-page #contact-form :is(input, select, textarea),
.booking-page #bookingForm :is(input, select, textarea) {
    width: 100%;
    border: 1px solid var(--fidelity-border-default);
    background: var(--fidelity-bg-section);
}

/* 预约页面 */
.booking-page .method-card {
    min-height: 17rem;
    border-radius: var(--fidelity-radius-card) !important;
}

.booking-page .method-card > p {
    flex: 1;
}

.booking-page .glass-card {
    border-radius: var(--fidelity-radius-card) !important;
}

.booking-page #method-1-content .inline-block > svg {
    display: block;
    width: min(12.5rem, 100%);
    height: auto;
    aspect-ratio: 1;
}

.booking-page #method-1-content .grid-cols-3 > div {
    min-width: 0;
}

/* 机巢详情 */
.nest-detail-page .tab-content > section,
.nest-detail-page .tab-content > div {
    min-width: 0;
}

.nest-detail-page table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.nest-detail-page table :is(th, td) {
    overflow-wrap: anywhere;
}

.nest-detail-page .tab-content .overflow-x-auto {
    max-width: 100%;
}

.nest-detail-page .tab-content img {
    object-position: center;
}

/* 新闻列表 */
.news-page #featured-news-container .news-card,
.news-page #news-grid .news-card {
    border-radius: var(--fidelity-radius-card) !important;
}

.news-page #news-grid {
    align-items: stretch;
}

.news-page #news-grid .news-card {
    display: flex;
    height: 100%;
    flex-direction: column;
}

.news-page #news-grid .news-card > .relative {
    height: auto !important;
    aspect-ratio: 16 / 10;
}

.news-page #news-grid .news-card > .p-6 {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.news-page #news-grid h3 {
    min-height: 3.15rem;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-page #news-grid .p-6 > p {
    min-height: 4.8em;
    flex: 1;
}

.news-page .filter-tab {
    min-width: 0;
    min-height: 2.25rem;
    padding: .45rem 1.125rem !important;
    border-radius: .5rem !important;
    border-color: rgba(185, 240, 245, .12) !important;
    background: rgba(255, 255, 255, .025) !important;
    box-shadow: none !important;
    color: var(--fidelity-text-secondary) !important;
    font-size: .8125rem !important;
    line-height: 1rem;
}

.news-page .filter-tab.active {
    border-color: rgba(5, 217, 239, .5) !important;
    background: rgba(5, 217, 239, .1) !important;
    box-shadow: inset 0 0 16px rgba(5, 217, 239, .04) !important;
    color: var(--fidelity-brand-cyan) !important;
}

.news-page .news-filter-list {
    gap: .625rem !important;
    padding-block: .625rem !important;
}

/* 新闻详情：大屏仍保持舒适行长。 */
.news-detail-page main > .max-w-\[1000px\] {
    width: min(100% - (var(--fidelity-gutter) * 2), 62.5rem);
    max-width: 62.5rem !important;
}

.news-detail-page .article-container {
    max-width: 56rem;
    margin-inline: auto;
}

.news-detail-page .article-content {
    max-width: 48rem;
    margin-inline: auto;
    font-size: clamp(1rem, .22vw + .96rem, 1.125rem);
    line-height: 1.95;
}

.news-detail-page .article-content p {
    margin-bottom: 1.5em;
}

.news-detail-page .article-content :is(blockquote, .quote-block) {
    margin-block: 2rem;
    padding: 1.25rem 1.5rem;
    border-left: 3px solid var(--fidelity-brand-cyan);
    border-radius: 0 var(--fidelity-radius-control) var(--fidelity-radius-control) 0;
    background: rgba(5, 217, 239, .055);
}

.news-detail-page #related-news {
    align-items: stretch;
}

.news-detail-page #related-news > * {
    height: 100%;
}

@media (max-width: 767px) {
    .performance-order-page #contact-form,
    .booking-page #bookingForm {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .products-page > section.sticky,
    .nest-detail-page > section.sticky {
        top: var(--fidelity-header-height) !important;
    }

    .products-page > section.sticky > div,
    .nest-detail-page > section.sticky > div {
        padding-inline: 1rem !important;
    }

    .products-page .product-card h3,
    .products-page .product-card .p-6 > p:last-of-type,
    .news-page #news-grid h3,
    .news-page #news-grid .p-6 > p {
        min-height: 0;
    }

    .products-page .product-card .border-t {
        align-items: flex-end;
    }

    .performance-order-page main .sticky {
        position: static !important;
    }

    .booking-page .method-card {
        min-height: 15rem;
    }

    .booking-page #method-1-content .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .booking-page #method-1-content .text-center {
        overflow: hidden;
    }

    .news-page .stats-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: .75rem !important;
    }

    .news-page .news-filter-list {
        justify-content: flex-start !important;
        scroll-padding-inline: 1rem;
    }

    .news-page .filter-tab {
        min-height: 2rem;
        padding: .4rem .875rem !important;
        font-size: .75rem !important;
    }

    .news-detail-page main > .max-w-\[1000px\] {
        width: 100%;
    }

    .news-detail-page #article-title {
        font-size: clamp(2rem, 9vw, 2.75rem) !important;
    }

    .news-detail-page #prev-article,
    .news-detail-page #next-article {
        width: 100%;
        max-width: 100% !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .d4-page *,
    .d4-page *::before,
    .d4-page *::after {
        scroll-behavior: auto !important;
    }
}

/* 客户视觉返工：页面专属形状、标题渐变和轻量暗面层级。 */
.d4-page main :is(h1.blue-gradient-text, h2.blue-gradient-text),
.booking-page main > section:first-of-type h1,
.performance-order-page main > section:first-of-type h2,
.nest-detail-page .tab-content h2,
.news-page #featured-news-container h2,
.news-detail-page main h2 {
    color: transparent !important;
    background: var(--fidelity-gradient-title);
    -webkit-background-clip: text;
    background-clip: text;
}

.products-page .product-card {
    border-radius: .625rem !important;
    box-shadow: inset 0 1px rgba(255,255,255,.025) !important;
}
.products-page .product-card .gradient-cover { aspect-ratio: 16 / 8; }
.products-page .product-card:nth-child(3n + 2) { transform: translateY(1.25rem); }

.performance-order-page #package-list > * {
    border-radius: .625rem !important;
    box-shadow: inset 0 1px rgba(255,255,255,.025) !important;
}
.performance-order-page #package-list > :nth-child(3n + 2) { transform: translateY(1.25rem); }

.booking-page .method-card { border-radius: .625rem 1.25rem .625rem .625rem !important; }
.booking-page .glass-card { border-radius: 1rem !important; }
.booking-page #bookingForm :is(input, select, textarea) { border-radius: .375rem !important; }

.nest-detail-page .tab-content :is(.rounded-2xl, .rounded-3xl) { border-radius: .75rem !important; }
.nest-detail-page .tab-content img { border-radius: .5rem !important; }

.news-page #featured-news-container .news-card { border-radius: 1rem .375rem 1rem .375rem !important; }
.news-page .featured-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: .35rem .7rem .35rem 1rem;
    border: 1px solid rgba(5, 217, 239, .34);
    border-radius: .35rem;
    background: rgba(7, 18, 31, .9);
    box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 6px 18px rgba(0, 0, 0, .2);
    color: #67e8f9;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .08em;
}
.news-page .featured-badge::before {
    position: absolute;
    left: .5rem;
    width: .2rem;
    height: .85rem;
    border-radius: 999px;
    content: "";
    background: linear-gradient(180deg, #05d9ef, #786dff);
    box-shadow: 0 0 8px rgba(5, 217, 239, .4);
}
.news-page #news-grid .news-card { border-radius: .5rem !important; }
.news-page #news-grid .news-card:nth-child(3n + 2) { transform: translateY(1rem); }
.news-detail-page #cover-container { border-radius: .75rem !important; }
.news-detail-page #related-news > * { border-radius: .5rem !important; }

@media (max-width: 1023px) {
    .products-page .product-card:nth-child(3n + 2),
    .performance-order-page #package-list > :nth-child(3n + 2),
    .news-page #news-grid .news-card:nth-child(3n + 2) { transform: none; }
}
