* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    background-image: url('pic/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 页面标题和介绍样式 */
.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: #6750a4;
    margin-bottom: 15px;
}

.intro-text {
    font-size: 16px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 内容包装器样式 */
.content-wrapper {
    display: flex;
    gap: 20px;
}

.left-panel {
    flex: 2;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 面板标题样式 */
.panel-header {
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 20px;
    color: #6750a4;
    margin-bottom: 10px;
}

.section-info {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.class-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.class-title {
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-icon {
    color: #aaa;
    cursor: pointer;
}

.more-icon {
    font-size: 20px;
    color: #555;
    cursor: pointer;
}

.upload-area {
    padding: 15px 0;
}

.upload-text {
    color: #666;
    margin-bottom: 15px;
}

.upload-buttons {
    display: flex;
    gap: 10px;
}

.upload-btn {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-color: #f0eef9;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upload-btn:hover {
    background-color: #e0dcf7;
}

.camera-icon,
.upload-icon {
    width: 24px;
    height: 24px;
}

.add-class-btn {
    background-color: #f0eef9;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    color: #6750a4;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.add-class-btn:hover {
    background-color: #e0dcf7;
}

.training-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.start-training-btn {
    background-color: #f0eef9;
    color: #6750a4;
    padding: 12px 30px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    margin: 20px 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.start-training-btn:hover {
    background-color: #e0dcf7;
}

.start-training-btn:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* 训练按钮完成状态 */
.start-training-btn.completed {
    background-color: #5cb85c;
    color: white;
    box-shadow: 0 2px 10px rgba(92, 184, 92, 0.3);
}

.start-training-btn.completed:hover {
    background-color: #4cae4c;
    box-shadow: 0 3px 15px rgba(92, 184, 92, 0.4);
}

.warning-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.warning-icon {
    background-color: #ffb74d;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.warning-text {
    color: #333;
    margin-bottom: 20px;
}

.download-area {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.download-btn {
    background-color: #f5f5f5;
    color: #555;
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.download-btn:hover {
    background-color: #e0e0e0;
}

.hidden {
    display: none !important;
}

#fileInput {
    display: none;
}

/* 图像预览相关样式 */
.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.image-preview {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-preview:hover .preview-overlay {
    opacity: 1;
}

.preview-delete {
    background-color: white;
    color: #ff5252;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
}

.image-count {
    color: #666;
    margin-top: 10px;
    font-size: 14px;
}

/* 相机模态框样式 */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.camera-container {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    width: 90%;
    max-width: 600px;
}

#camera-preview {
    width: 100%;
    height: auto;
    display: block;
}

.camera-controls {
    display: flex;
    justify-content: center;
    padding: 15px;
    gap: 20px;
}

.camera-controls button {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

#capture-btn {
    background-color: #6750a4;
    color: white;
}

#close-camera-btn {
    background-color: #f5f5f5;
    color: #555;
}

/* 编辑分类名称样式 */
.edit-class-input {
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-bottom: 2px solid #6750a4;
    outline: none;
    width: 80px;
}

/* 结果卡片样式 */
.result-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.result-card h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    font-weight: bold;
    font-size: 18px;
    color: #6750a4;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .right-panel {
        order: -1;
        margin-bottom: 20px;
    }
    
    .page-header h1 {
        font-size: 26px;
    }
    
    .intro-text {
        font-size: 14px;
    }
    
    .panel-header {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .step-number {
        margin-bottom: 10px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10% auto;
    }
}

/* 开始实时识别按钮样式 */
.start-recognition-btn {
    background-color: #6750a4;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    margin: 20px 0 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    animation: pulse 1.5s infinite;
    box-shadow: 0 2px 10px rgba(103, 80, 164, 0.3);
}

.start-recognition-btn:hover {
    background-color: #5a46a1;
    box-shadow: 0 3px 15px rgba(103, 80, 164, 0.4);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(103, 80, 164, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(103, 80, 164, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(103, 80, 164, 0);
    }
}

.recognition-section {
    margin-top: 15px;
    width: 100%;
}

/* 实时识别容器 */
.recognition-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.recognition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f0eef9;
    border-bottom: 1px solid #e0e0e0;
}

.recognition-header h3 {
    margin: 0;
    color: #6750a4;
}

.close-recognition-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #555;
    cursor: pointer;
}

.camera-view-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 比例 */
    overflow: hidden;
}

#recognition-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#recognition-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* 隐藏画布，仅用于处理 */
}

.recognition-results {
    padding: 20px;
    background-color: white;
}

.result-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

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

.result-icon {
    font-size: 26px;
    margin-right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0eef9;
}

.result-person .result-icon {
    background-color: #e3f2fd;
}

.result-emotion .result-icon {
    background-color: #fff8e1;
}

.result-confidence .result-icon {
    background-color: #e8f5e9;
}

.result-content {
    flex: 1;
}

.result-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.result-value {
    color: #6750a4;
    font-weight: 600;
    font-size: 18px;
}

/* 情绪图标样式 */
.emotion-icons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.emotion-icon {
    font-size: 20px;
    opacity: 0.3;
    transition: all 0.3s ease;
    cursor: default;
}

.emotion-icon.active {
    opacity: 1;
    transform: scale(1.3);
}

/* 置信度进度条样式 */
.confidence-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.confidence-bar-container {
    flex: 1;
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.confidence-bar {
    height: 100%;
    width: 0%;
    background-color: #4caf50;
    border-radius: 6px;
    transition: width 0.6s ease, background-color 0.3s ease;
}

#recognition-confidence {
    min-width: 60px;
    text-align: right;
}

/* 识别结果强调效果 */
#recognition-label {
    font-size: 20px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: #f4f0ff;
    display: inline-block;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .result-icon {
        background-color: #1a237e;
        color: #fff;
    }
    
    .result-person .result-icon {
        background-color: #0d47a1;
    }
    
    .result-emotion .result-icon {
        background-color: #e65100;
    }
    
    .result-confidence .result-icon {
        background-color: #1b5e20;
    }
    
    .confidence-bar-container {
        background-color: #37474f;
    }
    
    #recognition-label {
        background-color: #303f9f;
        color: #fff;
    }
}

