/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Dashboard mobile interaction system: single-column + segmented nav */
@media (max-width: 768px) {
    body.dashboard-page .main-content {
        width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        box-sizing: border-box;
    }

    body.dashboard-page .dashboard-card {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        width: 100%;
        padding: 0.75rem !important;
        border-radius: 14px !important;
        min-width: 0;
        box-sizing: border-box;
    }

    body.dashboard-page .dashboard-sidebar {
        order: 0 !important;
        width: 100%;
        max-width: 100%;
        padding: 0.5rem !important;
        border-radius: 12px;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.dashboard-page .dashboard-sidebar::-webkit-scrollbar {
        display: none;
    }

    body.dashboard-page .dashboard-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 0.5rem;
        white-space: nowrap;
        scroll-snap-type: x mandatory;
        padding: 0.1rem;
    }

    body.dashboard-page .dashboard-nav li {
        margin-bottom: 0 !important;
        flex: 0 0 auto;
        scroll-snap-align: center;
    }

    body.dashboard-page .dashboard-nav a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        padding: 0.5rem 0.8rem !important;
        border-radius: 10px;
        font-size: 0.84rem !important;
        font-weight: 600;
        line-height: 1.2;
        border: 1px solid rgba(15, 23, 42, 0.14);
        background: #e8eef5;
        color: #111827;
        -webkit-tap-highlight-color: transparent;
    }

    body.dashboard-page .dashboard-nav a.active {
        background: #4338ca;
        color: #fff;
        border-color: #3730a3;
        box-shadow: 0 4px 12px rgba(67, 56, 202, 0.35);
    }

    body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a {
        background: #2a3142;
        color: #f8fafc;
        border-color: rgba(148, 163, 184, 0.38);
    }

    body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a:hover,
    body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a.active {
        background: #0e7490;
        color: #fff;
        border-color: #22d3ee;
        box-shadow: 0 4px 14px rgba(14, 116, 144, 0.4);
    }

    body.dashboard-page .dashboard-nav a:active {
        transform: scale(0.98);
    }

    body.dashboard-page .dashboard-content {
        order: 1 !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 0.9rem !important;
        border-radius: 12px;
        overflow: hidden;
        box-sizing: border-box;
    }

    body.dashboard-page .dashboard-section {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    body.dashboard-page .user-info .info-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.45rem;
        width: 100%;
        min-width: 0;
    }

    body.dashboard-page .user-info .info-item .btn-small {
        width: 100%;
        text-align: center;
    }

    body.dashboard-page .user-info .info-item label,
    body.dashboard-page .user-info .info-item span,
    body.dashboard-page .user-info .info-item a,
    body.dashboard-page .user-info .info-item button {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body.dashboard-page .avatar-container {
        width: min(140px, 42vw);
        height: min(140px, 42vw);
    }

    body.dashboard-page #imagesList,
    body.dashboard-page #ordersList,
    body.dashboard-page #creditsHistory {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    body.dashboard-page .credits-balance,
    body.dashboard-page .checkin-header-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }

    body.dashboard-page .checkin-activity-list,
    body.dashboard-page .checkin-records,
    body.dashboard-page .checkin-activity-desc {
        width: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    body.dashboard-page .btn,
    body.dashboard-page .btn-small,
    body.dashboard-page .checkin-action-btn {
        max-width: 100%;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-card,
    .dashboard-nav a,
    .dashboard-section.active,
    .avatar-container,
    .edit-icon,
    .images-grid .image-item,
    .checkin-day-cell,
    .checkin-action-btn {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 480px) {
    body.dashboard-page .main-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    body.dashboard-page .dashboard-card {
        padding: 0.6rem !important;
        border-radius: 12px !important;
    }

    body.dashboard-page .dashboard-content {
        padding: 0.75rem !important;
    }

    body.dashboard-page .dashboard-nav a {
        min-height: 34px;
        padding: 0.45rem 0.7rem !important;
        font-size: 0.8rem !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 避免 100vw 全宽布局在部分移动浏览器产生横向溢出与错位 */
html {
    overflow-x: hidden;
    max-width: 100%;
}

/* 完全隐藏滚动条但保持滚动功能 */
html {
    /* Firefox - 完全隐藏 */
    scrollbar-width: none;
    /* IE and Edge - 完全隐藏 */
    -ms-overflow-style: none;
}

/* Chrome/Safari/Edge - 完全隐藏 */
html::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

/* body 元素也隐藏滚动条 */
body {
    /* Firefox - 完全隐藏 */
    scrollbar-width: none;
    /* IE and Edge - 完全隐藏 */
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

/* 仅在含 emoji/装饰符号的节点启用彩色呈现；勿用 * —— macOS Chrome 会对普通数字/$ 等套用 emoji 变体导致字距异常 */
.snowflake,
.theme-switcher-icon,
.credits-icon,
.referral-icon,
.menu-icon,
.toast-icon,
.avatar-edit-icon,
.checkin-tick-mark,
.generate-complete-icon,
.mobile-custom-select-option-check,
.success-icon,
.menu-toggle {
    font-variant-emoji: emoji;
}

/* 生成页面专用样式 */
body.generate-page {
    background-color: #000000; /* 整体背景为黑色 */
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 首页 #home-workspace：挂在 .upper-module 顶部，跳转后与首次进入页一致（顶栏 + 大标题 + 背景），不再对齐到 inner 卡片 */
body.generate-page #home-workspace {
    scroll-margin-top: 0;
}

/* 博客页全宽面包屑：允许横向铺满视口（避免 html/body overflow-x 裁切） */
html:has(.blog-static-breadcrumb),
body.generate-page:has(.blog-static-breadcrumb) {
    overflow-x: visible;
}

html:has(main.blog-static-wrapper),
body.generate-page:has(main.blog-static-wrapper) {
    background-color: #0a0a0a;
}

/* 博客独立静态页 / 列表页：顶栏下方面包屑（全宽与父级宽度无关；列表与详情同一套高度；仅面包屑文字略向右） */
.blog-static-breadcrumb {
    --blog-bc-nav-max: 1200px;
    --blog-bc-nav-pad-x: 2rem;
    --blog-bc-text-nudge: 1.15rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    box-sizing: border-box;
    position: relative;
    left: auto;
    transform: none;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    margin-bottom: 1.25rem;
    min-height: 3rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: calc(env(safe-area-inset-left, 0px) + (100vw - min(var(--blog-bc-nav-max), 100vw)) / 2 + var(--blog-bc-nav-pad-x) + var(--blog-bc-text-nudge));
    padding-right: calc(env(safe-area-inset-right, 0px) + (100vw - min(var(--blog-bc-nav-max), 100vw)) / 2 + var(--blog-bc-nav-pad-x));
    background: #1e1e1e;
    border: solid rgba(255, 255, 255, 0.08);
    border-width: 1px 0;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #ffffff;
}

.blog-static-breadcrumb a {
    color: #ffffff;
    text-decoration: none;
}

.blog-static-breadcrumb a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.blog-static-breadcrumb-sep {
    color: #ffffff;
    user-select: none;
    font-weight: 500;
}

.blog-static-breadcrumb-current {
    color: #ffffff;
    font-weight: 500;
    min-width: 0;
    word-break: break-word;
}

/* 博客静态文：标题下 meta（与博客列表 blog-post-meta 一致：作者 | 日期） */
.blog-static-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    margin: -4px 0 22px;
    font-size: 15px;
    line-height: 1.5;
    color: #6b7280;
}

.blog-static-meta-byline {
    color: #4b5563;
}

.blog-static-meta-author {
    font-weight: 600;
    color: #374151;
}

.blog-static-meta-sep {
    color: #9ca3af;
    user-select: none;
    padding: 0 0.15rem;
}

.blog-static-meta-time {
    color: #6b7280;
}

.blog-static-meta-byline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.blog-author-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f5f1e8;
    background: #2a2622;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.blog-author-avatar--sm {
    width: 28px;
    height: 28px;
    font-size: 0.68rem;
}

.blog-author-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    margin: 2rem 0 0;
    padding: 1.1rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-author-copy {
    min-width: 0;
}

.blog-author-name {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    font-weight: 700;
    color: #f5f1e8;
}

.blog-author-role {
    margin: 0 0 0.45rem;
    font-size: 0.85rem;
    color: #a39e97;
}

.blog-author-bio {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #c4bfb6;
}

body.generate-page:has(main.blog-static-wrapper) .blog-author-name {
    color: #f5f1e8;
}

body.generate-page:has(main.blog-static-wrapper) .blog-author-role {
    color: #a39e97;
}

body.generate-page:has(main.blog-static-wrapper) .blog-author-bio {
    color: #c4bfb6;
}

/* 博客静态文章页（main.blog-static-wrapper）：覆盖各页内联浅色，黑底白字 */
body.generate-page:has(main.blog-static-wrapper) {
    color: #e5e7eb;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card {
    background: transparent;
    border: none;
    box-shadow: none;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card h1 {
    color: #fafafa;
}

body.generate-page:has(main.blog-static-wrapper) .blog-lead {
    color: #cbd5e1;
}

body.generate-page:has(main.blog-static-wrapper) .blog-kicker {
    color: #f9fafb;
    border-left-color: #60a5fa;
}

body.generate-page:has(main.blog-static-wrapper) .blog-block p,
body.generate-page:has(main.blog-static-wrapper) .blog-block li {
    color: #d1d5db;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block p.blog-lead {
    color: #cbd5e1;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block p.blog-kicker {
    color: #f9fafb;
    border-left-color: #60a5fa;
}

body.generate-page:has(main.blog-static-wrapper) .blog-block h2,
body.generate-page:has(main.blog-static-wrapper) .blog-block .section-title,
body.generate-page:has(main.blog-static-wrapper) .blog-block .subsection-title,
body.generate-page:has(main.blog-static-wrapper) .blog-block .micro-title {
    color: #fafafa;
}

body.generate-page:has(main.blog-static-wrapper) .blog-block ul,
body.generate-page:has(main.blog-static-wrapper) .blog-block ol {
    color: #d1d5db;
}

body.generate-page:has(main.blog-static-wrapper) .blog-block strong,
body.generate-page:has(main.blog-static-wrapper) .blog-feature-list strong {
    color: #f3f4f6;
}

body.generate-page:has(main.blog-static-wrapper) .blog-feature-list,
body.generate-page:has(main.blog-static-wrapper) .blog-feature-list li {
    color: #d1d5db;
}

body.generate-page:has(main.blog-static-wrapper) .blog-block a {
    color: #93c5fd;
}

body.generate-page:has(main.blog-static-wrapper) .blog-block a:hover {
    color: #bfdbfe;
}

body.generate-page:has(main.blog-static-wrapper) .blog-tip,
body.generate-page:has(main.blog-static-wrapper) .blog-block .note {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
    border-left-color: #3b82f6;
}

body.generate-page:has(main.blog-static-wrapper) .blog-judge {
    color: #f3f4f6;
}

body.generate-page:has(main.blog-static-wrapper) .docx-table,
body.generate-page:has(main.blog-static-wrapper) .blog-compare-table {
    background: #141414;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.12);
}

body.generate-page:has(main.blog-static-wrapper) .docx-table th,
body.generate-page:has(main.blog-static-wrapper) .docx-table td,
body.generate-page:has(main.blog-static-wrapper) .blog-compare-table th,
body.generate-page:has(main.blog-static-wrapper) .blog-compare-table td {
    border-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}

body.generate-page:has(main.blog-static-wrapper) .docx-table th {
    background: #1f2937;
    color: #f9fafb;
}

body.generate-page:has(main.blog-static-wrapper) .blog-compare-heading,
body.generate-page:has(main.blog-static-wrapper) .blog-compare-label {
    color: #fafafa;
}

body.generate-page:has(main.blog-static-wrapper) .blog-compare-sub,
body.generate-page:has(main.blog-static-wrapper) .blog-compare-verdict {
    color: #cbd5e1;
}

body.generate-page:has(main.blog-static-wrapper) .blog-compare-table thead th {
    background: #1f2937;
    color: #f9fafb;
}

/* 博客正文插图 */
.blog-figure {
    margin: 24px 0;
    text-align: center;
}
.blog-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.blog-figure figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}
body.generate-page:has(main.blog-static-wrapper) .blog-figure figcaption {
    color: #9ca3af;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-meta {
    color: #9ca3af;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-meta-byline {
    color: #9ca3af;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-meta-author {
    color: #d1d5db;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-meta-sep {
    color: #6b7280;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-meta-time {
    color: #9ca3af;
}

/* 博客静态文：文末「大家在看」（与页面背景一致、无边框） */
.blog-related-back-wrap {
    margin: 0 0 0.5rem;
    padding: 0;
    text-align: right;
}

.blog-related-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #c4b5fd;
    text-decoration: none;
}

.blog-related-back:hover {
    color: #e9d5ff;
    text-decoration: underline;
}

body.embed-mode .blog-related-back-wrap {
    display: none !important;
}

.blog-related {
    margin-top: 1.5rem;
    padding: 1.25rem 1.35rem 1.1rem;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    box-sizing: border-box;
}

.blog-related-title {
    margin: 0 0 0.85rem;
    padding-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fafafa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.blog-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blog-related-item {
    margin: 0;
    padding: 0.55rem 0;
    border-bottom: none;
}

.blog-related-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.blog-related-link {
    color: #93c5fd;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 500;
    word-break: break-word;
}

.blog-related-link:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

.blog-related-status {
    margin: 0.65rem 0 0;
    font-size: 0.9rem;
    color: #9ca3af;
}

body.embed-mode .blog-related {
    display: none !important;
}

@media (max-width: 768px) {
    .blog-static-breadcrumb {
        --blog-bc-nav-pad-x: 0.75rem;
        --blog-bc-text-nudge: 0.75rem;
        min-height: 3rem;
    }

    .blog-static-meta {
        font-size: 14px;
    }

    .blog-related {
        padding: 1rem 0.9rem 0.9rem;
    }

    .blog-related-title {
        font-size: 1.15rem;
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%, 100% 50%, 50% 50%, 0% 50%; }
    50% { background-position: 100% 50%, 0% 50%, 50% 50%, 100% 50%; }
    100% { background-position: 0% 50%, 100% 50%, 50% 50%, 0% 50%; }
}

@keyframes gradientPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

/* 背景场景 */
.background-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: none; /* 隐藏装饰元素，只显示背景图 */
}

.sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 800px 600px at 15% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 600px 500px at 85% 35%, rgba(255, 255, 255, 0.06) 0%, transparent 60%);
    animation: skyPulse 25s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes skyPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.98; transform: scale(1.02); }
}

@keyframes skyMove {
    0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%, 30% 50%, 0% 0%; }
    50% { background-position: 20% 10%, 80% 90%, 60% 60%, 40% 60%, 20% 20%; }
}

.clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border-radius: 50px;
    opacity: 0.85;
    animation: float 30s infinite ease-in-out;
    box-shadow: 
        0 10px 30px rgba(255, 255, 255, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    filter: blur(0.8px);
    backdrop-filter: blur(10px);
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50px;
}

.cloud::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud::after {
    width: 60px;
    height: 60px;
    top: -35px;
    right: 15px;
}

.cloud1 {
    width: 150px;
    height: 50px;
    top: 15%;
    left: 5%;
    animation-delay: 0s;
}

.cloud2 {
    width: 130px;
    height: 45px;
    top: 10%;
    right: 10%;
    animation-delay: 3s;
}

.cloud3 {
    width: 160px;
    height: 55px;
    top: 20%;
    left: 45%;
    animation-delay: 6s;
}

@keyframes float {
    0%, 100% { 
        transform: translateX(0) translateY(0);
    }
    25% { 
        transform: translateX(20px) translateY(-5px);
    }
    50% { 
        transform: translateX(40px) translateY(0);
    }
    75% { 
        transform: translateX(20px) translateY(5px);
    }
}

.trees {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 35%;
    overflow: hidden;
}

.tree {
    position: absolute;
    bottom: 0;
    width: 180px;
    height: 100%;
    opacity: 0.8;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.tree::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 40px;
    background: linear-gradient(to right, #8B4513 0%, #A0522D 50%, #8B4513 100%);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tree-left {
    left: 3%;
    transform: scale(0.85);
}

.tree-left::after {
    content: '';
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 120px solid rgba(34, 139, 34, 0.7);
    filter: blur(1px);
}

.tree-left::before {
    z-index: 1;
}

.tree-right {
    right: 3%;
    transform: scale(0.9);
}

.tree-right::after {
    content: '';
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 70px solid transparent;
    border-right: 70px solid transparent;
    border-bottom: 140px solid rgba(46, 125, 50, 0.75);
    filter: blur(1px);
}

.tree-right::before {
    z-index: 1;
}

.snowflakes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    animation: snowfall 15s infinite linear;
    opacity: 0;
    text-shadow: 
        0 0 8px rgba(255, 255, 255, 0.8),
        0 0 15px rgba(255, 255, 255, 0.4);
    filter: blur(0.3px);
    font-weight: 300;
}

.snowflake:nth-child(1) { left: 8%; animation-delay: 0s; font-size: 16px; }
.snowflake:nth-child(2) { left: 25%; animation-delay: 1.5s; font-size: 20px; }
.snowflake:nth-child(3) { left: 45%; animation-delay: 3s; font-size: 18px; }
.snowflake:nth-child(4) { left: 65%; animation-delay: 4.5s; font-size: 22px; }
.snowflake:nth-child(5) { left: 82%; animation-delay: 6s; font-size: 16px; }
.snowflake:nth-child(6) { left: 92%; animation-delay: 2s; font-size: 19px; }

@keyframes snowfall {
    0% {
        transform: translateY(-100px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.9;
    }
    95% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) translateX(30px) rotate(360deg);
        opacity: 0;
    }
}

/* 添加星星装饰 */
.background-scene::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(3px 3px at 15% 25%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(2px 2px at 35% 45%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 55% 65%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1.5px 1.5px at 70% 20%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(2.5px 2.5px at 85% 55%, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1px 1px at 25% 75%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(2px 2px at 45% 30%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1.5px 1.5px at 65% 80%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 90% 15%, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1px 1px at 10% 60%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(2px 2px at 30% 90%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1.5px 1.5px at 75% 40%, rgba(255, 255, 255, 0.8), transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: twinkle 10s ease-in-out infinite, starMove 20s linear infinite;
    pointer-events: none;
    filter: blur(0.3px);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; }
    25% { opacity: 0.8; }
    50% { opacity: 1; }
    75% { opacity: 0.7; }
}

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

/* 添加光晕效果 */
.background-scene::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 800px;
    height: 800px;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 200, 255, 0.12) 0%, transparent 60%),
        radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowMove 25s ease-in-out infinite, glowPulse 15s ease-in-out infinite;
    pointer-events: none;
    filter: blur(40px);
}

@keyframes glowMove {
    0% { 
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.4;
    }
    33% { 
        transform: translate(-120px, 80px) scale(1.15) rotate(120deg);
        opacity: 0.5;
    }
    66% { 
        transform: translate(80px, -100px) scale(1.1) rotate(240deg);
        opacity: 0.45;
    }
    100% { 
        transform: translate(0, 0) scale(1) rotate(360deg);
        opacity: 0.4;
    }
}

@keyframes glowPulse {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.1);
    }
}

