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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #101031;
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
}

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

/* 顶部导航样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 42px;
    font-weight: 700;
    color: #fefefe;
    margin-bottom: 8px;
}

.logo .subtitle {
    font-size: 16px;
    color: #fefefe;
    font-weight: 400;
}

.brand-colors .color-bar {
    width: 200px;
    height: 50px;
    background: url('545475467.png') no-repeat center center;
    background-size: contain;
    border-radius: 3px;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

/* 左侧输入区域 */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    height: fit-content;
}

.section-title {
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.section-title p {
    font-size: 14px;
    color: #a0a6d6;
}

/* 输入组件 */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 10px;
}

#prompt-input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

#prompt-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

#prompt-input::placeholder {
    color: #6b7280;
}

/* 比例选择 */
.aspect-ratio-controls {
    margin-bottom: 30px;
}

.aspect-ratio-controls label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 15px;
}

.aspect-ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}

.aspect-ratio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.aspect-ratio-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.aspect-ratio-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ratio-preview {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.ratio-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* 不同比例的预览形状 */
.ratio-1-1::after {
    width: 20px;
    height: 20px;
}

.ratio-4-3::after {
    width: 24px;
    height: 18px;
}

.ratio-3-4::after {
    width: 18px;
    height: 24px;
}

.ratio-3-2::after {
    width: 24px;
    height: 16px;
}

.ratio-2-3::after {
    width: 16px;
    height: 24px;
}

.ratio-16-9::after {
    width: 28px;
    height: 16px;
}

.ratio-9-16::after {
    width: 16px;
    height: 28px;
}

.ratio-label {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

.ratio-size {
    font-size: 10px;
    color: #a0a6d6;
    opacity: 0.8;
}

/* 生成按钮 */
.generate-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.generate-button:active {
    transform: translateY(0);
}

.generate-button.loading {
    pointer-events: none;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.generate-button.loading .btn-loader {
    display: block;
}

.generate-button.loading .btn-text {
    display: none;
}

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

/* 状态信息 */
.status-info {
    font-size: 14px;
    color: #a0a6d6;
    text-align: center;
    margin-top: 15px;
    min-height: 20px;
}

/* 右侧输出区域 */
.output-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
}

.image-display {
    width: 100%;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 占位符样式 */
.placeholder {
    text-align: center;
    color: #6b7280;
}

.placeholder-icon {
    margin-bottom: 20px;
    opacity: 0.6;
}

.placeholder h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #9ca3af;
}

.placeholder p {
    font-size: 14px;
    color: #6b7280;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    color: #a0a6d6;
}

.loading-animation {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.loading-circle {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-circle:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-circle:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.loading-state p {
    font-size: 14px;
    color: #a0a6d6;
}

/* 加载内容容器 */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.loading-title {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 500;
}

/* 实时进度条 */
.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 20px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-text {
    font-size: 14px;
    color: #a0a6d6;
    font-weight: 500;
}

/* 结果容器 */
.result-container {
    width: 100%;
    text-align: center;
}

#generated-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.image-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* 底部统计 */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 0;
}

.stats {
    display: flex;
    justify-content: space-around;
    max-width: 800px;
    margin: 0 auto;
}

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

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #a0a6d6;
    font-weight: 400;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 32px;
    }
    
    .brand-colors .color-bar {
        width: 150px;
    }
    
    .input-section,
    .output-section {
        padding: 20px;
    }
    
    .stats {
        flex-direction: column;
        gap: 30px;
    }
    
    /* 移动端比例选择优化 */
    .aspect-ratio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .aspect-ratio-item {
        padding: 8px 4px;
    }
    
    .ratio-preview {
        width: 24px;
        height: 24px;
    }
    
    .ratio-label {
        font-size: 11px;
    }
    
    .ratio-size {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 28px;
    }
    
    .section-title h2 {
        font-size: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    /* 小屏幕比例选择优化 */
    .aspect-ratio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .aspect-ratio-item {
        padding: 6px 3px;
    }
    
    .ratio-preview {
        width: 20px;
        height: 20px;
    }
    
    .ratio-label {
        font-size: 10px;
    }
    
    .ratio-size {
        font-size: 8px;
    }
}

/* 历史图片展示区域 */
.history-section {
    padding: 30px 0;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 0px;
    padding-right: 0px;
}

.history-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    margin-top: -10px;
    padding: 0 20px;
}

.clear-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.clear-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.history-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: flex-start;
    width: 100%;
}

.history-item {
    width: 435px;
    height: 435px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    position: relative;
    flex-shrink: 0;
}

.history-item:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.history-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.history-item:hover img {
    transform: scale(1.1);
}

.item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 8px 4px 4px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.history-item:hover .item-info {
    transform: translateY(0);
}

.item-prompt {
    font-size: 10px;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 空历史状态 */
.history-gallery:empty::before {
    content: "暂无历史记录";
    display: block;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    padding: 20px;
    width: 100%;
}

/* 响应式调整历史图片 */
@media (max-width: 768px) {
    .history-item {
        width: 120px;
        height: 120px;
    }
    
    .history-gallery {
        gap: 12px;
        padding: 0 10px;
    }
    
    .history-section {
        margin: 0 10px;
    }
    
    .history-controls {
        padding: 0 10px;
    }
    
    .clear-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .item-prompt {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .history-item {
        width: 100px;
        height: 100px;
    }
    
    .history-gallery {
        gap: 10px;
        padding: 0 8px;
    }
    
    .history-section {
        margin: 0 8px;
    }
    
    .history-controls {
        padding: 0 8px;
    }
    
    .clear-btn {
        width: 100%;
        padding: 12px 16px;
    }
}

/* 图片放大模态框 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalSlideIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: -10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
}

.modal-controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

/* 可点击图片样式 */
#generated-image {
    cursor: pointer;
    transition: transform 0.3s ease;
}

#generated-image:hover {
    transform: scale(1.02);
}

.history-item img {
    cursor: pointer;
}

/* 模态框动画 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 响应式模态框 */
@media (max-width: 768px) {
    .modal-content {
        max-width: 98vw;
        max-height: 98vh;
    }
    
    .modal-image {
        max-height: 75vh;
    }
    
    .modal-close {
        top: -40px;
        right: 0;
        font-size: 24px;
        width: 35px;
        height: 35px;
    }
    
    .modal-controls {
        margin-top: 15px;
    }
    
    .modal-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
} 