/* ================= 通用大厅与工作台 CSS ================= */
    .home-content { padding: 20px 40px 60px; max-width: 1400px; margin: 0 auto; width: 100%; }
    .hero-title { font-size: 32px; font-weight: bold; margin-bottom: 24px; line-height: 1.4; }
    .hero-title span { color: var(--accent-green); }
    .hero-banners { display: grid; grid-template-columns: 1.5fr 1fr 2.5fr; gap: 20px; margin-bottom: 40px; }
    .banner-card { border-radius: var(--radius-lg); overflow: hidden; position: relative; height: 280px; background: var(--bg-panel); border: 1px solid var(--border-color); cursor: pointer; transition: 0.3s; }
    .banner-card:hover { border-color: #555; transform: translateY(-2px); }
    .banner-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
    .banner-info { position: absolute; bottom: 20px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: flex-end; color: #fff; }
    .banner-btn { background: #fff; color: #000; border: none; padding: 8px 20px; border-radius: 20px; font-weight: bold; cursor: pointer; }

    .tools-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 40px; }
    .tool-card { height: 100px; border-radius: var(--radius-md); position: relative; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; padding: 12px; transition: 0.3s; border: 1px solid transparent; }
    .tool-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-color: rgba(128,128,128,0.3); }
    .card-t1 { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); color: #000; }
    .card-t2 { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); color: #000; }
    .card-t3 { background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%); color: #fff; }
    .card-t4 { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); color: #000; }
    .card-t5 { background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%); color: #000; }
    .card-t6 { background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%); color: #000; }
    .tool-name { font-size: 15px; font-weight: bold; position: relative; z-index: 2; }

    /* 大厅画廊瀑布流 */
    .gallery-nav { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
    .gallery-tag { padding: 6px 16px; background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 20px; font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: 0.2s; }
    .gallery-tag:hover, .gallery-tag.active { color: var(--bg-main); background: var(--text-primary); }
    .gallery-masonry { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
    .gallery-item { border-radius: var(--radius-md); overflow: hidden; background: var(--bg-panel); height: 300px; position: relative; border: 1px solid var(--border-color); transition: 0.3s; }


/* 首页装修：Banner / 工具卡片支持后台配置背景图片。 */
.banner-card.has-home-bg-image,
.tool-card.has-home-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffffff;
}

.banner-card.has-home-bg-image::before,
.tool-card.has-home-bg-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.58));
    pointer-events: none;
    z-index: 1;
}

.banner-card.has-home-bg-image .banner-info,
.tool-card.has-home-bg-image .tool-name,
.tool-card.has-home-bg-image .tool-subtitle {
    position: relative;
    z-index: 2;
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}

.tool-card.has-home-bg-image {
    justify-content: flex-end;
    min-height: 100px;
}

.tool-card.has-home-bg-image .tool-name {
    font-size: 15px;
    font-weight: 900;
}

.tool-card.has-home-bg-image .tool-subtitle {
    opacity: .86 !important;
}


/* 修复：首页 Banner 使用背景图片后，标题/副标题/按钮必须固定在底部内容层。 */
.hero-banners .banner-card.has-home-bg-image {
    position: relative;
    overflow: hidden;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

.hero-banners .banner-card.has-home-bg-image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.28) 42%, rgba(0,0,0,0.72) 100%);
}

.hero-banners .banner-card.home-banner-raw-image::before {
    display: none !important;
}

.hero-banners .banner-card.home-banner-raw-image > div:not(.banner-info) {
    display: none !important;
}

.hero-banners .banner-card.has-home-bg-image .banner-info {
    position: absolute !important;
    left: 20px !important;
    right: 20px !important;
    bottom: 20px !important;
    top: auto !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 14px !important;
    color: #ffffff !important;
    pointer-events: none;
}

.hero-banners .banner-card.has-home-bg-image .banner-info > div {
    min-width: 0;
    max-width: calc(100% - 130px);
}