/* 顶部品牌和标题（现在在上边模块内） */
.top-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1rem 1.5rem; /* 减少上下边距，使内容能完整显示在屏幕中 */
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0; /* 防止被压缩 */
}

/* 个人中心页面：为 top-header 添加顶部间距，避免被固定导航栏遮挡 */
/* 导航栏高度约 60-70px，添加足够的顶部间距 */
body.dashboard-page .top-header {
    padding-top: 5.5rem; /* 增加顶部间距（约 88px），确保 main-title 不被固定导航栏遮挡 */
}

/* 个人中心页面：背景由 .dashboard-bg-container 两层实现 */
body.dashboard-page {
    background-color: #000;
}

body.dashboard-page .dashboard-bg-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

body.dashboard-page .dashboard-bg-layer {
    position: absolute;
    inset: 0;
    background-color: #1a0a0a;
    transition: opacity 1s ease;
    pointer-events: none;
}

body.dashboard-page .dashboard-bg-layer-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

body.dashboard-page .dashboard-bg-current {
    opacity: 1;
}

body.dashboard-page .dashboard-bg-next {
    opacity: 0;
}

/* 确保个人中心页面的背景图片显示在 background-scene 之上 */
body.dashboard-page .background-scene {
    z-index: 0;
}

.brand-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.brand-icon {
    font-size: 1.2rem;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0;
}

/* 导航栏：文字纯白并加深色描边，浅色/白色背景时也清晰 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #0f121c;
    background-color: #0f121c;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 0;
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    margin-bottom: 0;
    margin-top: 0;
}

.skip-link {
    position: absolute;
    left: 0.75rem;
    top: calc(0.75rem + env(safe-area-inset-top, 0px));
    z-index: 10001;
    padding: 0.55rem 0.9rem;
    background: #111111;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 8px;
    transform: translateY(-160%);
    transition: transform 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.generate-page .top-nav,
body.generate-page .top-nav .nav-link,
body.generate-page .top-nav .nav-activity-btn,
body.generate-page .top-nav .nav-credits-badge,
body.generate-page .top-nav .message-center-btn,
body.generate-page .top-nav .language-switcher,
body.generate-page .top-nav .language-switcher-text,
body.generate-page .top-nav .language-switcher-arrow,
body.generate-page .top-nav .top-login-btn {
    color: #ffffff !important;
    text-shadow: 0 0 1px #000, 0 0 2px #000, 0 1px 2px rgba(0,0,0,0.9), 0 1px 4px rgba(0,0,0,0.8);
}

/* 非首页：顶栏常驻不透明深色底（白底正文上透明栏会让白 logo「消失」） */
body.site-landing-page .top-nav,
body.blog-page .top-nav,
body.dashboard-page .top-nav,
body.gallery-detail-page .top-nav,
body.pricing-landing-page .top-nav,
body.public-gallery-page .top-nav,
body.generate-page:not([data-public-gallery="teaser"]) .top-nav,
.gallery-detail-page .top-nav,
.pricing-landing-page .top-nav {
    background: #0f121c !important;
    background-color: #0f121c !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* 首页滚动时：同样加不透明深色底 */
.top-nav.scrolled,
body.generate-page .top-nav.scrolled,
body.dashboard-page .top-nav.scrolled,
body.blog-page .top-nav.scrolled,
body.gallery-detail-page .top-nav.scrolled,
.gallery-detail-page .top-nav.scrolled,
.pricing-landing-page .top-nav.scrolled {
    background: #0f121c !important;
    background-color: #0f121c !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Guide 已有全站顶栏，隐藏旧的浮动「返回首页」，避免叠在正文上 */
.guide-back-home {
    display: none !important;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
}

.nav-logo-img {
    height: 44px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-actions-desktop {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 桌面端：横向链接组 */
.nav-links-desktop {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 汉堡按钮：默认隐藏（仅窄屏显示） */
/* 窄屏顶栏左侧：汉堡（桌面端隐藏） */
.nav-mobile-leading {
    display: none;
    flex-shrink: 0;
    align-items: center;
}

.nav-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    z-index: 10002;
}

.nav-menu-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.generate-page .nav-menu-toggle {
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.8);
}

.nav-menu-toggle[aria-expanded="true"] .nav-menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-menu-toggle[aria-expanded="true"] .nav-menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-menu-toggle[aria-expanded="true"] .nav-menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 抽屉：默认隐藏（宽屏） */
.nav-drawer-backdrop,
.nav-drawer {
    display: none;
}

.nav-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    z-index: 10001;
    width: min(88vw, 320px);
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(18, 18, 22, 0.98);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-drawer.is-open {
    display: flex;
    transform: translateX(0);
}

.nav-drawer-inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.nav-drawer-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.nav-drawer-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-drawer-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(255, 255, 255, 0.92);
}

.nav-drawer-item-icon-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.nav-drawer-row-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
    text-align: left;
}

.nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.78rem 0.95rem;
    min-height: 50px;
    border-radius: 10px;
    color: #fff !important;
    text-decoration: none;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
}

.nav-drawer-link:hover,
.nav-drawer-link.active {
    background: rgba(255, 255, 255, 0.12);
}

.nav-drawer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    padding: 0.78rem 0.95rem;
    min-height: 50px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

a.nav-drawer-row {
    text-decoration: none;
}

.nav-drawer-row .upgrade-text {
    color: #fff;
}

.nav-drawer-entry-text {
    font: 500 0.95rem/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #fff;
}

.nav-drawer-body .nav-drawer-entry-text {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-weight: 500 !important;
}

.nav-drawer-row,
.nav-drawer-link {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#messageCenterBtnDrawer .nav-drawer-row-label {
    font-weight: 500;
}

#messageCenterBtnDrawer {
    width: 100%;
    height: auto;
    min-height: 50px;
    margin-right: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    background-image: none;
    justify-content: space-between;
    padding: 0.78rem 0.95rem;
}

#messageCenterBtnDrawer:hover {
    background: rgba(255, 255, 255, 0.12);
    background-image: none;
}

body.nav-drawer-open .nav-menu-toggle {
    opacity: 0;
    pointer-events: none;
}

.nav-drawer-row .message-badge,
.nav-drawer .message-badge--drawer {
    position: static;
}

.nav-drawer-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0.75rem 0 0.35rem;
    padding: 0 0.25rem;
}

.nav-drawer-language-select-wrap {
    width: 100%;
}

.nav-drawer-language-select {
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    outline: none;
}

.nav-drawer-language-select option {
    color: #111827;
}

.nav-drawer-auth {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.nav-drawer-auth .top-login-btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
}

.nav-drawer-avatar {
    display: block;
}

/* 移动端：抽屉/用户菜单打开时锁定页面滚动（配合 api.js lockAppScroll） */
html.app-scroll-locked,
body.app-scroll-locked {
    overflow: hidden !important;
    touch-action: none;
    height: 100%;
}

body.app-scroll-locked {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

@media (min-width: 769px) {
    .nav-drawer,
    .nav-drawer-backdrop {
        display: none !important;
    }

    .nav-menu-toggle {
        display: none !important;
    }

    body.nav-drawer-open {
        overflow: auto;
    }
}

@media (max-width: 768px) {
    .nav-mobile-leading {
        display: flex;
    }

    .nav-menu-toggle {
        display: flex;
    }

    .nav-links-desktop,
    .nav-actions-desktop {
        display: none !important;
    }

    .nav-credits-slot {
        display: none !important;
    }

    .nav-right {
        min-width: 44px;
        justify-content: flex-end;
        flex-shrink: 0;
    }

    .nav-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .nav-left {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
    }

    .nav-logo-img {
        max-width: min(160px, 42vw);
    }

    .nav-drawer-backdrop {
        display: block;
        pointer-events: none;
        opacity: 0;
    }

    .nav-drawer-backdrop.is-open {
        pointer-events: auto;
        opacity: 1;
    }

    .nav-drawer {
        display: flex;
        transform: translateX(-100%);
        pointer-events: none;
    }

    .nav-drawer.is-open {
        transform: translateX(0);
        pointer-events: auto;
    }
}

.nav-link {
    color: #ffffff !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.95rem;
    line-height: 1.25;
    box-sizing: border-box;
    height: 36px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
}

.top-nav .logo h2 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #ffffff !important;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

/* 无内联导航的旧页：nav fetch 完成前避免顶栏区域塌陷 */
#site-nav-container:empty {
    min-height: 56px;
}

/* 主内容区域 */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 背景切换：两层叠在内容背后，铺满区域作为背景 */
.bg-container {
    position: absolute;
    inset: 0;
    min-height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.upper-module > *:not(.bg-container) {
    position: relative;
    z-index: 1;
}

.bg-layer {
    position: absolute;
    inset: 0;
    min-height: 100vh;
    background-color: #1a0a0a;
    transition: opacity 1s ease;
    pointer-events: none;
}

.bg-layer-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.bg-current {
    opacity: 1;
}

.bg-next {
    opacity: 0;
}

/* 上边模块容器（包含顶部标题、生成卡片和预览区域） */
.upper-module {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 0;
    padding: 0;
    padding-top: 6rem; /* 顶部留出空间给固定导航栏 */
    padding-bottom: 2rem; /* 减少底部边距，使内容能完整显示 */
    min-height: 100vh;
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

/* 上边模块内容容器，保持与 main-content 一致的最大宽度 */
.upper-module-content {
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* 允许内容自然撑高父容器，由页面整体滚动 */
    flex: 1 0 auto;
    overflow-y: visible;
    overflow-x: visible; /* 改为 visible，允许下拉菜单超出 */
    min-height: 0; /* 允许 flex 子元素缩小 */
    /* 自定义滚动条样式（可选） */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.upper-module-content::-webkit-scrollbar {
    width: 6px;
}

.upper-module-content::-webkit-scrollbar-track {
    background: transparent;
}

.upper-module-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.upper-module-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 添加半透明遮罩层，确保内容可读性（在背景之上） */
.upper-module::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 85%, rgba(0,0,0,1) 100%);
    z-index: 1;
    pointer-events: none;
}

.upper-module > *:not(.bg-container) {
    position: relative;
    z-index: 1;
}

/* 生成卡片 */
.generate-card {
    background: #F1EAD6; /* 护眼背景 */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: visible; /* 改为 visible，允许下拉菜单显示 */
    /* 移除 transition，避免切换模式时的动画效果 */
    width: 1050px; /* 固定宽度，不跟随内容变化 */
    max-width: 100%; /* 在小屏幕上允许缩小 */
    min-width: 0; /* 窄屏下可被父级约束，避免子项 min-content 撑破布局 */
    box-sizing: border-box;
    /* 确保卡片布局稳定，不会因为内容变化而影响其他元素 */
    min-height: 400px; /* 设置最小高度，避免高度变化过大 */
}



/* 模式选择标签 */
.mode-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    background: transparent;
    padding: 0;
    border: none;
    justify-content: flex-start;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.mode-tabs::-webkit-scrollbar {
    height: 5px;
}

.mode-tabs::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.22);
    border-radius: 999px;
}

.mode-tab {
    flex-shrink: 0;
    width: auto;
    padding: 0.5rem 0;
    border: none;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: #4b5563;
    position: relative;
    white-space: nowrap;
}

.mode-tab.active {
    background: transparent;
    color: #000;
    font-weight: 700;
    box-shadow: none;
}

.mode-tab:not(.active):hover {
    background: transparent;
    color: #666;
}

/* 提示词和上传区域容器 */
.prompt-and-upload-wrapper {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    /* 始终保持 flex 布局，避免切换时布局重排 */
    /* 禁用过渡动画，避免布局变化时的动画效果 */
    transition: none;
}

/* 图片上传容器（仅图生图模式显示） */
.source-image-upload-container {
    flex: 0 0 22.5%;
    position: relative;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
    /* 禁用过渡动画，避免显示/隐藏时的动画效果 */
    transition: none;
    /* 隐藏时使用 display: none，但保持 flex 布局稳定 */
}

/* 上传区域 */
.source-image-upload-area {
    width: 100%;
    min-height: 160px;
    height: 100%;
    border: 2px dashed rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 1rem 0.75rem;
    box-sizing: border-box;
}

.source-image-upload-container.has-thumbnails .source-image-upload-area {
    min-height: 112px;
    padding: 0.75rem 0.6rem;
}

.source-image-upload-area:hover {
    border-color: rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.08);
}

.source-image-upload-area.drag-over {
    border-color: rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.12);
}

.upload-icon-wrapper {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
}

.upload-icon-svg {
    width: 100%;
    height: 100%;
}

.source-image-upload-area .upload-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #000000;
    margin: 0;
}

.source-image-upload-area .upload-hint {
    font-size: 0.75rem;
    color: #000000;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

/* 提示词输入区域 */
.prompt-group {
    flex: 1;
    min-width: 0; /* 防止 flex 子元素溢出 */
    transition: none; /* 禁用过渡动画，避免布局变化 */
    /* flex: 1 会自动计算宽度，不需要设置 width */
}

/* 文生图模式时，上传容器隐藏，提示词输入框自动占满空间 */
.prompt-and-upload-wrapper:not(.has-upload) .source-image-upload-container {
    display: none !important;
    flex: 0 0 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
}

/* 确保提示词输入框在文生图模式下占满全宽 */
.prompt-and-upload-wrapper:not(.has-upload) .prompt-group {
    flex: 1 1 100%;
    max-width: 100%;
}

/* 手机端图生图：上为上传区、下为提示词（DOM 顺序已如此，仅改横向 flex 为纵向） */
@media (max-width: 768px) {
    .prompt-and-upload-wrapper.has-upload {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .prompt-and-upload-wrapper.has-upload .source-image-upload-container {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-height: 0;
    }

    .prompt-and-upload-wrapper.has-upload .prompt-group {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    /* 手机端图生图上传入口：缩小体积，保留核心提示 */
    .prompt-and-upload-wrapper.has-upload .source-image-upload-area {
        min-height: 112px;
        border-radius: 12px;
        gap: 0.35rem;
        padding: 0.65rem 0.6rem;
    }

    .prompt-and-upload-wrapper.has-upload .upload-icon-wrapper {
        width: 24px;
        height: 24px;
    }

    .prompt-and-upload-wrapper.has-upload .source-image-upload-area .upload-text {
        font-size: 0.82rem;
        font-weight: 600;
    }

    .prompt-and-upload-wrapper.has-upload .source-image-upload-area .upload-hint {
        display: none;
    }
}

.source-image-preview {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.08);
}

.source-image-preview img {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}


.source-image-thumbnails {
    display: none;
    gap: 0.375rem;
    padding: 0.5rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
}

.source-image-upload-container.has-thumbnails .source-image-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, 44px);
}

.mask-editor-section {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
    transition: opacity 160ms ease, transform 160ms ease;
}

.mask-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.1rem 0.55rem 0.1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.mask-editor-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.mask-editor-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mask-editor-body {
    padding: 0.7rem 0 0.55rem 0;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mask-editor-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.6rem 0.1rem 0.15rem 0.1rem;
    flex: 0 0 auto;
}

.mask-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.mask-brush-label {
    font-size: 0.76rem;
    color: #334155;
    min-width: 36px;
}

.mask-editor-toolbar input[type="range"] {
    flex: 1;
    min-width: 120px;
}

.mask-brush-value {
    font-size: 0.75rem;
    color: #475569;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
}

.mask-tool-btn {
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    padding: 0.44rem 0.62rem;
    min-height: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.mask-tool-btn:hover {
    background: #eef2ff;
    border-color: rgba(59, 130, 246, 0.45);
}

.mask-tool-btn.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.mask-tool-btn:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.35);
    cursor: not-allowed;
}

.mask-history-btn {
    width: 40px;
    min-width: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mask-history-icon {
    width: 22px;
    height: 22px;
    color: #cbd5e1;
}

.mask-history-btn:not(:disabled) .mask-history-icon {
    color: #94a3b8;
}

.mask-history-btn:hover:not(:disabled) .mask-history-icon {
    color: #64748b;
}

.mask-pan-btn {
    width: 40px;
    min-width: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mask-pan-icon {
    width: 20px;
    height: 20px;
    color: #94a3b8;
}

.mask-pan-btn:hover:not(:disabled) .mask-pan-icon {
    color: #64748b;
}

.mask-pan-btn.active .mask-pan-icon {
    color: #ffffff;
}

.mask-primary-btn {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.mask-primary-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.mask-editor-stage {
    position: relative;
    width: 100%;
    min-height: 160px;
    height: min(60vh, calc(100vh - 340px));
    max-height: calc(100vh - 340px);
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #0b1120 0%, #1e293b 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mask-editor-pan-zoom {
    position: relative;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    will-change: transform;
}

.mask-editor-pan-zoom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.mask-editor-pan-zoom canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
    cursor: crosshair;
}

.mask-brush-preview {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
}

.mask-brush-preview.is-visible {
    opacity: 1;
}

.mask-brush-preview-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: block;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1.5px solid rgba(34, 197, 94, 0.95);
    background: rgba(34, 197, 94, 0.24);
}

.mask-brush-preview-dot.is-eraser {
    border-color: rgba(245, 158, 11, 0.95);
    background: rgba(245, 158, 11, 0.24);
}

.mask-toolbar-sep {
    width: 1px;
    min-width: 1px;
    align-self: stretch;
    margin: 0 0.15rem;
    background: rgba(148, 163, 184, 0.45);
}

.mask-zoom-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    font-variant-numeric: tabular-nums;
    min-width: 44px;
    text-align: center;
}

.mask-editor-tip {
    font-size: 0.74rem;
    color: #475569;
    line-height: 1.4;
    margin-top: 0.48rem;
}

.mask-editor-notice {
    margin-top: 0.38rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #0f766e;
}

.mask-editor-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    z-index: 210000;
    backdrop-filter: blur(1.5px);
}

.mask-editor-section.is-open {
    position: fixed;
    left: 50%;
    top: calc(50% + 20px);
    transform: translate(-50%, -50%);
    width: min(920px, calc(100vw - 28px), calc((100vh - 170px) * 1.32));
    max-height: calc(100vh - 108px);
    overflow: hidden;
    background: #ffffff;
    border-radius: 14px;
    padding: 0.8rem;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.28), 0 0 0 1px rgba(148, 163, 184, 0.22);
    z-index: 210010;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .mask-editor-section.is-open {
        width: calc(100vw - 18px);
        top: calc(50% + 14px);
        max-height: calc(100vh - 92px);
        padding: 0.6rem;
        border-radius: 12px;
    }

    .mask-editor-toolbar {
        gap: 0.42rem;
    }

    .mask-editor-stage {
        min-height: 120px;
        height: min(52vh, calc(100vh - 320px));
        max-height: calc(100vh - 320px);
    }

    .mask-editor-actions .mask-tool-btn,
    .mask-editor-toolbar .mask-tool-btn {
        min-height: 40px;
        padding: 0.42rem 0.56rem;
    }
}

