* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 60px;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a5568;
}

.nav-brand i {
    color: #667eea;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 12px;
}

.nav-btn {
    padding: 8px 22px;
    border: none;
    background: none;
    border-radius: 40px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-btn:hover {
    background: #f0f0f0;
}

.nav-btn.active {
    background: #667eea;
    color: white;
}

/* 页面切换 */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px);}
    to { opacity: 1; transform: translateY(0);}
}

/* 摄像头卡片 */
.camera-card {
    background: white;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.video-container {
    position: relative;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

#video, #poseCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#poseCanvas {
    pointer-events: none;
}

.status-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    border-radius: 30px;
    padding: 6px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.9rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #48bb78;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1);}
    50% { opacity: 0.5; transform: scale(1.2);}
    100% { opacity: 1; transform: scale(1);}
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:active { transform: scale(0.97); }
.btn.primary { background: #48bb78; color: white; }
.btn.primary:hover { background: #38a169; }
.btn.secondary { background: #e2e8f0; color: #4a5568; }
.btn.secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.info { background: #4299e1; color: white; }
.btn.outline { background: transparent; border: 2px solid #667eea; color: #667eea; }
.btn.danger { background: #f56565; color: white; }

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.stat-card i {
    font-size: 2.5rem;
    color: #667eea;
}

.stat-card div {
    display: flex;
    flex-direction: column;
}

.stat-card span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2d3748;
}

.stat-card small {
    font-size: 0.8rem;
    color: #718096;
}

/* 信息行 */
.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.info-panel {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.info-panel h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.posture-status {
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    margin-bottom: 15px;
}

.posture-status.good {
    background: #c6f6d5;
    color: #22543d;
}

.posture-status.bad {
    background: #fed7d7;
    color: #742a2a;
}

.issues-list {
    font-size: 0.9rem;
    color: #e53e3e;
}

.issue-item {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 报告页面样式 */
.report-header {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tab-bar {
    background: white;
    display: flex;
    gap: 5px;
    padding: 0 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #718096;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 500;
}

.tab-content {
    background: white;
    border-radius: 0 0 20px 20px;
    padding: 20px;
    min-height: 400px;
}

.tab-pane {
    display: none;
}
.tab-pane.active { display: block; }

.report-card {
    background: #f7fafc;
    border-radius: 16px;
    padding: 20px;
    font-family: monospace;
    white-space: pre-wrap;
    line-height: 1.6;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chart-card {
    background: #f7fafc;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
}
.chart-card canvas { max-height: 250px; width: 100%; }
.chart-card p { margin-top: 10px; font-size: 0.9rem; color: #4a5568; }

.achievements-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.achievement-item {
    background: #f7fafc;
    border-radius: 16px;
    padding: 15px;
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 5px solid #e2e8f0;
}
.achievement-item.earned {
    border-left-color: #f6e05e;
    background: #fffff0;
}
.achievement-icon { font-size: 2rem; }
.achievement-info { flex: 1; }
.achievement-name { font-weight: bold; }
.achievement-date { font-size: 0.75rem; color: #718096; }

/* 设置页面 */
.settings-container {
    background: white;
    border-radius: 24px;
    padding: 25px;
}
.settings-group {
    margin-bottom: 25px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 20px;
}
.settings-group h3 {
    margin-bottom: 15px;
}
.setting-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.setting-item label {
    min-width: 150px;
    font-weight: 500;
}
.setting-item input[type="number"], .setting-item select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
    width: 100px;
}
.setting-item input[type="range"] {
    flex: 1;
    max-width: 250px;
}
.settings-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* 响应式 */
@media (max-width: 768px) {
    .app-container { padding: 10px; }
    .navbar { flex-direction: column; gap: 10px; border-radius: 30px; }
    .info-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card span { font-size: 1.4rem; }
    .tab-btn { padding: 8px 16px; font-size: 0.85rem; }
}

.training-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}
.btn.success { background: #48bb78; color: white; }
.btn.warning { background: #ed8936; color: white; }