/**
 * 首页布局整理 — 仅做区块划分与结构辅助，不覆盖 qt-home 组件样式
 *
 * 结构：
 * .home-page
 *   ├── .home-page__header   顶部导航 / 搜索 / 分类
 *   ├── .home-page__main     主体内容
 *   │   └── .home-page__section[data-section]
 *   ├── .home-page__footer   页脚
 *   └── .home-page__widgets  右侧悬浮工具
 */

.home-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.home-page__header {
    flex-shrink: 0;
    position: relative;
    z-index: 200;
}

.home-page__main {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.home-page__section {
    position: relative;
}

/* 加载占位：无无限滚动 JS 时不占空间 */
.home-page__section--loading {
    display: none;
}

.home-page__footer {
    flex-shrink: 0;
}

.home-page__widgets {
    flex-shrink: 0;
}

/* ===== 行业楼层：瀑布流布局（多列容器，追加时不重排已有项） ===== */
.home-page__section--industry .industry-waterfall {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
}

.home-page__section--industry .industry-waterfall__col {
    flex: 1;
    min-width: 0;
}

.home-page__section--industry .industry-waterfall__item {
    display: block;
    width: 100%;
    margin: 0 0 24px;
}

.home-page__section--industry .industry-waterfall .industry-waterfall-card.qtd-theme-card-e {
    aspect-ratio: auto;
    height: auto;
    display: block;
    width: 100%;
}

.home-page__section--industry .industry-waterfall .qtd-theme > a:nth-child(1) {
    height: auto;
}

.home-page__section--industry .industry-waterfall .qtd-theme .card-preview {
    height: auto;
}

.home-page__section--industry .industry-waterfall .qtd-theme .card-preview.image-preview-single .image-container {
    height: auto;
    min-height: 0;
}

.home-page__section--industry .industry-waterfall .qtd-theme .card-preview.image-preview-single .image-container > img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

.home-page__section--industry .industry-waterfall-loadmore {
    display: flex;
    justify-content: center;
    padding: 8px 0 32px;
}

.home-page__section--industry .industry-waterfall-loadmore.is-hidden {
    display: none;
}

.home-page__section--industry .industry-waterfall-loadmore__btn {
    min-width: 168px;
    pointer-events: auto;
}

.home-page__section--industry .industry-waterfall-loadmore.is-loading .industry-waterfall-loadmore__btn {
    opacity: 0.88;
    cursor: wait;
}

.home-page__section--industry .industry-waterfall-loadmore__loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.home-page__section--industry .industry-waterfall-loadmore__countdown {
    font-variant-numeric: tabular-nums;
    opacity: 0.72;
}

.home-page__section--industry .industry-waterfall-loadmore__loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: industry-loadmore-spin 0.8s linear infinite;
}

@keyframes industry-loadmore-spin {
    to { transform: rotate(360deg); }
}

/* ===== Hero：左大 Banner + 右主题卡片（对齐参考布局） ===== */
.home-page__section--hero.new-banner-wrap-v2 {
    padding-bottom: 40px;
}

.hero-banner-layout {
    display: flex;
    align-items: stretch;
    gap: 24px;
    width: 100%;
}

.hero-banner-main {
    flex: 1 1 58%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-banner-main__label,
.hero-trend-panel__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: #ff4d4f;
    letter-spacing: 0.02em;
}

.hero-banner-main .banner-swiper {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
}

.hero-banner-main .banner-swiper .swiper-wrapper,
.hero-banner-main .banner-swiper .swiper-slide,
.hero-banner-main .banner-swiper .clickImgLite {
    height: 100%;
}

.hero-banner-main .banner-swiper .swiper-slide:not(.swiper-slide-active) .hero-banner-overlay {
    opacity: 0;
    visibility: hidden;
}

