/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区域 */
.main {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

/* 文件上传区域 */
.file-label {
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-label:hover .file-input-area {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #667eea;
    margin-bottom: 15px;
}

.file-text .primary-text {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.file-text .secondary-text {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

#photoInput {
    display: none;
}

/* 用户登录卡片风格（与管理员页面一致的视觉） */
.login-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.input-field {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 6px 18px rgba(102,126,234,0.08);
}
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* 选择的文件列表 */
.selected-files {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.file-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.file-size {
    font-size: 0.8rem;
    color: #666;
}

.remove-file {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.remove-file:hover {
    background: #c82333;
}

/* 备注输入框 */
.remarks-label {
    margin-bottom: 10px !important;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea::placeholder {
    color: #999;
}

/* 按钮样式 */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.submit-btn .btn-text {
    display: inline-block;
}

.required-star {
    color: #e55353;
    margin-left: 6px;
    font-weight: 700;
}

.required-group input, .required-group textarea {
    border: 2px solid #e6eefc;
}

.required-group input:required:invalid, .required-group textarea:required:invalid {
    border-color: #e55353;
    box-shadow: 0 0 0 3px rgba(229,83,83,0.08);
}

.input-help {
    margin-top: 6px;
    font-size: 0.9rem;
    color: #e55353;
    display: none;
}

.input-help.visible {
    display: block;
}

/* 对齐表单输入框：保持和上传区域同宽 */
.form-group {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"], .form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

/* 保证上传区域与表单对齐（文件选择区域为块级元素，遵循 container 宽度） */
.file-input-area, .form-group {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .file-input-area, .form-group {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 2px solid white;
    animation: spin 1s linear infinite;
    display: none;
}

.submit-btn.loading .loading-spinner {
    display: block;
}

.submit-btn.loading .btn-text {
    display: none;
}

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

/* 进度条样式 */
.progress-container {
    margin-top: 25px;
    text-align: center;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
}

/* 结果消息 */
.result-message {
    margin-top: 25px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

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

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

/* 底部样式 */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header p {
        font-size: 1rem;
    }

    .main {
        padding: 20px;
    }

    .file-input-area {
        padding: 30px 15px;
    }

    .upload-icon {
        width: 40px;
        height: 40px;
    }

    .file-text .primary-text {
        font-size: 1.1rem;
    }

    .submit-btn {
        padding: 14px 30px;
        font-size: 1rem;
    }

    textarea {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .main {
        padding: 15px;
    }

    .file-input-area {
        padding: 25px 10px;
    }

    .submit-btn {
        width: 100%;
        padding: 15px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .file-item img {
        align-self: center;
    }

    .remove-file {
        align-self: center;
    }
}

/* 拖拽效果 */
.drag-over .file-input-area {
    border-color: #28a745;
    background: #f0fff0;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
    pointer-events: none !important;
}

/* 压缩质量控制样式 */
.compression-group {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.compression-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
}

.compression-info {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.compression-slider-container {
    margin-bottom: 10px;
}

.compression-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.compression-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.compression-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.compression-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.compression-levels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #666;
}

.compression-description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
    text-align: center;
}

/* 压缩文件大小显示样式 */
.file-size-compressed {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
}

/* 添加更多按钮样式 */
.add-more-btn {
    background: #ffffff;
    color: #667eea;
    border: 2px dashed #dbe4ff;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    margin: 0 auto;
}

.add-more-btn:hover {
    background: #f5f8ff;
    transform: translateY(-2px);
}

/* 一次性多选按钮样式（与 add-more 区别在颜色） */
.multi-picker-btn {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: inline-block;
    margin: 0 auto;
}

.multi-picker-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.size-current {
    color: #28a745;
    font-weight: 600;
}

.size-original {
    color: #6c757d;
    text-decoration: line-through;
}

.size-saved {
    color: #007bff;
    font-weight: 500;
}

/* 移动端压缩控制优化 */
@media (max-width: 768px) {
    .compression-group {
        padding: 15px;
        margin: 15px 0;
    }

    .compression-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .compression-levels {
        font-size: 0.75rem;
    }

    .compression-description {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .file-size-compressed {
        font-size: 0.75rem;
    }

    .size-current, .size-original, .size-saved {
        display: block;
        text-align: left;
    }
}


