/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    -webkit-tap-highlight-color: transparent;
}

/* 容器 */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* 头部 */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.app-header h1 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:active {
    background: #e0e0e0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 登录页 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 360px;
    padding: 32px 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin: 16px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 16px;
    min-height: 20px;
}

/* 产品列表 */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.product-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f0f0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    padding: 12px 16px;
    min-width: 0;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-desc {
    font-size: 13px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-action {
    padding: 0 16px;
    color: #667eea;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.arrow {
    font-size: 18px;
}

/* 产品大图 */
.product-image-large {
    width: 100%;
    max-height: 250px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #f0f0f0;
}

.product-image-large img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.product-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

/* 评分滑块 */
.rating-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rating-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
}

.rating-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.rating-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    min-width: 32px;
    text-align: center;
}

/* 图片上传 */
.upload-area {
    margin-top: 8px;
}

.upload-buttons {
    display: flex;
    gap: 12px;
}

.upload-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-icon {
    font-size: 18px;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uploading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ==================== 自定义相机界面 ==================== */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 提示框 */
.camera-prompt {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
    z-index: 2;
}

.camera-prompt p {
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* 取景框 */
.camera-viewfinder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75%;
    aspect-ratio: 3 / 4;
    max-height: 60%;
    border: 2px solid rgba(255,255,255,0.8);
    border-radius: 12px;
    z-index: 1;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.3);
}

/* 底部控制栏 */
.camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 30px 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
}

.camera-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.camera-btn:active {
    background: rgba(255,255,255,0.4);
}

/* 拍照按钮（中间大圆） */
.camera-capture-btn {
    width: 72px;
    height: 72px;
    background: transparent;
    border: 3px solid white;
}

.capture-inner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    display: block;
}

.camera-capture-btn:active .capture-inner {
    background: #ccc;
    transform: scale(0.9);
}

.capture-inner {
    transition: all 0.15s ease;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* 响应式适配 */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .app-header {
        padding: 12px;
    }
    
    .app-header h1 {
        font-size: 16px;
    }
    
    .login-container {
        padding: 24px 20px;
    }
    
    .product-image {
        width: 80px;
        height: 80px;
    }
    
    .product-info {
        padding: 10px 12px;
    }
    
    .product-name {
        font-size: 15px;
    }
    
    .product-desc {
        font-size: 12px;
    }
}