.hero-trend-panel {
    flex: 0 0 42%;
    max-width: 42%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-trend-panel__head {
    flex-shrink: 0;
}

.hero-trend-panel__cards {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.hero-trend-card {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
}

.hero-trend-panel__cards .trend-item-wrap {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
}

.hero-trend-panel__cards .trend-item-wrap .img-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

.hero-trend-panel__cards .trend-item-wrap .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero 主 Banner：文案浮层（Glassmorphism + 瑞士极简排版） */
.hero-banner-main .clickImgLite {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 16px;
    height: 100%;
    isolation: isolate;
}

.hero-banner-main .clickImgLite::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.08) 0%,
        rgba(15, 23, 42, 0.02) 42%,
        rgba(15, 23, 42, 0.28) 100%
    );
}

.hero-banner-main .clickImgLite .banner-info {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    margin: 0;
    pointer-events: none;
}

.hero-banner-main .clickImgLite .banner-stress {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    background: rgba(37, 194, 136, 0.92);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.hero-banner-main .clickImgLite img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    border-radius: inherit;
    display: block;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-banner-main .clickImgLite:hover img {
    transform: scale(1.03);
}

.hero-banner-main .clickImgLite .hero-banner-overlay {
    position: absolute;
    top: 50%;
    left: clamp(16px, 3vw, 32px);
    right: auto;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 2;
    width: auto;
    max-width: min(480px, 58%);
    margin: 0;
    padding: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hero-banner-main .clickImgLite .hero-banner-overlay__panel {
    --hero-overlay-bg: rgba(15, 23, 42, 0.72);
    --hero-overlay-border: rgba(255, 255, 255, 0.18);
    --hero-overlay-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
    position: relative;
    overflow: hidden;
    padding: clamp(14px, 2vw, 20px) clamp(16px, 2.2vw, 24px);
    border-radius: 14px;
    border: 1px solid var(--hero-overlay-border);
    background: var(--hero-overlay-bg);
    box-shadow: var(--hero-overlay-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hero-banner-main .clickImgLite .hero-banner-overlay__panel::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--qtd-brand-color-5, #25C288), var(--qtd-brand-color-6, #00B277));
    z-index: 0;
}

.hero-banner-main .clickImgLite .hero-banner-overlay__title,
.hero-banner-main .clickImgLite .hero-banner-overlay__desc {
    position: relative;
    z-index: 1;
}

.hero-banner-main .clickImgLite:hover .hero-banner-overlay__panel {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
}

.hero-banner-main .clickImgLite .hero-banner-overlay__title {
    margin: 0;
    padding-left: 8px;
    color: #F8FAFC;
    font-size: clamp(16px, 1.5vw, 20px);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.hero-banner-main .clickImgLite .hero-banner-overlay__desc {
    margin: 0;
    padding-left: 8px;
    color: rgba(248, 250, 252, 0.82);
    font-size: clamp(12px, 1.1vw, 14px);
    font-weight: 400;
    line-height: 1.6;
    max-width: 42ch;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .hero-banner-main .clickImgLite img,
    .hero-banner-main .clickImgLite .hero-banner-overlay__panel {
        transition: none;
    }

    .hero-banner-main .clickImgLite:hover img {
        transform: none;
    }

    .hero-banner-main .clickImgLite:hover .hero-banner-overlay__panel {
        transform: none;
    }
}

@media (max-width: 992px) {
    .hero-banner-layout {
        flex-direction: column;
        gap: 20px;
    }

    .hero-banner-main,
    .hero-trend-panel {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .hero-trend-panel__cards {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .hero-trend-panel__cards::-webkit-scrollbar {
        display: none;
    }

    .hero-trend-card {
        flex: 0 0 calc(33.333% - 8px);
        min-width: 132px;
    }
}

@media (max-width: 768px) {
    .hero-trend-card {
        flex: 0 0 calc(50% - 6px);
        min-width: 120px;
    }
}

@media (max-width: 992px) {
    .home-page__section--industry .industry-waterfall {
        gap: 16px;
    }

    .home-page__section--industry .industry-waterfall__item {
        margin-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .home-page__section--industry .industry-waterfall {
        gap: 12px;
    }

    .home-page__section--industry .industry-waterfall__item {
        margin-bottom: 12px;
    }
}

/* ===== 首页分类栏底部光晕 ===== */
.category-box-wrap,
.search-pic-category-box-wrap {
    width: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding-bottom: 40px;
    position: relative;
    z-index: 2;
}

.category-box-wrap .category-box-bottom,
.search-pic-category-box-wrap .category-box-bottom {
    width: 100%;
    position: absolute;
    z-index: 1;
    height: 75px;
    border-radius: 50%;
    opacity: 0.8;
    bottom: 28px;
    background: linear-gradient(180deg, #fff 0%, #fff 50%, var(--qtd-brand-color-6) 100%);
    filter: blur(10px);
}

/* ===== 首页覆盖变量（原 index.html 内联样式） ===== */
body {
    --qtd-header-height: 80px;
    --category-theme-color1: var(--qtd-brand-color-6);
}

.login-tip-header,
.login-tip-page {
    display: none !important;
}

/* 移除头部工具推荐条后收紧首页 Header 高度（原 408px 含约 154px 工具区）；仅首屏展开，滚动后由 .is-fixed 收紧 */
.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed) .head-box,
.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed) .head-box .head-func,
.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed) .head-box .head-func .head-func-flex {
    height: 254px;
}

.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed) .head-box .head-func .head-func-flex .header-search-wrap {
    min-height: 120px;
    padding-bottom: 16px;
}

.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed).show-ai-input .head-box,
.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed).show-ai-input .head-box .head-func,
.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed).show-ai-input .head-box .head-func .head-func-flex {
    height: 326px;
}

.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed).show-ai-input.show-ai-input-img .head-box,
.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed).show-ai-input.show-ai-input-img .head-box .head-func,
.home-page__header.new-header-v2.index-header-new-v2:not(.is-fixed).show-ai-input.show-ai-input-img .head-box .head-func .head-func-flex {
    height: 426px;
}

