/* 生成中进度条动画 */
@keyframes aiProgressSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.ai-progress-bar {
    width: 40%;
    animation: aiProgressSlide 1.6s linear infinite;
}
/**
 * AI图片生成器优化样式 - 基于Tailwind CSS明亮主题
 * 
 * @package AI_Image_Generator
 * @since 1.0.0
 * 
 * 注意：大部分样式已迁移到Tailwind类中，此文件仅保留必要的自定义样式
 */

/* ====== 全局基础样式 ====== */

/* 视口单位修复与头部高度变量（移动端优化） */
:root {
    --vh: 1vh; /* JS 会在运行时覆盖为 window.innerHeight * 0.01 */
}

/* 基于 --vh 的容器高度（供未内联样式的页面使用） */
@media (max-width: 1024px) {
    #mainContainer {
        height: calc(var(--vh) * 100 - var(--header-height, 64px));
        min-height: calc(var(--vh) * 100 - var(--header-height, 64px));
    }
}

/* iOS 安全区适配（刘海/底部Home条） */
@supports (padding: max(0px)) {
    .site-header {
        padding-top: max(env(safe-area-inset-top), 0px);
    }
    #mobileMenu {
        padding-bottom: max(env(safe-area-inset-bottom), 0px);
    }
}

/* 移动端菜单显示/隐藏强制规则，避免与 .lg:hidden 冲突 */
@media (max-width: 1023px) {
    /* 任何情况下，标记为 hidden 的移动菜单与遮罩都必须隐藏 */
    #mobileMenu.hidden { display: none !important; }
    #mobileUserMenu.hidden { display: none !important; }
    #mobileMenuOverlay.hidden { display: none !important; }
    #leftPanel.hidden { display: none !important; }

    /* 当未标记 hidden 时，明确显示（覆盖 `.lg:hidden { display: block !important; }` 等自定义规则的副作用） */
    #mobileMenu:not(.hidden) { display: block !important; }
    #mobileUserMenu:not(.hidden) { display: block !important; }
    #mobileMenuOverlay:not(.hidden) { display: block !important; }
    #leftPanel:not(.hidden) { display: flex !important; flex-direction: column !important; }
}

/* 移动端侧边栏样式优化 */
@media (max-width: 1023px) {
    #leftPanel:not(.hidden) {
        position: fixed !important;
        top: var(--header-height, 64px) !important;
        left: 0 !important;
        width: 85% !important;
        max-width: 320px !important;
        height: calc(100vh - var(--header-height, 64px)) !important;
        z-index: 60 !important;
        background: white !important;
        border-right: 1px solid #e5e7eb !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15) !important;
    }
}

/* 图生图界面样式 */
#imageUploadArea {
    transition: all 0.3s ease;
    border-color: #d1d5db;
}

#imageUploadArea:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

#imageUploadArea.border-blue-400 {
    border-color: #3b82f6 !important;
    background-color: #dbeafe !important;
}

.suggestion-tag {
    cursor: pointer;
    user-select: none;
}

.suggestion-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 上传图片预览样式 */
#uploadedImagePreview {
    animation: fadeIn 0.3s ease-in-out;
}

/* 面板切换动画 */
#textToImagePanel,
#imageToImagePanel {
    transition: opacity 0.3s ease-in-out;
}

/* 统一文生图与图生图描述词模块距离顶部的间距
   注意：父容器使用了 space-y-6，会给后续兄弟元素添加 margin-top。
   这里强制两个面板自身的 margin-top 为 0，避免因面板顺序导致顶部距离不一致。 */
#textToImagePanel,
#imageToImagePanel {
    margin-top: 0 !important;
}

#textToImagePanel.hidden,
#imageToImagePanel.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 全局主体样式 */
body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #334155;
}

