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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-color: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-color);
    line-height: 1.5;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-brand i {
    font-size: 1.75rem;
}

.nav-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.domain-info, .stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.domain-info i, .stats i {
    color: var(--primary-color);
}

/* 主容器 */
.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 180px);
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 上传卡片 */
.upload-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.upload-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.upload-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.subtitle {
    color: var(--gray-color);
    font-size: 0.875rem;
}

/* 上传区域 */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 1rem;
    text-align: center;
    background: var(--light-color);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    position: relative;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.upload-hint {
    color: var(--gray-color);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.upload-formats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.format-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--light-color);
    color: var(--dark-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-refresh {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--light-color);
    border: 1px solid var(--border-color);
}

.btn-refresh:hover {
    background: #f1f5f9;
    transform: rotate(45deg);
}

.upload-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* 上传队列 */
.upload-queue {
    margin-bottom: 1.5rem;
    display: none;
}

.upload-queue h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.queue-items {
    max-height: 200px;
    overflow-y: auto;
}

.queue-item {
    background: var(--light-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.queue-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.queue-item-info i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.queue-item-text {
    flex: 1;
}

.queue-item-name {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-size {
    font-size: 0.75rem;
    color: var(--gray-color);
}

.queue-item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.queue-progress {
    flex: 1;
    position: relative;
    height: 20px;
    background: #e2e8f0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.queue-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.queue-progress-text {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1;
}

.queue-progress-text.success {
    color: var(--success-color);
}

.queue-progress-text.error {
    color: var(--danger-color);
}

.queue-remove {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.queue-remove:hover {
    background: var(--danger-color);
    color: white;
}

/* 批量控制 */
.batch-controls {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.progress-container {
    margin-top: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* 信息卡片 */
.info-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.info-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-list {
    list-style: none;
}

.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list li i {
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.info-list li div {
    flex: 1;
}

.info-list strong {
    font-weight: 600;
    color: var(--dark-color);
}

/* 右侧面板 */
.right-panel {
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-left h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--light-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.search-box {
    position: relative;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 图片网格 */
.image-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    align-content: start;
}

/* 图片卡片 */
.image-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8fafc;
}

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

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-card:hover .card-overlay {
    opacity: 1;
}

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

.overlay-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.overlay-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.card-content {
    padding: 1.25rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.file-type {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.card-delete {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.card-delete:hover {
    background: var(--danger-color);
    color: white;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-color);
}

.meta-item i {
    font-size: 0.875rem;
}

.card-url {
    display: flex;
    gap: 0.5rem;
}

.card-url input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    background: var(--light-color);
    color: var(--gray-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy-small {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy-small:hover {
    background: var(--primary-dark);
}

/* 空状态和加载状态 */
.empty-state, .loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.empty-state p {
    color: var(--gray-color);
    margin-bottom: 1.5rem;
}

.loading-spinner {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-state p {
    color: var(--gray-color);
    font-weight: 500;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.modal-close {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-color);
}

.modal-close:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    max-height: 60vh;
}

.preview-image-container {
    background: var(--light-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.info-item label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-color);
    margin-bottom: 0.25rem;
}

.info-item span {
    display: block;
    font-size: 1rem;
    color: var(--dark-color);
    word-break: break-all;
}

.url-box {
    margin-top: auto;
}

.url-box input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    background: var(--light-color);
    color: var(--gray-color);
}

.btn-copy {
    width: 100%;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 通知 */
.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.info {
    border-left-color: var(--info-color);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
}

.notification-content i {
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.notification.success .notification-content i {
    color: var(--success-color);
}

.notification.error .notification-content i {
    color: var(--danger-color);
}

.notification.info .notification-content i {
    color: var(--info-color);
}

.notification span {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: var(--light-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 页脚 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding: 1.5rem 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    display: flex;
    gap: 2rem;
}

.footer-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-color);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-link {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--gray-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.footer-link:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        max-height: 70vh;
    }
    
    .preview-image-container {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .main-container {
        padding: 1rem;
        margin: 1rem auto;
    }
    
    .panel-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-right {
        width: 100%;
    }
    
    .search-box {
        width: 100%;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-controls {
        flex-direction: column;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}