/* 滚动吸顶：恢复单行搜索栏高度（覆盖上方 :not(.is-fixed) 的 254px） */
.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-box,
.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-box .head-func,
.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-box .head-func .head-func-flex,
.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-box .head-func .head-box-logo,
.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-box .head-func .header-func-info {
    height: var(--qtd-header-height);
}

.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-box .head-func .head-func-flex {
    pointer-events: auto;
}

.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-box .head-func .head-func-flex .header-search-wrap {
    min-height: 0;
    padding-bottom: 0;
}

.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-func-new-bg-1,
.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-func-new-bg-2 {
    opacity: 0;
    pointer-events: none;
}

.home-page__header.new-header-v2.index-header-new-v2.is-fixed .header-search-title {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
}

.home-page__header.new-header-v2.index-header-new-v2.is-fixed .header-search-wrap .header-search-type {
    display: none;
}

.home-page__header.new-header-v2.index-header-new-v2.is-fixed .head-box-logo .brand-slogan {
    display: none;
}

/* ===== 首页头部品牌 Logo（与 sidenav 一致） ===== */
.home-page__header .head-box-logo .brand-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    min-width: 0;
}

.home-page__header .head-box-logo .brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    text-decoration: none;
    color: inherit;
}

.home-page__header .head-box-logo .brand-logo-link:hover {
    opacity: 0.85;
}

.home-page__header .head-box-logo .logo-icon-brand {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.35);
    flex-shrink: 0;
}

.home-page__header .head-box-logo .brand-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--qtd-fun-color-12);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.home-page__header .head-box-logo .brand-slogan {
    margin: 0;
    font-size: 11px;
    color: var(--qtd-fun-color-10);
    padding-left: 42px;
    line-height: 1.2;
    white-space: nowrap;
}

/* ===== 搜索框热门词轮播占位 ===== */
.home-page__header .search-form-dom {
    flex: 1;
    min-width: 0;
    height: 100%;
}

.home-search-input-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
}

.home-search-input-wrap #home-search-input {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    background: transparent;
}

.home-search-placeholder-carousel {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    pointer-events: none;
    overflow: hidden;
}