/* 更多菜单样式 */
.more-menu {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    min-width: 120px;
}

.menu-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.delete-class {
    color: #ff5252;
}

.delete-class:hover {
    background-color: #ffeeee;
}

/* 加载指示器样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f0eef9;
    border-top: 5px solid #6750a4;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 18px;
    color: #333;
}

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

/* 人脸框样式 */
.face-box {
    position: absolute;
    border: 2px solid #3b82f6;
    box-sizing: border-box;
}

.face-label {
    position: absolute;
    top: -25px;
    left: 0;
    background-color: rgba(59, 130, 246, 0.8);
    color: white;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 3px;
    white-space: nowrap;
}

/* 相机画布样式 */
.camera-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 样本数据可视化样式 */
.samples-breakdown {
    margin-top: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.breakdown-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
}

.breakdown-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.breakdown-chart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    width: 35%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
}

.color-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.breakdown-bar-container {
    width: 65%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.breakdown-bar {
    height: 100%;
    min-width: 20px;
    border-radius: 10px;
    transition: width 0.8s ease;
}

.breakdown-value {
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

/* 深色模式下的样式 */
@media (prefers-color-scheme: dark) {
    .samples-breakdown {
        background-color: #1e293b;
    }
    
    .breakdown-title {
        color: #e2e8f0;
    }
    
    .breakdown-bar-container {
        background-color: #334155;
    }
    
    .breakdown-value {
        color: #fff;
    }
    
    .breakdown-label {
        color: #e2e8f0;
    }
}

/* 导航按钮样式 */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
}

.prev-btn, .next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #4f46e5;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    width: fit-content;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.prev-btn:hover, .next-btn:hover {
    background-color: #3730a3;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.training-info {
    margin-bottom: 15px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.warning-detail {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

/* 使用指导弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    color: #6750a4;
}

.instruction-steps {
    margin: 25px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-number {
    background-color: #6750a4;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step p {
    margin: 0;
    flex: 1;
}

.modal-note {
    font-style: italic;
    color: #666;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 14px;
}

#start-exploring-btn {
    background-color: #6750a4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: block;
    margin: 0 auto;
}

#start-exploring-btn:hover {
    background-color: #7b61c0;
}

/* 返回按钮样式 */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6750a4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(103, 80, 164, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

.back-btn:hover {
    background-color: #5a46a1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(103, 80, 164, 0.4);
}

/* 完成提示框 */
.completion-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    padding: 20px;
    width: 300px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(350px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                opacity 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.completion-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.completion-toast img {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(103, 80, 164, 0.3);
}

.completion-toast h3 {
    color: #6750a4;
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

/* 烟花动画 */
.firework {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px white;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

@keyframes firework-animation {
    0% {
        transform: translate(0, 0);
        width: 6px;
        height: 6px;
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y));
        width: 3px;
        height: 3px;
        opacity: 0;
    }
}

/* 闪光效果 */
@keyframes sparkle {
    0%, 100% {
        box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.5);
    }
} 