* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    --danger-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    background-attachment: fixed;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* 头部 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

/* 上传区域 */
.upload-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-area h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.upload-hint {
    color: #666;
    font-size: 0.95em;
}

/* 视频预览 */
.video-preview {
    margin-top: 30px;
}

.video-preview video {
    width: 100%;
    max-height: 400px;
    border-radius: 10px;
    margin-bottom: 15px;
    background: #000;
}

.video-info {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.video-info p {
    color: #555;
    margin: 5px 0;
}

/* 进度条 */
.progress-section {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.95em;
}

/* 按钮 */
.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    margin-top: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #f8f9ff;
}

/* 分析状态 */
.analyzing-status {
    text-align: center;
    margin-top: 30px;
    padding: 30px;
    background: #f8f9ff;
    border-radius: 10px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.analyzing-status p {
    color: #555;
    font-size: 1.1em;
}

/* 结果区域 */
.results-section {
    background: white;
    border-radius: 25px;
    padding: 50px;
    box-shadow: var(--card-shadow);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-section h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 700;
    /* 不使用渐变文字，避免html2canvas渲染问题 */
}

.analysis-time {
    color: #888;
    font-size: 0.95em;
    margin-top: 10px;
    font-weight: 500;
}

.result-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.08);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.result-card h3 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.6em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sub-section {
    margin-bottom: 30px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sub-section h4 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
    padding-left: 15px;
    border-left: 5px solid #667eea;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    padding: 10px 15px;
    border-radius: 0 8px 8px 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.metric-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.metric-item:hover::before {
    opacity: 0.03;
}

.metric-label {
    color: #888;
    font-size: 0.95em;
    margin-bottom: 8px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.metric-value {
    color: #333;
    font-size: 1.8em;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.metric-unit {
    color: #666;
    font-size: 0.7em;
    margin-left: 5px;
    font-weight: 500;
}

/* 情绪评分条 */
.emotion-bars {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.emotion-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.emotion-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.emotion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.emotion-name {
    font-size: 1.15em;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.emotion-name::before {
    content: '●';
    font-size: 0.8em;
    color: #667eea;
}

.emotion-score {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    /* 不使用渐变文字，避免html2canvas渲染问题 */
}

.score-bar-container {
    width: 100%;
    height: 14px;
    background: linear-gradient(90deg, #e8ebff 0%, #f8f9ff 100%);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.score-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 20px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.score-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.score-bar.low {
    background: var(--danger-gradient);
}

.score-bar.medium {
    background: var(--warning-gradient);
}

.score-bar.high {
    background: var(--success-gradient);
}

.emotion-comment {
    color: #555;
    font-size: 1em;
    line-height: 1.8;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
    font-weight: 400;
}

/* 综合评估卡片 */
.overall-card {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.4);
}

.overall-card h3 {
    color: white;
    font-size: 1.8em;
    margin-bottom: 30px;
}

/* 用户信息区域 */
.user-info-section {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 35px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.user-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.user-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.meta-label {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    min-width: 80px;
}

.meta-value {
    font-size: 0.95em;
    color: white;
    font-weight: 600;
}

/* 综合分数内联显示 - 无背景框 */
.overall-score-inline {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.overall-score-inline .score-number {
    font-size: 4em;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1;
    margin-bottom: 8px;
}

.overall-score-inline .score-label {
    font-size: 1em;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* 优化的综合得分圆圈样式 */
.score-circle {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4),
                0 4px 15px rgba(118, 75, 162, 0.3);
    transition: all 0.3s ease;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 0;
}

.score-circle:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5),
                0 6px 20px rgba(118, 75, 162, 0.4);
}

.score-circle .score-number {
    font-size: 3em;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.score-circle .score-label {
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}
.card-header-with-tip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-header-with-tip h3 {
    margin-bottom: 0;
}

.score-tip {
    font-size: 0.9em;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

.score-tip.high-better {
    background: rgba(72, 187, 120, 0.15);
    color: #2f855a;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.score-tip.low-better {
    background: rgba(245, 101, 101, 0.15);
    color: #c53030;
    border: 1px solid rgba(245, 101, 101, 0.3);
}

/* 正面情绪卡片 - 绿色系 */
.positive-card {
    background: linear-gradient(145deg, #f0fff4 0%, #e6ffed 100%);
    border: 1px solid rgba(72, 187, 120, 0.2);
}

.positive-card h3 {
    color: #38a169;
}

/* 负面情绪卡片 - 橙红色系 */
.negative-card {
    background: linear-gradient(145deg, #fff5f5 0%, #ffe8e8 100%);
    border: 1px solid rgba(245, 101, 101, 0.2);
}

.negative-card h3 {
    color: #e53e3e;
}

/* 心理能力卡片 - 蓝色系 */
.ability-card {
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.ability-card h3 {
    color: #3b82f6;
}

/* 专业建议卡片 - 紫色系 */
.suggestion-card {
    background: linear-gradient(145deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.suggestion-card h3 {
    color: #8b5cf6;
}

.suggestion-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    line-height: 2;
    font-size: 1.05em;
    color: #555;
    border-left: 4px solid #8b5cf6;
}

.overall-score {
    text-align: center;
    margin: 40px 0;
    display: none; /* 默认隐藏，使用 inline 版本 */
}

.overall-comment {
    background: rgba(255, 255, 255, 0.15);
    padding: 30px;
    border-radius: 15px;
    line-height: 2;
    font-size: 1.1em;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    font-weight: 400;
}

.overall-comment p {
    margin: 0;
}

.detailed-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
    color: #555;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}

/* 上传方式选择 */
.upload-mode-selection {
    text-align: center;
    padding: 20px 0;
}

.upload-mode-selection h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 30px;
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.mode-btn {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border: 2px solid #e0e4ff;
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-btn:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.mode-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.mode-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.mode-desc {
    font-size: 0.9em;
    color: #666;
}

/* 摄像头录制区域 */
.camera-section {
    text-align: center;
}

#cameraPreview {
    width: 100%;
    max-width: 640px;
    height: 480px;
    background: #000;
    border-radius: 15px;
    margin: 0 auto 20px;
    display: block;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.camera-controls .btn {
    width: auto;
    min-width: 140px;
    margin: 0;
}

.camera-hint {
    color: #666;
    font-size: 0.95em;
    margin-top: 15px;
}

.recording-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ff4444;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: 700;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.6; }
}

.recording-indicator {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* 视频封面 */
.video-thumbnail-card {
    text-align: center;
}

.video-thumbnail {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    margin: 20px auto;
    display: block;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
}

.action-buttons .btn {
    flex: 1;
    min-width: 160px;
    max-width: 250px;
    margin: 0;
}

/* 不导出的元素 */
.no-export {
    /* 标记为不导出，由 html2canvas 的 ignoreElements 处理 */
}

/* 操作按钮区域 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.action-buttons .btn {
    min-width: 150px;
}

/* 响应式 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .upload-section,
    .results-section {
        padding: 25px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-circle .score-number {
        font-size: 2.5em;
    }
    
    .mode-buttons {
        grid-template-columns: 1fr;
    }
    
    #cameraPreview {
        height: 360px;
    }
}

/* 图表容器 */
.chart-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* 情绪详细解释 */
.emotion-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.emotion-detail-item {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.emotion-detail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.emotion-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8ebff;
}

.emotion-detail-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
}

.emotion-detail-score {
    font-size: 1.4em;
    font-weight: 800;
    color: #667eea;
    /* 不使用渐变文字，避免html2canvas渲染问题 */
}

.emotion-detail-comment {
    color: #555;
    font-size: 0.95em;
    line-height: 1.8;
}

/* 生理特征紧凑卡片 */
.physio-card-compact {
    background: linear-gradient(145deg, #fffaf0 0%, #fff5e6 100%);
    border: 1px solid rgba(255, 153, 51, 0.2);
}

.physio-card-compact h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #ff9933;
}

.physio-card-compact .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.physio-card-compact .metric-item {
    padding: 20px;
    background: white;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.physio-card-compact .metric-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(255, 153, 51, 0.2);
    border-color: rgba(255, 153, 51, 0.3);
}

.physio-card-compact .metric-label {
    font-size: 0.8em;
    margin-bottom: 6px;
    color: #666;
    font-weight: 600;
}
}

.physio-card-compact .metric-value {
    font-size: 0.95em;
    font-weight: 700;
    color: #ff9933;
    line-height: 1.2;
}

.physio-card-compact .metric-unit {
    font-size: 0.65em;
    color: #999;
    margin-left: 4px;
}

/* 响应式：小屏幕改为2列 */
@media (max-width: 768px) {
    .physio-card-compact .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .emotion-details {
        grid-template-columns: 1fr;
    }
}

/* 更小屏幕：单列 */
@media (max-width: 480px) {
    .physio-card-compact .metrics-grid {
        grid-template-columns: 1fr;
    }
}