/* 主容器背景 */
.h-screen {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ====== 自定义组件样式 ====== */
/* 侧边栏明亮主题渐变 */
.sidebar-light {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
}

/* ====== 现代化任务区域样式 ====== */

/* 隐藏滚动条工具类 */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* 状态筛选按钮组 */
.status-filter {
    position: relative;
    color: #64748b;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.status-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 0.75rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.status-filter:hover::before {
    opacity: 0.1;
    transform: scale(1);
}

.status-filter.active::before {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.status-filter.active {
    color: white;
    font-weight: 600;
}

.status-filter.active .count-badge {
    background-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    backdrop-filter: blur(10px);
}

.status-filter:not(.active) .count-badge {
    background-color: #9ca3af;
    color: white;
    transition: all 0.3s ease;
}

.status-filter:hover:not(.active) .count-badge {
    background-color: #6b7280;
}

/* 合并下方重复定义的交互动效，保持现有视觉效果 */
.status-filter {
    transform: translateY(0);
}

.status-filter:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.status-filter.active {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* 视图切换按钮 */
.view-toggle {
    position: relative;
    color: #6b7280;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    cursor: pointer;
}

.view-toggle.active {
    color: #3b82f6;
    background-color: #eff6ff;
}

.view-toggle:hover {
    color: #3b82f6;
    background-color: #f9fafb;
}

/* 图片卡片样式 */
.image-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #e2e8f0;
}

.image-card .card-image {
    aspect-ratio: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f8fafc;
    position: relative;
}

.image-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover .card-image img {
    transform: scale(1.05);
}

.image-card .card-content {
    padding: 1rem;
}

.image-card .status-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    z-index: 10;
}

/* 已移除完成状态徽章样式 */

.image-card .status-badge.processing {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.image-card .status-badge.failed {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

/* card-actions 现在位于右上角，使用内联样式定位 */

/* 简化的图片卡片操作按钮样式 */
.image-card .action-btn {
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.9;
}

.image-card .action-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}

/* 加载占位符动画 */
.loading-placeholder {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

/* 进度条样式 */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.3s ease;
    stroke-linecap: round;
}

/* 响应式优化 */
@media (max-width: 640px) {
    .status-filter {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .image-card .card-content {
        padding: 0.75rem;
    }
    
    .image-card .status-badge {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem;
    }
    
    /* 移动端参数标签优化 */
    .image-card .space-y-2 > div:first-child {
        min-height: 1.5rem; /* 移动端稍微减少高度 */
    }
    
    .image-card .space-y-2 > div:first-child .truncate {
        max-width: 80px; /* 移动端更紧凑 */
    }
    
    .image-card .space-y-2 > div:first-child .inline-flex {
        font-size: 0.6875rem; /* 11px */
        padding: 0.125rem 0.5rem;
    }
    
    .image-card .space-y-2 > div:first-child svg {
        width: 0.625rem;
        height: 0.625rem;
        margin-right: 0.125rem; /* 减少图标间距 */
    }
    
    /* 移动端完成状态指示器 */
    .image-card .text-green-600 {
        font-size: 0.6875rem;
    }
    
    .image-card .text-green-600 svg {
        width: 0.625rem;
        height: 0.625rem;
    }
    
    /* 移动端按钮进一步简化 */
    .image-card .card-actions {
        top: 0.375rem;
        right: 0.375rem;
    }
    
    .image-card .action-btn {
        width: 1.25rem; /* w-5 */
        height: 1.25rem; /* h-5 */
    }
    
    .image-card .action-btn svg {
        width: 0.625rem; /* w-2.5 */
        height: 0.625rem; /* h-2.5 */
    }
}

/* 装饰性动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-float-delay-1 {
    animation: float 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

.animate-float-delay-2 {
    animation: float 3s ease-in-out infinite;
    animation-delay: 1s;
}

/* 统一认证按钮特效 */
#authModalBtnSidebar:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* 功能特色卡片悬停效果增强 */
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* 新欢迎页面的背景渐变 */
.welcome-bg-gradient {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.03) 0%, 
        rgba(139, 92, 246, 0.03) 50%, 
        rgba(219, 39, 119, 0.03) 100%);
}

/* 复制按钮样式优化 */
.copy-user-message-btn {
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ====== AI生成图片特殊样式 ====== */
/* 图片网格容器优化 - 响应式设计 */
.ai-image-only {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    width: 100%;
    max-width: 480px; /* 移动端更紧凑 */
    margin: 0 auto;
}

@media (min-width: 640px) {
    .ai-image-only {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.75rem;
        max-width: 600px;
    }
}

@media (min-width: 1024px) {
    .ai-image-only {
        max-width: 640px;
    }
}

/* 响应式图片尺寸优化 */
img.ai-generated-image {
    max-width: 200px;
    max-height: 200px;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    transition: transform 0.2s ease-in-out;
}

@media (min-width: 640px) {
    img.ai-generated-image {
        max-width: 280px;
        max-height: 280px;
        border-radius: 0.75rem;
    }
}

@media (min-width: 1024px) {
    img.ai-generated-image {
        max-width: 320px;
        max-height: 320px;
    }
}

img.ai-generated-image:hover {
    transform: scale(1.02);
}

/* 图片容器和操作按钮优化 */
.ai-image-wrap, .ai-image-container {
    position: relative;
    transition: all 0.2s ease-in-out;
}

/* 移除容器悬停效果，保持简洁 */

.ai-download-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.ai-image-wrap:hover .ai-download-overlay,
.ai-image-container:hover .ai-download-overlay {
    opacity: 1;
}


/* 按钮容器 - 悬停显示 */
.ai-image-overlay {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.ai-image-container:hover .ai-image-overlay {
    opacity: 1;
}

/* 按钮磨砂效果 - 透明风格 */
.ai-image-overlay button {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), 
                0 1px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.ai-image-overlay button:hover {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 响应式调整 */
@media (max-width: 640px) {
    .ai-image-overlay {
        opacity: 1 !important; /* 小屏幕设备一直显示按钮 */
        bottom: 0.6rem;
        padding: 0.375rem 0.5rem;
        gap: 0.375rem;
    }
    
    .ai-image-overlay button {
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem; /* 缩小字体到10px */
        gap: 0.125rem;
        border-radius: 0.375rem; /* 稍微缩小圆角 */
    }
    
    .ai-image-overlay button svg {
        width: 0.75rem;
        height: 0.75rem;
    }
}

/* 平板端适中调整 */
@media (min-width: 641px) and (max-width: 1023px) {
    .ai-image-overlay button {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        gap: 0.375rem;
    }
}

@media (min-width: 1024px) {
    .ai-image-overlay {
        bottom: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .ai-image-overlay button {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }
}

.ai-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 8px;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    color: #374151;
    backdrop-filter: blur(8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
    .ai-download-btn {
        padding: 8px;
        border-radius: 10px;
    }
}

.ai-download-btn {
    cursor: pointer;
}

.ai-download-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(59, 130, 246, 0.2);
}

.ai-download-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}


/* ====== 原始数据信息图标与浮层 ====== */
.raw-info .raw-icon {
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px;
    border-radius: 6px;
}

.raw-info .raw-icon:hover { 
    color: #374151;
    background-color: rgba(59, 130, 246, 0.1);
}

.raw-tooltip {
    position: absolute;
    transform: translateY(8px);
    max-width: 640px;
    min-width: 280px;
    z-index: 40;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background-color: rgba(255, 255, 255, 0.98);
    color: #374151;
    box-shadow: 0 20px 64px rgba(0,0,0,0.12);
    backdrop-filter: blur(16px);
}

.raw-pre {
    white-space: pre-wrap;
    font-family: 'SFMono-Regular', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
}

/* ====== 特殊CSS动画效果 ====== */
/* 打字光标动画优化 */
.typing-cursor {
    color: #2563eb; /* blue-600 */
    animation: cursor-blink 1s infinite;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(37, 99, 235, 0.4);
}

@keyframes cursor-blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* ====== 移动端优化 ====== */
@media (max-width: 767.98px) {
    /* 移动端主容器优化 */
    #mainContainer {
        flex-direction: column !important;
        height: calc(100vh - var(--header-height, 56px)) !important;
        min-height: calc(100vh - var(--header-height, 56px)) !important;
    }
    
    /* 移动端主布局优化 */
    .h-screen {
        height: 100vh;
        min-height: 100vh;
    }
    
    /* 移动端右侧面板全屏显示 */
    #rightPanel {
        width: 100% !important;
        padding: 0.75rem;
        flex: 1;
        overflow: hidden;
    }
    /* 防止右侧内容因子元素最小宽度导致换行 */
    #rightPanel { min-width: 0; }
    
    /* 移动端左侧面板完全隐藏 */
    #leftPanel {
        display: none !important;
        width: 0 !important;
    }
    
    /* 图片下载按钮在移动端始终显示 */
    .ai-download-overlay {
        opacity: 1;
    }
    
    /* 防止iOS Safari缩放 */
    #messageInput {
        font-size: 16px;
    }
    
    /* 移动端图片网格间距优化 */
    #imageGrid {
        gap: 0.75rem;
    }
    
    /* 移动端图片网格具体优化 */
    #imageGrid .grid {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    @media (min-width: 480px) {
        #imageGrid .grid {
            grid-template-columns: repeat(2, 1fr) !important;
        }
    }
    
    /* 移动端筛选和操作区域优化 */
    .flex.flex-col.lg\\:flex-row.lg\\:items-center.lg\\:justify-between {
        gap: 1rem !important;
    }
    
    /* 移动端状态筛选按钮优化 */
    .status-filter {
        min-height: 2.5rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    /* 移动端操作按钮组优化 */
    #toggleSelectMode {
        min-height: 2.75rem !important;
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
}

/* ====== 可访问性优化 ====== */
/* 减少动画（尊重用户偏好）：保留关键反馈动画，降低非关键动效 */
@media (prefers-reduced-motion: reduce) {
    /* 关闭非关键的过渡动画，避免大幅运动 */
    .ai-download-btn,
    .ai-generated-image,
    .feature-card,
    .announcement-item {
        transition: none !important;
    }

    /* 禁用装饰性/大面积动画（不影响关键加载指示器） */
    .decorative-particles,
    .welcome-bg-gradient,
    .announcement-gradient,
    .announcement-modern {
        animation: none !important;
        transition: none !important;
    }

    /* 保留关键反馈动画（等待提示/加载旋转/打字光标等） */
    #globalWaitingNotice *,
    .typing-cursor,
    .animate-spin,
    .animate-pulse,
    .animate-bounce {
        animation-duration: 0.8s !important;
        animation-iteration-count: infinite !important;
    }
}

