* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部 */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 上传区域 */
.upload-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.upload-area:active {
    transform: scale(0.99);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8ecff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.9rem;
    color: #999;
}

/* 上传状态 */
.upload-status {
    margin-top: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 0.9rem;
}

.status-text {
    font-weight: 500;
}

.status-text.success {
    color: #52c41a;
}

.status-text.error {
    color: #ff4d4f;
}

/* 图片展示区域 */
.gallery-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.gallery-section h2 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: #333;
}

.image-count {
    color: #999;
    font-size: 1rem;
    font-weight: normal;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.loading,
.no-images,
.error {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.error {
    color: #ff4d4f;
}

/* 图片卡片 */
.image-card {
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
    touch-action: manipulation;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

@media (hover: none) {
    .image-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .image-card:active {
        transform: scale(0.98);
    }
}

.image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.image-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.image-info {
    padding: 15px;
}

.image-filename {
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.image-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 12px;
}

.image-actions {
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.btn-copy {
    background: #667eea;
    color: white;
}

.btn-copy:hover {
    background: #5568d3;
}

.btn-copy:active {
    background: #4a56c0;
    transform: scale(0.98);
}

.btn-download {
    background: #52c41a;
    color: white;
}

.btn-download:hover {
    background: #389e0d;
}

.btn-download:active {
    background: #2d7a0a;
    transform: scale(0.98);
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: #ff4d4f;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header {
        margin-bottom: 25px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .upload-section,
    .gallery-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .upload-text {
        font-size: 1rem;
    }

    .upload-hint {
        font-size: 0.85rem;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .image-wrapper {
        height: 160px;
    }

    .image-info {
        padding: 12px;
    }

    .image-filename {
        font-size: 0.9rem;
    }

    .image-meta {
        font-size: 0.75rem;
        flex-direction: column;
        gap: 3px;
    }

    .btn {
        font-size: 0.85rem;
        padding: 10px 12px;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header {
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .upload-section,
    .gallery-section {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 10px;
    }

    .upload-area {
        padding: 30px 15px;
        border-width: 2px;
    }

    .upload-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .upload-text {
        font-size: 0.95rem;
    }

    .upload-hint {
        font-size: 0.8rem;
    }

    .gallery-section h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .image-card {
        border-radius: 6px;
    }

    .image-wrapper {
        height: 220px;
    }

    .image-info {
        padding: 12px;
    }

    .image-filename {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .image-meta {
        font-size: 0.75rem;
        margin-bottom: 10px;
        flex-direction: column;
        gap: 2px;
        align-items: flex-start;
    }

    .image-actions {
        gap: 8px;
    }

    .btn {
        font-size: 0.9rem;
        padding: 12px 16px;
        border-radius: 5px;
        font-weight: 500;
        min-height: 44px;
    }

    .status-item {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .toast {
        font-size: 0.9rem;
        padding: 12px 20px;
        max-width: 90%;
        border-radius: 8px;
        word-break: break-word;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.4rem;
    }

    .upload-area {
        padding: 25px 10px;
    }

    .image-wrapper {
        height: 200px;
    }

    .btn {
        font-size: 0.85rem;
        padding: 9px 12px;
    }
}