.source-image-thumb-item {
    position: relative;
    width: 100%;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.source-image-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.source-image-thumb-remove {
    position: absolute;
    right: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    background: rgba(239, 68, 68, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}


/* 生成类型标签 */
.type-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.type-tab {
    padding: 0.5rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.type-tab.active {
    background: #333;
    color: white;
    border-color: #333;
}

.type-tab:hover {
    border-color: #999;
}

/* 提示词输入 */
.prompt-group {
    margin-bottom: 2rem;
    position: relative;
}

.prompt-input {
    width: 100%;
    padding: 1.75rem 1.5rem;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    resize: none; /* 禁止拖动调整大小 */
    min-height: 160px;
    /* 移除 transition，避免切换模式时的动画效果 */
    background: transparent;
    color: #333;
    line-height: 1.6;
    box-shadow: none;
}

.prompt-input::placeholder {
    color: #4b5563;
    font-style: italic;
}

.prompt-input:focus {
    outline: none;
    border: none;
    background: transparent;
    box-shadow: none;
    transform: none;
}

/* 模型选择容器 */
.model-selection-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
}

.model-list-sidebar {
    background: #1a1a1a;
}

.model-list-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #333;
}

/* 模型选择组 */
.model-select-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.select-label {
    color: #aaa;
    font-size: 0.85rem;
    font-weight: 500;
}

.model-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #333;
    border-radius: 8px;
    background: #252525;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.model-select:hover {
    border-color: #444;
    background-color: #2a2a2a;
}

.model-select:focus {
    outline: none;
    border-color: #10b981;
    background-color: #2a2a2a;
}

.model-select option {
    background: #252525;
    color: #fff;
    padding: 0.5rem;
}

.tag-new {
    background: #ef4444;
    color: #fff;
}

.tag-hot {
    background: #10b981;
    color: #fff;
}

/* 模型详情卡片 */
.model-detail-card {
    background: #1a1a1a;
}

.model-detail-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #333;
}

.model-detail-content {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #333;
}

.model-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

.model-detail-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #4a5568;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.model-detail-info {
    flex: 1;
}

.model-detail-name-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.model-detail-name {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
}

.model-detail-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.model-detail-desc {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.model-detail-credits {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #aaa;
    font-size: 0.85rem;
}

.credits-icon {
    font-size: 1rem;
}

.model-selected-indicator {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

/* 选项行 */
.options-row {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 改为左对齐，选项少时左靠齐显示 */
    gap: 0.25rem;
    /* 当页面变窄时允许换行，避免被卡片的 overflow:hidden 裁剪掉 */
    flex-wrap: wrap;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
}

.options-container {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5rem;
    row-gap: 0.65rem;
    flex: 0 0 auto; /* 改为不自动扩展，保持内容宽度 */
    min-width: 0;
    justify-content: flex-start; /* 确保左对齐 */
}

.option-item {
    position: relative;
    width: 180px;
    min-width: 180px;
    max-width: 220px;
}

/* style、aspectRatio、count、quantity 选择项使用固定较小宽度 */
.option-item:nth-child(2),
.option-item:nth-child(3),
.option-item:nth-child(4),
.option-item:nth-child(5) {
    width: 140px;
    min-width: 140px;
    max-width: 160px;
}

#style,
#aspectRatio,
#count,
#quantity {
    width: 100%;
}

/* 比例选择器自定义下拉菜单 */
.aspect-ratio-dropdown {
    position: relative;
    width: 100%;
    z-index: 10001; /* 确保在 upper-module-content 之上 */
}

.aspect-ratio-selected {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: none;
}

.aspect-ratio-selected:hover {
    background: #e8e8e8;
}

.aspect-ratio-selected-text {
    flex: 1;
}

.aspect-ratio-arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    font-size: 0;
    overflow: hidden;
    transition: transform 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.aspect-ratio-dropdown.open .aspect-ratio-arrow {
    transform: rotate(180deg);
}

.aspect-ratio-menu {
    position: fixed; /* 改为 fixed，避免被父容器裁剪 */
    background: #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    flex-direction: column;
    max-height: 400px;
    overflow: hidden;
    min-width: 140px; /* 确保最小宽度 */
    width: auto; /* 宽度自适应 */
}

/* 菜单显示由 JavaScript 控制 */

.aspect-ratio-menu-header {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.aspect-ratio-menu-list {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
    padding: 8px 0;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.aspect-ratio-menu-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.aspect-ratio-option {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    color: #ffffff;
    font-size: 0.85rem;
}

.aspect-ratio-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.aspect-ratio-option.selected {
    background: rgba(255, 255, 255, 0.15);
}

.aspect-ratio-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aspect-ratio-option.selected .aspect-ratio-checkbox {
    border-color: #ffffff;
    background: #ffffff;
}

.aspect-ratio-text {
    flex: 1;
}

.aspect-ratio-checkmark {
    display: none;
    color: #2a2a2a;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 8px;
}

.aspect-ratio-option.selected .aspect-ratio-checkmark {
    display: block;
}

.aspect-ratio-menu-footer {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    font-size: 0.85rem;
}

.aspect-ratio-footer-text {
    flex: 1;
}

.aspect-ratio-footer-arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    font-size: 0;
    overflow: hidden;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.6;
}

.option-item label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.option-select {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
    padding-right: 2rem;
    box-shadow: none;
}

.option-select:hover {
    background: #e8e8e8;
    box-shadow: none;
    transform: none;
}

.option-select:focus {
    outline: none;
    border: none;
    background: #e8e8e8;
    box-shadow: none;
    transform: none;
}

/* 生成页选择框主题变量（自定义下拉统一读取） */
body.generate-page {
    /* 触发器（选择框按钮）的背景/文字（面板面板文字使用 --select-text） */
    --select-trigger-bg: #f5f5f5;
    --select-trigger-bg-hover: #e8e8e8;
    --select-trigger-bg-focus: #e0e0e0;
    --select-trigger-text: #2f3642;
    --select-trigger-arrow: #4f5a6a;

    --select-bg: #252a33;
    --select-bg-hover: #2c323d;
    --select-bg-focus: #333a47;
    --select-text: rgba(240, 245, 255, 0.95);
    --select-arrow: rgba(214, 224, 240, 0.92);
    --select-panel-bg: rgba(20, 24, 36, 0.96);
    --select-panel-border: rgba(255, 255, 255, 0.14);
    --select-panel-header-bg: rgba(20, 24, 36, 0.98);
    --select-panel-header-label: rgba(255, 255, 255, 0.66);
    --select-option-hover: rgba(255, 255, 255, 0.1);
    --select-option-selected: rgba(255, 255, 255, 0.16);
    --select-check: #9be38f;
    --select-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* 移动端模型选择：自定义下拉（解决原生选项超屏） */
.mobile-custom-select {
    display: block;
    width: 100%;
}

.mobile-custom-select-trigger {
    width: 100%;
    min-height: 42px;
    border: none;
    border-radius: 12px;
    background: var(--select-trigger-bg);
    color: var(--select-trigger-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    text-align: left;
    font-size: 0.85rem;
    cursor: pointer;
}

.mobile-custom-select-trigger:hover {
    background: var(--select-trigger-bg-hover);
}

.mobile-custom-select-trigger:focus {
    outline: none;
    background: var(--select-trigger-bg-focus);
}

.mobile-custom-select-value {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-custom-select-arrow {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-right: 2px solid var(--select-trigger-arrow);
    border-bottom: 2px solid var(--select-trigger-arrow);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-right: 2px;
}

.mobile-custom-select.is-open .mobile-custom-select-arrow {
    transform: rotate(-135deg);
}

.mobile-custom-select-panel {
    display: none;
    position: fixed;
    z-index: 20050;
    border-radius: 12px;
    border: 1px solid var(--select-panel-border);
    background: var(--select-panel-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--select-shadow);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.35rem;
    pointer-events: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.mobile-custom-select-panel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.mobile-custom-select-panel-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.55rem 0.5rem;
    margin: -0.35rem -0.35rem 0.35rem;
    background: var(--select-panel-header-bg);
    border-bottom: 1px solid var(--select-panel-border);
}

.mobile-custom-select-panel-header-label {
    font-size: 0.72rem;
    color: var(--select-panel-header-label);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.mobile-custom-select-panel-header-value {
    min-width: 0;
    font-size: 0.83rem;
    color: var(--select-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-custom-select-option {
    width: 100%;
    min-height: 42px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--select-text);
    text-align: left;
    padding: 0.55rem 0.65rem;
    font-size: 0.88rem;
    line-height: 1.3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.mobile-custom-select-option-text {
    min-width: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.mobile-custom-select-option-check {
    opacity: 0;
    font-size: 0.82rem;
    line-height: 1;
    color: var(--select-check);
    flex-shrink: 0;
}

.mobile-custom-select-option:hover,
.mobile-custom-select-option.is-selected {
    background: var(--select-option-hover);
}

.mobile-custom-select-option.is-selected .mobile-custom-select-option-check {
    opacity: 1;
}

.mobile-custom-select-option.is-selected {
    background: var(--select-option-selected);
}

/* 比例选择器自定义下拉菜单（带比例预览框） */
.aspect-ratio-select-wrapper {
    position: relative;
    width: 100%;
}

.aspect-ratio-select-display {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: none;
}

.aspect-ratio-select-display:hover {
    background: #e8e8e8;
}

.aspect-ratio-preview {
    width: 20px;
    height: 20px;
    border: 1px solid #999;
    background: #fff;
    flex-shrink: 0;
    aspect-ratio: 3/4;
}

.aspect-ratio-display-text {
    flex: 1;
}

.aspect-ratio-arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    font-size: 0;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.aspect-ratio-select-wrapper.open .aspect-ratio-arrow {
    transform: rotate(180deg);
}

.aspect-ratio-select-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 0;
    /* 位置由 JavaScript 动态设置 */
}

.aspect-ratio-select-dropdown.show-below {
    top: calc(100% + 4px);
    bottom: auto;
}

.aspect-ratio-select-dropdown.show-above {
    bottom: calc(100% + 4px);
    top: auto;
}

.aspect-ratio-select-wrapper.open .aspect-ratio-select-dropdown {
    display: block;
}

.aspect-ratio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333;
    font-size: 0.85rem;
}

.aspect-ratio-option:hover {
    background: #f5f5f5;
}

.aspect-ratio-option.selected {
    background: #e8e8e8;
}

.aspect-ratio-preview-box {
    width: 20px;
    height: 20px;
    border: 1px solid #999;
    background: #fff;
    flex-shrink: 0;
    display: block;
}

.aspect-ratio-option-text {
    flex: 1;
}

/* 公众可见开关 */
.public-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: nowrap;
    margin-left: auto; /* 确保在选项少时仍然保持在右侧 */
}

.public-toggle-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.public-toggle-hint-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #374151;
    cursor: help;
    opacity: 0.88;
}

.public-toggle-hint-btn:hover,
.public-toggle-hint-btn:focus-visible,
.public-toggle-hint-btn[aria-expanded="true"] {
    opacity: 1;
}

.public-toggle-hint-btn:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 2px;
}

.public-toggle-hint-icon {
    display: block;
    width: 16px;
    height: 16px;
}

.public-toggle-hint-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20040;
    width: max-content;
    max-width: min(16.5rem, calc(100vw - 1.5rem));
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: #1a1f2e;
    color: #f3f4f6;
    font-size: 0.8rem;
    line-height: 1.4;
    font-weight: 400;
    text-align: left;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.public-toggle-hint-tooltip::before {
    content: "";
    position: absolute;
    top: -4px;
    right: 9px;
    width: 8px;
    height: 8px;
    background: #1a1f2e;
    transform: rotate(45deg);
}

.public-toggle-hint:hover .public-toggle-hint-tooltip,
.public-toggle-hint:focus-within .public-toggle-hint-tooltip,
.public-toggle-hint-btn[aria-expanded="true"] + .public-toggle-hint-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .public-toggle-hint-tooltip {
        transition: none;
    }
}

.public-toggle-label {
    font-size: 0.9rem;
    color: #374151;
    white-space: nowrap;
}

.public-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.public-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.public-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.public-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.public-toggle input:checked + .toggle-slider {
    background-color: #4CAF50;
}

.public-toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 表单底部 */
.form-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-top: 2rem;
    border-top: 1px solid #e8e8e8;
    margin-top: 2rem;
}

/* 建议区域 */
.suggestions-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 300px;
}

.refresh-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.suggestion-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.suggestion-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

/* 提示模板区域和生成按钮行 */
.prompt-templates-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    width: 100%;
    justify-content: space-between;
}

.refresh-templates-btn {
    background: rgba(0, 0, 0, 0.35);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.refresh-templates-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: rotate(180deg);
}

.refresh-templates-btn .refresh-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.3s;
}

.refresh-icon-svg {
    width: 20px;
    height: 20px;
    display: block;
    margin: 0;
    padding: 0;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.prompt-templates-container {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0; /* 允许flex项目收缩 */
}

.prompt-templates-row .generate-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-left: auto;
}

.prompt-template-item {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.prompt-template-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.prompt-template-item:active {
    transform: translateY(0);
}

/* 生成按钮行 */
.generate-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 1rem;
    width: 100%;
}

/* 生成操作区 */
.generate-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    min-width: 0;
}

.credits-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.875rem;
    color: #666;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}

.credits-display strong {
    color: #6F1D63;
    font-weight: 700;
    font-size: 1.1rem;
}

.current-credits {
    font-size: 0.8rem;
    color: #999;
}

.generate-btn {
    padding: 0.75rem 1.5rem;
    /* 白字按钮底色须 ≥4.5:1（#667eea 仅约 3.7:1） */
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem; 
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 12px rgba(111, 29, 99, 0.25),
        0 2px 4px rgba(111, 29, 99, 0.15);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
    white-space: nowrap;
    min-width: 180px;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.generate-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(111, 29, 99, 0.3),
        0 3px 8px rgba(111, 29, 99, 0.2);
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(111, 29, 99, 0.25),
        0 1px 3px rgba(111, 29, 99, 0.15);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #999;
    box-shadow: none;
}


/* 预览卡片 */
.preview-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(30px);
    border-radius: 28px;
    padding: 3rem;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6F1D63 0%, #FFD700 50%, #6F1D63 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

.preview-card:hover {
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.preview-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #333;
    position: relative;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    letter-spacing: 0.5px;
}

.preview-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #6F1D63 0%, #FFD700 100%);
}

.preview-content {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e0e0e0;
    border-radius: 16px;
    padding: 3rem;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    transition: all 0.3s ease;
}

.preview-content:hover {
    border-color: #6F1D63;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    box-shadow: inset 0 2px 8px rgba(111, 29, 99, 0.05);
}

.preview-content .placeholder {
    color: #999;
    text-align: center;
    font-size: 1rem;
    font-style: italic;
}

.preview-content img {
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.preview-content img:hover {
    transform: scale(1.02);
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.2),
        0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 首屏以下大段：减少离屏布局/绘制成本（移动 PageSpeed / Speed Index） */
.home-mode-spotlights,
.home-audience,
.home-showcase--workflow,
.public-images-section,
.faq-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
}

/* 首页：图片广场上方 — 功能与使用说明（深色展示带） */
.home-showcase {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 3rem 1.25rem 3.25rem;
    background: linear-gradient(180deg, #0a0c12 0%, #050508 45%, #000000 100%);
    color: #e5e7eb;
    box-sizing: border-box;
}

.home-showcase--intro {
    padding-bottom: 2.5rem;
}

.home-showcase--intro .home-showcase-cards {
    margin-bottom: 0;
}

.home-showcase--workflow {
    padding-top: 2.75rem;
    padding-bottom: 3.25rem;
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* 首页：适用人群（简单流程上方） */
.home-audience {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 2.75rem 1.25rem 2.5rem;
    background: #0a0c12;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    box-sizing: border-box;
}

.home-audience-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.home-audience-kicker {
    margin: 0 0 0.65rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #94a3b8;
}

.home-audience-heading {
    margin: 0 0 1rem;
    text-align: center;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #fafafa;
}

.home-audience-lead {
    max-width: 42rem;
    margin: 0 auto 2.25rem;
    text-align: center;
    font-size: 1.02rem;
    line-height: 1.65;
    color: #94a3b8;
}

.home-audience-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.home-audience-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem 1.35rem 1.4rem;
    border-radius: 14px;
    background: #111114;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.home-audience-card-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.3;
    color: #fafafa;
}

.home-audience-card-desc {
    flex: 1 1 auto;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #a1a1aa;
}

.home-audience-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.15rem;
}

.home-audience-tag {
    display: inline-block;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #c084fc;
    background: #1e1b4b;
    border: 1px solid rgba(192, 132, 252, 0.12);
}

@media (max-width: 900px) {
    .home-audience-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .home-audience-grid {
        grid-template-columns: 1fr;
    }
}

.home-showcase-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.home-showcase-kicker {
    margin: 0 0 0.65rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #94a3b8;
}

.home-showcase-heading {
    margin: 0 0 1rem;
    text-align: center;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #fafafa;
}

.home-showcase-heading-grad {
    display: inline;
    color: #e879f9;
}

.home-showcase-lead {
    max-width: 52rem;
    margin: 0 auto 2.25rem;
    text-align: center;
    font-size: 1.02rem;
    line-height: 1.65;
    color: #94a3b8;
}

.home-showcase-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.home-showcase-card {
    position: relative;
    display: block;
    min-height: 260px;
    border-radius: 22px;
    overflow: hidden;
    text-decoration: none;
    color: #fafafa;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-showcase-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.55);
}

.home-showcase-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
    transition: transform 0.4s ease;
}

.home-showcase-card:hover .home-showcase-card-bg {
    transform: scale(1.06);
}

.home-showcase-card-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 8, 15, 0.1) 0%, rgba(5, 8, 15, 0.55) 55%, rgba(5, 8, 15, 0.92) 100%);
    pointer-events: none;
}

.home-showcase-card-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.35rem 1.35rem 1.5rem;
    z-index: 1;
}

.home-showcase-card-title {
    margin: 0 0 0.45rem;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.25;
    color: #fafafa;
}

.home-showcase-card-desc {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(248, 250, 252, 0.88);
}

.home-showcase-steps-kicker {
    margin: 0 0 0.6rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #94a3b8;
}

.home-showcase-steps-heading {
    margin: 0 0 1.75rem;
    text-align: center;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 800;
    line-height: 1.25;
    color: #fafafa;
}