/* ====== 层级管理 ====== */

/* 图片下载按钮层级调整 */
.ai-download-overlay {
    z-index: 5 !important;
}


/* ====== 自适应容器优化 ====== */
/* 主容器自适应 */
.h-screen {
    min-height: 100vh;
    height: 100vh;
}

/* 主容器高度修复 */
#mainContainer {
    min-height: calc(100vh - var(--header-height));
    max-height: calc(100vh - var(--header-height));
}

@media (max-width: 1023px) {
    /* 移动端和平板端容器高度调整 */
    #mainContainer {
        height: calc(100vh - var(--header-height)) !important;
        min-height: calc(100vh - var(--header-height)) !important;
        max-height: calc(100vh - var(--header-height)) !important;
        overflow: hidden;
    }
}

/* 内容区域滚动优化 */
#rightPanel > .flex-1 {
    overflow-y: auto;
    overflow-x: hidden;
}

/* 图片网格容器滚动优化 */
#imageGrid {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* 分页与网格底部间距优化（默认） */
#imageGrid .grid {
    padding-bottom: 0.5rem; /* 原为 pb-4，通过CSS收紧以减少与分页的间距 */
}

#pagination {
    margin-top: 0.5rem; /* 原为 mt-3，略微收紧，减少与网格的空隙 */
}

/* 移动端分页样式优化 */
@media (max-width: 639px) {
    #pagination {
        margin-top: 0.75rem;
        padding: 0 0.5rem;
    }
    
    /* 页码按钮移动端样式 */
    #pageNumbers button {
        min-width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        font-size: 0.75rem !important;
        line-height: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* 当前页码按钮强调 */
    #pageNumbers button.bg-blue-600 {
        font-weight: 600 !important;
    }
    
       /* 省略号样式 */
       #pageNumbers .pagination-ellipsis {
           padding: 0 0.25rem !important;
           font-size: 0.875rem !important;
           color: #9ca3af !important;
       }
   }

   /* 输入框基础优化 - 使用Tailwind优先，仅必要的补充 */
   #promptInput, #promptInputImage {
       /* 防止iOS自动放大 */
       font-size: 16px !important;
       /* 确保行高一致性 */
       line-height: 1.625 !important;
   }
   
   /* 桌面端字体大小优化 */
   @media (min-width: 1024px) {
       #promptInput, #promptInputImage {
           font-size: 14px !important;
       }
   }

/* ====== 左侧面板响应式优化 ====== */
/* 中等屏幕左侧面板宽度调整 */
@media (min-width: 1024px) and (max-width: 1279px) {
    #leftPanel {
        width: 22rem; /* w-88 approximately */
        min-width: 22rem;
    }
}

/* 大屏幕左侧面板宽度 */
@media (min-width: 1280px) {
    #leftPanel {
        width: 16rem; /* w-64 */
        min-width: 16rem;
    }
}

/* 超大屏幕左侧面板宽度稍微增加 */
@media (min-width: 1536px) {
    #leftPanel {
        width: 18rem; /* w-72 */
        min-width: 18rem;
    }
}



/* 左侧面板内容padding优化 */
#leftPanel .overflow-y-auto > div {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

@media (min-width: 1024px) {
    #leftPanel .overflow-y-auto > div {
        padding: 1.5rem;
    }
}

/* ====== UI元素间距优化 ====== */
/* 描述输入区域优化 */
#leftPanel .space-y-3 > * + * {
    margin-top: 0.875rem;
}

/* 尺寸选择按钮网格间距 */
#leftPanel .grid.grid-cols-3.gap-2 {
    gap: 0.5rem;
}

/* 选项卡按钮间距 */
#leftPanel .flex.rounded-lg.bg-gray-100.p-1 {
    padding: 0.375rem;
    gap: 0.25rem;
}

/* 底部用户区域优化 */
#leftPanel .border-t.border-gray-100 {
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), #ffffff);
}


/* 任务卡片提示词区域样式 */
.prompt-container {
    position: relative;
    min-height: 2.5rem; /* 确保两行的最小高度 */
    line-height: 1.25rem;
}

/* 任务卡片参数标签优化 */
.image-card .space-y-2 > div:first-child {
    min-height: 1.75rem; /* 确保参数行有足够高度 */
}

.image-card .space-y-2 > div:first-child .inline-flex {
    max-width: 100%;
    transition: all 0.2s ease;
}

.image-card .space-y-2 > div:first-child .truncate {
    max-width: 120px;
}

/* 参数标签悬停效果 */
.image-card .space-y-2 > div:first-child .inline-flex:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 完成状态指示器样式 */
.image-card .text-green-600 {
    font-weight: 500;
}

.prompt-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* 标准属性 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 2rem; /* 为复制按钮留出空间 */
    min-height: 2.5rem; /* 确保占位高度 */
}

.copy-prompt-btn {
    position: absolute;
    top: 0;
    right: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.prompt-container:hover .copy-prompt-btn {
    opacity: 1;
}

.copy-prompt-btn:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* 用户信息卡片悬停效果 */
.bg-white.rounded-xl.p-4.mb-4.border.border-gray-100.shadow-sm,
.bg-white.rounded-xl.p-3.mb-4.border.border-gray-100.shadow-sm {
    transition: all 0.2s ease-in-out;
}

.bg-white.rounded-xl.p-4.mb-4.border.border-gray-100.shadow-sm:hover,
.bg-white.rounded-xl.p-3.mb-4.border.border-gray-100.shadow-sm:hover {
    border-color: #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 生成按钮优化样式 */
button[id*="generateBtn"] {
    position: relative;
    overflow: hidden;
}

button[id*="generateBtn"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button[id*="generateBtn"]:hover::before {
    left: 100%;
}

/* 顶部logo区域优化 */
#leftPanel .px-4.py-4.border-b {
    padding: 1.25rem 1rem;
}

/* 功能切换选项卡区域 */
#leftPanel .px-4.py-4.border-b.border-gray-100 {
    padding: 1rem;
}

/* 标签切换过渡效果 */
.tab-button {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.tab-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* 状态筛选按钮过渡效果：基础过渡由上方块已声明，这里保留一次 */
.status-filter {
    transition: all 0.3s ease;
}

/* 设置标签过渡效果 */
.settings-tab {
    transition: all 0.3s ease;
    position: relative;
}

.settings-tab:hover {
    transform: translateY(-1px);
}

.settings-tab.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* 图片尺寸选择器样式 */
.size-option.active {
    border-color: #3B82F6 !important;
    background-color: #EBF8FF !important;
    color: #2563EB !important;
}

.size-option.active div {
    background-color: #3B82F6 !important;
}

.size-option.active span {
    color: #2563EB !important;
}

/* 确保尺寸选择器的默认状态 */
.size-option {
    border-color: #E5E7EB;
    background-color: #FFFFFF;
    color: #6B7280;
}

.size-option div {
    background-color: #9CA3AF;
}

.size-option:hover {
    border-color: #D1D5DB;
    background-color: #F9FAFB;
}

/* 内容面板淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

/* 移动端标签样式优化 */
@media (max-width: 768px) {
    .tab-button {
        font-size: 0.875rem;
        padding: 0.625rem 0.75rem;
    }
    
    .status-filter {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .settings-tab {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* 减少移动端的hover效果，避免触摸设备问题 */
    .tab-button:hover,
    .status-filter:hover,
    .settings-tab:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* 移动端点击反馈 */
    .tab-button:active,
    .status-filter:active,
    .settings-tab:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* 表单标签和输入框间距优化 */
#leftPanel label {
    margin-bottom: 0.625rem;
}

#leftPanel .space-y-6 textarea,
#leftPanel .space-y-6 select,
#leftPanel .space-y-6 input {
    margin-bottom: 0.125rem;
}

/* 建议标签区域间距 */
#leftPanel .flex.flex-wrap.gap-2 {
    gap: 0.5rem;
    margin-top: 0.625rem;
}

/* 推荐区域内边距 */
#leftPanel .bg-gray-50.border.border-gray-200.rounded-lg.p-3 {
    padding: 0.875rem;
}


/* ====== 上传图片预览优化（不增加整体高度） ====== */
/* 横向滚动列表容器 */
.images-list-row {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.images-list-row::-webkit-scrollbar {
    height: 8px;
}

.images-list-row::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.6); /* slate-400 */
    border-radius: 9999px;
}