.hero-banners .banner-card.has-home-bg-image .banner-info h3,
.hero-banners .banner-card.has-home-bg-image .banner-info p {
    position: relative !important;
    z-index: 2 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 14px rgba(0,0,0,0.72) !important;
}

.hero-banners .banner-card.has-home-bg-image .banner-info h3 {
    margin: 0 0 8px !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
}

.hero-banners .banner-card.has-home-bg-image .banner-info p {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    opacity: .88 !important;
}

.hero-banners .banner-card.has-home-bg-image .banner-btn {
    position: relative !important;
    z-index: 3 !important;
    flex: 0 0 auto !important;
    align-self: flex-end !important;
    pointer-events: auto;
}

/* 修复：首页工具卡片文字层统一左下角，保证无背景图卡片与有背景图卡片位置一致。 */
.tools-grid .tool-card {
    justify-content: flex-end;
}

.tools-grid .tool-card .tool-name {
    position: relative;
    z-index: 2;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 900;
}

.tools-grid .tool-card .tool-subtitle,
.tools-grid .tool-card .tool-name + div {
    position: relative;
    z-index: 2;
    font-size: 10px !important;
    line-height: 1.35;
    margin-top: 4px !important;
    opacity: .86 !important;
}

.tools-grid .tool-card.has-home-bg-image .tool-name,
.tools-grid .tool-card.has-home-bg-image .tool-subtitle {
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}


/* 修复：工具卡片标题/副标题颜色统一，避免新增“万物转写实/万物转实物”卡片出现深色文字。 */
.tools-grid .tool-card,
.tools-grid .tool-card .tool-name,
.tools-grid .tool-card .tool-subtitle,
.tools-grid .tool-card .tool-name + div {
    color: #ffffff !important;
}

.tools-grid .tool-card .tool-name,
.tools-grid .tool-card .tool-subtitle,
.tools-grid .tool-card .tool-name + div {
    text-shadow: 0 2px 12px rgba(0,0,0,0.42);
}

/* ===== ZIZI 响应式缩放热修复 2026-05-28：首页密度自适应 ===== */
@media (max-width: 1280px), (max-height: 820px) {
    .home-content {
        max-width: 1180px;
        padding: 16px 28px 44px;
    }
    .hero-banners {
        gap: 16px;
    }
    .hero-banners .banner-card {
        min-height: 210px;
    }
    .hero-banners .banner-card.has-home-bg-image {
        height: 240px;
        min-height: 240px;
    }
    .hero-banners .banner-card.has-home-bg-image .banner-info h3 {
        font-size: clamp(24px, 2.6vw, 38px);
    }
    .hero-banners .banner-card.has-home-bg-image .banner-info p {
        font-size: clamp(12px, 1.05vw, 16px);
    }
    .tools-grid {
        gap: 14px;
    }
    .tools-grid .tool-card {
        min-height: 126px;
    }
}

@media (max-width: 1100px), (max-height: 760px) {
    .home-content {
        max-width: 1040px;
        padding: 14px 22px 36px;
    }
    .hero-banners .banner-card,
    .hero-banners .banner-card.has-home-bg-image {
        height: 210px;
        min-height: 210px;
    }
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .tools-grid .tool-card {
        min-height: 112px;
        padding: 14px;
    }
    .tools-grid .tool-card .tool-name {
        font-size: 14px;
    }
}