.home-showcase-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.home-showcase-step {
    position: relative;
    padding: 1.85rem 0.9rem 1.15rem;
    text-align: center;
    border-radius: 16px;
    background: rgba(18, 22, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.home-showcase-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    margin: 0 auto 0.65rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    color: #fafafa;
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    box-shadow: 0 6px 18px rgba(147, 51, 234, 0.35);
}

.home-showcase-step-title {
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: #f8fafc;
}

.home-showcase-step-desc {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #94a3b8;
}

.home-showcase-cta-wrap {
    text-align: center;
}

.home-showcase-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 11rem;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    color: #0a0a0a;
    text-decoration: none;
    background: linear-gradient(90deg, #bef264 0%, #d9f99d 50%, #a3e635 100%);
    box-shadow: 0 10px 28px rgba(190, 246, 100, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-showcase-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(190, 246, 100, 0.45);
}

@media (max-width: 900px) {
    .home-showcase-cards {
        grid-template-columns: 1fr;
    }

    .home-showcase-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .home-showcase-steps {
        grid-template-columns: 1fr;
    }

    .home-showcase-card {
        min-height: 220px;
    }
}

/* 文生图 / 图生图 说明（图片广场上方） */
.home-mode-spotlights {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 0 1.25rem 2.5rem;
    background: #000000;
}

.home-mode-spotlights-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.home-mode-panel {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    padding: clamp(1.35rem, 2.5vw, 2rem) clamp(1.25rem, 2.5vw, 2.25rem);
    border-radius: 22px;
    background: linear-gradient(165deg, #141820 0%, #0f1218 55%, #0c0e12 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.home-mode-panel--reverse {
    flex-direction: row-reverse;
}

.home-mode-panel-copy {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
}

.home-mode-panel-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.6vw, 1.85rem);
    font-weight: 800;
    line-height: 1.2;
    color: #fafafa;
}

.home-mode-panel-desc {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #94a3b8;
}

.home-mode-panel-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.35rem;
    padding: 0.72rem 1.45rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0a0a0a;
    text-decoration: none;
    background: linear-gradient(90deg, #bef264 0%, #d9f99d 50%, #a3e635 100%);
    box-shadow: 0 8px 22px rgba(190, 246, 100, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-mode-panel-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(190, 246, 100, 0.38);
}

.home-mode-panel-visual {
    flex: 0 1 38%;
    max-width: 340px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.home-mode-panel-img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(360px, 38vh);
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.home-mode-panel-img--t2i {
    aspect-ratio: 682 / 1024;
}

.home-mode-panel-img--i2i {
    aspect-ratio: 747 / 1024;
}

.home-mode-panel-img--ui {
    aspect-ratio: auto;
    max-width: min(640px, 100%);
    max-height: min(380px, 52vw);
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    background: rgba(6, 8, 12, 0.5);
}

@media (max-width: 820px) {
    .home-mode-panel,
    .home-mode-panel--reverse {
        flex-direction: column;
        align-items: stretch;
    }

    /* 三张卡同一顺序：图片 → 文案 → 按钮（含 reverse，避免左右交替） */
    .home-mode-panel-visual,
    .home-mode-panel--reverse .home-mode-panel-visual {
        order: -1;
        flex: 1 1 auto;
        max-width: none;
        width: 100%;
        justify-content: flex-start;
        align-self: stretch;
    }

    .home-mode-panel-copy {
        order: 0;
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    .home-mode-panel-cta {
        align-self: flex-start;
    }

    .home-mode-panel-img,
    .home-mode-panel-img:not(.home-mode-panel-img--ui) {
        width: 100%;
        max-width: 100%;
        max-height: min(420px, 72vw);
        margin-left: 0;
        margin-right: 0;
        object-fit: contain;
        object-position: left center;
    }

    .home-mode-panel-img--ui {
        max-height: none;
        width: 100%;
        max-width: 100%;
        object-position: left center;
    }
}

/* 图片广场区域 */
.public-images-section {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 0;
    padding: 2rem;
    background: #000000;
    /* 上方渐变过渡效果 */
    padding-top: 4rem;
}

/* 图片广场上方渐变过渡 */
.public-images-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4rem;
    background: linear-gradient(to bottom, 
        transparent 0%,
        rgba(0, 0, 0, 0.3) 30%,
        rgba(0, 0, 0, 0.6) 60%,
        rgba(0, 0, 0, 0.9) 85%,
        #000000 100%
    );
    pointer-events: none;
    z-index: 1;
}

.public-images-section .section-title {
    position: relative;
    z-index: 2;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-align: center;
}

.public-images-section > p {
    position: relative;
    z-index: 2;
    color: #e5e7eb;
    text-align: center;
    max-width: 42rem;
    margin: -0.5rem auto 1.5rem;
    line-height: 1.55;
    font-size: 0.95rem;
}

/* 图片广场独立落地页：主内容区预留顶栏高度 */
body.public-gallery-page .public-gallery-page-main {
    padding-top: 4.75rem;
}

.public-images-grid {
    position: relative;
    z-index: 2;
    margin-top: 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 0.5rem;
    min-height: 100px;
}

.public-image-item {
    position: absolute;
    background: transparent;
    border-radius: 12px;
    overflow: hidden; /* 保持 hidden，但允许绝对定位的缩略图显示 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
}

.public-image-item:hover {
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.public-image-thumbnail {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    /* 确保缩略图容器不会超出父元素 */
    contain: layout style paint;
}

.public-image-thumbnail img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.public-image-thumbnail img.loaded {
    opacity: 1;
}

.public-image-thumbnail img.error {
    opacity: 1;
    background: #f0f0f0;
}

.public-image-item:hover .public-image-thumbnail img {
    transform: scale(1.02);
}

/* 图生图原图缩略图 */
.source-image-thumbnail {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 6px;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000 !important;
    background: #fff;
    cursor: pointer;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* 确保不被其他元素遮挡 */
    pointer-events: auto !important;
}

.source-image-thumbnail:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.source-image-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

.source-image-count-badge {
    position: absolute;
    right: 0;
    top: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 0 6px 0 6px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    font-weight: 600;
    z-index: 2;
}

/* 图片加载遮罩 */
.image-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(240, 240, 240, 0.8);
    z-index: 1;
    /* 确保不遮挡原图缩略图 */
    pointer-events: none;
}

.image-loading-overlay .spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6F1D63;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 加载占位符 */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #ffffff;
}

.loading-placeholder .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6F1D63;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-make-same {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.public-image-thumbnail:hover .btn-make-same {
    opacity: 1;
    visibility: visible;
}

.btn-make-same:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.btn-make-same:active {
    transform: translate(-50%, -50%) scale(0.98);
}

/* 图片广场：窄屏或无主悬停设备上始终显示「制作同款」，底部条避免遮挡主图（中间区域仍可点进详情） */
@media (max-width: 768px), (hover: none) {
    .public-image-item .public-image-thumbnail .btn-make-same {
        opacity: 1;
        visibility: visible;
        top: auto;
        bottom: max(0.45rem, env(safe-area-inset-bottom, 0px));
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        transform: none;
        padding: 0.65rem 0.85rem;
        font-size: 0.82rem;
        font-weight: 600;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        z-index: 3;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.78) 100%);
        border-color: rgba(255, 255, 255, 0.38);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
    }

    .public-image-item .public-image-thumbnail .btn-make-same:hover {
        transform: none;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0.88) 100%);
        border-color: rgba(255, 255, 255, 0.48);
    }

    .public-image-item .public-image-thumbnail .btn-make-same:active {
        transform: scale(0.98);
    }
}

.public-images-grid .loading,
.public-images-grid .error,
.public-images-grid .no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #ffffff;
}

/* 加载更多指示器 */
.load-more-indicator {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 0.5rem;
}

.load-more-indicator p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* 加载更多指示器 */
.load-more-indicator {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 0.5rem;
}

.load-more-indicator p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* 图片广场：加载更多按钮 */
.load-more-wrap {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem 0;
}
.load-more-btn {
    padding: 0.6rem 2rem;
    font-size: 0.95rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
a.load-more-btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}
.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}
.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 图片广场：详情弹窗 */
.image-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.25s, opacity 0.25s;
}
.image-detail-modal.is-open {
    visibility: visible;
    opacity: 1;
}
.image-detail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    cursor: pointer;
}
.image-detail-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}
.image-detail-modal.is-open .image-detail-content {
    transform: scale(1);
}
.image-detail-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.75rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, color 0.2s;
}
.image-detail-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.image-detail-body {
    padding: 1.5rem;
    overflow: auto;
    flex: 1;
    min-height: 0;
}
.image-detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #fff;
}
.image-detail-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #9d4edd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
.image-detail-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 768px) {
    .image-detail-main {
        grid-template-columns: 1fr;
    }
}
.image-detail-preview {
    border-radius: 12px;
    overflow: hidden;
    background: #0d0d14;
    aspect-ratio: 1;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-detail-preview img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.image-detail-info {
    color: #fff;
}
.image-detail-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}
.image-detail-fields {
    margin: 0 0 1rem 0;
    padding: 0;
    display: grid;
    gap: 0.5rem 1rem;
    grid-template-columns: auto 1fr;
}
.image-detail-fields dt {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}
.image-detail-fields dd {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    word-break: break-word;
}
.image-detail-prompt {
    grid-column: 1 / -1;
    max-height: 6em;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
}
.btn-make-same-in-modal {
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #6F1D63 0%, #7e22ce 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-make-same-in-modal:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}
.btn-make-same-in-modal:active {
    transform: translateY(0);
}

/* 图片广场：详情落地页 */
body.gallery-detail-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0a12 0%, #16213e 50%, #0a0a12 100%);
}
.gallery-detail-page .top-nav {
    background: rgba(0, 0, 0, 0.4);
}
.gallery-detail-main {
    max-width: 1200px; /* 放宽详情页整体宽度，让左图右详情更舒展 */
    margin: 0 auto;
    padding: 5.5rem 1rem 3rem 1rem;
    min-height: 60vh;
}
.gallery-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    transition: opacity 0.2s, background 0.2s;
}
.gallery-detail-back:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.gallery-detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #fff;
}
.gallery-detail-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #9d4edd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
.gallery-detail-error {
    text-align: center;
    padding: 3rem 2rem;
    color: #fff;
}
.gallery-detail-error .error-msg {
    margin-bottom: 1rem;
}
.gallery-detail-content {
    /* 左图右详情：使用 flex 明确两列布局 */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    flex-wrap: nowrap; /* 强制左右排列，不自动换行到下一行 */
}
/* 窄屏改为上图下详情，避免固定 420px 列宽撑出横向滚动 */
@media (max-width: 768px) {
    .gallery-detail-content {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .gallery-detail-preview-wrap {
        flex: 1 1 auto;
        max-width: 100%;
    }
}
.gallery-detail-page .gallery-detail-preview-wrap {
    width: 100%;
}
.gallery-detail-preview-wrap {
    border-radius: 16px;
    overflow: hidden;
    background: #0d0d14;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 420px; /* 再缩小详情页图片宽度 */
    margin: 0;        /* 由 flex 布局控制位置 */
    flex: 0 0 420px;  /* 左侧列固定宽度，保持左右布局 */
}
.gallery-detail-preview-wrap img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    vertical-align: top;
}
.gallery-detail-info-card {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    flex: 1 1 0; /* 右侧列自动占据剩余空间 */
}
.gallery-detail-title {
    margin: 0 0 1.25rem 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
}
.gallery-detail-fields {
    margin: 0 0 1.25rem 0;
    padding: 0;
    display: grid;
    gap: 0.5rem 1rem;
    grid-template-columns: auto 1fr;
}
.gallery-detail-fields dt {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}
.gallery-detail-fields dd {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    word-break: break-word;
}
.gallery-detail-prompt {
    grid-column: 1 / -1;
    max-height: 8em;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.45;
}
.btn-make-same-landing {
    display: block;
    width: 100%;
    padding: 0.85rem 1.5rem;
    margin-top: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #6F1D63 0%, #7e22ce 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
/* 详情页信息卡内：制作同款按钮缩小并居中 */
.gallery-detail-info-card .btn-make-same-landing {
    width: auto;
    max-width: 200px;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    margin-left: auto;
    margin-right: auto;
}
.btn-make-same-landing:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}
.btn-make-same-landing:active {
    transform: translateY(0);
}

/* AdSense: gallery UGC banner + editorial on dark detail pages */
.gallery-detail-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}
.gallery-detail-toolbar .gallery-detail-back {
    margin-bottom: 0;
    flex: 0 0 auto;
    align-self: flex-start;
    white-space: nowrap;
}
.gallery-moderation-banner[hidden],
.gallery-editorial-depth[hidden] {
    display: none !important;
}
.gallery-moderation-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 1.25rem 0 0;
    padding: 0.7rem 1rem 0.7rem 1.05rem;
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 3px solid #a78bfa;
    border-radius: 12px;
    color: #e8eaef;
    font-size: 0.875rem;
    line-height: 1.5;
}
.gallery-detail-toolbar .gallery-moderation-banner {
    flex: 1 1 0;
    min-width: 0;
}
.gallery-moderation-banner-text {
    margin: 0;
    flex: 1 1 16rem;
    color: #e8eaef;
}
.gallery-moderation-banner-text strong {
    color: #fff;
    font-weight: 650;
    margin-right: 0.25rem;
}
.gallery-moderation-banner-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    flex: 0 1 auto;
}
.gallery-moderation-banner-links a,
.gallery-moderation-banner a {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(196, 181, 253, 0.4);
    background: rgba(196, 181, 253, 0.1);
    color: #c4b5fd;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}
.gallery-moderation-banner-links a:hover,
.gallery-moderation-banner a:hover {
    color: #e9d5ff;
    border-color: rgba(233, 213, 255, 0.55);
    background: rgba(196, 181, 253, 0.18);
}
.gallery-editorial-depth {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    color: #e8eaef;
    max-width: none;
    width: 100%;
    margin: 1.75rem 0 0;
    padding: 1.5rem 1.5rem 1.65rem;
    line-height: 1.7;
}
.gallery-editorial-depth h2 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    margin: 1.45rem 0 0.7rem;
    padding: 0 0 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.gallery-editorial-depth h2:first-child {
    margin-top: 0;
}
.gallery-editorial-depth p {
    margin: 0 0 0.75rem;
    color: #e8eaef;
    font-size: 0.95rem;
}
.gallery-editorial-depth p:last-child {
    margin-bottom: 0;
}
.gallery-editorial-depth strong {
    color: #fff;
    font-weight: 650;
}
.gallery-editorial-depth a {
    color: #c4b5fd;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.gallery-editorial-depth a:hover {
    color: #e9d5ff;
}
.gallery-editorial-meta {
    list-style: none;
    margin: 0 0 0.9rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}
.gallery-editorial-meta li {
    margin: 0;
    padding: 0.7rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    min-width: 0;
}
.gallery-editorial-meta span {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #c5c9d4;
    margin-bottom: 0.25rem;
}
.gallery-editorial-meta strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    word-break: break-word;
}
.gallery-editorial-depth ol {
    list-style: none;
    counter-reset: gallery-remix;
    padding: 0;
    margin: 0.15rem 0 0.9rem;
    display: grid;
    gap: 0.55rem;
}
.gallery-editorial-depth ol li {
    counter-increment: gallery-remix;
    position: relative;
    margin: 0;
    padding: 0.75rem 0.95rem 0.75rem 2.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e8eaef;
    font-size: 0.95rem;
}
.gallery-editorial-depth ol li::before {
    content: counter(gallery-remix);
    position: absolute;
    left: 0.75rem;
    top: 0.72rem;
    width: 1.45rem;
    height: 1.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #6F1D63 0%, #7e22ce 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}
.gallery-editorial-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.55rem;
    align-items: center;
}
.gallery-editorial-links a {
    display: inline-flex;
    text-decoration: none;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(196, 181, 253, 0.4);
    background: rgba(196, 181, 253, 0.1);
    font-size: 0.82rem;
    font-weight: 600;
}
.gallery-editorial-links a:hover {
    text-decoration: none;
}
.gallery-editorial-notice {
    margin-top: 0.35rem;
    font-size: 0.86rem;
    color: #c5c9d4;
}
.gallery-editorial-notice strong {
    color: #e8eaef;
}
.gallery-detail-report a {
    color: #c4b5fd;
}
.gallery-detail-report a:hover {
    color: #e9d5ff;
}
@media (max-width: 768px) {
    .gallery-detail-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .gallery-detail-toolbar .gallery-detail-back {
        align-self: flex-start;
    }
    .gallery-editorial-meta {
        grid-template-columns: 1fr;
    }
}

/* 制作同款弹窗：展示 upper-module-content 生成表单 */
.make-same-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    min-height: 100dvh; /* 动态视口，避免移动端底部白线 */
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10002;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.25s, opacity 0.25s;
}
.make-same-modal.is-open {
    visibility: visible;
    opacity: 1;
}
.make-same-overlay {
    position: absolute;
    inset: 0;
    /* 统一使用首页样式：半透明黑色蒙版 + 模糊 */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}
/* 首页弹窗 wrapper：占满视口并用 flex 使弹窗严格水平+垂直居中 */
#makeSameModalViewportWrapper {
    min-height: 100vh;
    min-width: 100vw;
}
/* 制作同款弹窗（公共）：首页与详情页共用同一套样式，保证一致 */
.index-make-same-modal,
.detail-make-same-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}
.index-make-same-modal .make-same-overlay,
.detail-make-same-modal .make-same-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important; /* 覆盖移动端动态视口，消除底部白线 */
    /* 与首页一致：半透明黑色蒙版 + 模糊效果 */
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
}
/* 制作同款弹窗：.make-same-content 铺满全屏、蒙版半透明黑，内部表单区居中；overflow:visible 避免关闭按钮被裁切 */
.index-make-same-modal .make-same-content,
.detail-make-same-modal .make-same-content {
    position: absolute !important;
    inset: 0 !important;
    z-index: 2;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
    /* 与首页弹窗保持一致：内容层本身透明，只保留模糊效果，颜色由 overlay 提供 */
    background: transparent !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}