/* 预览项尺寸统一，避免撑高 */
.image-preview-item img {
    width: 64px;   /* w-16 */
    height: 64px;  /* h-16 */
    object-fit: cover;
    border-radius: 0.5rem; /* rounded-lg */
}

.image-preview-item {
    display: inline-block; /* 便于nowrap水平排列 */
}

/* 名称条覆盖层在缩略图内，不加高布局（overlay） */
.image-preview-item > div {
    font-size: 11px;
}

/* ====== AI生成图片样式优化 ====== */
/* AI生成图片基础样式 - 明亮主题优化 */
.ai-generated-image {
    max-width: 240px;
    width: auto;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.ai-generated-image:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

/* 已移除图片预览模态框样式 */

/* ====== 平板端优化 ====== */
@media (max-width: 1024px) and (min-width: 768px) {
    .ai-image-only {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 0.875rem;
        max-width: 500px;
    }
    
    .ai-generated-image {
        max-width: 220px;
        border-radius: 14px;
    }
    
    /* 平板端欢迎页面优化 */
    .welcome-main-title {
        font-size: 3rem;
        line-height: 1.1;
    }
    
    .welcome-subtitle {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    .welcome-description {
        font-size: 1.25rem;
        line-height: 1.6;
    }
    
    /* 功能特色卡片平板布局 */
    .feature-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 2rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    /* 行动召唤区域平板优化 */
    .cta-section {
        padding: 2.5rem 2rem;
        margin: 0 2rem;
    }
    
}

/* ====== 移动端响应式优化 ====== */
@media (max-width: 767.98px) {
    /* 图片网格容器移动端优化 */
    .ai-image-only {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
        max-width: 100%;
    }
    
    /* 图片显示优化 */
    .ai-generated-image {
        border-radius: 12px;
        max-width: 180px;
    }
    
    .ai-generated-image:hover {
        transform: none; /* 移动端禁用悬停效果 */
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    }
    
    /* 移动端参数切换按钮动画 */
    
    /* 图片预览区域优化 */
    #uploadedImagesArea {
        max-height: 200px;
        overflow-y: auto;
    }
    
    
    /* 图片容器居左布局优化 */
    #inlineImages {
        align-items: flex-start !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        justify-content: flex-start !important;
    }
    
    /* 图片项目样式优化 - 强制正方形显示 */
    #inlineImages .inline-image-item {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px !important;
        min-height: 80px !important;
        max-width: 80px !important;
        max-height: 80px !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        flex-basis: auto !important;
        position: relative !important;
        overflow: hidden !important;
        border-radius: 8px !important;
        border: 2px solid transparent !important;
        transition: all 0.2s ease !important;
        display: block !important;
        box-sizing: border-box !important;
        aspect-ratio: 1/1 !important;
    }
    
    /* 超强制性样式 - 确保所有可能影响尺寸的属性都被覆盖 */
    div#inlineImages .inline-image-item {
        width: 80px !important;
        height: 80px !important;
    }
    
    body div#inlineImages .inline-image-item {
        width: 80px !important;
        height: 80px !important;
    }
    
    #inlineImages .inline-image-item:hover {
        border-color: #3b82f6 !important;
        transform: scale(1.02) !important;
    }
    
    #inlineImages .inline-image-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        border-radius: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 移动端作用域内不再嵌套桌面端媒体查询（不可达），对应样式已在全局适配 */
    
    
    
    /* 输入框内按钮组响应式优化 */
    @media (max-width: 640px) {
        /* 移动端图片显示优化 */
        #inlineImages .inline-image-item {
            width: 60px !important;
            height: 60px !important;
            min-width: 60px !important;
            min-height: 60px !important;
            max-width: 60px !important;
            max-height: 60px !important;
        }
        
        div#inlineImages .inline-image-item {
            width: 60px !important;
            height: 60px !important;
        }
        
        body div#inlineImages .inline-image-item {
            width: 60px !important;
            height: 60px !important;
        }
        
        /* 移动端删除按钮始终可见 */
        #inlineImages .inline-image-remove {
            opacity: 1;
            top: 2px;
            right: 2px;
            width: 18px;
            height: 18px;
            font-size: 10px;
        }
        
        /* 移动端输入区域间距调整 */
        #inputArea {
            margin-top: 0.75rem !important;
        }
        
        /* 移动端输入框按钮组调整 */
        #messageInput {
            padding-right: 8rem !important; /* 为按钮组留出更多空间 */
            min-height: 60px !important;
            padding-bottom: 2.5rem !important; /* 为移动端留出底部空间 */
        }
        /* 移动端：优化“优化提示词”按钮对齐与尺寸，避免不同浏览器错位 */
        .prompt-optimize-container {
            right: 0.5rem !important;
            bottom: 0.5rem !important;
            align-items: center;
            gap: 0.25rem !important;
            pointer-events: none; /* 容器不抢焦点 */
        }
        .prompt-optimize-container .prompt-optimize-btn {
            pointer-events: auto;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2.25rem;
            height: 2.25rem;
            min-width: 2.25rem;
            min-height: 2.25rem;
            line-height: 1;
            border-radius: 0.5rem;
            box-sizing: content-box;
        }
        .prompt-optimize-container .prompt-optimize-icon,
        .prompt-optimize-container .prompt-optimize-loading {
            width: 1rem !important;
            height: 1rem !important;
            flex: 0 0 auto;
        }
        
        /* 移动端按钮组间距调整 */
        .absolute.right-2.bottom-2 .flex.gap-1 {
            gap: 0.25rem;
        }
        
        /* 移动端按钮尺寸优化 - 使用Tailwind类优先 */
        #imageUploadBtn {
            padding: 0.25rem;
        }
        
        #sendBtn {
            width: 1.75rem;
            height: 1.75rem;
        }
        
        /* 移动端按钮图标尺寸 - promptOptimizeBtn使用Tailwind响应式类 */
        #imageUploadBtn svg,
        #sendBtn svg {
            width: 0.875rem;
            height: 0.875rem;
        }
        
        /* 移动端图片预览区域优化 */
        #uploadedImagesArea {
            max-height: 150px;
        }
        
        #uploadedImagesArea .bg-gray-50 {
            padding: 0.75rem;
        }
    }
    
    /* 移动端错误信息显示优化 */
    #messagesList .bg-white .ai-content {
        line-height: 1.6;
        font-size: 0.95rem;
    }
    
    /* 移动端错误消息特殊样式 */
    #messagesList .bg-white[data-error="true"],
    #messagesList .bg-white:has(.error-message) {
        border-left: 4px solid #ef4444;
        background: linear-gradient(to right, #fef2f2, #ffffff);
    }
    
    /* 移动端时间戳位置调整 */
    #messagesList .text-xs.text-gray-500 {
        margin-left: 2.75rem;
        font-size: 0.75rem;
    }
    
    /* 移动端复制按钮优化 - 调整大小 */
    .copy-user-message-btn {
        padding: 6px;
        min-width: 28px;
        min-height: 28px;
    }
    
    .copy-user-message-btn svg {
        width: 14px;
        height: 14px;
    }
    
    /* 已移除图片预览模态框样式 */
    
    /* 消息容器响应式 */
    .max-w-4xl {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 消息气泡最大宽度优化 */
    .max-w-\[75\%\] {
        max-width: 92% !important;
    }
    
    .lg\:max-w-\[60\%\] {
        max-width: 92% !important;
    }
    
    /* 移动端消息容器宽度优化 */
    #messagesList .mb-4 {
        width: 100%;
    }
    
    /* 移动端AI消息和用户消息容器优化 */
    #messagesList .flex.items-end {
        max-width: 95% !important;
        width: 100%;
    }
    
    /* 移动端消息气泡内容优化 */
    #messagesList .bg-gradient-to-r,
    #messagesList .bg-white {
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    /* 下载按钮在移动端的优化 */
    .ai-download-btn {
        width: 40px;
        height: 40px;
        padding: 10px;
    }
    
    .ai-download-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* 新欢迎页面移动端优化 */
    .welcome-main-title {
        font-size: 2.5rem; /* 调整主标题大小 */
        line-height: 1.1;
    }
    
    .welcome-subtitle {
        font-size: 1.875rem;
        line-height: 1.2;
    }
    
    .welcome-description {
        font-size: 1.125rem;
        line-height: 1.6;
        padding: 0 1rem;
    }
    
    /* 功能特色卡片移动端布局 */
    .feature-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .feature-card h3 {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-card p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    /* 行动召唤区域移动端优化 */
    .cta-section {
        padding: 2rem 1rem;
        margin: 0 1rem;
    }
    
    .cta-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .cta-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    /* 按钮组移动端布局 */
    .auth-buttons-mobile {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .auth-buttons-mobile button {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* 装饰性粒子移动端调整 */
    .decorative-particles {
        display: none; /* 移动端隐藏装饰粒子 */
    }
    
}

/* ====== 超宽屏优化 ====== */
@media (min-width: 1536px) {
    /* 2xl屏幕优化 */
    #messagesArea .max-w-4xl {
        max-width: 90rem; /* 6xl */
        padding-left: 3rem;
        padding-right: 3rem;
    }
    
    /* 超宽屏欢迎页面优化 */
    .welcome-main-title {
        font-size: 4rem;
        line-height: 1;
    }
    
    .welcome-subtitle {
        font-size: 3rem;
        line-height: 1.1;
    }
    
    .welcome-description {
        font-size: 1.5rem;
        line-height: 1.6;
        max-width: 4rem;
    }
    
    /* 功能特色卡片超宽屏布局 */
    .feature-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
        max-width: 6rem;
    }
    
    .feature-card {
        padding: 2rem;
    }
    
    .feature-card h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .feature-card p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* ====== 中等屏幕设备优化 ====== */
@media (min-width: 768px) and (max-width: 1023px) {
    /* 平板端主容器优化 */
    #mainContainer {
        flex-direction: column !important;
        height: calc(100vh - var(--header-height, 64px)) !important;
        min-height: calc(100vh - var(--header-height, 64px)) !important;
    }
    
    /* 平板端隐藏左侧面板 */
    #leftPanel {
        display: none !important;
        width: 0 !important;
    }
    
    /* 平板端显示移动端顶部导航 */
    .lg\:hidden {
        display: flex !important;
    }
    
    /* 平板端右侧面板全屏 */
    #rightPanel {
        width: 100% !important;
        padding: 1rem;
        flex: 1;
        overflow: hidden;
    }
    
    
    /* 已移除状态提示相关样式 */
    
    /* 平板端图片网格优化 */
    #imageGrid {
        gap: 1rem;
    }
    
    #imageGrid .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    @media (min-width: 900px) and (max-width: 1023px) {
        #imageGrid .grid {
            grid-template-columns: repeat(3, 1fr) !important;
        }
    }
    
    /* 中等屏幕输入框工具栏优化 */
    #inputArea .hidden.md\:flex {
        gap: 1rem;
    }
    
    /* 桌面端模型选择器在中等屏幕的尺寸调整 */
    #modelSelect {
        width: 8rem; /* w-32 */
    }
    
    #modelSizeSelect {
        width: 7rem; /* w-28 */
    }
    
    /* 中等屏幕按钮尺寸优化 - promptOptimizeBtn使用Tailwind类 */
        #imageUploadBtn {
        padding: 0.5rem; /* p-2 */
    }
    
    #sendBtn {
        width: 2.5rem; /* w-10 */
        height: 2.5rem; /* h-10 */
    }
    /* 平板：保持“优化提示词”按钮一致对齐与尺寸 */
    .prompt-optimize-container {
        right: 0.5rem !important;
        bottom: 0.5rem !important;
        align-items: center;
    }
    .prompt-optimize-container .prompt-optimize-btn {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
        min-height: 2.5rem;
    }
    .prompt-optimize-container .prompt-optimize-icon,
    .prompt-optimize-container .prompt-optimize-loading {
        width: 1.125rem !important;
        height: 1.125rem !important;
    }
}