@media (max-width: 760px) {
    .home-content {
        padding: 14px 14px 32px;
    }
    .hero-banners {
        grid-template-columns: 1fr;
    }
    .hero-banners .banner-card,
    .hero-banners .banner-card.has-home-bg-image {
        height: 190px;
        min-height: 190px;
    }
    .tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

/* ===== ZIZI 工具卡片背景图溢出热修复 2026-05-28 =====
   修复后台工具卡片配置背景图片 URL 后，深色模式下卡片底部/边缘出现轻微溢出的细线。 */
.tools-grid .tool-card.has-home-bg-image,
.tools-grid .tool-card.home-tool-with-image {
    overflow: hidden !important;
    background-clip: padding-box !important;
    border-radius: var(--radius-md) !important;
    isolation: isolate;
    contain: paint;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    clip-path: inset(0 round var(--radius-md));
    -webkit-clip-path: inset(0 round var(--radius-md));
}

.tools-grid .tool-card.has-home-bg-image::before,
.tools-grid .tool-card.home-tool-with-image::before {
    inset: 0 !important;
    border-radius: inherit !important;
    overflow: hidden !important;
}

.tools-grid .tool-card.has-home-bg-image:hover,
.tools-grid .tool-card.home-tool-with-image:hover {
    clip-path: inset(0 round var(--radius-md));
    -webkit-clip-path: inset(0 round var(--radius-md));
}

/* ===== ZIZI 首页响应式布局统一 2026-06-04 ===== */
.page-container {
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding: 48px;
    box-sizing: border-box;
    min-width: 0;
}

.home-content.page-container {
    max-width: 1600px;
    padding: 48px;
}

#homeView {
    overflow-x: hidden;
}

.hero-grid,
.feature-grid,
.gallery-grid {
    width: 100%;
    min-width: 0;
}

.hero-banners.hero-grid {
    grid-template-columns: 1.2fr 0.8fr 2fr;
    gap: 24px;
}

.hero-banners.hero-grid .banner-card {
    border-radius: 16px;
    min-width: 0;
    height: 280px;
    min-height: 280px;
}

.feature-grid.tools-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.feature-grid.tools-grid .tool-card {
    border-radius: 14px;
    min-width: 0;
}

.feature-grid.tools-grid .tool-card.has-home-bg-image,
.feature-grid.tools-grid .tool-card.home-tool-with-image {
    border-radius: 14px !important;
    clip-path: inset(0 round 14px);
    -webkit-clip-path: inset(0 round 14px);
}

.feature-grid.tools-grid .tool-card.has-home-bg-image:hover,
.feature-grid.tools-grid .tool-card.home-tool-with-image:hover {
    clip-path: inset(0 round 14px);
    -webkit-clip-path: inset(0 round 14px);
}

.gallery-grid.gallery-masonry {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 18px;
}

.gallery-grid.gallery-masonry .gallery-item {
    border-radius: 12px;
    min-width: 0;
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .page-container,
    .home-content.page-container {
        max-width: 1440px;
        padding: 40px;
    }

    .gallery-grid.gallery-masonry {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .page-container,
    .home-content.page-container {
        max-width: 1180px;
        padding: 32px;
    }

    .hero-banners.hero-grid {
        grid-template-columns: 1.2fr 0.8fr 2fr;
    }

    .gallery-grid.gallery-masonry {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .page-container,
    .home-content.page-container {
        max-width: none;
        padding: 24px;
    }

    .hero-banners.hero-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .hero-banners.hero-grid .banner-card {
        height: 240px;
        min-height: 240px;
    }

    .hero-banners.hero-grid .banner-card:nth-child(3) {
        grid-column: 1 / -1;
    }

    .feature-grid.tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gallery-grid.gallery-masonry {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .gallery-grid.gallery-masonry {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (min-width: 769px) and (max-width: 899px) {
    .gallery-grid.gallery-masonry {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .page-container,
    .home-content.page-container {
        max-width: none;
        padding: 16px;
    }

    .hero-banners.hero-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-banners.hero-grid .banner-card,
    .hero-banners.hero-grid .banner-card.has-home-bg-image {
        height: 220px;
        min-height: 220px;
    }

    .feature-grid.tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .gallery-grid.gallery-masonry {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-banners.hero-grid .banner-card [style*="letter-spacing: 20px"] {
        font-size: 32px !important;
        letter-spacing: 8px !important;
    }
}

/* ===== ZIZI 首页作品流解锁与完整图展示 2026-06-04 ===== */
#homeView .gallery-nav,
#homeView .gallery-grid.gallery-masonry {
    max-width: none;
    box-sizing: border-box;
}

#homeView .gallery-grid.gallery-masonry {
    align-items: start;
}

#homeView .gallery-grid.gallery-masonry .gallery-item.home-template-card {
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
}

#homeView .gallery-grid.gallery-masonry .gallery-item.home-template-card:not(:has(.home-template-img)) {
    min-height: 260px;
    aspect-ratio: 3 / 4;
}

#homeView .gallery-grid.gallery-masonry .home-template-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center top;
}

@media (min-width: 1200px) {
    #homeView .gallery-nav,
    #homeView .gallery-grid.gallery-masonry {
        width: min(calc(100vw - 72px - 96px), 2080px);
        margin-left: 50%;
        transform: translateX(-50%);
    }
}

@media (min-width: 1920px) {
    #homeView .gallery-grid.gallery-masonry {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    #homeView .gallery-grid.gallery-masonry {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    #homeView .gallery-grid.gallery-masonry {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}

@media (max-width: 1199px) {
    #homeView .gallery-nav,
    #homeView .gallery-grid.gallery-masonry {
        width: 100%;
        margin-left: 0;
        transform: none;
    }
}

/* ===== ZIZI 工具卡片背景图完整自适应 2026-06-04 ===== */
#homeView .feature-grid.tools-grid .tool-card {
    height: auto;
    min-height: 96px;
    aspect-ratio: 16 / 7;
}