/* 卡片包裹层：长宽锁定为 1050×95vh，整体缩小为 90% 显示 */
.make-same-card-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 1050px;
    height: 95vh;
    max-width: 1050px;
    max-height: 95vh;
    transform: scale(0.9);
    transform-origin: center center;
    box-sizing: border-box;
}
.index-make-same-modal .make-same-content .make-same-modal-body,
.detail-make-same-modal .make-same-content .make-same-modal-body {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
}
.make-same-content {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 1050px;
    max-height: calc(100vh - 2rem);
    padding: 0 2rem;
    height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.96);
    transition: transform 0.25s ease;
    box-sizing: border-box;
    background: #F1EAD6;
    border-radius: 28px;
}
.make-same-modal.is-open .make-same-content {
    transform: scale(1);
}
.make-same-close {
    position: absolute;
    top: 1rem; /* 比 generate-card 顶部稍高一点 */
    right: 0;
    transform: translate(100%, 0);
    margin-right: 0.5rem;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10; /* 高于 iframe，确保详情页弹窗内关闭按钮可见、可点 */
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.make-same-close:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

/* 首页制作同款：关闭键在 generate-card 内时置于卡片右上角（由 generate.js 打开弹窗时移入） */
.index-make-same-modal .generate-card > .make-same-close {
    top: 1rem;
    right: 1rem;
    transform: none;
    margin-right: 0;
    z-index: 20;
    color: rgba(0, 0, 0, 0.65);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.index-make-same-modal .generate-card > .make-same-close:hover {
    background: rgba(255, 255, 255, 1);
    color: #000;
}

body[data-theme="theme2"][data-bg="keji"] .index-make-same-modal .generate-card > .make-same-close {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
body[data-theme="theme2"][data-bg="keji"] .index-make-same-modal .generate-card > .make-same-close:hover {
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
}

.make-same-modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* iframe 作为弹窗内容时需严格限制在容器内，避免撑破弹窗 */
iframe.make-same-modal-body {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}
/* 弹窗内 upper-module-content：水平居中，上下留白并使 generate-card 垂直居中 */
.make-same-modal-body .upper-module-content {
    margin: 0 auto;
    max-width: 1050px;
    width: 100%;
    padding: 1.5rem 2rem;
    padding-bottom: 1.5rem !important;
    gap: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 1050px) {
    .make-same-card-wrap {
        width: 100%;
        max-width: 100%;
    }
}
@media (max-width: 768px) {
    .make-same-content {
        padding: 0 1rem;
    }
    .make-same-modal-body .upper-module-content,
    body.embed-mode .upper-module-content {
        padding: 0 1rem;
    }
}

/* 详情页 iframe：加载前透明，避免先出现米色再变深色蒙版的闪烁；加载后由内页提供背景 */
.detail-make-same-modal .detail-make-same-iframe,
.detail-make-same-modal iframe.make-same-modal-body {
    background: transparent;
}
/* 首页/通用 iframe 与 div 内容区：同背景、同圆角；z-index 低于关闭按钮 */
.detail-make-same-iframe,
iframe.make-same-modal-body {
    border: none;
    border-radius: 28px;
    background: #F1EAD6;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    z-index: 0;
    position: relative;
}

/* index 嵌入模式（详情页 iframe 内只显示表单区域） */
body.embed-mode #site-nav-container,
body.embed-mode .theme-switcher,
body.embed-mode .background-scene,
body.embed-mode .upper-module .bg-container,
body.embed-mode .upper-module .top-header,
body.embed-mode .public-images-section,
body.embed-mode .faq-section,
body.embed-mode #makeSameModal,
body.embed-mode #site-footer-container {
    display: none !important;
}
/* 详情弹窗 iframe 内：body 与各层背景均为透明，避免黑色透出 */
body.embed-mode {
    background: transparent !important;
}
body.embed-mode .upper-module {
    background: transparent;
    min-height: 0;
}
/* 详情弹窗 iframe 内：去掉 upper-module 的渐变遮罩，保持背景透明 */
body.embed-mode .upper-module::before {
    background: transparent;
}
body.embed-mode .main-content {
    padding: 0.5rem 0;
    width: 100%;
    max-width: 1050px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    background: transparent !important;
}
/* 与首页弹窗内 .make-same-modal-body .upper-module-content 一致，保证 generate-card 大小统一 */
body.embed-mode .upper-module-content {
    max-width: 1050px;
    width: 100%;
    padding: 1.5rem 2rem;
    padding-bottom: 1.5rem;
    box-sizing: border-box;
    flex-shrink: 0;
    gap: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent !important;
}

/* 常见问题：居中、字体突出、两列布局（突破 main-content 宽度限制，单独加宽） */
.faq-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
    text-align: center;
    box-sizing: border-box;
}
/* 常见问题宽度 = 图片广场 max-width 1200px 的 80% = 960px */
.faq-section .section-title {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.faq-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    text-align: left;
    max-width: 960px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .faq-list {
        grid-template-columns: 1fr;
    }
}
.faq-item {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.faq-q {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem 0;
}
.faq-a {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin: 0;
}
.faq-a-list {
    margin: 0.35rem 0 0;
    padding-left: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    line-height: 1.6;
}
.faq-a-list li {
    margin-bottom: 0.25rem;
}
.faq-a a {
    color: #7eb8ff;
    text-decoration: none;
}
.faq-a a:hover {
    text-decoration: underline;
}
.faq-contact {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.95rem;
    color: #fff;
}
.faq-contact a {
    color: #7eb8ff;
    text-decoration: none;
}
.faq-contact a:hover {
    text-decoration: underline;
}
/* 页脚：版权与链接同一行 */
.site-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    z-index: 2;
}
.site-footer a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}
.footer-sep {
    margin: 0 0.75rem;
    opacity: 0.6;
}
.site-footer .footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 0.75rem;
}
.site-footer .footer-copyright {
    display: inline;
    font-size: 0.9rem;
    opacity: 0.9;
}
.footer-trademark-notice {
    max-width: 46rem;
    margin: 1rem auto 0;
    padding: 0 1rem;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #e5e7eb;
    text-align: center;
}
.footer-trademark-notice strong {
    color: #f3f4f6;
    font-weight: 600;
}
.site-footer .footer-friends {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    opacity: 0.95;
}
.site-footer .footer-launch-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.85rem;
}
.site-footer .footer-launch-badges > a,
.site-footer .footer-launch-badges > a:hover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 50px;
    flex: 0 0 auto;
    overflow: visible;
    line-height: 1.2;
    text-decoration: none;
}
.site-footer .footer-launch-badges > a:not(.footer-bowora-badge) img {
    display: block;
    width: auto;
    height: 50px;
    max-height: 50px;
    object-fit: contain;
}
.site-footer .footer-launch-badges > a.footer-bowora-badge,
.site-footer .footer-launch-badges > a.footer-bowora-badge:hover,
#site-footer-container .site-footer a.footer-bowora-badge,
#site-footer-container .site-footer a.footer-bowora-badge:hover {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    box-sizing: border-box;
    width: 200px;
    height: 50px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    background-color: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.2;
    text-decoration: none;
}
.site-footer .footer-launch-badges > a.footer-bowora-badge img {
    display: block;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    object-fit: contain;
}
.site-footer .footer-bowora-badge-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    white-space: nowrap;
}
.site-footer .footer-bowora-badge-kicker {
    font-size: 10px;
    font-weight: 400;
}
.site-footer .footer-bowora-badge-name {
    font-size: 16px;
    font-weight: 700;
}
/* 页脚社交图标 */
.site-footer .footer-social-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.site-footer .footer-social-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.site-footer .footer-social-link:hover {
    color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    text-decoration: none;
}
.site-footer .footer-social-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

/* 独立定价落地页（/pricing.html） */
body.pricing-landing-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #0a0a0a;
    color: #e5e7eb;
}

.pricing-landing-page #site-nav-container {
    flex-shrink: 0;
}

.pricing-landing-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5.25rem 1.5rem 2.5rem;
    box-sizing: border-box;
}

.pricing-header {
    text-align: center;
    max-width: 48rem;
    margin: 0 auto 2.25rem;
    padding: 2rem 1.25rem 2.5rem;
    background-color: #1a1614;
    border-radius: 12px;
    box-sizing: border-box;
}

.pricing-header h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.25rem);
    font-weight: 700;
    color: #f5f1e8;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.pricing-header-lead {
    margin: 0 auto;
    max-width: 40rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #a39e97;
}

.pricing-credits-footnote {
    margin: 2rem auto 0;
    max-width: 42rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #6b6560;
}

.pricing-landing-plans.pricing-plans {
    margin-top: 0.25rem;
}

.pricing-landing-page #site-footer-container {
    flex-shrink: 0;
}