/* ====== 小屏设备优化 ====== */
@media (max-width: 480px) {
    /* 极小屏幕下的容器调整 */
    #messagesArea .max-w-4xl {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* 输入区域边距调整 */
    #inputArea .w-full {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    
    /* 极小屏幕输入框按钮优化（扁平化嵌套） */
    /* 极小屏幕图片显示优化 */
    #inlineImages .inline-image-item {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        max-width: 50px !important;
        max-height: 50px !important;
    }
    
    div#inlineImages .inline-image-item {
        width: 50px !important;
        height: 50px !important;
    }
    
    body div#inlineImages .inline-image-item {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* 极小屏幕删除按钮优化 */
    #inlineImages .inline-image-remove {
        top: 1px;
        right: 1px;
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
    
    /* 极小屏幕输入区域间距调整 */
    #inputArea {
        margin-top: 0.5rem !important;
    }
    
    #messageInput {
        padding-right: 7rem !important;
        min-height: 56px !important;
        padding-bottom: 2.5rem !important;
    }
    
    #imageUploadBtn {
        padding: 0.1875rem;
    }
    
    #sendBtn {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    #imageUploadBtn svg,
    #sendBtn svg {
        width: 0.75rem;
        height: 0.75rem;
    }
    
    /* 极小屏幕图片预览区域 */
    #uploadedImagesArea {
        max-height: 120px;
    }
    
    #uploadedImagesArea .bg-gray-50 {
        padding: 0.5rem;
    }
    
    #uploadedImagesArea .text-xs {
        font-size: 0.7rem;
    }
    
    /* 图片预览项在极小屏下调整 */
    .image-preview-item img {
        width: 48px;
        height: 48px;
    }
    
    /* 模型选择框在极小屏下优化：与模板内 h-7/py-0.5 保持一致，文本垂直居中 */
    #modelSelect {
        font-size: 14px;
        padding: 2px 8px; /* 修复过大内边距导致的居中偏移 */
        height: 28px;     /* h-7 等效高度 */
        line-height: 24px;/* 提升文本垂直居中效果 */
    }
    
    /* 移动端顶部导航logo优化 */
    .lg\:hidden h1 {
        font-size: 1rem; /* text-base */
    }
    
    /* 移动端侧边栏logo优化 */
    #mobileSidebar h1 {
        font-size: 0.875rem; /* text-sm */
    }
    
    #mobileSidebar .w-9 {
        width: 2rem; /* w-8 */
        height: 2rem; /* h-8 */
    }
    
    /* 移动端用户信息区域优化 */
    #mobileSidebar .w-12 {
        width: 2.5rem; /* w-10 */
        height: 2.5rem; /* h-10 */
    }
    
    #mobileSidebar .text-base {
        font-size: 0.875rem; /* text-sm */
    }
    
    #mobileSidebar .text-sm {
        font-size: 0.75rem; /* text-xs */
    }
    
    /* 极小屏幕欢迎页面优化 */
    .welcome-main-title {
        font-size: 2rem !important;
        line-height: 1.1;
    }
    
    .welcome-subtitle {
        font-size: 1.5rem !important;
        line-height: 1.2;
    }
    
    .welcome-description {
        font-size: 1rem !important;
        padding: 0 0.5rem;
    }
    
    /* 功能特色卡片极小屏布局 */
    .feature-cards-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .feature-card {
        padding: 0.75rem;
        text-align: center;
    }
    
    /* 行动召唤区域极小屏优化 */
    .cta-section {
        padding: 1.5rem 0.5rem;
        margin: 0 0.5rem;
    }
    
    .cta-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .cta-description {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }
    
    /* 按钮极小屏优化 */
    .auth-buttons-mobile button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    /* 特殊标签极小屏优化 */
    .feature-tag {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* ====== 认证弹窗样式 ====== */
/* 弹窗动画效果 */
#loginModal .bg-white,
#registerModal .bg-white,
#forgotPasswordModal .bg-white {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 表单输入框优化 */
#loginForm input,
#registerForm input,
#forgotPasswordForm input {
    font-size: 16px; /* 防止iOS Safari缩放 */
}