.home-search-placeholder-carousel[hidden] {
    display: none !important;
}

.home-search-input-wrap.is-carousel-hidden .home-search-placeholder-carousel {
    display: none !important;
}

.home-search-placeholder-carousel__viewport {
    width: 100%;
    height: 1.4em;
    overflow: hidden;
}

.home-search-placeholder-carousel__track {
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-search-placeholder-carousel__item {
    height: 1.4em;
    line-height: 1.4em;
    color: var(--qtd-fun-color-8, #94a3b8);
    font-size: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-page__header .qt-search-box.is-ai-search .home-search-placeholder-carousel__item,
.home-page__header.show-ai-input .home-search-placeholder-carousel__item {
    color: var(--qtd-fun-color-8, #94a3b8);
}

@media (prefers-reduced-motion: reduce) {
    .home-search-placeholder-carousel__track {
        transition: none !important;
    }
}

/* ===== 首页头部：语言切换 + 登录/用户 ===== */
.home-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-header-language {
    display: flex;
    align-items: center;
    gap: 6px;
}

.home-header-language__label {
    font-size: 12px;
    color: var(--qtd-fun-color-10);
    white-space: nowrap;
}

.home-header-language__select {
    height: 32px;
    padding: 0 28px 0 10px;
    border-radius: 16px;
    border: 1px solid var(--qtd-fun-color-4);
    background: var(--qtd-fun-color-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--qtd-fun-color-12);
    font-size: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    min-width: 96px;
}

.home-header-language__select:focus {
    outline: none;
    border-color: var(--qtd-brand-color-6);
}

.home-header-user {
    position: relative;
    flex-shrink: 0;
}

.home-header-login-btn {
    height: 32px;
    padding: 0 18px;
    border: none;
    border-radius: 16px;
    background: var(--qtd-brand-color-6);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, box-shadow .2s;
}

.home-header-login-btn:hover {
    background: var(--qtd-brand-color-5);
    box-shadow: 0 2px 8px rgba(0, 178, 119, .25);
}

.home-header-user-card {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 4px 8px 4px 4px;
    border-radius: 20px;
    background: var(--qtd-fun-color-2);
    border: 1px solid var(--qtd-fun-color-4);
    position: relative;
}

.home-header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(0, 178, 119, .25);
}

.home-header-user-details {
    min-width: 0;
    max-width: 100px;
}

.home-header-user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--qtd-fun-color-12);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.home-header-user-score {
    display: block;
    font-size: 11px;
    color: var(--qtd-brand-color-6);
    line-height: 1.2;
}

.home-header-user-card .logout-icon {
    font-size: 15px;
    color: var(--qtd-fun-color-8);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color .2s, background .2s;
    flex-shrink: 0;
}

.home-header-user-card .logout-icon:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, .08);
}

.home-header-user-card .logout-confirm {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .15);
    display: none;
    z-index: 300;
}

.home-header-user-card .logout-confirm.show {
    display: block;
}

.home-header-user-card .logout-confirm p {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--qtd-fun-color-12);
}

.home-header-user-card .logout-confirm .confirm-btn {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.home-header-user-card .logout-confirm button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.home-header-user-card .logout-confirm .btn-cancel {
    background: var(--qtd-fun-color-3);
    color: var(--qtd-fun-color-10);
}

.home-header-user-card .logout-confirm .btn-confirm {
    background: #ef4444;
    color: #fff;
}

/* 登录弹窗（与创作台一致） */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1300;
}

.login-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1301;
    width: 90%;
    max-width: 420px;
}

.login-modal .modal-content {
    background: linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .18);
    position: relative;
}

.login-modal .close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    line-height: 1;
}

.login-modal .close-modal:hover {
    color: #1a1a1a;
}

.login-modal .modal-content h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 22px;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-modal .form-group {
    margin-bottom: 18px;
}

.login-modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #666;
}

.login-modal .form-group input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .1);
    font-size: 14px;
    box-sizing: border-box;
}

.login-modal .form-group input:focus {
    outline: none;
    border-color: var(--qtd-brand-color-6);
}