/* Marketing landings (about / faq / tools / credits / alternatives) */
body.site-landing-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #0a0a0a;
    color: #e5e7eb;
}
.site-landing-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 5.25rem 1.5rem 2.5rem;
    box-sizing: border-box;
}
.site-landing-hero {
    text-align: center;
    margin: 0 auto 2rem;
    padding: 2rem 1.25rem;
    background-color: #1a1614;
    border-radius: 12px;
}
.site-landing-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 700;
    color: #f5f1e8;
    margin: 0 0 0.75rem;
}
.site-landing-hero p,
.site-landing-lead {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #a39e97;
}
.site-landing-section {
    margin: 0 0 2rem;
}
.site-landing-section h2 {
    font-size: 1.2rem;
    color: #f5f1e8;
    margin: 0 0 1rem;
}
.site-landing-section p {
    color: #c4bfb6;
    line-height: 1.65;
    margin: 0 0 0.85rem;
}
.site-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.site-card {
    background: #1a1614;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.15rem 1.2rem;
}
.site-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #f5f1e8;
}
.site-card p {
    margin: 0 0 0.65rem;
    color: #a39e97;
    font-size: 0.95rem;
    line-height: 1.55;
}
.site-card a {
    color: #7eb8ff;
    text-decoration: none;
}
.site-card a:hover {
    text-decoration: underline;
}
.site-landing-section details,
.site-landing-page details {
    margin: 0.65rem 0;
}
.site-landing-section details summary,
.site-landing-page details summary {
    cursor: pointer;
    list-style-position: outside;
}
.site-landing-section details summary h2,
.site-landing-page details summary h2 {
    display: inline;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: inherit;
}
.site-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0 0;
}
.site-cta-row .btn-make-same-landing {
    width: auto;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    margin-top: 0;
}
.guide-static-body {
    color: #1f2937;
}
.guide-static-body h1 {
    margin: 0 0 0.75rem;
    color: #111827;
}
.guide-static-body article {
    margin: 1.25rem 0;
}
.guide-static-body .site-related {
    border-top-color: rgba(0, 0, 0, 0.08);
}
.site-related {
    margin: 2.5rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
/* Blog articles put related outside the 900px wrapper — match that column */
main.blog-static-wrapper ~ .site-related {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 1.5rem 16px 2.5rem;
    box-sizing: border-box;
}
.site-related-title {
    font-size: 1.05rem;
    color: #f5f1e8;
    margin: 0 0 0.75rem;
    font-weight: 700;
}
.site-related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.35rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.site-related-list li {
    margin: 0;
    padding: 0;
    list-style: none;
}
.site-related-list a {
    color: #7eb8ff;
    text-decoration: none;
}
.site-related-list a:hover {
    color: #bfdbfe;
    text-decoration: underline;
}
.site-compare-row {
    background: #1a1614;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    margin: 0 0 0.75rem;
}
.site-compare-row h3 {
    margin: 0 0 0.4rem;
    color: #f5f1e8;
    font-size: 1rem;
}
.site-compare-row p {
    margin: 0.2rem 0;
    color: #c4bfb6;
    font-size: 0.95rem;
}
.site-credits-table {
    width: 100%;
    border-collapse: collapse;
    color: #e5e7eb;
    font-size: 0.95rem;
}
.site-credits-table th,
.site-credits-table td {
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-credits-table th {
    color: #a39e97;
    font-weight: 600;
}
.site-landing-page .faq-item {
    margin-bottom: 0.75rem;
}
.site-landing-page details {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.site-landing-page summary {
    cursor: pointer;
    font-weight: 700;
    color: #fff;
}
.site-landing-page details p {
    margin: 0.65rem 0 0;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.6;
}
.site-landing-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: landing-step;
}
.site-landing-steps li {
    counter-increment: landing-step;
    position: relative;
    background: #1a1614;
    border-radius: 12px;
    padding: 0.9rem 1.15rem 0.9rem 3.25rem;
    margin: 0 0 0.65rem;
    color: #c4bfb6;
    line-height: 1.55;
}
.site-landing-steps li::before {
    content: counter(landing-step);
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #6F1D63;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Locale SEO one-line note (non-English pages only) */
.seo-locale-intro {
    max-width: 1200px;
    margin: 12px auto 18px;
    padding: 0 16px;
}

.seo-locale-intro-text {
    margin: 0;
    font-size: 12px;
    color: #8a8a8a;
    line-height: 1.5;
}

/* 生成的图片网格布局 - 一行显示4张 */
.generated-images-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.generated-image-item {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.generated-image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.generated-image-thumbnail {
    width: 100%;
    padding-top: 100%; /* 1:1 比例，显示为缩略图 */
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.generated-image-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.generated-image-item:hover .generated-image-thumbnail img {
    transform: scale(1.05);
}

.generated-image-actions {
    padding: 1rem;
    text-align: center;
    background: #fff;
}

.btn-download {
    padding: 0.5rem 1rem;
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-download:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #764ba2;
    border-color: #764ba2;
    transform: translateY(-2px);
}

/* 兼容旧的单张图片显示方式 */
.generated-image-container {
    text-align: center;
}

.generated-image-container .generated-image-thumbnail {
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    position: static;
    padding-top: 0;
}

.generated-image-container .generated-image-thumbnail:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    /* 宽度由JavaScript控制 */
    
    .public-images-section {
        padding: 1.5rem;
        padding-top: 3rem;
        margin-top: 0;
    }
    
    .upper-module {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        /* 导航栏 + 刘海安全区；不用固定 height/max-height，避免内容被裁切与移动端 100vh 与地址栏不一致 */
        padding-top: max(4.25rem, calc(env(safe-area-inset-top, 0px) + 3.25rem));
        min-height: 100dvh;
        min-height: 100vh;
        height: auto;
        max-height: none;
    }
    
    .top-header {
        padding: 0.5rem 0.5rem 0.5rem;
    }
    
    .public-images-grid {
        padding: 0 1rem;
    }
    
    .generated-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .generated-image-container .generated-image-thumbnail {
        max-width: 100%;
        max-height: 300px;
    }
    
    /* 移动端：模板提示区域和生成按钮垂直布局，避免重叠 */
    .prompt-templates-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .prompt-templates-row .generate-action {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }
    
    .prompt-templates-container {
        width: 100%;
        order: 1;
    }
    
    .refresh-templates-btn {
        order: 0;
        align-self: flex-start;
    }
    
    .prompt-templates-row .generate-action {
        order: 2;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 0.4rem 0;
        padding-top: calc(0.4rem + env(safe-area-inset-top, 0px));
    }
    
    .nav-container {
        padding: 0 0.5rem;
        gap: 0.2rem;
    }
    
    .nav-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .upgrade-member-btn,
    .language-switcher,
    .top-login-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.65rem;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .upgrade-text,
    .language-switcher-text {
        display: inline;
        font-size: 0.65rem;
    }
    
    .top-user-avatar-btn {
        width: 32px !important;
        height: 32px !important;
    }
    
    .nav-right {
        gap: 0.15rem;
    }
    
    .language-switcher-container {
        z-index: 99998 !important;
    }
    
    .language-dropdown {
        z-index: 99999 !important;
        min-width: 160px !important;
        max-width: 85vw !important;
        pointer-events: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .language-switcher-container.active .language-dropdown {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        display: block !important;
    }
    
    .top-header {
        padding-top: 0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .main-content {
        padding: 0.75rem 0.5rem 1.5rem;
    }
    
    .generate-card {
        padding: 1rem;
        min-width: auto; /* 小屏幕上允许缩小 */
    }
    
    /* 小屏幕：进一步优化模板提示区域布局 */
    .prompt-templates-row {
        margin-top: 1rem;
        gap: 0.75rem;
    }
    
    .prompt-templates-container {
        max-height: 120px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .prompt-template-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
    
    /* 宽度由JavaScript控制 */
    
    .generated-images-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.loading-content {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: 16px;
    border: 2px dashed #e0e0e0;
}

.loading-spinner {
    border: 4px solid rgba(111, 29, 99, 0.1);
    border-top: 4px solid #6F1D63;
    border-right: 4px solid #FFD700;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 12px rgba(111, 29, 99, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .generate-card {
        width: 100% !important; /* 中等屏幕上使用100%宽度 */
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .dashboard-card {
        grid-template-columns: 1fr;
    }
    
    .model-selection-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 1.8rem;
    }
    
    .generate-card {
        width: 100% !important; /* 小屏幕上使用100%宽度 */
    }
    
    .options-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .options-container {
        max-width: 100%;
        grid-template-columns: 1fr;
        width: 100%;
    }
    
    .option-item {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }
    
    .generate-action {
        width: 100%;
    }
    
    .generate-btn {
        width: 100%;
        min-width: auto;
    }
}

/* 自定义弹窗样式 */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    z-index: 10001;
}

.custom-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modal-success .custom-modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modal-error .custom-modal-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.modal-info .custom-modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.custom-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.custom-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.custom-modal-body {
    padding: 24px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-modal-body p {
    margin: 0;
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
    text-align: center;
    word-break: break-word;
}

.custom-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    background: #f9fafb;
}

.custom-modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.modal-success .custom-modal-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.modal-error .custom-modal-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.modal-info .custom-modal-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.custom-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.custom-modal-btn:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: #6F1D63;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav a {
    text-decoration: none;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav a:hover,
.nav a.active {
    background: #f0f0f0;
    color: #6F1D63;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #6F1D63;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn:hover {
    background: #501547;
}

.btn-primary {
    background: #6F1D63;
}

.btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: none; /* 禁止拖动调整大小 */
}

/* 认证页面 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-box h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #333;
}

.divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.text-center {
    text-align: center;
}

/* 首页样式 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.features {
    padding: 4rem 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.feature-item h3 {
    margin-bottom: 1rem;
    color: #6F1D63;
}

/* 生成页面 */
.generate-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.generate-preview {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.generate-preview img {
    max-width: 100%;
    border-radius: 4px;
}

.credits-info {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6F1D63;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 用户中心 */
.dashboard-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.dashboard-sidebar {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(111, 29, 99, 0.08);
}

/* 隐藏dashboard-sidebar中的语言切换按钮 */
.dashboard-sidebar .language-switcher-container {
    display: none !important;
}

.dashboard-nav {
    list-style: none;
}

.dashboard-nav li {
    margin-bottom: 0.5rem;
}

.dashboard-nav a {
    display: block;
    padding: 0.75rem;
    text-decoration: none;
    color: #333;
    border-radius: 10px;
    transition: background-color 0.24s ease, color 0.24s ease, transform 0.2s ease, box-shadow 0.24s ease;
    border: 1px solid transparent;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    background: #f6f1f8;
    color: #6F1D63;
    border-color: rgba(111, 29, 99, 0.18);
    box-shadow: 0 6px 18px rgba(111, 29, 99, 0.08);
}

.dashboard-nav a:hover {
    transform: translateY(-1px);
}

.dashboard-nav a:active {
    transform: translateY(0);
}

.dashboard-nav a:focus-visible,
.avatar-container:focus-visible,
.edit-icon:focus-visible,
.checkin-action-btn:focus-visible,
.btn:focus-visible,
.btn-small:focus-visible,
.user-name-input:focus-visible {
    outline: 2px solid rgba(111, 29, 99, 0.7);
    outline-offset: 2px;
}

.dashboard-content {
    background: rgba(255, 255, 255, 0.5);
    padding: 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(111, 29, 99, 0.08);
}

/* 个人中心科技主题：与主页一致 */
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-card {
    background: linear-gradient(145deg, #161a24 0%, #1a1f2e 50%, #141822 100%);
    border: 1px solid rgba(0, 200, 255, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 32px rgba(0, 0, 0, 0.4);
}
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-sidebar {
    background: rgba(30, 34, 45, 0.6);
    border: 1px solid rgba(0, 200, 255, 0.1);
}
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-content {
    background: rgba(30, 34, 45, 0.5);
    border: 1px solid rgba(0, 200, 255, 0.08);
}
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a {
    color: #e5e7eb;
}
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a:hover,
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a.active {
    background: rgba(0, 200, 255, 0.12);
    color: #e4e8ee;
}
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-section,
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .user-info .info-item,
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-content h2 {
    color: #e4e8ee;
}
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .user-info .info-item {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .avatar-container {
    border-color: rgba(200, 204, 212, 0.4);
}
body.dashboard-page[data-theme="theme2"][data-bg="keji"] .avatar-container:hover {
    border-color: rgba(0, 200, 255, 0.5);
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
    animation: dashboardSectionIn 0.24s ease;
}

@keyframes dashboardSectionIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-info .info-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.22s ease;
}

.user-info .avatar-item {
    align-items: flex-start;
}

.avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: border-color 0.24s ease, transform 0.2s ease, box-shadow 0.24s ease;
}

.avatar-container:hover {
    border-color: #6F1D63;
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 8px 20px rgba(111, 29, 99, 0.18);
}

.avatar-container:hover .avatar-overlay {
    opacity: 1;
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: #fff;
}

.avatar-edit-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.avatar-edit-text {
    font-size: 0.75rem;
    font-weight: 500;
}

.edit-icon {
    font-size: 0.875rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
    margin-left: 0.5rem;
    user-select: none;
}

.edit-icon:hover {
    opacity: 1;
    transform: scale(1.08);
}

.user-name-input {
    padding: 0.25rem 0.5rem;
    border: 1px solid #6F1D63;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    min-width: 150px;
    max-width: 300px;
}

.user-name-input:focus {
    outline: none;
    border-color: #6F1D63;
    box-shadow: 0 0 0 2px rgba(111, 29, 99, 0.1);
}

/* Toast提示弹窗 */
.toast-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999 !important;
    display: none;
    pointer-events: none;
}

.toast-modal.show {
    display: block;
    animation: toastFadeIn 0.3s ease;
}

.toast-content {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    max-width: 400px;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-message {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* Toast弹窗移动端适配 */
@media (max-width: 768px) {
    .toast-modal {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 90%;
    }
    
    .toast-content {
        padding: 16px 24px;
        min-width: auto;
        max-width: 100%;
        border-radius: 10px;
    }
    
    .toast-icon {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .toast-message {
        font-size: 14px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .toast-modal {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85%;
        max-width: 85%;
    }
    
    .toast-content {
        padding: 12px 20px;
        border-radius: 8px;
        gap: 10px;
    }
    
    .toast-icon {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
    
    .toast-message {
        font-size: 13px;
        line-height: 1.3;
    }
}

.credits-amount {
    color: #6F1D63;
    font-size: 1.25rem;
    font-weight: bold;
}

/* 积分记录页面样式 */
.credits-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.credits-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.credits-balance h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credits-balance h3 span {
    color: #6F1D63;
    font-weight: 700;
}

.credits-balance #purchaseCreditsBtn {
    margin-left: auto;
    flex-shrink: 0;
    background: linear-gradient(135deg, #ff7a18 0%, #ff4d4f 100%);
    border-color: #ff4d4f;
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 77, 79, 0.28);
}

.credits-balance #purchaseCreditsBtn:hover {
    background: linear-gradient(135deg, #ff8f3a 0%, #ff6668 100%);
    border-color: #ff6668;
    transform: translateY(-1px);
}

/* 签到日历样式 */
.checkin-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.checkin-header-row h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.checkin-header-copy {
    min-width: 0;
}

.checkin-current-credits {
    margin: 0.4rem 0 0;
    font-size: 0.95rem;
    color: #1a1a1a;
    font-weight: 600;
}

#checkinCreditsBalance {
    font-variant-numeric: tabular-nums;
}

.checkin-status-text {
    font-size: 0.95rem;
    color: #6F1D63;
    font-weight: 600;
}

.checkin-calendar {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 0.72rem;
    width: min(96vw, 430px);
    max-width: none;
    margin: 0 auto;
}

.checkin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.checkin-week-header {
    margin-bottom: 7px;
}

.checkin-week-cell {
    text-align: center;
    color: #8b9198;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 5px 0;
}

.checkin-day-cell {
    min-height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f3f4f6;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.checkin-day-cell:not(.is-empty):not(.is-future):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(17, 24, 39, 0.1);
}

.checkin-day-cell.is-empty {
    border: none;
    background: transparent;
}

.checkin-day-cell.is-today {
    border-color: #f59e0b;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.checkin-day-cell.is-checked {
    background: #f8ecd7;
    border-color: #efd5a8;
}

.checkin-day-cell.is-future {
    background: #f8fafc;
    border-color: #eef2f7;
    color: #c1c8d0;
}

.checkin-day-number {
    font-size: 0.88rem;
    font-weight: 700;
    color: #8b9198;
}

.checkin-day-cell.is-checked .checkin-day-number {
    color: #db8822;
}

.checkin-day-cell.is-future .checkin-day-number {
    color: #c1c8d0;
}

.checkin-tick-mark {
    font-size: 0.96rem;
    line-height: 1;
    color: #de8a21;
    font-weight: 700;
}

.checkin-action-btn {
    width: auto;
    min-width: 120px;
    margin: 0 auto;
    border-radius: 999px;
    font-size: 0.96rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    background: linear-gradient(135deg, #ff7a18 0%, #ff4d6d 55%, #ff2d95 100%);
    border: none;
    color: #fff;
    box-shadow: 0 8px 18px rgba(255, 77, 109, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.checkin-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ff8a2a 0%, #ff5f7f 55%, #ff3aa0 100%);
    box-shadow: 0 10px 22px rgba(255, 77, 109, 0.42);
}

.checkin-action-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    box-shadow: none;
    opacity: 1;
    cursor: not-allowed;
}

.checkin-records h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #1a1a1a;
}

.checkin-activity-desc {
    max-width: 860px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.9rem;
}

.checkin-activity-list {
    margin: 0;
    padding-left: 1.1rem;
}

.checkin-activity-list li {
    margin: 0.3rem 0;
}

.credits-fix-notice {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.images-grid .image-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.images-grid .image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.images-grid .image-thumbnail {
    width: 100%;
    padding-top: 100%; /* 1:1 比例，显示为缩略图 */
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.images-grid .image-thumbnail:hover {
    transform: scale(1.02);
}

.images-grid .image-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.images-grid .image-thumbnail img.loaded {
    opacity: 1;
}

.images-grid .image-thumbnail img.error {
    opacity: 1;
    background: #f0f0f0;
}

.images-grid .image-item:hover .image-thumbnail img {
    transform: scale(1.05);
}

.images-grid .image-prompt {
    padding: 0.75rem;
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    text-align: center;
}

/* 订单记录样式 */
#ordersList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.order-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.order-number {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.order-value {
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.order-status {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-refunded {
    background: #e0e7ff;
    color: #3730a3;
}

.order-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 0.9375rem;
    color: #1a1a1a;
    font-weight: 500;
}

.info-value.amount {
    color: #6F1D63;
    font-weight: 600;
    font-size: 1.125rem;
}

.info-value.credits {
    color: #10b981;
    font-weight: 600;
    font-size: 1.125rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-state p {
    margin: 0.5rem 0;
}

.empty-hint {
    font-size: 0.875rem;
    color: #999;
}

/* 积分记录样式 */
.credits-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.warning-content strong {
    display: block;
    color: #92400e;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.warning-content p {
    margin: 0.25rem 0;
    color: #78350f;
    font-size: 0.875rem;
    line-height: 1.5;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

.stat-value.calculated {
    color: #f59e0b;
}

.credits-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.credit-record {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.credit-record:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.credit-record-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.credit-type {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.type-positive {
    background: #d1fae5;
    color: #065f46;
}

.type-negative {
    background: #fee2e2;
    color: #991b1b;
}

.order-link {
    font-size: 0.8125rem;
    color: #6F1D63;
    font-family: 'Courier New', monospace;
}

.credit-amount {
    font-size: 1.25rem;
    font-weight: 600;
}

.amount-positive {
    color: #10b981;
}

.amount-negative {
    color: #ef4444;
}

.credit-record-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: #666;
}

.credit-note {
    flex: 1;
}

.credit-date {
    color: #999;
}

.empty-state,
.error-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

@media (max-width: 768px) {
    .order-info-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* dashboard 页面移动端布局优化（仅作用于 dashboard） */
@media (max-width: 768px) {
    body.dashboard-page .main-content {
        padding: 1rem 0.75rem 1.5rem;
    }

    body.dashboard-page .dashboard-card {
        grid-template-columns: 1fr;
        gap: 0.9rem;
        padding: 0.9rem;
        border-radius: 16px;
    }

    body.dashboard-page .dashboard-sidebar {
        order: 0 !important;
        padding: 0.55rem;
        border-radius: 12px;
    }

    body.dashboard-page .dashboard-nav {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.32rem;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        padding: 0.02rem;
    }

    body.dashboard-page .dashboard-nav::-webkit-scrollbar {
        display: none;
    }

    body.dashboard-page .dashboard-nav li {
        margin-bottom: 0;
        flex: 0 0 auto;
        min-width: 0;
    }

    body.dashboard-page .dashboard-nav a {
        width: auto;
        min-width: 68px;
        text-align: center;
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.25;
        border-radius: 999px;
        padding: 0.5rem 0.72rem;
        font-size: 0.86rem;
    }

    body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a {
        background: #2a3142;
        color: #f8fafc;
        border-color: rgba(148, 163, 184, 0.4);
    }

    body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a:hover,
    body.dashboard-page[data-theme="theme2"][data-bg="keji"] .dashboard-nav a.active {
        background: #0e7490;
        color: #fff;
        border-color: #22d3ee;
        box-shadow: 0 4px 14px rgba(14, 116, 144, 0.4);
    }

    body.dashboard-page .dashboard-content {
        min-width: 0;
        padding: 1rem;
        border-radius: 12px;
    }

    body.dashboard-page .user-info .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        padding: 0.85rem 0;
    }

    body.dashboard-page .user-info .avatar-item {
        align-items: center;
    }

    body.dashboard-page .user-info .info-item label,
    body.dashboard-page .user-info .info-item span {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body.dashboard-page .user-name-input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    body.dashboard-page .credits-balance {
        flex-wrap: wrap;
        gap: 0.7rem;
    }

    body.dashboard-page .credits-balance #purchaseCreditsBtn {
        margin-left: 0;
        width: 100%;
    }

    body.dashboard-page .images-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    body.dashboard-page .order-card,
    body.dashboard-page .credit-record {
        padding: 0.9rem;
    }

    body.dashboard-page .order-value,
    body.dashboard-page .order-link,
    body.dashboard-page .credit-note,
    body.dashboard-page .credit-date {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body.dashboard-page .credit-record-main,
    body.dashboard-page .credit-record-details {
        gap: 0.5rem;
    }

    body.dashboard-page .checkin-header-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.85rem;
    }

    body.dashboard-page .checkin-calendar {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    body.dashboard-page .checkin-day-cell {
        min-height: 42px;
    }
}

@media (max-width: 480px) {
    body.dashboard-page .main-content {
        padding: 0.75rem 0.5rem 1.1rem;
    }

    body.dashboard-page .dashboard-card {
        padding: 0.7rem;
        gap: 0.75rem;
        border-radius: 12px;
    }

    body.dashboard-page .dashboard-sidebar,
    body.dashboard-page .dashboard-content,
    body.dashboard-page .checkin-calendar {
        border-radius: 10px;
    }

    body.dashboard-page .dashboard-content {
        padding: 0.8rem;
    }

    body.dashboard-page .dashboard-nav {
        gap: 0.32rem;
    }

    body.dashboard-page .dashboard-nav a {
        padding: 0.5rem 0.72rem;
        font-size: 0.84rem;
    }

    body.dashboard-page .dashboard-nav li {
        flex-basis: auto;
        flex: 0 0 auto;
    }

    body.dashboard-page .avatar-container {
        width: 84px;
        height: 84px;
    }

    body.dashboard-page .images-grid {
        grid-template-columns: 1fr;
    }

    body.dashboard-page .order-card,
    body.dashboard-page .credit-record {
        border-radius: 10px;
        padding: 0.75rem;
    }

    body.dashboard-page .credit-record-main,
    body.dashboard-page .credit-record-details {
        flex-direction: column;
        align-items: flex-start;
    }

    body.dashboard-page .checkin-day-cell {
        min-height: 38px;
        padding: 3px 4px;
        border-radius: 10px;
    }

    body.dashboard-page .checkin-day-number {
        font-size: 0.8rem;
    }

    body.dashboard-page .checkin-week-cell {
        font-size: 0.78rem;
    }
}

/* 管理后台布局 */
body .admin-layout {
    display: flex !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    position: relative !important;
}

body .admin-sidebar {
    width: 250px !important;
    background: #fff !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1) !important;
    padding: 1.5rem 0 !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    overflow-y: auto !important;
    z-index: 1000;
    transition: width 0.3s ease !important;
}

body .admin-sidebar.collapsed {
    width: 70px !important;
}

body .admin-sidebar.collapsed .logo h1 {
    font-size: 0 !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
}

body .admin-sidebar.collapsed .admin-sidebar-nav a {
    padding: 0.875rem 0.5rem !important;
    text-align: center !important;
    position: relative !important;
}

body .admin-sidebar.collapsed .admin-sidebar-nav a span {
    display: none !important;
}

body .admin-sidebar.collapsed .admin-sidebar-nav a::after {
    content: attr(data-icon) !important;
    font-size: 1.2rem !important;
}

body .admin-sidebar .logo {
    padding: 0 1.5rem !important;
    margin-bottom: 2rem !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 1rem !important;
}

body .admin-sidebar .logo h1 {
    font-size: 1.25rem !important;
    color: #6F1D63 !important;
    margin: 0 !important;
}

body .admin-sidebar-nav {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body .admin-sidebar-nav li {
    margin: 0 !important;
}

body .admin-sidebar-nav a {
    display: flex !important;
    align-items: center !important;
    padding: 0.875rem 1.5rem !important;
    text-decoration: none !important;
    color: #333 !important;
    transition: all 0.3s !important;
    border-left: 3px solid transparent !important;
    white-space: nowrap !important;
}

body .admin-sidebar-nav a span {
    margin-left: 0.5rem !important;
}

body .admin-sidebar-nav a:hover {
    background: #f5f5f5 !important;
    color: #6F1D63 !important;
}

body .admin-sidebar-nav a.active {
    background: #f0f0f0 !important;
    color: #6F1D63 !important;
    border-left-color: #6F1D63 !important;
    font-weight: 500 !important;
}

body .admin-main-content {
    flex: 1 !important;
    margin-left: 250px !important;
    background: #f5f5f5 !important;
    min-height: 100vh !important;
    width: calc(100% - 250px) !important;
    transition: margin-left 0.3s ease, width 0.3s ease !important;
}

body .admin-sidebar.collapsed ~ .admin-main-content {
    margin-left: 70px !important;
    width: calc(100% - 70px) !important;
}

body .admin-header {
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    padding: 1rem 2rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 0 !important;
    gap: 1rem !important;
}

body .admin-header .menu-toggle {
    background: none !important;
    border: none !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    color: #333 !important;
    padding: 0.5rem !important;
    border-radius: 4px !important;
    transition: background 0.3s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
}

body .admin-header .menu-toggle:hover {
    background: #f5f5f5 !important;
    color: #6F1D63 !important;
}

body .admin-header .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
}

body .admin-header h2 {
    margin: 0 !important;
    font-size: 1.5rem !important;
}

body .admin-header .logout-btn {
    padding: 0.5rem 1rem !important;
    background: #6F1D63 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    transition: background 0.3s !important;
}

body .admin-header .logout-btn:hover {
    background: #501547 !important;
}

body .admin-content {
    padding: 2rem !important;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-item h3 {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: normal;
}

.stat-item p {
    font-size: 2rem;
    font-weight: bold;
    color: #6F1D63;
    margin: 0.5rem 0;
}

.stat-item small {
    display: block;
    color: #999;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* 页脚 */
.footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .generate-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar {
        order: 2;
    }
    
    .nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    body .admin-sidebar {
        width: 200px !important;
    }
    
    body .admin-main-content {
        margin-left: 200px !important;
        width: calc(100% - 200px) !important;
    }
}

@media (max-width: 640px) {
    body .admin-sidebar {
        width: 0 !important;
        overflow: hidden !important;
        transition: width 0.3s !important;
    }
    
    body .admin-sidebar.open {
        width: 200px !important;
    }
    
    body .admin-main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ==================== 主题切换功能（科技 / 春 / 夏 / 秋 / 冬） ==================== */

/* 主题切换按钮 - 只在主页显示，位于右下角 */
body.generate-page .theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    user-select: none;
}

/* 其他页面不显示主题切换按钮 */
.theme-switcher {
    display: none;
}

body.generate-page .theme-switcher:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

body.generate-page .theme-switcher:active {
    transform: translateY(0) scale(1);
}

body.generate-page .theme-switcher-icon {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

body.generate-page .theme-switcher:hover .theme-switcher-icon {
    transform: rotate(180deg) scale(1.1);
}

body.generate-page .theme-switcher-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 消息中心按钮 - 历史/闹钟图标（对齐 backgroundcanvas） */
.message-center-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 1 !important;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 7px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow: none;
    transition: background 0.2s ease;
    color: #ffffff;
    user-select: none;
    transform: none !important;
    height: 36px;
    width: 36px;
    min-width: 36px;
    box-sizing: border-box;
    margin-right: 0;
}

.message-center-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

.message-center-icon,
.message-center-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.message-center-btn.loading {
    animation: spin 1s linear infinite;
}

html:not(.is-authenticated) .message-center-btn,
html:not(.is-authenticated) #messageCenterBtnDrawer {
    display: none !important;
}

.message-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Rewards + 积分（对齐 backgroundcanvas：未登录仅 Rewards，已登录显示积分） */
.nav-credits-slot {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
    gap: 0;
    min-height: 36px;
    height: 36px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    overflow: hidden;
}

.nav-activity-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 36px;
    height: 36px;
    padding: 0 0.65rem;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    color: #ffffff;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: background 0.2s ease;
}

.nav-activity-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-activity-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: #f59e0b;
}

.nav-credits-divider {
    display: flex;
    align-items: center;
    align-self: stretch;
    padding: 0 0.15rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    user-select: none;
    pointer-events: none;
    text-shadow: none;
}

.nav-credits-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 36px;
    height: 36px;
    padding: 0 0.65rem;
    border-radius: 0;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    color: #ffffff;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: background 0.2s ease;
}

.nav-credits-badge:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-credits-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

.nav-credits-amount {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html:not(.is-authenticated) .nav-credits-badge,
html:not(.is-authenticated) .nav-credits-divider {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 语言切换容器 - 在导航栏内 */
.language-switcher-container {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 1 !important;
    /* 确保不受父元素 transform 影响 */
    transform: none !important;
    /* 确保在所有情况下都固定 */
    will-change: auto;
}

/* Upgrade CTA (BGResize — next to auth) */
.nav-upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 0.9rem;
    border-radius: 6px;
    background: #1f3d36;
    color: #f2f2f2 !important;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
}

.nav-upgrade-btn:hover {
    background: #2d564c;
    transform: translateY(-1px);
}

html:not(.is-authenticated) .nav-credits-slot .nav-upgrade-btn {
    display: none;
}

/* 认证按钮容器 - 在导航栏内 */
.auth-buttons-container {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 1 !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: none !important;
    flex-shrink: 0;
}

.top-login-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    user-select: none;
    height: 36px;
    box-sizing: border-box;
}

.top-login-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.top-user-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    object-fit: cover;
}

.top-user-avatar-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 语言切换按钮（地球图标，不显示当前语言文案） */
.language-switcher {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 7px;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: none;
    transition: background 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    user-select: none;
    min-width: 120px;
    justify-content: space-between;
    height: 36px;
    box-sizing: border-box;
}

.language-switcher.language-switcher--icon-only {
    min-width: 36px;
    width: 36px;
    padding: 0;
    justify-content: center;
    gap: 0;
}

.language-switcher:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

.language-switcher:active {
    transform: none;
}

.language-switcher-globe-icon,
.language-switcher-globe-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.language-switcher-flag-img {
    width: 1em;
    height: 0.75em;
    display: inline-block;
    vertical-align: middle;
    object-fit: cover;
    border-radius: 2px;
}

.language-switcher-text {
    font-weight: 500;
    letter-spacing: 0.5px;
    flex: 1;
    color: #ffffff;
}

.language-switcher-arrow {
    display: none;
}

/* 语言下拉菜单 */
.language-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    background: rgba(30, 30, 35, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0;
    padding: 4px 0;
}

.language-switcher-container.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 语言项 */
.language-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 2px 4px;
}

.language-item:last-child {
    margin-bottom: 2px;
}

.language-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.language-item.active {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.language-flag-img {
    width: 1em;
    height: 0.75em;
    display: inline-block;
    vertical-align: middle;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.language-name {
    font-size: 0.9rem;
    color: #ffffff;
    flex: 1;
    font-weight: 400;
}

.language-item.active .language-name {
    font-weight: 500;
}

/* 主题1：深色科技风（默认） */
body.generate-page[data-theme="theme1"] {
    --select-bg: #252a33;
    --select-bg-hover: #2c323d;
    --select-bg-focus: #333a47;
    --select-text: #2f3a2f;
    --select-arrow: #4d5a4d;
    --select-panel-bg: rgba(33, 44, 33, 0.96);
    --select-panel-border: rgba(255, 255, 255, 0.22);
    --select-panel-header-bg: rgba(33, 44, 33, 0.98);
    --select-panel-header-label: rgba(232, 245, 232, 0.7);
    --select-option-hover: rgba(255, 255, 255, 0.12);
    --select-option-selected: rgba(180, 225, 180, 0.2);
    --select-check: #9fe2a1;
    --select-shadow: 0 10px 26px rgba(31, 53, 31, 0.35);
}

body[data-theme="theme1"] .generate-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #6a4c93 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    transition: background 0.5s ease;
}

body[data-theme="theme1"] .top-header,
body[data-theme="theme1"] .nav-links a {
    color: #e0e0e0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

body[data-theme="theme1"] .top-nav {
    background: #0f121c;
}

body[data-theme="theme1"].site-landing-page .top-nav,
body[data-theme="theme1"].dashboard-page .top-nav,
body[data-theme="theme1"].blog-page .top-nav,
body[data-theme="theme1"] .top-nav.scrolled {
    background: #0f121c !important;
}

body[data-theme="theme1"] .generate-card,
body[data-theme="theme1"] .preview-card {
    background: #F1EAD6;
    border: 1px solid rgba(100, 100, 150, 0.3);
    color: #e0e0e0;
}

body[data-theme="theme1"] .preview-card::before {
    background: linear-gradient(90deg, #6a4c93 0%, #9d7fd8 50%, #6a4c93 100%);
}

body[data-theme="theme1"] .prompt-input {
    background: transparent;
    border: none;
    color: #e0e0e0;
}

body[data-theme="theme1"] .prompt-input:focus {
    border: none;
    background: transparent;
    box-shadow: none;
}

body[data-theme="theme1"] .option-select {
    background-color: #4a4a4a;
    border: none;
    color: #e0e0e0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}

body[data-theme="theme1"] .option-select:hover,
body[data-theme="theme1"] .option-select:focus {
    border: none;
    background-color: #5a5a5a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}

body[data-theme="theme1"] .options-row {
    background: transparent;
    border: none;
}

body[data-theme="theme1"] .generate-btn {
    background: linear-gradient(135deg, #5b21b6 0%, #6d28d9 100%);
    box-shadow: 
        0 4px 12px rgba(91, 33, 182, 0.4),
        0 2px 4px rgba(91, 33, 182, 0.3);
}

body[data-theme="theme1"] .generate-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    box-shadow: 
        0 6px 16px rgba(106, 76, 147, 0.5),
        0 3px 8px rgba(106, 76, 147, 0.4);
}

body[data-theme="theme1"] .preview-title {
    color: #e0e0e0;
    border-bottom-color: #4a4a6e;
}

body[data-theme="theme1"] .preview-title::after {
    background: linear-gradient(90deg, #6a4c93 0%, #9d7fd8 100%);
}

body[data-theme="theme1"] .preview-content {
    background: linear-gradient(135deg, #2a2a3e 0%, #1f1f2e 100%);
    border-color: #4a4a6e;
}

body[data-theme="theme1"] .preview-content .placeholder {
    color: #999;
}

body[data-theme="theme1"] .loading-spinner {
    border-color: rgba(106, 76, 147, 0.1);
    border-top-color: #6a4c93;
    border-right-color: #9d7fd8;
}

/* 主题2：温暖渐变风 */
body.generate-page[data-theme="theme2"] {
    --select-bg: #252a33;
    --select-bg-hover: #2c323d;
    --select-bg-focus: #333a47;
    --select-text: rgba(240, 245, 255, 0.95);
    --select-arrow: rgba(214, 224, 240, 0.92);
    --select-panel-bg: rgba(20, 24, 36, 0.96);
    --select-panel-border: rgba(255, 255, 255, 0.14);
    --select-panel-header-bg: rgba(20, 24, 36, 0.98);
    --select-panel-header-label: rgba(255, 255, 255, 0.66);
    --select-option-hover: rgba(255, 255, 255, 0.1);
    --select-option-selected: rgba(255, 255, 255, 0.16);
    --select-check: #9be38f;
    --select-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body[data-theme="theme2"] .generate-page {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 25%, #ffa726 50%, #ffb74d 75%, #ffcc80 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    transition: background 0.5s ease;
}

body[data-theme="theme2"] .top-header,
body[data-theme="theme2"] .nav-links a {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body[data-theme="theme2"] .top-nav {
    background: #0f121c;
}

body[data-theme="theme2"].site-landing-page .top-nav,
body[data-theme="theme2"].dashboard-page .top-nav,
body[data-theme="theme2"].blog-page .top-nav,
body[data-theme="theme2"] .top-nav.scrolled {
    background: #0f121c !important;
}

body[data-theme="theme2"] .generate-card,
body[data-theme="theme2"] .preview-card {
    background: #F1EAD6;
    border: 1px solid rgba(255, 182, 77, 0.3);
    color: #333;
}

body[data-theme="theme2"] .preview-card::before {
    background: linear-gradient(90deg, #ff6b6b 0%, #ffb74d 50%, #ff6b6b 100%);
}

body[data-theme="theme2"] .prompt-input {
    background: transparent;
    border: none;
    color: #333;
}

body[data-theme="theme2"] .prompt-input:focus {
    border: none;
    background: transparent;
    box-shadow: none;
}

body[data-theme="theme2"] .option-select {
    background-color: #f5f5f5;
    border: none;
    color: #333;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}

body[data-theme="theme2"] .option-select:hover,
body[data-theme="theme2"] .option-select:focus {
    border: none;
    background-color: #e8e8e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}

body[data-theme="theme2"] .options-row {
    background: transparent;
    border: none;
}

body[data-theme="theme2"] .generate-btn {
    background: linear-gradient(135deg, #b91c1c 0%, #c2410c 100%);
    box-shadow: 
        0 4px 12px rgba(185, 28, 28, 0.4),
        0 2px 4px rgba(194, 65, 12, 0.3);
}

body[data-theme="theme2"] .generate-btn:hover {
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
    box-shadow: 
        0 6px 16px rgba(185, 28, 28, 0.5),
        0 3px 8px rgba(194, 65, 12, 0.4);
}

body[data-theme="theme2"] .preview-title {
    color: #333;
    border-bottom-color: #ffcc80;
}

body[data-theme="theme2"] .preview-title::after {
    background: linear-gradient(90deg, #ff6b6b 0%, #ffb74d 100%);
}

body[data-theme="theme2"] .preview-content {
    background: linear-gradient(135deg, #fff8f0 0%, #ffe0b2 100%);
    border-color: #ffcc80;
}

body[data-theme="theme2"] .preview-content .placeholder {
    color: #999;
}

body[data-theme="theme2"] .loading-spinner {
    border-color: rgba(255, 107, 107, 0.1);
    border-top-color: #ff6b6b;
    border-right-color: #ffb74d;
}

/* 科技背景时覆盖 theme2 的卡片样式：generate-card 深色科技 */
body.generate-page[data-theme="theme2"][data-bg="keji"] {
    /* 科技主题：触发器背景改用 #252a33 */
    --select-trigger-bg: #252a33;
    --select-trigger-bg-hover: #2c323d;
    --select-trigger-bg-focus: #333a47;
    --select-trigger-text: rgba(240, 245, 255, 0.95);
    --select-trigger-arrow: rgba(214, 224, 240, 0.92);

    --select-bg: #252a33;
    --select-bg-hover: #2c323d;
    --select-bg-focus: #333a47;
    --select-text: rgba(240, 245, 255, 0.95);
    --select-arrow: rgba(214, 224, 240, 0.92);
    --select-panel-bg: rgba(10, 21, 35, 0.97);
    --select-panel-border: rgba(116, 174, 228, 0.24);
    --select-panel-header-bg: rgba(10, 21, 35, 0.99);
    --select-panel-header-label: rgba(159, 201, 234, 0.76);
    --select-option-hover: rgba(121, 173, 223, 0.18);
    --select-option-selected: rgba(121, 173, 223, 0.28);
    --select-check: #9cd6ff;
    --select-shadow: 0 10px 34px rgba(0, 14, 28, 0.55);
}

body[data-theme="theme2"][data-bg="keji"] .generate-card {
    background: linear-gradient(145deg, #161a24 0%, #1a1f2e 50%, #141822 100%);
    border: 1px solid rgba(0, 200, 255, 0.15);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.4);
    color: #e4e8ee;
}

/* 深色科技时 generate-card 内字体与表单控件颜色 */
body[data-theme="theme2"][data-bg="keji"] .generate-card .mode-tab {
    color: #d1d5db;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .mode-tab.active {
    color: #e4e8ee;
}

body[data-theme="theme2"][data-bg="keji"] .generate-card .mode-tabs::-webkit-scrollbar-thumb {
    background: rgba(148, 189, 220, 0.35);
}

body[data-theme="theme2"][data-bg="keji"] .generate-card .prompt-input {
    color: #e4e8ee;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .prompt-input::placeholder {
    color: #cbd5e1;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .option-select {
    background-color: #252a33;
    color: #e4e8ee;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23e4e8ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .option-select:hover,
body[data-theme="theme2"][data-bg="keji"] .generate-card .option-select:focus {
    background-color: #2d333b;
    color: #e4e8ee;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23e4e8ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .option-item {
    color: #b4bac4;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .public-toggle-label,
body[data-theme="theme2"][data-bg="keji"] .generate-card .public-toggle-hint-btn {
    color: #e5e7eb;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .upload-text,
body[data-theme="theme2"][data-bg="keji"] .generate-card .upload-hint {
    color: #b4bac4;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .form-group label {
    color: #b4bac4;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .select-label {
    color: #9ca3af;
}

/* 科技主题：图生图上传区域灰白色边框 */
body[data-theme="theme2"][data-bg="keji"] .source-image-upload-area {
    border-color: rgba(200, 204, 212, 0.6);
}
body[data-theme="theme2"][data-bg="keji"] .source-image-upload-area:hover {
    border-color: rgba(220, 224, 230, 0.8);
}
body[data-theme="theme2"][data-bg="keji"] .source-image-upload-area.drag-over {
    border-color: rgba(230, 232, 238, 0.9);
}

body[data-theme="theme2"][data-bg="keji"] .source-image-upload-area .upload-icon-svg {
    color: rgba(200, 204, 212, 0.9);
}

/* 主题3：清新自然风 */
body.generate-page[data-theme="theme3"] {
    --select-bg: #252a33;
    --select-bg-hover: #2c323d;
    --select-bg-focus: #333a47;
    --select-text: rgba(240, 245, 255, 0.95);
    --select-arrow: rgba(214, 224, 240, 0.92);
    --select-panel-bg: rgba(8, 30, 45, 0.96);
    --select-panel-border: rgba(122, 214, 230, 0.22);
    --select-panel-header-bg: rgba(8, 30, 45, 0.98);
    --select-panel-header-label: rgba(171, 225, 234, 0.72);
    --select-option-hover: rgba(122, 214, 230, 0.16);
    --select-option-selected: rgba(122, 214, 230, 0.24);
    --select-check: #7de7c2;
    --select-shadow: 0 10px 30px rgba(5, 26, 38, 0.45);
}

body[data-theme="theme3"] .generate-page {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 25%, #00f260 50%, #0575e6 75%, #00c9ff 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    transition: background 0.5s ease;
}

body[data-theme="theme3"] .top-header,
body[data-theme="theme3"] .nav-links a {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body[data-theme="theme3"] .top-nav {
    background: #0f121c;
}

body[data-theme="theme3"].site-landing-page .top-nav,
body[data-theme="theme3"].dashboard-page .top-nav,
body[data-theme="theme3"].blog-page .top-nav,
body[data-theme="theme3"] .top-nav.scrolled {
    background: #0f121c !important;
}

body[data-theme="theme3"] .generate-card,
body[data-theme="theme3"] .preview-card {
    background: #F1EAD6;
    border: 1px solid rgba(0, 242, 96, 0.3);
    color: #333;
}

body[data-theme="theme3"] .preview-card::before {
    background: linear-gradient(90deg, #00d2ff 0%, #00f260 50%, #00d2ff 100%);
}

body[data-theme="theme3"] .prompt-input {
    background: transparent;
    border: none;
    color: #333;
}

body[data-theme="theme3"] .prompt-input:focus {
    border: none;
    background: transparent;
    box-shadow: none;
}

body[data-theme="theme3"] .option-select {
    background-color: #f5f5f5;
    border: none;
    color: #333;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}

body[data-theme="theme3"] .option-select:hover,
body[data-theme="theme3"] .option-select:focus {
    border: none;
    background-color: #e8e8e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}

body[data-theme="theme3"] .options-row {
    background: transparent;
    border: none;
}

body[data-theme="theme3"] .generate-btn {
    background: linear-gradient(135deg, #0e7490 0%, #047857 100%);
    box-shadow: 
        0 4px 12px rgba(14, 116, 144, 0.4),
        0 2px 4px rgba(4, 120, 87, 0.3);
}

body[data-theme="theme3"] .generate-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #0e7490 100%);
    box-shadow: 
        0 6px 16px rgba(14, 116, 144, 0.5),
        0 3px 8px rgba(4, 120, 87, 0.4);
}

body[data-theme="theme3"] .preview-title {
    color: #333;
    border-bottom-color: #80ffd4;
}

body[data-theme="theme3"] .preview-title::after {
    background: linear-gradient(90deg, #00d2ff 0%, #00f260 100%);
}

body[data-theme="theme3"] .preview-content {
    background: linear-gradient(135deg, #f0fffa 0%, #b2ffe0 100%);
    border-color: #80ffd4;
}

body[data-theme="theme3"] .preview-content .placeholder {
    color: #999;
}

body[data-theme="theme3"] .loading-spinner {
    border-color: rgba(0, 210, 255, 0.1);
    border-top-color: #00d2ff;
    border-right-color: #00f260;
}

/* 主题切换按钮响应式 */
@media (max-width: 768px) {
    body.generate-page .theme-switcher {
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        top: auto;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    body.generate-page .theme-switcher-icon {
        font-size: 1rem;
    }
    
    /* 顶部留白由 .upper-module 的 padding-top 统一承担，避免与导航区重复叠加导致错位 */
    .top-header {
        padding-top: 0.5rem;
        padding-bottom: 0.75rem;
    }
    
    .main-content {
        padding: 1rem 1rem 2rem;
    }
    
    .generate-card {
        padding: 1.5rem;
        min-width: auto; /* 小屏幕上允许缩小 */
    }
    
    .language-dropdown {
        min-width: 180px;
        background: rgba(30, 30, 35, 0.98);
    }
    
    .language-flag-img {
        width: 0.9em;
        height: 0.7em;
    }
    
    .language-name {
        font-size: 0.85rem;
        color: #ffffff;
    }
    
    .language-item {
        padding: 0.5rem 0.75rem;
    }
}

/* 购买积分弹窗样式 */
.purchase-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.purchase-modal.show {
    display: flex;
}

.purchase-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.purchase-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: hidden;
    overflow-x: hidden;
    z-index: 10001;
    animation: slideUp 0.3s ease;
}

.purchase-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.purchase-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.purchase-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.purchase-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.purchase-modal-body {
    padding: 32px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

/* 隐藏滚动条但保持滚动功能 */
.purchase-modal-body::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.purchase-modal-body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.purchase-modal-subtitle {
    text-align: center;
    color: #ccc;
    font-size: 16px;
    margin-bottom: 32px;
}

.pricing-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pricing-plan {
    background: #2a2a2a;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pricing-plan:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pricing-plan.active {
    border: 2px solid;
    border-image: linear-gradient(135deg, #ef4444 0%, #10b981 100%) 1;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

.plan-header {
    margin-bottom: 20px;
}

.plan-name {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.plan-desc {
    font-size: 14px;
    color: #999;
    margin: 0;
}

.plan-price {
    margin-bottom: 24px;
}

.price-amount {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    display: block;
    margin-bottom: 4px;
}

.price-credits {
    font-size: 14px;
    color: #999;
}

.plan-btn {
    width: 100%;
    padding: 12px 24px;
    background: #3a3a3a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plan-btn:hover {
    background: #4a4a4a;
    transform: translateY(-2px);
}

.pricing-plan.active .plan-btn,
.plan-btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #10b981 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.pricing-plan.active .plan-btn:hover,
.plan-btn-primary:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.plan-description-text {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.plan-description-text h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.plan-description-text ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-description-text li {
    font-size: 13px;
    color: #ccc;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.plan-description-text li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

@media (max-width: 768px) {
    .pricing-plans {
        grid-template-columns: 1fr;
    }
    
    .purchase-modal-content {
        width: 95%;
        max-width: 95%;
    }
    
    .purchase-modal-body {
        padding: 24px;
    }
}

/* 用户头像按钮 */
.user-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    transition: all 0.3s ease;
}

.user-avatar-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 用户菜单弹窗（高于顶栏 z-index 10000，避免与导航同层被遮挡） */
.user-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10020;
    display: none;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 20px;
    pointer-events: none;
}

.user-menu-modal.show {
    display: flex;
    pointer-events: auto;
}

.user-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.user-menu-content {
    position: relative;
    width: 320px;
    max-width: 90vw;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 10021;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.16s ease;
    margin-top: 60px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 用户信息头部 */
.user-menu-header {
    padding: 20px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-menu-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-menu-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-menu-info {
    flex: 1;
    min-width: 0;
}

.user-menu-nickname-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 4px 0;
    transition: opacity 0.2s;
}

.user-menu-nickname-wrapper:hover {
    opacity: 0.8;
}

.user-menu-nickname {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    font-size: 0;
    overflow: hidden;
    margin-left: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.5;
    transform: rotate(-90deg);
}

.user-menu-email {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-credits {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
}

.credits-icon {
    font-size: 18px;
}

/* 推广链接区域 */
.user-menu-referral {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.referral-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.referral-icon {
    font-size: 16px;
}

.referral-label {
    flex: 1;
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.copy-btn {
    padding: 6px 16px;
    background: #fbbf24;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #f59e0b;
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.referral-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    line-height: 1.5;
}

.referral-link-input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    outline: none;
}

.referral-link-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

/* 菜单项 */
.user-menu-items {
    padding: 8px 0;
    overflow-y: auto;
    max-height: calc(90vh - 300px);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
    color: #fff;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu-text {
    font-size: 15px;
    flex: 1;
}

/* 响应式：移动端从顶部展开，不要底部抽屉 */
@media (max-width: 768px) {
    .user-menu-content {
        width: 100%;
        max-width: 100%;
        margin-top: 0;
        border-radius: 0 0 16px 16px;
        max-height: min(85vh, calc(100dvh - env(safe-area-inset-top, 0px)));
        padding-top: env(safe-area-inset-top, 0px);
        animation: slideInFromTop 0.18s ease;
    }
    
    .user-menu-modal {
        align-items: flex-start;
        justify-content: stretch;
        padding: 0;
    }

    .user-menu-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0.6;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 价格套餐弹窗 */
.pricing-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pricing-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.pricing-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 20001;
    display: flex;
    flex-direction: column;
}

.pricing-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pricing-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.pricing-modal-close {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transform-origin: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.pricing-modal-close-icon {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.pricing-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.pricing-modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.pricing-modal-body .pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.pricing-modal-body .pricing-plan {
    background: #2a2a2a;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pricing-modal-body .pricing-plan:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pricing-modal-body .pricing-plan.active {
    border: 2px solid;
    border-image: linear-gradient(135deg, #ef4444 0%, #10b981 100%) 1;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

@media (max-width: 768px) {
    .top-nav {
        padding: 0.5rem 0;
    }
    
    .nav-container {
        padding: 0 0.75rem;
        flex-wrap: nowrap;
        gap: 0.25rem;
        overflow-x: visible;
        overflow-y: visible !important;
    }
    
    .nav-left {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
    }
    
    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .nav-right {
        gap: 0.3rem;
        flex-wrap: nowrap;
        flex-shrink: 0;
        position: relative;
        align-items: center;
        overflow: visible !important;
    }
    
    .nav-container {
        overflow: visible !important;
    }
    
    .top-nav {
        overflow: visible !important;
    }
    
    .upgrade-member-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
        flex-shrink: 0;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .upgrade-text {
        display: inline;
        font-size: 0.7rem;
    }
    
    .language-switcher-container {
        position: relative !important;
        z-index: 99998 !important;
        flex-shrink: 0;
    }
    
    .language-switcher {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
        min-width: auto;
        flex-shrink: 0;
        white-space: nowrap;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .language-switcher-text {
        display: inline;
        font-size: 0.7rem;
    }
    
    .language-dropdown {
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        left: 0 !important;
        right: auto !important;
        z-index: 99999 !important;
        min-width: 180px !important;
        max-width: 90vw !important;
        max-height: 60vh !important;
        background: rgba(30, 30, 35, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 8px !important;
        overflow-y: auto !important;
        box-shadow: 
            0 8px 30px rgba(0, 0, 0, 0.6),
            0 4px 12px rgba(0, 0, 0, 0.4) !important;
        pointer-events: none !important;
        -webkit-overflow-scrolling: touch;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) !important;
        display: block !important;
        touch-action: manipulation;
        padding: 4px 0 !important;
    }
    
    .language-switcher-container.active .language-dropdown {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        display: block !important;
        pointer-events: auto !important;
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        left: 0 !important;
        z-index: 99999 !important;
    }
    
    .language-item {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
    
    .language-switcher-container {
        z-index: 99998 !important;
    }
    
    .top-login-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
        flex-shrink: 0;
        white-space: nowrap;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .top-user-avatar-btn {
        width: 36px !important;
        height: 36px !important;
        flex-shrink: 0;
    }
    
    .top-user-avatar-btn {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0;
    }
    
    .top-header {
        padding-top: 80px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .main-content {
        padding: 1rem 0.75rem 2rem;
    }
    
    .generate-card {
        padding: 1.5rem;
        min-width: auto; /* 小屏幕上允许缩小 */
    }
    
    .pricing-modal-content {
        width: 95%;
        max-width: 95%;
    }
    
    .pricing-modal-body {
        padding: 20px;
    }
    
    .pricing-modal-body .pricing-plans {
        grid-template-columns: 1fr;
    }
}

/* 隐藏所有弹窗的滚动条 */
.pricing-modal-content,
.pricing-modal-body,
.purchase-modal-content,
.purchase-modal-body,
.custom-modal-content,
.custom-modal-body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.pricing-modal-content::-webkit-scrollbar,
.pricing-modal-body::-webkit-scrollbar,
.purchase-modal-content::-webkit-scrollbar,
.purchase-modal-body::-webkit-scrollbar,
.custom-modal-content::-webkit-scrollbar,
.custom-modal-body::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* 消息中心样式 */
.message-center-list {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px 0;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#messageCenterModal .pricing-modal-content {
    width: min(92vw, 800px);
}

#messageCenterModal .pricing-modal-body {
    padding: 16px;
}

.message-center-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 消息中心加载更多指示器 */
.message-center-load-more-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 10px;
}

.message-center-load-more-indicator p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.message-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.message-item-thumbnail {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
}

.message-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.message-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-item-model {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.message-item-prompt {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-item-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.message-item.completed .message-item-status {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.message-item.pending .message-item-status {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.message-item.failed .message-item-status {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.empty-message,
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.error-message-with-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
}

.message-center-retry-btn {
    min-width: 110px;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 15px;
}

.loading-placeholder .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-placeholder p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* 生成完成弹窗样式 */
.generate-complete-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    z-index: 10002;
    animation: slideDown 0.3s ease;
    pointer-events: none;
}

.generate-complete-content {
    background: #000000;
    padding: 15px 30px;
    text-align: center;
    width: auto;
    max-width: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 8px;
    pointer-events: auto;
}

.generate-complete-icon {
    color: #4CAF50;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    animation: scaleIn 0.3s ease;
}

.generate-complete-message {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.generate-complete-btn {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* 顶部通知样式 */
.top-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
}

.top-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.top-notification.success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.top-notification.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* 生成动画元素 */
.generate-animation-element {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .message-center-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 0;
        margin-right: 0;
        background-image: none;
    }
    
    .message-center-btn:hover {
        background-image: none;
    }
    
    .nav-credits-slot {
        min-height: 32px;
        height: 32px;
    }

    .nav-activity-btn,
    .nav-credits-badge {
        min-height: 32px;
        height: 32px;
        padding: 0 0.5rem;
        font-size: 0.75rem;
    }

    .language-switcher.language-switcher--icon-only {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }
    
    .message-badge {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        top: -3px;
        right: -3px;
    }
    
    .message-item {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
        padding: 12px;
    }
    
    .message-item-thumbnail {
        width: 100%;
        height: 170px;
    }

    #messageCenterModal .pricing-modal-content {
        width: calc(100vw - 16px);
        max-width: none !important;
        max-height: calc(100vh - 16px);
        border-radius: 12px;
    }

    #messageCenterModal .pricing-modal-header {
        padding: 12px 14px;
    }

    #messageCenterModal .pricing-modal-body {
        padding: 10px 12px !important;
    }

    .message-center-list {
        max-height: calc(100vh - 140px);
        padding: 6px 0;
    }

    #contactModal .pricing-modal-content {
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        border-radius: 12px;
    }

    #contactModal .pricing-modal-body > div {
        padding: 12px !important;
    }

    #contactModal a[href^="mailto:"] {
        font-size: 16px !important;
    }
    
    .top-notification {
        left: 10px;
        right: 10px;
        transform: translateY(-100px);
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .top-notification.show {
        transform: translateY(0);
    }
}

/* 图片预览模态框样式 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20001;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.image-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 20002;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.3s ease;
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 20003;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-preview-image-container {
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    overflow: hidden;
}

.image-preview-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-preview-info {
    margin-top: 20px;
    text-align: center;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.image-preview-prompt {
    color: white;
    font-size: 16px;
    line-height: 1.6;
    padding: 0 20px;
    word-wrap: break-word;
}

.image-preview-prompt.is-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.image-preview-prompt-toggle {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.image-preview-prompt-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-preview-download {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.image-preview-download:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-preview-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.image-preview-download .download-icon {
    font-size: 18px;
}

.image-preview-download .download-text {
    font-size: 16px;
}

.message-item-thumbnail.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message-item-thumbnail.clickable:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 博客静态页（guide 内嵌 iframe）正文显示兜底 — 仅文章页，黑底白字 */
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block {
    color: #d1d5db !important;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block p,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block h2,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block h3,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block li,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block span,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block strong {
    color: #d1d5db !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block h2,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block h3,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block .section-title,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block .subsection-title,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block .micro-title {
    color: #fafafa !important;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block strong {
    color: #f3f4f6 !important;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block a {
    color: #93c5fd !important;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block p.blog-lead {
    color: #cbd5e1 !important;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block p.blog-kicker {
    color: #f9fafb !important;
    border-left-color: #60a5fa !important;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block ul,
body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block ol {
    display: block !important;
    margin: 0 0 14px !important;
    padding-left: 1.25rem !important;
}

body.generate-page:has(main.blog-static-wrapper) .blog-static-card .blog-block li {
    display: list-item !important;
    margin-bottom: 8px !important;
    line-height: 1.8 !important;
}

@media (max-width: 768px) {
    .image-preview-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .image-preview-image {
        max-height: 70vh;
    }
    
    .image-preview-close {
        top: -35px;
        right: -10px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .image-preview-prompt {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .image-preview-download {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    .image-preview-download .download-icon {
        font-size: 16px;
    }
    
    .image-preview-download .download-text {
        font-size: 14px;
    }
}

/* 使用指南弹窗样式 */
.guide-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.guide-modal.show {
    display: flex;
}

.guide-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.guide-modal-content {
    position: relative;
    /* 弹窗整体背景为白色，与网站深色背景形成明显对比 */
    background: #ffffff;
    border-radius: 16px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 20001;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.guide-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    /* 头部也使用浅色背景，保持整块弹窗干净的白色系 */
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-bottom: 1px solid #e5e7eb;
}

.guide-modal-title {
    font-size: 20px;
    font-weight: 600;
    /* 深色文字搭配白色背景 */
    color: #111827;
    margin: 0;
}

.guide-modal-close {
    background: #f3f4f6;
    border: none;
    color: #4b5563;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.guide-modal-close:hover {
    background: #e5e7eb;
    transform: none;
}

.guide-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.guide-wrapper-inner {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.guide-sidebar {
    width: 250px;
    /* 侧边栏使用浅色背景，避免与整站深色背景混在一起 */
    background: #f8f9fa;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.guide-sidebar h3 {
    /* 浅色背景上的分组标题 */
    color: #111827;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.guide-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-nav li {
    margin-bottom: 0.5rem;
}

.guide-nav a {
    display: block;
    padding: 0.75rem 1rem;
    /* 浅色背景上的导航文字 */
    color: #111827;
    text-decoration: none;
    border-radius: 6px;
    /* 取消背景动画，避免选中样式出现延迟感 */
    transition: color 0.15s ease;
    font-size: 14px;
}

.guide-nav a:hover {
    /* 浅色主题下的悬停效果：轻微灰底 + 深色文字 */
    background: rgba(15, 23, 42, 0.04);
    color: #111827;
}

.guide-nav a.active {
    /* 激活态依然使用深色块，形成清晰对比 */
    background: #111827;
    color: white;
}

.guide-container-inner {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    /* 主内容区域使用深色文字，适配白色弹窗背景 */
    color: #111827;
}

.guide-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.guide-header h1 {
    font-size: 2rem;
    /* 顶部主标题使用深色文字 */
    color: #111827;
    margin-bottom: 0.5rem;
}

.guide-section {
    margin-bottom: 2rem;
    /* 浅色卡片背景，更符合白色弹窗风格 */
    background: rgba(255, 255, 255, 0.98);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    scroll-margin-top: 1rem;
}

.guide-section h2 {
    /* 浅色背景下的章节标题 */
    color: #111827;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.guide-section h3 {
    /* 浅色背景下的小标题 */
    color: #374151;
    font-size: 1.2rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
}

.guide-section .step-list {
    list-style: none;
    padding: 0;
    counter-reset: step-counter;
}

.guide-section .step-list li {
    margin-bottom: 1rem;
    padding-left: 2.5rem;
    position: relative;
}

.guide-section .step-list li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    /* 步骤圆圈：深色圆底 + 白字，在白色内容卡片中更醒目 */
    background: #111827;
    color: #ffffff;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.guide-section .highlight {
    background: #fff3cd;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    color: #856404;
}

.guide-section .tip-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.guide-section .tip-box strong {
    color: #1976D2;
}

.guide-section .warning-box {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.guide-section .warning-box strong {
    color: #f57c00;
}

.guide-section .icon {
    font-size: 1.3rem;
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .guide-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .guide-wrapper-inner {
        flex-direction: column;
    }
    
    .guide-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .guide-container-inner {
        padding: 1rem;
    }
    
    .guide-header h1 {
        font-size: 1.5rem;
    }
    
    .guide-section {
        padding: 1rem;
    }
}

/* 首页手机端：生成卡片左右贴屏（仅 generate-page，不影响其他页面 main-content） */
@media (max-width: 768px) {
    .top-nav {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .top-nav.scrolled,
    body.generate-page .top-nav.scrolled,
    body.dashboard-page .top-nav.scrolled {
        background: #0f121c !important;
        background-color: #0f121c !important;
    }

    body.generate-page .generate-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* 顶栏半透明按钮叠在背景图上，移动端补不透明底，保证白字 ≥4.5:1 */
    body.generate-page .top-nav .top-login-btn {
        background: rgba(15, 18, 28, 0.88);
        color: #fff;
    }

    body.generate-page .nav-menu-toggle {
        background: rgba(15, 18, 28, 0.88);
    }

    body.generate-page .main-content {
        padding-left: 0;
        padding-right: 0;
        overflow: visible !important;
    }

    body.generate-page .upper-module {
        padding-left: 0;
        padding-right: 0;
        /* 移动端与桌面一致：由内容自然撑开，不做裁切 */
        padding-top: max(4.25rem, calc(env(safe-area-inset-top, 0px) + 3.25rem));
        min-height: 100vh;
        min-height: 100dvh;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body.generate-page .upper-module-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        overflow-x: hidden;
        overflow-y: visible;
        min-height: 0;
        height: auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    body.generate-page .generate-card {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        border-radius: 16px;
        box-sizing: border-box;
        min-height: 0;
        padding: 0.95rem 0.85rem;
        overflow-x: hidden;
        overflow-y: visible;
    }

    body.generate-page .upper-module > .top-header {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.5rem !important;
    }

    /* 手机端仅保留生成按钮区域，隐藏模板行中的其他标签 */
    body.generate-page .prompt-templates-row > :not(.generate-action) {
        display: none !important;
    }

    body.generate-page .prompt-templates-row {
        display: flex !important;
        justify-content: center;
        align-items: center;
        margin-top: 0.75rem;
    }

    body.generate-page .prompt-templates-row .generate-action {
        width: auto;
        justify-content: center;
    }

    body.generate-page .prompt-templates-row .generate-btn {
        width: min(88vw, 320px);
        max-width: 100%;
        min-width: 0;
    }

    /* 手机端压缩生成区垂直高度，尽量让生成按钮进入首屏；标签过长时横向滑动 */
    body.generate-page .mode-tabs {
        margin-bottom: 0.5rem;
        gap: 1rem;
        padding-bottom: 0.2rem;
    }

    body.generate-page .prompt-group {
        margin-bottom: 0.75rem;
    }

    body.generate-page .prompt-input {
        min-height: 108px;
        height: 108px;
        padding: 0.9rem 0.85rem;
        line-height: 1.45;
    }

    body.generate-page .options-row {
        gap: 0.5rem;
    }

    /* 手机端保留与桌面同一套自定义下拉，不再额外切换显示逻辑 */
}

/* 全端统一：隐藏原生选择框，使用自定义下拉 */
body.generate-page #model.option-select,
body.generate-page #style.option-select,
body.generate-page #aspectRatio.option-select,
body.generate-page #count.option-select,
body.generate-page #quantity.option-select {
    display: none;
}

@media (min-width: 769px) {
    body.generate-page .options-row {
        gap: 0.75rem;
        align-items: center;
    }

    body.generate-page .options-container {
        column-gap: 0.75rem;
        row-gap: 0.8rem;
    }

    body.generate-page .option-select {
        min-height: 46px;
        padding: 0.72rem 0.92rem;
        padding-right: 2.3rem;
        font-size: 0.86rem;
        background-position: right 0.85rem center;
        background-size: 12px;
        border: 1px solid rgba(18, 24, 40, 0.12);
        border-radius: 12px;
        background-color: #f7f8fa;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 2px rgba(16, 24, 40, 0.04), 0 3px 8px rgba(16, 24, 40, 0.06);
        transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    body.generate-page .option-select:hover {
        background-color: #f1f3f7;
        border-color: rgba(18, 24, 40, 0.2);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 14px rgba(16, 24, 40, 0.1);
    }

    body.generate-page .option-select:focus {
        background-color: #ffffff;
        border-color: rgba(111, 29, 99, 0.45);
        box-shadow: 0 0 0 3px rgba(111, 29, 99, 0.2), 0 8px 16px rgba(16, 24, 40, 0.1);
    }

    body.generate-page[data-theme="theme1"] .option-select {
        border-color: rgba(224, 224, 224, 0.2);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 4px 10px rgba(0, 0, 0, 0.2);
        background-color: #4a4a4a;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme1"] .option-select:hover {
        border-color: rgba(224, 224, 224, 0.32);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 7px 16px rgba(0, 0, 0, 0.25);
        background-color: #5a5a5a;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme1"] .option-select:focus {
        border-color: rgba(157, 127, 216, 0.6);
        box-shadow: 0 0 0 3px rgba(157, 127, 216, 0.26), 0 7px 16px rgba(0, 0, 0, 0.25);
        background-color: #5a5a5a;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme2"] .option-select {
        border-color: rgba(255, 182, 77, 0.38);
        box-shadow: 0 1px 2px rgba(180, 90, 20, 0.08), 0 4px 10px rgba(180, 90, 20, 0.1);
        background-color: #f5f5f5;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme2"] .option-select:hover {
        border-color: rgba(255, 153, 51, 0.52);
        box-shadow: 0 1px 2px rgba(180, 90, 20, 0.1), 0 7px 16px rgba(180, 90, 20, 0.14);
        background-color: #e8e8e8;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme2"] .option-select:focus {
        border-color: rgba(255, 107, 107, 0.55);
        box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2), 0 7px 16px rgba(180, 90, 20, 0.14);
        background-color: #e8e8e8;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme3"] .option-select {
        border-color: rgba(0, 210, 255, 0.32);
        box-shadow: 0 1px 2px rgba(0, 140, 180, 0.08), 0 4px 10px rgba(0, 140, 180, 0.1);
        background-color: #f5f5f5;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme3"] .option-select:hover {
        border-color: rgba(0, 210, 255, 0.5);
        box-shadow: 0 1px 2px rgba(0, 140, 180, 0.1), 0 7px 16px rgba(0, 140, 180, 0.15);
        background-color: #e8e8e8;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme3"] .option-select:focus {
        border-color: rgba(0, 210, 255, 0.65);
        box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.2), 0 7px 16px rgba(0, 140, 180, 0.15);
        background-color: #e8e8e8;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme2"][data-bg="keji"] .option-select {
        border-color: rgba(0, 200, 255, 0.28);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.35);
        background-color: #252a33;
        background-position: right 0.75rem center;
        background-size: 10px;
    }

    body.generate-page[data-theme="theme2"][data-bg="keji"] .option-select:hover,
    body.generate-page[data-theme="theme2"][data-bg="keji"] .option-select:focus {
        border-color: rgba(0, 200, 255, 0.52);
        box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.2), 0 8px 18px rgba(0, 0, 0, 0.42);
        background-color: #2d333b;
        background-position: right 0.75rem center;
        background-size: 10px;
    }
}
