/* 全局样式 */
:root {
    --primary-color: #0066cc;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --disabled-color: #6c757d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f8f9fa;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin: 10px 0 20px;
    font-size: 1.5em;
}

/* 按钮样式 */
.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-width: 100px;
    justify-content: center;
}

.btn:disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
}

.btn:hover:not(:disabled) {
    background-color: #0056b3;
}

/* 加载动画 */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 文件输入框 */
#fileInput {
    display: none;
}

/* 图片预览区域 */
.image-preview {
    margin-bottom: 15px;
    text-align: center;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.image-preview:hover {
    background-color: #e9ecef;
}

.image-preview img {
    max-width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 图片查看器模态框 */
.image-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow: hidden;
}

.image-viewer-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center;
    transition: transform 0.3s ease;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    cursor: zoom-in;
    transform-origin: center;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.image-viewer-content.zoomed img {
    cursor: grab;
}

.image-viewer-content.zoomed.grabbing img {
    cursor: grabbing;
}

/* 控制按钮 */
.viewer-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 20px;
    z-index: 1001;
}

.viewer-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.viewer-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.zoom-level {
    color: white;
    font-size: 14px;
    margin: 0 10px;
    min-width: 60px;
    text-align: center;
    line-height: 40px;
}

.close-viewer {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
}

.close-viewer:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 结果显示区域 */
.result-section {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-top: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-section h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
}

#resultContent {
    font-size: 13px;
    line-height: 1.4;
}

.result-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    color: #666;
    font-size: 12px;
}

/* 消息提示 */
.error-message,
.loading-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 20px;
    text-align: center;
}

.error-message {
    background-color: var(--error-color);
    color: white;
}

.loading-message {
    background-color: var(--warning-color);
    color: #333;
}

/* 通用工具类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
}