#homeView .feature-grid.tools-grid .tool-card.has-home-bg-image,
#homeView .feature-grid.tools-grid .tool-card.home-tool-with-image {
    background-size: 100% 100%, contain !important;
    background-position: center, center !important;
    background-repeat: no-repeat, no-repeat !important;
    background-color: var(--bg-panel-light);
}

@media (min-width: 1200px) {
    #homeView .feature-grid.tools-grid .tool-card {
        min-height: 104px;
    }
}

@media (max-width: 768px) {
    #homeView .feature-grid.tools-grid .tool-card {
        min-height: 92px;
    }
}

/* ===== ZIZI 首页模板搜索框 2026-06-05 ===== */
#homeView .template-filter-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    max-width: none;
    box-sizing: border-box;
}

#homeView .template-filter-row .gallery-nav {
    flex: 1 1 auto;
    width: auto;
    margin: 0;
    transform: none;
}

#homeView .home-template-search {
    position: relative;
    flex: 0 0 320px;
    width: 320px;
    height: 38px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-panel);
    color: var(--text-secondary);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

#homeView .home-template-search:hover,
#homeView .home-template-search:focus-within {
    border-color: rgba(128,128,128,0.45);
    background: var(--bg-panel);
    box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

#homeView .home-template-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

#homeView .home-template-search-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#homeView .home-template-search input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    padding: 0 14px 0 39px;
    caret-color: transparent;
    box-sizing: border-box;
}

#homeView .home-template-search:hover input,
#homeView .home-template-search:focus-within input {
    padding-right: 74px;
    caret-color: var(--text-primary);
}

#homeView .home-template-search input::placeholder {
    color: var(--text-secondary);
}

#homeView .home-template-search button {
    position: absolute;
    right: 6px;
    top: 5px;
    height: 28px;
    min-width: 58px;
    padding: 0 14px;
    border: 0;
    border-radius: 7px;
    background: var(--bg-panel-light);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(6px);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

#homeView .home-template-search:hover button,
#homeView .home-template-search:focus-within button {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

#homeView .home-template-search button:hover {
    background: var(--text-primary);
    color: var(--bg-main);
}

@media (min-width: 1200px) {
    #homeView .template-filter-row {
        width: min(calc(100vw - 72px - 96px), 2080px);
        margin-left: 50%;
        transform: translateX(-50%);
    }

    #homeView .template-filter-row .gallery-nav {
        width: auto;
        margin-left: 0;
        transform: none;
    }
}

@media (max-width: 1199px) {
    #homeView .template-filter-row {
        width: 100%;
        margin-left: 0;
        transform: none;
    }
}

@media (max-width: 768px) {
    #homeView .home-template-search {
        flex: 1 1 100%;
        width: 100%;
    }

    #homeView .template-filter-row {
        gap: 12px;
        margin-bottom: 20px;
    }
}