.login-modal .captcha-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-modal .captcha-group input {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 42px;
    padding: 0 14px;
    margin: 0;
    line-height: 42px;
}

.login-modal .send-captcha-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 14px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.login-modal .send-captcha-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.login-modal .modal-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}

.login-modal .modal-btn.login-btn {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff;
}

.login-modal .modal-btn.register-btn {
    background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
    color: #fff;
}

.login-modal .switch-form {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #666;
}

.login-modal .switch-form a {
    color: var(--qtd-brand-color-6);
    text-decoration: none;
    margin-left: 4px;
}

/* ===== 模板详情弹窗 ===== */
.template-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s, visibility .25s;
}

.template-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.template-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.template-modal-dialog {
    position: relative;
    width: min(920px, 100%);
    max-height: min(88vh, 640px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .22);
    overflow: hidden;
    transform: translateY(16px) scale(.98);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.template-modal.is-open .template-modal-dialog {
    transform: translateY(0) scale(1);
}

.template-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

.template-modal-body {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 420px;
    max-height: min(88vh, 640px);
}

.template-modal-preview,
.template-modal-info {
    min-height: 0;
}

.template-modal-preview {
    background: #f1f5f9;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.template-modal-preview-inner {
    width: 100%;
    height: 100%;
    min-height: 320px;
    max-height: calc(min(88vh, 640px) - 40px);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.template-modal-preview-inner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.template-modal-preview-inner video,
.template-modal-preview-inner .template-modal-preview-video {
    width: 100%;
    height: 100%;
    max-height: calc(min(88vh, 640px) - 40px);
    object-fit: contain;
    display: block;
    background: #000;
    border-radius: 12px;
}

.template-modal-preview-inner .preview-placeholder {
    width: 100%;
    height: 100%;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: rgba(255, 255, 255, .9);
    text-align: center;
    padding: 24px;
}

/* 图生图 / 图生视频 / 视频编辑：左右对比预览 */
.template-modal.is-compare-mode .template-modal-dialog {
    width: min(1080px, 100%);
    max-height: min(90vh, 720px);
}

.template-modal-preview.is-compare {
    padding: 16px 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.template-modal-preview-inner--compare {
    min-height: 0;
    max-height: none;
    height: auto;
    box-shadow: none;
    display: block;
    overflow: visible;
}

.template-modal-compare {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-modal-compare__hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
}

.template-modal-compare__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    min-height: 280px;
}

.template-modal-compare__panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.template-modal-compare__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.template-modal-compare__label {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.template-modal-compare__panel--input .template-modal-compare__label {
    color: #065f46;
    background: rgba(185, 240, 214, 0.55);
}

.template-modal-compare__panel--output .template-modal-compare__label {
    color: #0c4a6e;
    background: rgba(191, 219, 254, 0.55);
}

.template-modal-compare__frame {
    flex: 1 1 auto;
    min-height: 240px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-modal-compare__frame.is-empty {
    color: #94a3b8;
    font-size: 14px;
}

.template-modal-compare__media {
    width: 100%;
    height: 100%;
    max-height: 360px;
    object-fit: contain;
    display: block;
    background: #0f172a;
}

.template-modal-compare__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}

.template-modal-compare__arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--qtd-brand-color-6, #00B277);
    background: #fff;
    border: 1px solid rgba(0, 178, 119, 0.18);
    box-shadow: 0 4px 14px rgba(0, 178, 119, 0.12);
}

.template-modal-compare__arrow .icon {
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 768px) {
    .template-modal-compare__grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .template-modal-compare__divider {
        padding: 4px 0;
    }

    .template-modal-compare__arrow {
        transform: rotate(90deg);
    }

    .template-modal-compare__frame {
        min-height: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .template-modal-compare__arrow {
        transition: none;
    }
}

.template-modal-info {
    padding: 28px 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
}

.template-modal-header {
    flex-shrink: 0;
}

.template-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.3;
    padding-right: 28px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.template-modal-subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.template-modal-subtitle:empty {
    display: none;
}

.template-modal-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-right: 2px;
}

.template-modal-block {
    background: #f7f8fa;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #eee;
}

.template-modal-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    margin-bottom: 8px;
}

.template-modal-prompt {
    font-size: 13px;
    color: #1a1a1a;
    line-height: 1.65;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-modal-meta {
    display: grid;
    gap: 10px;
}

.template-modal-meta-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eee;
}

.template-modal-meta-key {
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
}

.template-modal-meta-val {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: right;
    line-height: 1.4;
}

.template-modal-meta-val.is-free {
    color: var(--qtd-brand-color-6);
}

.template-modal-meta-val.is-paid {
    color: #e6a23c;
}

.template-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: auto;
    height: 46px;
    border-radius: 23px;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(7, 193, 96, .32);
}