/* 确保找回密码按钮样式正确 */
#forgotPasswordForm button[type="submit"] {
    background: linear-gradient(to right, #f97316, #ea580c) !important;
    color: white !important;
    border: none !important;
}

#forgotPasswordForm button[type="submit"]:hover {
    background: linear-gradient(to right, #ea580c, #dc2626) !important;
}

/* 返回登录按钮样式 */
#backToLogin {
    color: #4b5563 !important;
}

#backToLogin:hover {
    color: #1f2937 !important;
}

/* ====== 横屏模式优化 ====== */
@media (max-height: 600px) and (orientation: landscape) {
    
    /* 认证弹窗在横屏模式下优化 */
    #loginModal .bg-white,
    #registerModal .bg-white,
    #forgotPasswordModal .bg-white {
        max-height: 90vh;
        overflow-y: auto;
    }
    
}

/* ====== 公告系统样式 ====== */

/* 公告按钮样式 */
#announcementBtn {
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#announcementBtn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 公告弹窗样式 */
#announcementModal {
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

#announcementModal .bg-white {
    animation: slideInUp 0.3s ease-out;
}

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

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

/* 公告模板样式 */
.announcement-item {
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 0.5rem; /* 缩小间距从1rem到0.5rem */
    transition: all 0.3s ease;
}

.announcement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 默认模板 */
.announcement-default {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    color: #334155;
}

.announcement-default h3 {
    color: #1e293b;
}

/* 信息模板 */
.announcement-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.announcement-info h3 {
    color: #1d4ed8;
}

/* 成功模板 */
.announcement-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #86efac;
    color: #166534;
}

.announcement-success h3 {
    color: #15803d;
}

/* 警告模板 */
.announcement-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fcd34d;
    color: #92400e;
}

.announcement-warning h3 {
    color: #b45309;
}

/* 错误模板 */
.announcement-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #f87171;
    color: #dc2626;
}

.announcement-error h3 {
    color: #b91c1c;
}

/* 渐变模板 */
.announcement-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.announcement-gradient h3 {
    color: white;
}

/* 现代模板 */
.announcement-modern {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    box-shadow: 0 15px 35px rgba(240, 147, 251, 0.3);
    position: relative;
    overflow: hidden;
}

.announcement-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.announcement-modern h3 {
    color: white;
    position: relative;
    z-index: 1;
}

.announcement-modern .announcement-content {
    position: relative;
    z-index: 1;
}

/* 公告内容样式 */
.announcement-content {
    line-height: 1.6;
}

.announcement-content p {
    margin-bottom: 1rem;
}

.announcement-content p:last-child {
    margin-bottom: 0;
}

.announcement-content h1,
.announcement-content h2,
.announcement-content h3,
.announcement-content h4,
.announcement-content h5,
.announcement-content h6 {
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
    font-weight: 600;
}

.announcement-content h1:first-child,
.announcement-content h2:first-child,
.announcement-content h3:first-child,
.announcement-content h4:first-child,
.announcement-content h5:first-child,
.announcement-content h6:first-child {
    margin-top: 0;
}

.announcement-content ul,
.announcement-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

/* 无序列表样式优化 */
.announcement-content ul {
    list-style: none;
}

.announcement-content ul li {
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
}

.announcement-content ul li::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    font-size: 1.2em;
    position: absolute;
    left: 0;
    top: 0;
    line-height: 1.5;
}

/* 有序列表样式优化 */
.announcement-content ol {
    counter-reset: list-counter;
    list-style: none;
}

.announcement-content ol li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    counter-increment: list-counter;
}

.announcement-content ol li::before {
    content: counter(list-counter) ".";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
    min-width: 1.25rem;
    line-height: 1.5;
}

/* 嵌套列表样式 */
.announcement-content ul ul,
.announcement-content ol ol,
.announcement-content ul ol,
.announcement-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
}

.announcement-content ul ul li::before {
    content: "◦";
    color: #6b7280;
}

.announcement-content ol ol {
    counter-reset: nested-counter;
}

.announcement-content ol ol li {
    counter-increment: nested-counter;
}

.announcement-content ol ol li::before {
    content: counter(nested-counter, lower-alpha) ".";
    color: #6b7280;
}

.announcement-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.announcement-content a:hover {
    opacity: 0.8;
}

.announcement-content strong {
    font-weight: 600;
}

.announcement-content em {
    font-style: italic;
}

