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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger div {
    width: 20px;
    height: 2px;
    background: #666;
    border-radius: 1px;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-align: center;
    flex: 1;
}

.highlight {
    color: #4facfe;
}

.help-link {
    color: #666;
    font-size: 14px;
    cursor: pointer;
}

/* 主内容区 */
.main-content {
    flex: 1;

    justify-content: center;
    align-items: center;
}

.page {
    display: none;
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.page.active {
    display: block;
}

/* 首页按钮 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: white;
    color: #333;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.btn-back {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    border: none;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: linear-gradient(45deg, #00f2fe, #4facfe);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.4);
    color: white;
}

.btn-back:active {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.btn-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-back:hover::before {
    left: 100%;
}

/* 上传区域 */
.upload-area {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.upload-area h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.upload-hint {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

#fileInput {
    display: none;
}

.file-input-label {
    display: block;
    padding: 30px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.file-input-label:hover {
    border-color: #4facfe;
    color: #4facfe;
}

/* 文件列表 */
.file-list {
    margin: 20px 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    font-size: 20px;
}

.file-details {
    text-align: left;
}

.file-name {
    font-weight: 500;
    color: #333;
}

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

.remove-file {
    background: #ff4757;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

/* 上传进度 */
.upload-progress {
    margin: 20px 0;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    height: 100%;
    width: 0%;
    transition: width 0.1s ease-out;
    border-radius: 10px;
}

.progress-text {
    color: #666;
    font-size: 14px;
}

/* 成功页面 */
.success-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.success-content h2 {
    color: #333;
    margin-bottom: 20px;
}

.file-info {
    margin-bottom: 30px;
    color: #666;
}

.share-options {
    margin-bottom: 30px;
}

.share-item {
    margin-bottom: 20px;
}

.share-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    text-align: left;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.btn-copy {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.code-display {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    color: #4facfe;
    letter-spacing: 2px;
}

/* 社交分享按钮 */
.social-share {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-social {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-social.qq {
    background: #12b7f5;
    color: white;
}

.btn-social.wechat {
    background: #07c160;
    color: white;
}

/* 下载页面 */
.download-area {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.download-area h2 {
    color: #333;
    margin-bottom: 30px;
}

.code-input-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#codeInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#codeInput:focus {
    outline: none;
    border-color: #4facfe;
}

.download-result {
    margin-top: 20px;
}

.download-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.download-info h3 {
    color: #333;
    margin-bottom: 10px;
}

.download-info p {
    color: #666;
    margin-bottom: 5px;
}

.btn-download {
    background: #28a745;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.btn-download:hover {
    background: #218838;
}

/* 错误和成功消息 */
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 底部 */
.footer {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-top: 20px;
}

/* 文件操作按钮 */
.file-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.preview-btn:hover {
    background: #138496;
}

/* 图片预览弹窗 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 10px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: calc(90vh - 100px);
    overflow: auto;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .upload-area,
    .success-content,
    .download-area {
        padding: 30px 20px;
    }
    
    .code-input-wrapper {
        flex-direction: column;
    }
    
    .social-share {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-social {
        width: 100%;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-header h3 {
        max-width: 250px;
    }
    
    .modal-body {
        padding: 15px;
    }
}
