/* === 雪票 SnowCoach — 移动端优先样式 === */

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* === 导航栏 === */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon { font-size: 24px; }

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.logo-text small {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: 4px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover { background: var(--border); color: var(--text); }

/* === 主内容 === */
.main-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 120px);
}

/* === Hero 区域 === */
.hero {
    text-align: center;
    padding: 32px 0 24px;
}

.hero h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 15px;
}

.shooting-tips {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    text-align: left;
}

.shooting-tips h3 {
    font-size: 14px;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 8px;
}

.shooting-tips ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.shooting-tips li { margin-bottom: 4px; }

.analysis-tip-card {
    margin-top: 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: var(--radius-sm);
    border: 1px solid #334155;
}

.analysis-tip-card .tip-icon { margin-right: 6px; }

.analysis-tip-card .tip-title {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    color: #22d3ee;
}

.analysis-tip-card .tip-body {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #cbd5e1;
}

.disclaimer-banner {
    font-size: 11px;
    line-height: 1.5;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 14px;
}

.skel-strip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.skel-strip-head h4 { margin: 0; }

.skel-toggle {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.skel-toggle input { accent-color: #22d3ee; }

/* === 上传区域 === */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-card);
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.03);
}

.upload-area.has-file {
    border-style: solid;
    border-color: var(--primary-light);
    padding: 16px;
}

.upload-icon {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.preview-video {
    width: 100%;
    border-radius: var(--radius-sm);
    max-height: 300px;
    background: #000;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0 0;
    font-size: 13px;
}

.file-name {
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size { color: var(--text-muted); }

.btn-remove {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover { border-color: var(--danger); color: var(--danger); }

/* === 分析模式选择 === */
.quality-select {
    margin-top: 20px;
}

.quality-select label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 10px;
}

.quality-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quality-btn {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.quality-btn:hover { border-color: var(--primary-light); }

.quality-btn.active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.quality-name {
    display: block;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.quality-desc {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.quality-btn.active .quality-name { color: var(--primary); }

.tag-fast { background: #dbeafe; color: #1e40af; }
.tag-pro { background: #fef3c7; color: #92400e; }

/* === 模型选择 === */
.model-select {
    margin-top: 20px;
}

.model-select label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 10px;
}

.model-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.model-btn {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.model-btn:hover { border-color: var(--primary-light); }

.model-btn.active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.model-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.model-desc {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

/* === 按钮 === */
.btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.loading-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === 进度条 === */
.progress-section { margin-top: 16px; }

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* === 分析结果 === */
.btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.score-high { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; }
.score-medium { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.score-low { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }

.score-number { font-size: 28px; font-weight: 700; line-height: 1; }
.score-label { font-size: 12px; font-weight: 500; opacity: 0.7; }

.result-meta h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    margin-right: 6px;
}

.tag-snowboard { background: #dbeafe; color: #1e40af; }
.tag-ski { background: #ede9fe; color: #5b21b6; }
.tag-unknown { background: #f1f5f9; color: #475569; }
.tag-model { background: #f0fdf4; color: #166534; }

.result-summary {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}

.pose-hint {
    font-size: 13px;
    color: #f59e0b;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #fffbeb;
    border-radius: var(--radius-sm);
}

.cv-panel {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid #1e293b;
}

.cv-panel h3 {
    font-size: 15px;
    font-weight: 600;
    color: #22d3ee;
    margin-bottom: 14px;
}

.cv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.cv-cell {
    background: #1e293b;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cv-cell span {
    font-size: 11px;
    color: #94a3b8;
}

.cv-cell strong {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
}

.radar-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 16px;
}

.radar-canvas { display: block; }

.skel-strip h4 {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.skel-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.skel-row figure {
    flex: 0 0 auto;
    width: 100px;
    margin: 0;
}

.skel-row img {
    width: 100px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #334155;
}

.skel-row figcaption {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    margin-top: 4px;
}

/* === 问题诊断 === */
.issues-section, .suggestions-section { margin-bottom: 20px; }

.issues-section h3, .suggestions-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-left: 4px;
}

.issue-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--border);
}

.issue-card.severity-high { border-left-color: var(--danger); }
.issue-card.severity-medium { border-left-color: var(--warning); }
.issue-card.severity-low { border-left-color: var(--success); }

.issue-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.issue-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

.issue-part {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.severity-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: auto;
}

.badge-high { background: #fee2e2; color: #991b1b; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-low { background: #d1fae5; color: #065f46; }

.issue-desc {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.issue-suggestion {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    line-height: 1.6;
}

.issue-suggestion strong { color: var(--primary); }

/* === 练习建议 === */
.suggestion-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 16px 16px 36px;
    box-shadow: var(--shadow);
}

.suggestion-list li {
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.6;
    border-bottom: 1px solid var(--border);
}

.suggestion-list li:last-child { border-bottom: none; }

/* === 原始响应 === */
.raw-response {
    margin-top: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.raw-response summary {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

.raw-response pre {
    padding: 0 16px 16px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

/* === 历史面板 === */
.history-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.history-panel.open { right: 0; }

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.history-header h3 { font-size: 16px; }

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.history-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover { background: var(--bg); }

.history-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.history-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.status-completed { background: #d1fae5; color: #065f46; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-pending { background: #f1f5f9; color: #475569; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
}

/* === 标准动作库 === */
.actions-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.actions-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.action-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.action-tabs button {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-tabs button.active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
}

.action-cards {
    display: grid;
    gap: 12px;
}

.action-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.action-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.action-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.action-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* === 弹窗 === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 40px;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.modal-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.modal-content h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.key-points {
    list-style: none;
    padding: 0;
}

.key-points li {
    position: relative;
    padding: 10px 0 10px 24px;
    font-size: 14px;
    line-height: 1.6;
    border-bottom: 1px solid var(--border);
}

.key-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.key-points li:last-child { border-bottom: none; }

/* === 文件大小警告 === */
.file-size-warning {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 6px;
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.25);
}

.file-compressed {
    color: var(--accent);
    font-size: 12px;
    margin-left: 4px;
}

/* === 底部 === */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* === 响应式适配 === */
@media (min-width: 768px) {
    .hero h1 { font-size: 34px; }
    .upload-area { padding: 60px 40px; }
    .modal-overlay { align-items: center; }
    .modal-content {
        border-radius: var(--radius);
        max-height: 70vh;
    }
}