.announcement-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* 代码块样式 */
.announcement-content pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.announcement-content code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.announcement-content pre code {
    background: transparent;
    color: #334155;
    padding: 0;
    border-radius: 0;
}

/* 引用块样式 */
.announcement-content blockquote {
    border-left: 4px solid #3b82f6;
    background: #f8fafc;
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #475569;
}

.announcement-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 表格样式 */
.announcement-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.announcement-content th,
.announcement-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.announcement-content th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.announcement-content tr:hover {
    background: #f8fafc;
}

.announcement-content tr:last-child td {
    border-bottom: none;
}

/* 分隔线样式 */
.announcement-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 2rem 0;
}

/* 徽章和标签样式 */
.announcement-content .badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #dbeafe;
    color: #1e40af;
    margin: 0 0.25rem;
}

.announcement-content .badge.success {
    background: #dcfce7;
    color: #166534;
}

.announcement-content .badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.announcement-content .badge.error {
    background: #fee2e2;
    color: #dc2626;
}

/* 公告时间样式优化 */
.announcement-item .text-xs.text-gray-500 {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.announcement-item .text-xs.text-gray-500::before {
    content: "📅";
    font-size: 0.875rem;
    opacity: 0.8;
}

/* 关闭按钮样式 */
.dismiss-announcement {
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dismiss-announcement:hover {
    transform: scale(1.1);
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* 公告徽章样式 */
#announcementBadge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ====== 移动端公告样式优化 ====== */
@media (max-width: 767.98px) {
    /* 公告按钮移动端调整 */
    #announcementBtn {
        bottom: 1rem;
        right: 1rem;
    }
    
    #announcementBtn button {
        padding: 0.875rem;
    }
    
    #announcementBtn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* 公告弹窗移动端优化 */
    #announcementModal .max-w-2xl {
        max-width: calc(100vw - 1rem);
        margin: 0.5rem;
    }
    
    #announcementModal .max-h-\[80vh\] {
        max-height: calc(100vh - 1rem);
    }
    
    /* 公告内容移动端优化 */
    .announcement-item {
        padding: 0.875rem;
        border-radius: 8px;
        margin-bottom: 0.375rem;
    }
    
    .announcement-item h3 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .announcement-content {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    /* 移动端列表优化 */
    .announcement-content ul,
    .announcement-content ol {
        padding-left: 1rem;
    }
    
    .announcement-content ul li,
    .announcement-content ol li {
        margin-bottom: 0.375rem;
        padding-left: 1rem;
    }
    
    /* 移动端代码块优化 */
    .announcement-content pre {
        padding: 0.75rem;
        font-size: 0.8125rem;
        overflow-x: auto;
    }
    
    .announcement-content code {
        font-size: 0.8125rem;
        padding: 0.125rem 0.25rem;
    }
    
    /* 移动端表格优化 */
    .announcement-content table {
        font-size: 0.8125rem;
    }
    
    .announcement-content th,
    .announcement-content td {
        padding: 0.5rem 0.75rem;
    }
    
    /* 移动端引用块优化 */
    .announcement-content blockquote {
        padding: 0.75rem 1rem;
        margin: 0.75rem 0;
    }
    
    /* 移动端时间样式优化 */
    .announcement-item .text-xs.text-gray-500 {
        font-size: 0.6875rem; /* 11px */
        gap: 0.25rem;
    }
    
    .announcement-item .text-xs.text-gray-500::before {
        font-size: 0.75rem;
    }
    
    /* 关闭按钮移动端优化 */
    .dismiss-announcement {
        padding: 0.375rem;
    }
    
    .dismiss-announcement svg {
        width: 1rem;
        height: 1rem;
    }
}

/* ====== 小屏设备公告优化 ====== */
@media (max-width: 480px) {
    /* 公告弹窗极小屏优化 */
    #announcementModal .p-6 {
        padding: 1rem;
    }
    
    .announcement-item {
        padding: 0.875rem;
    }
    
    .announcement-item h3 {
        font-size: 0.9375rem;
    }
    
    .announcement-content {
        font-size: 0.8125rem;
    }
}

/* ====== 页眉和页脚布局样式 ====== */

/* 页眉导航栏样式 */
.site-header {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3B82F6, #6366F1);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.text-blue-600::after {
    width: 100%;
}

/* 用户下拉菜单增强 */
.group:hover #userDropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#userDropdown {
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

/* 移动端菜单动画 */
#mobileMenu {
    will-change: transform;
}

#mobileMenuOverlay {
    will-change: opacity;
}

/* 页脚样式增强（并收紧页脚与内容的间距） */
.site-footer a {
    transition: all 0.2s ease;
}

/* 减少页脚上方留白：让页脚容器内边距更紧凑 */
.site-footer > div.py-6 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.site-footer a:hover {
    transform: translateX(4px);
}

/* 社交媒体图标悬停效果 */
.site-footer .w-9.h-9 {
    position: relative;
    overflow: hidden;
}

.site-footer .w-9.h-9::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.site-footer .w-9.h-9:hover::before {
    width: 100%;
    height: 100%;
}

/* 返回顶部按钮动画 */
#backToTopMobile {
    transform: translateY(100px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#backToTopMobile:not(.opacity-0) {
    transform: translateY(0);
}

#backToTopMobile:hover {
    transform: translateY(-4px) scale(1.05);
}

/* 跳转链接无障碍 */
.skip-link {
    position: absolute;
    left: -9999px;
    top: -9999px;
    z-index: 999999;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
}

.skip-link:focus {
    left: 6px;
    top: 7px;
}

/* 页面布局增强 */
:root {
    --header-height: 56px; /* 14 * 4 = 56px - 移动端 */
}

@media (min-width: 640px) {
    :root {
        --header-height: 64px; /* 16 * 4 = 64px - 小屏幕+ */
    }
}

@media (min-width: 1024px) {
    :root {
        --header-height: 80px; /* 20 * 4 = 80px - 桌面端 */
    }
}

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

.site-main {
    flex: 1;
}

/* 大屏幕布局优化 */
@media (min-width: 1024px) {
    /* 确保侧边栏在大屏幕上完全可见 */
    #leftPanel {
        height: calc(100vh - var(--header-height));
        max-height: calc(100vh - var(--header-height));
        display: flex;
        flex-direction: column;
    }
    
    /* 顶部选项卡区域固定高度 */
    #leftPanel > div:first-child {
        flex-shrink: 0;
    }
    
    /* 优化参数设置面板的滚动区域 */
    #leftPanel .flex-1.overflow-y-auto {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        /* 使用max-height确保不会超出容器 */
        max-height: calc(100vh - var(--header-height) - 160px); /* 预留选项卡60px + 按钮区域100px */
    }
    
    /* 确保生成按钮区域固定在底部 */
    #leftPanel .border-t {
        margin-top: auto;
        flex-shrink: 0;
        min-height: 100px; /* 确保按钮区域有足够高度 */
    }
    
    /* 右侧面板高度调整 */
    #rightPanel {
        height: calc(100vh - var(--header-height));
        max-height: calc(100vh - var(--header-height));
        overflow: hidden;
    }
    
    
    /* 图片网格容器优化 */
    #imageGrid {
        max-height: calc(100vh - var(--header-height) - 160px); /* 收紧预留高度，减少底部留白 */
        overflow-y: auto;
    }
    
    /* 空状态容器居中显示 */
    #emptyState {
        height: calc(100vh - var(--header-height) - 200px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    /* 优化参数设置内容的间距 */
    #leftPanel .space-y-6 {
        gap: 1rem; /* 减少间距以适应固定高度 */
    }
    
    /* 压缩描述词推荐区域 */
    #leftPanel .bg-gray-50.border.border-gray-200.rounded-lg {
        padding: 0.75rem;
    }
    
    /* 优化尺寸选择区域 */
    #leftPanel .grid.grid-cols-2.gap-3 {
        gap: 0.5rem;
    }
}

