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

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

/* 完全隐藏滚动条但保持滚动功能 */
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正确显示 */
* {
    font-variant-emoji: emoji;
}

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

@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: transparent;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    padding: 0.75rem 0;
    margin-bottom: 0;
    margin-top: 0;
    transition: background 0.3s ease, border-bottom-color 0.3s ease;
}

body.generate-page .top-nav,
body.generate-page .top-nav .nav-link,
body.generate-page .top-nav .upgrade-member-btn,
body.generate-page .top-nav .upgrade-text,
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);
}

/* 导航栏滚动时的样式 */
.top-nav.scrolled {
    background: rgba(0, 0, 0, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !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-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: #ffffff !important;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

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

/* 主内容区域 */
.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%; /* 在小屏幕上允许缩小 */
    box-sizing: border-box;
    /* 确保卡片布局稳定，不会因为内容变化而影响其他元素 */
    min-height: 400px; /* 设置最小高度，避免高度变化过大 */
}



/* 模式选择标签 */
.mode-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    background: transparent;
    padding: 0;
    border: none;
    justify-content: flex-start;
    align-items: center;
}

.mode-tab {
    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: #999;
    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%;
}

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

.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: #999;
    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;
    gap: 0;
    flex: 0 0 auto; /* 改为不自动扩展，保持内容宽度 */
    min-width: 0;
    justify-content: flex-start; /* 确保左对齐 */
}

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

.option-item:last-child {
    margin-right: 0;
}

/* 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;
}

/* 比例选择器自定义下拉菜单（带比例预览框） */
.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;
    margin-left: auto; /* 确保在选项少时仍然保持在右侧 */
}

.public-toggle-label {
    font-size: 0.9rem;
    color: #666;
    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;
    /* 统一使用站点主配色的紫色渐变按钮 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    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, #764ba2 0%, #667eea 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);
}


/* 图片广场区域 */
.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-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);
}

.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;
}
.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%, #9d4edd 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; /* 强制左右排列，不自动换行到下一行 */
}
/* 非常窄的小屏时才改为上图下详情 */
@media (max-width: 400px) {
    .gallery-detail-content {
        flex-direction: column;
    }
}
.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;
    background: linear-gradient(135deg, #6F1D63 0%, #9d4edd 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);
}

/* 制作同款弹窗：展示 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;
}
.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 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;
}
/* 页脚社交图标 */
.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;
}

/* 生成的图片网格布局 - 一行显示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;
        padding-top: 70px; /* 移动端适配导航栏高度 */
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
    }
    
    .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;
    }
    
    .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: 90px;
        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;
}

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

/* 隐藏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: 4px;
    transition: background 0.3s;
}

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

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

/* 个人中心科技主题：与主页一致 */
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: #b4bac4;
}
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;
}

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

.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: all 0.3s;
}

.avatar-container:hover {
    border-color: #6F1D63;
}

.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.3s;
    margin-left: 0.5rem;
    user-select: none;
}

.edit-icon:hover {
    opacity: 1;
}

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

.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: all 0.3s 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;
}

.credits-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

/* 管理后台布局 */
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;
}

/* 消息中心按钮 - 在导航栏内 */
.message-center-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 1 !important;
    background: #000000 url('../images/message-icon.jpg') no-repeat center;
    background-size: 32px 32px;
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    user-select: none;
    transform: none !important;
    height: 36px;
    width: 36px;
    box-sizing: border-box;
    margin-right: 0.5rem;
}

.message-center-btn:hover {
    background: #1a1a1a url('../images/message-icon.jpg') no-repeat center;
    background-size: 32px 32px;
    transform: translateY(-1px);
}

.message-center-btn.loading {
    animation: spin 1s linear infinite;
}

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

/* 升级会员按钮 - 在导航栏内 */
.upgrade-member-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 1 !important;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    user-select: none;
    transform: none !important;
    height: 36px;
    box-sizing: border-box;
}

.upgrade-member-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.upgrade-icon {
    font-size: 1.1rem;
}

.upgrade-text {
    white-space: nowrap;
}

/* 语言切换容器 - 在导航栏内 */
.language-switcher-container {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 1 !important;
    /* 确保不受父元素 transform 影响 */
    transform: none !important;
    /* 确保在所有情况下都固定 */
    will-change: auto;
}

/* 认证按钮容器 - 在导航栏内 */
.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;
}

.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: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: none;
    transition: all 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:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.language-switcher:active {
    transform: translateY(0) scale(1);
}

.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[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: transparent;
}

body[data-theme="theme1"] .top-nav.scrolled {
    background: rgba(0, 0, 0, 0.95) !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, #6a4c93 0%, #9d7fd8 100%);
    box-shadow: 
        0 4px 12px rgba(106, 76, 147, 0.4),
        0 2px 4px rgba(106, 76, 147, 0.3);
}

body[data-theme="theme1"] .generate-btn:hover {
    background: linear-gradient(135deg, #9d7fd8 0%, #6a4c93 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[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: transparent;
}

body[data-theme="theme2"] .top-nav.scrolled {
    background: rgba(0, 0, 0, 0.95) !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, #ff6b6b 0%, #ff8e53 100%);
    box-shadow: 
        0 4px 12px rgba(255, 107, 107, 0.4),
        0 2px 4px rgba(255, 107, 107, 0.3);
}

body[data-theme="theme2"] .generate-btn:hover {
    background: linear-gradient(135deg, #ff8e53 0%, #ff6b6b 100%);
    box-shadow: 
        0 6px 16px rgba(255, 107, 107, 0.5),
        0 3px 8px rgba(255, 107, 107, 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[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: #9ca3af;
}
body[data-theme="theme2"][data-bg="keji"] .generate-card .mode-tab.active {
    color: #e4e8ee;
}
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: #6b7280;
}
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 {
    color: #b4bac4;
}
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[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: transparent;
}

body[data-theme="theme3"] .top-nav.scrolled {
    background: rgba(0, 0, 0, 0.95) !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, #00d2ff 0%, #00f260 100%);
    box-shadow: 
        0 4px 12px rgba(0, 210, 255, 0.4),
        0 2px 4px rgba(0, 210, 255, 0.3);
}

body[data-theme="theme3"] .generate-btn:hover {
    background: linear-gradient(135deg, #00f260 0%, #00d2ff 100%);
    box-shadow: 
        0 6px 16px rgba(0, 210, 255, 0.5),
        0 3px 8px rgba(0, 210, 255, 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: 10px;
        right: 10px;
        top: auto;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    body.generate-page .theme-switcher-icon {
        font-size: 1rem;
    }
    
    .top-header {
        padding-top: 110px;
    }
    
    .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);
}

/* 用户菜单弹窗 */
.user-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    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: 10001;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s 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: 16px 16px 0 0;
        max-height: 85vh;
    }
    
    .user-menu-modal {
        align-items: flex-end;
        padding: 0;
    }
}

/* 价格套餐弹窗 */
.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 {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.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: auto;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-container::-webkit-scrollbar {
        display: none;
    }
    
    .nav-left {
        flex-shrink: 0;
    }
    
    .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 */
}

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

.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;
        padding: 0;
        margin-right: 0.3rem;
        background-size: 28px 28px;
    }
    
    .message-center-btn:hover {
        background-size: 28px 28px;
    }
    
    .message-badge {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        top: -3px;
        right: -3px;
    }
    
    .message-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .message-item-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .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);
}

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