body.template-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .template-modal-body {
        grid-template-columns: 1fr;
    }
    .template-modal-preview-inner,
    .template-modal-preview-inner .preview-placeholder {
        min-height: 220px;
    }
}

/* ===== 移动端自适应 ===== */

/* 补齐 qtd 栅格缺失的隐藏列（模板中已使用但 qtd.css 未定义） */
@media (max-width: 1439px) {
    .col-lg-0 {
        display: none !important;
    }
}

@media (max-width: 959px) {
    .col-sm-0 {
        display: none !important;
    }
}

/* ---------- ≤768px 平板 / 大屏手机 ---------- */
@media (max-width: 768px) {
    body.home-page,
    body.default-theme.home-page {
        --qtd-header-height: 56px;
        overflow-x: hidden;
    }

    .home-page {
        overflow-x: hidden;
    }

    /* 内容区左右留白 */
    .home-page__main .common-content-box,
    #qt-app.is-default .common-content-box {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* LCP 占位图 */
    #lcp {
        height: 220px !important;
    }

    /* ----- 顶部导航 ----- */
    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func {
        gap: 8px;
        padding: 0 8px;
    }

    .home-page__header .head-func-flex .header-search-wrap {
        padding: 0 !important;
        min-width: 0;
    }

    .home-page__header .header-search-type {
        gap: 12px;
    }

    .home-page__header .header-search-type-item em {
        font-size: 13px;
    }

    .home-page__header .qt-search-box-new-content {
        flex-wrap: wrap;
    }

    .home-page__header .search-input input {
        font-size: 13px;
    }

    .home-page__header .btn-search-v4 {
        flex-shrink: 0;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex {
        width: 100%;
        min-width: 0;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .new-head-box-search {
        width: 100%;
        max-width: 100%;
        float: none;
        overflow: hidden;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box,
    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func,
    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex {
        height: auto;
        min-height: 0;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap {
        min-height: 0;
        padding-bottom: 12px;
    }

    .home-page__header .header-func-info .home-header-actions {
        gap: 8px;
    }

    .home-page__header .home-header-language__label {
        display: none;
    }

    .home-page__header .home-header-language__select {
        min-width: 84px;
        height: 28px;
        font-size: 11px;
    }

    .home-page__header .home-header-login-btn {
        height: 28px;
        padding: 0 14px;
        font-size: 13px;
    }

    .home-page__header .home-header-user-details {
        max-width: 72px;
    }

    .home-page__header .home-header-user-name {
        font-size: 12px;
    }

    /* 楼层 Tab 横向滚动 */
    .home-page__header .head-classification .classificatio-ul {
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 8px 16px;
    }

    .home-page__header .head-classification .classificatio-ul::-webkit-scrollbar {
        display: none;
    }

    .home-page__header .head-classification .qtd-switch-tab-box {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }

    .home-page__header .head-classification .qtd-switch-tab-item {
        flex-shrink: 0;
        padding: 4px 12px;
        font-size: 13px;
    }

    /* ----- Hero 轮播 ----- */
    .home-page__section--hero.new-banner-wrap-v2 {
        padding-bottom: 20px;
    }

    .hero-banner-layout {
        gap: 12px;
    }

    .hero-banner-main .banner-swiper {
        aspect-ratio: 16 / 10;
        border-radius: 12px;
    }

    .home-page__section--hero .banner-pagination {
        display: none;
    }

    .home-page__section--hero .trend-item-wrap {
        border-radius: 12px;
    }

    .home-page__section--hero .trend-item-wrap .banner-bottom-text p {
        font-size: 14px;
    }

    .home-page__section--hero .trend-item-wrap .banner-bottom-text span {
        font-size: 12px;
    }

    /* ----- 收藏推荐 ----- */
    .home-page__section--calendar .market-floor-calc-box > div {
        flex-wrap: wrap !important;
    }

    .home-page__section--calendar .festival-item-box .title-box .text-box p {
        font-size: 14px;
    }

    /* ----- 楼层素材 ----- */
    .home-page__main .floor-container {
        padding-bottom: 24px;
    }

    .home-page__main .floor-container .head .title-box .desc {
        font-size: 18px;
    }

    .home-page__main .floor-container .head .title-box .floor-bg {
        font-size: 36px;
    }

    .home-page__main .floor-container .content .grid-row {
        row-gap: 12px;
    }

    .home-page__main .gutter-24 {
        --gutter: 12px;
    }

    /* ----- 版权 CTA ----- */
    .home-page__section--copyright.new-copyright-container {
        height: auto;
        min-height: 0;
        padding: 32px 16px;
        margin-bottom: 24px;
        text-align: center;
    }

    .home-page__section--copyright.new-copyright-container p {
        font-size: 15px;
        line-height: 1.6;
    }

    .home-page__section--copyright.new-copyright-container p em {
        display: block;
        margin-left: 0 !important;
        margin-top: 4px;
    }

    .home-page__section--copyright .btn-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 280px;
        margin-top: 20px;
    }

    .home-page__section--copyright .btn-group .qtd-btn {
        width: 100%;
    }

    /* ----- 创作入口 ----- */
    .home-page__section--designer.designer-entry-container {
        height: auto;
        min-height: 0;
        padding: 32px 16px;
        margin-bottom: 24px;
        text-align: center;
    }

    .home-page__section--designer .title {
        font-size: 20px;
        line-height: 1.4;
    }

    .home-page__section--designer .more {
        font-size: 13px;
        line-height: 1.6;
        margin-top: 8px;
    }

    /* ----- 热门搜索 ----- */
    .home-page__section--keywords.hot-keyword-container {
        padding: 24px 16px;
        margin-bottom: 24px;
    }

    .home-page__section--keywords .title {
        font-size: 20px;
        line-height: 1.4;
        margin-bottom: 16px;
    }

    .home-page__section--keywords .content {
        gap: 8px;
    }

    .home-page__section--keywords .content > a {
        font-size: 13px;
        height: 34px;
        padding: 0 14px;
    }

    /* ----- 页脚 ----- */
    .home-page__footer.qt-footer-content {
        padding: 20px 16px;
    }

    .home-page__footer .qt-footer-text-box p {
        font-size: 11px;
        line-height: 1.6;
    }

    /* ----- 右侧悬浮 ----- */
    .home-page__widgets.qtd-right-panel-container {
        right: 4px;
        bottom: 60px;
    }

    .home-page__widgets .hxp-qa-20221018 {
        display: none !important;
    }

    /* 模板弹窗 */
    .template-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .template-modal-dialog {
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }

    .template-modal-info {
        padding: 20px 16px;
    }

    .template-modal-title {
        font-size: 18px;
    }
}

/* ---------- ≤480px 小屏手机 ---------- */
@media (max-width: 480px) {
    body.home-page,
    body.default-theme.home-page {
        --qtd-header-height: 52px;
    }

    .home-page__main .common-content-box,
    #qt-app.is-default .common-content-box {
        padding-left: 12px;
        padding-right: 12px;
    }

    #lcp {
        height: 180px !important;
    }

    .home-page__header .search-input input {
        font-size: 12px;
    }

    .home-page__header .search-input input::placeholder {
        font-size: 11px;
    }

    .home-page__section--hero .banner-swiper {
        aspect-ratio: 4 / 3;
        border-radius: 10px;
    }

    .home-page__section--hero .trend-item-wrap .bottom-box {
        padding: 8px 10px;
    }

    .home-page__section--hero .trend-item-wrap .banner-bottom-text p {
        font-size: 13px;
    }

    .home-page__section--hero .trend-item-wrap .qtd-btn {
        display: none;
    }

    .hero-banner-main .clickImgLite .hero-banner-overlay {
        left: 12px;
        max-width: calc(100% - 24px);
    }

    .hero-banner-main .clickImgLite .hero-banner-overlay__panel {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .home-page__main .floor-container .head .title-box .desc {
        font-size: 16px;
    }

    .home-page__main .floor-container .head .title-box .floor-bg {
        font-size: 28px;
    }

    .home-page__section--copyright.new-copyright-container p {
        font-size: 14px;
    }

    .home-page__section--copyright.new-copyright-container p br {
        display: none;
    }

    .home-page__section--designer .title {
        font-size: 18px;
    }

    .home-page__section--keywords .title {
        font-size: 18px;
    }

    .home-page__section--keywords .content > a {
        font-size: 12px;
        height: 30px;
        padding: 0 12px;
    }
}

/* ===== 搜索页 ===== */
.home-page--search .home-page__main {
    padding-top: 24px;
}

.home-page--search .new-header-v2.index-header-new-v2 {
    position: sticky;
    top: 0;
}

.home-page--search .qt-app-box {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
}

.home-search-page {
    padding: 24px 0 64px;
    min-height: calc(100vh - 200px);
    max-width: 1440px;
    margin: 0 auto;
}

.home-search-page__head {
    margin-bottom: 32px;
    text-align: left;
}

.home-search-page__summary {
    margin-bottom: 20px;
}

.home-search-page__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
    color: var(--qtd-fun-color-12);
    line-height: 1.3;
}