/* ====== 页眉页脚移动端优化 ====== */
@media (max-width: 768px) {
    /* 页眉移动端优化 */
    .site-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 移动端导航项间距 */
    #mobileMenu nav a {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    #mobileMenu nav a:last-child {
        border-bottom: none;
    }
    
    /* 页脚移动端优化 */
    .site-footer .flex-col {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .site-footer nav {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ====== 页眉页脚中等屏幕优化 ====== */
@media (min-width: 769px) and (max-width: 1023px) {
    /* 页眉中等屏幕优化 */
    .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ====== 页眉页脚大屏幕优化 ====== */
@media (min-width: 1024px) {
    /* 页眉大屏幕增强 */
    .site-header {
        position: sticky;
        top: 0;
    }
    
    /* 用户下拉菜单定位 */
    .group:hover #userDropdown {
        display: block;
    }
}

/* ====== 超大屏幕优化 ====== */
@media (min-width: 1440px) {
    /* 全宽布局，无宽度限制 */
    
    /* 超大屏幕下的侧边栏优化 */
    #leftPanel {
        width: 18rem; /* w-72 */
    }
    
    /* 在超大屏幕上增加参数设置面板的最大高度 */
    #leftPanel .flex-1.overflow-y-auto {
        max-height: calc(100vh - var(--header-height) - 140px); /* 更多空间给参数设置 */
    }
    
    /* 优化按钮区域 */
    #leftPanel .border-t {
        min-height: 90px; /* 稍微减少按钮区域高度 */
    }
}

/* ====== 极大屏幕优化 ====== */
@media (min-width: 1920px) {
    /* 4K屏幕等超大显示器的优化 */
    #leftPanel {
        width: 22rem; /* 缩小的侧边栏 */
    }
    
    /* 增加内容间距 */
    #leftPanel .space-y-6 {
        gap: 1.5rem;
    }
    
    /* 恢复推荐区域的padding */
    #leftPanel .bg-gray-50.border.border-gray-200.rounded-lg {
        padding: 1rem;
    }
}

/* ====== 打印样式 ====== */
@media print {
    .site-header,
    .site-footer,
    #backToTopMobile,
    #mobileMenu,
    #mobileMenuOverlay {
        display: none !important;
    }
    
    .site-main {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ====== 高对比度模式支持 ====== */
@media (prefers-contrast: high) {
    .site-header {
        border-bottom-width: 2px;
        border-bottom-color: #000;
    }
    
    .nav-link {
        font-weight: 600;
    }
    
    .site-footer {
        border-top: 2px solid #fff;
    }
}

/* ====== 灯箱组件样式 ====== */
/* 灯箱覆盖层（overlay） */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 灯箱容器 */
.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-overlay.active .lightbox-container {
    transform: scale(1) translateY(0);
}

/* 灯箱图片 */
.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

/* 关闭按钮 */
.lightbox-close {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #374151;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    color: #1f2937;
}

/* 导航按钮（左右切换） */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
    z-index: 2;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.lightbox-nav.prev {
    left: 8px;
}

.lightbox-nav.next {
    right: 8px;
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    color: #374151;
}

/* 图片信息面板 */
.lightbox-info {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.lightbox-container:hover .lightbox-info {
    opacity: 1;
    transform: translateY(0);
}

.lightbox-prompt {
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
    line-height: 1.5;
}

.lightbox-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
}

.lightbox-actions {
    display: flex;
    gap: 8px;
}

.lightbox-action-btn {
    padding: 6px 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-action-btn:hover {
    background: #2563eb;
}

/* 键盘导航提示 */
.lightbox-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.lightbox-overlay.show-hint .lightbox-hint {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .lightbox-container {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .lightbox-close {
        top: -15px;
        right: -15px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav.prev {
        left: 8px;
    }
    
    .lightbox-nav.next {
        right: 8px;
    }
    
    .lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .lightbox-info {
        bottom: -50px;
        padding: 12px 16px;
    }
    
    .lightbox-prompt {
        font-size: 13px;
    }
    
    .lightbox-meta {
        font-size: 11px;
    }
}

/* ====== 减少动画偏好 ====== */
@media (prefers-reduced-motion: reduce) {
    .nav-link::after,
    #userDropdown,
    #mobileMenu,
    #mobileMenuOverlay,
    #backToTopMobile,
    .site-footer a,
    .site-footer .w-9.h-9::before,
    .lightbox-overlay,
    .lightbox-container,
    .lightbox-close,
    .lightbox-nav,
    .lightbox-info {
        transition: none !important;
        animation: none !important;
    }
}

/* ====== Tailwind CSS 响应式优化 ====== */
/* 确保所有响应式类正确工作 */

/* 移动优先的断点覆盖 */
@media (max-width: 639px) {
    /* 小屏幕专用样式 */
    .sm\:hidden { display: block !important; }
    .sm\:block { display: none !important; }
    .sm\:flex { display: none !important; }
}

@media (min-width: 640px) and (max-width: 767px) {
    /* 小屏幕到中屏过渡 */
    .sm\:hidden { display: none !important; }
    .sm\:block { display: block !important; }
    .sm\:flex { display: flex !important; }
}

@media (max-width: 1023px) {
    /* 非桌面端设备 */
    .lg\:hidden { display: block !important; }
    .lg\:block { display: none !important; }
    .lg\:flex { display: none !important; }
}

@media (min-width: 1024px) {
    /* 桌面端设备 */
    .lg\:hidden { display: none !important; }
    .lg\:block { display: block !important; }
    .lg\:flex { display: flex !important; }
}

/* 容器宽度响应式优化 */
.container-responsive {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container-responsive {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 768px) {
    .container-responsive {
        max-width: 768px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container-responsive {
        max-width: 1024px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1280px) {
    .container-responsive {
        max-width: 1280px;
    }
}

/* 文字大小响应式优化 */
.text-responsive {
    font-size: 0.875rem; /* 14px */
    line-height: 1.5;
}

@media (min-width: 640px) {
    .text-responsive {
        font-size: 1rem; /* 16px */
    }
}

@media (min-width: 1024px) {
    .text-responsive {
        font-size: 1.125rem; /* 18px */
    }
}

/* 间距响应式优化 */
.gap-responsive {
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .gap-responsive {
        gap: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .gap-responsive {
        gap: 1rem;
    }
}

/* 内边距响应式优化 */
.p-responsive {
    padding: 0.75rem;
}

@media (min-width: 640px) {
    .p-responsive {
        padding: 1rem;
    }
}

@media (min-width: 1024px) {
    .p-responsive {
        padding: 1.5rem;
    }
}