/**
 * 首页布局整理 — 仅做区块划分与结构辅助，不覆盖 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;
}

/* ===== 首页分类栏底部光晕 ===== */
.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;
}

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

/* ===== 首页头部品牌 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-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 .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 {
    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 .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-info {
    padding: 28px 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}

.template-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.3;
    padding-right: 28px;
}

.template-modal-subtitle {
    margin-top: 6px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.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;
    max-height: 120px;
    overflow-y: auto;
    word-break: break-word;
}

.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;
    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 .head-func .head-func-flex .header-search-wrap .header-tool-list-box {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        margin-top: 12px;
        margin-left: 0;
        margin-right: 0;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .home-page__header .header-tool-list-box::-webkit-scrollbar,
    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box::-webkit-scrollbar {
        display: none;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item,
    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item-wrap {
        width: 116px;
        min-width: 116px;
        max-width: 116px;
        flex-shrink: 0;
        border-radius: 12px;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item .tool-list-box-item-title {
        padding: 6px 8px 8px;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item .tool-list-box-item-title .span-1 {
        font-size: 12px;
        line-height: 18px;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item .tool-list-box-item-title .span-1 em {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 100%;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item .tool-list-box-item-title .span-2 {
        font-size: 11px;
        line-height: 16px;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item:nth-child(n+4) {
        display: none;
    }

    .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;
    }

    .home-page__section--hero .grid-row {
        row-gap: 12px;
    }

    .home-page__section--hero .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.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item,
    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item-wrap {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item .tool-list-box-item-title .span-1 {
        font-size: 11px;
        line-height: 16px;
    }

    .home-page__header.new-header-v2.index-header-new-v2 .head-box .head-func .head-func-flex .header-search-wrap .header-tool-list-box .tool-list-box-item .tool-list-box-item-title .span-2 {
        font-size: 10px;
        line-height: 14px;
    }

    .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;
    }

    .home-page__section--hero .swiper-slide .bottom-box .qtd-btn {
        display: none;
    }

    .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;
}

.is-search-header .header-tool-list-box {
    display: none;
}

@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;
}
