/* 页面背景 */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 主容器 */
.container {
    display: flex;
    height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
    background: #f5f7fa;
}

/* 左侧导航栏 */
.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 24px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.9;
}

.categories {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4a5568;
    font-size: 14px;
}

.category-item:hover {
    background: #edf2f7;
    color: #2d3748;
}

.category-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.category-icon {
    margin-right: 12px;
    font-size: 18px;
}

.category-count {
    margin-left: auto;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.category-item.active .category-count {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* 右侧主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部搜索栏 */
.search-bar {
    background: white;
    padding: 20px 32px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 16px;
}

/* AI 生图入口按钮 */
.ai-generate-entry-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ai-btn-icon {
    font-size: 18px;
}

.ai-btn-text {
    font-size: 14px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: #f7fafc;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #a0aec0;
}

.stats {
    color: #718096;
    font-size: 14px;
    white-space: nowrap;
}

/* 图片网格 */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.image-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.image-wrapper {
    position: relative;
    width: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f7fafc;
    padding: 10px;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

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

.image-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.image-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
    font-size: 18px;
    color: #667eea;
}

.loading .spinner {
    width: 40px;
    height: 40px;
    margin-right: 12px;
}

/* 图片放大查看 */
.image-zoom-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.image-zoom-overlay.active {
    display: flex;
}

.image-zoom-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(255,255,255,0.1);
}

.image-zoom-overlay .zoom-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.image-zoom-overlay .zoom-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* 模态框中的图片可点击样式 */
.modal-image-wrapper {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.modal-image-wrapper:hover {
    opacity: 0.9;
}

.modal-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.modal-image-wrapper {
    flex: 1;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.modal-prompt-area {
    flex: 1;
    max-width: 50%;
}

.prompt-section {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    max-height: 70vh;
    overflow-y: auto;
}

.prompt-label {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.prompt-text {
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn.copied {
    background: #48bb78;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #a0aec0;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 18px;
}

/* 错误状态 */
.error-state {
    text-align: center;
    padding: 80px 20px;
    color: #e53e3e;
}

.error-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-state-text {
    font-size: 18px;
    margin-bottom: 12px;
}

.error-state-details {
    font-size: 14px;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
    word-break: break-all;
}

.retry-btn {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 15px;
}

/* 邀请码验证界面 */
.invitation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.invitation-overlay.hidden {
    display: none;
}

.invitation-card {
    background: white;
    border-radius: 20px;
    padding: 48px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.invitation-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.invitation-title {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.invitation-subtitle {
    font-size: 14px;
    color: #718096;
    margin-bottom: 32px;
    line-height: 1.6;
}

.invitation-input-wrapper {
    margin-bottom: 20px;
}

.invitation-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.3s;
    background: #f7fafc;
}

.invitation-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.invitation-input::placeholder {
    letter-spacing: 0;
    font-size: 14px;
}

.invitation-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.invitation-error {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 12px;
    min-height: 20px;
}

.invitation-hint {
    color: #a0aec0;
    font-size: 12px;
    margin-top: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 200px;
    }

    .categories {
        display: flex;
        overflow-x: auto;
        padding: 8px;
    }

    .category-item {
        white-space: nowrap;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }

    .search-bar {
        flex-direction: column;
        gap: 12px;
    }

    .modal-layout {
        flex-direction: column;
    }

    .modal-image-wrapper {
        max-width: 100%;
    }

    .modal-prompt-area {
        max-width: 100%;
    }
}
