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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: transparent;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
.header-div {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 auto 20px auto;
    padding: 0;
    background: transparent;
    color: #333;
    border-radius: 10px;
    max-width: 1200px;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.header-title {
    margin: 0 0 10px 0;
    font-size: 2rem;
    font-weight: 700;
}

.header-link {
    margin-top: 10px;
}

.link-a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.link-a:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 主容器 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* 上传区域 */
.upload-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.upload-area {
    padding: 40px 20px;
    text-align: center;
    position: relative;
}

.file-label {
    display: block;
    cursor: pointer;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px 20px;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.file-label:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #666;
}

#fileInput {
    display: none;
}

/* EXIF信息区域 */
.exif-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.exif-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    padding: 20px;
}

.image-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.image-preview h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    background: white;
    overflow: hidden;
}

#previewImage {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.exif-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.exif-info h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.info-grid {
    display: grid;
    gap: 8px;
}

.exif-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.exif-label {
    font-weight: 600;
    color: #495057;
}

.exif-value {
    color: #007bff;
    word-break: break-all;
}

/* 没有EXIF数据时的提示 */
.no-exif {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    background: white;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.no-exif-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.no-exif h4 {
    margin-bottom: 8px;
    color: #495057;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .main-container {
        padding: 0 5px;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .exif-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .image-preview,
    .exif-info {
        padding: 12px;
    }

    .preview-container {
        min-height: 150px;
    }

    #previewImage {
        max-height: 200px;
    }

    .exif-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .exif-label {
        font-size: 0.8rem;
        opacity: 0.8;
    }

    .exif-value {
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .header-div {
        padding: 0px;
    }

    .header-title {
        font-size: 1.3rem;
    }

    .upload-area {
        padding: 20px 15px;
    }

    .upload-text {
        font-size: 1rem;
    }

    .exif-container {
        padding: 10px;
    }

    .image-preview,
    .exif-info {
        padding: 10px;
    }

    .preview-container {
        min-height: 120px;
    }

    #previewImage {
        max-height: 150px;
    }
}

/* 拖拽状态 */
.upload-area.dragover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.upload-area.dragover .file-label {
    border-color: #007bff;
    background-color: #f0f8ff;
}

/* 加载状态 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* EXIF信息分类样式 */
.exif-category {
    margin-bottom: 20px;
}

.exif-category h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1rem;
}

.exif-category ul {
    list-style: none;
    padding: 0;
}

.exif-category li {
    margin-bottom: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.exif-category strong {
    color: #495057;
}

/* 摘要区域样式 */
.exif-summary {
    background: #fff;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    padding: 18px 20px;
    margin-bottom: 12px;
    border-radius: 6px;
}
.exif-summary .summary-title {
    text-align: center;
    font-size: 18px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}
.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f2;
}
.summary-row:last-child {
    border-bottom: none;
}
.summary-label {
    flex: 0 0 140px;
    color: #6c757d;
    font-size: 14px;
    padding-right: 12px;
    text-align: left;
}
.summary-value {
    flex: 1 1 auto;
    color: #212529;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    word-break: break-word;
}

.upload-new-btn {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.upload-new-btn:hover {
    background-color: #5a6268;
}

/* 原始EXIF数据区域 */
.raw-exif {
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 12px;
    border-radius: 6px;
    max-height: 380px;
    overflow: auto;
    font-family: monospace;
    font-size: 12px;
    color: #333;
    margin-top: 12px;
}

/* 错误状态 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    margin-bottom: 15px;
}

.error-message h4 {
    margin-bottom: 5px;
    font-size: 1rem;
}

.error-message p {
    margin: 0;
    font-size: 0.9rem;
}