.home-search-page__title em {
    color: var(--qtd-brand-color-6);
    font-style: normal;
}

.home-search-page__count {
    margin: 0;
    font-size: 14px;
    color: var(--qtd-fun-color-10);
}

.home-search-page__filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.home-search-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
}

.home-search-filter-chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid var(--qtd-fun-color-4);
    background: var(--qtd-fun-color-1);
    color: var(--qtd-fun-color-11);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.home-search-filter-chip:hover {
    border-color: var(--qtd-brand-color-5);
    color: var(--qtd-brand-color-6);
}

.home-search-filter-chip.is-active {
    border-color: var(--qtd-brand-color-6);
    background: var(--qtd-brand-color-1);
    color: var(--qtd-brand-color-6);
    font-weight: 500;
}

.home-search-page__grid {
    margin-top: 8px;
    justify-content: flex-start;
}

.home-search-page__grid > .col-10,
.home-search-page__grid > .col-60 {
    float: none;
}

.home-search-page__grid .qtd-ai-template-card {
    display: block;
    height: 100%;
}

.home-search-page__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    color: var(--qtd-fun-color-10);
    margin: 0 auto;
}

.home-search-page__empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.home-search-page__empty p {
    margin: 0 0 20px;
    font-size: 15px;
}

.home-search-page__load-more {
    display: flex;
    justify-content: center;
    padding: 32px 0 8px;
}

@media (max-width: 768px) {
    .home-search-page {
        max-width: 100%;
    }

    .home-search-page__title {
        font-size: 22px;
    }

    .home-search-filter-chip {
        height: 28px;
        padding: 0 10px;
        font-size: 12px;
    }
}

/* 素材收藏按钮 */
.js-template-favorite-btn {
    cursor: pointer;
    user-select: none;
}

.js-template-favorite-btn.is-favorited .icon-xin {
    color: #ff4d6a;
}

.js-template-favorite-btn:focus-visible {
    outline: 2px solid rgba(7, 193, 96, 0.45);
    outline-offset: 2px;
    border-radius: 4px;
}
