/**
 * 来云顶班®️培训系统 - 全局样式
 * 移动端优先，375px基准宽度
 */

/* ==================== 基础样式重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #FAFAF8;
    color: #2C2C2C;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 品牌色变量 ==================== */
:root {
    --color-primary: #C4A77D;      /* 驼色 */
    --color-secondary: #9CAF88;    /* Sage绿 */
    --color-background: #FAFAF8;   /* 米白 */
    --color-white: #FFFFFF;
    --color-text: #2C2C2C;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-border: #E8E8E8;
    --color-success: #9CAF88;
    --color-warning: #F5A623;
    --color-error: #E74C3C;
    --color-info: #3498DB;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==================== 页面布局 ==================== */
.page-container {
    max-width: 414px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--color-background);
    padding-bottom: 80px;
}

/* ==================== 顶部导航栏 ==================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--color-primary) 0%, #B8996E 100%);
    color: var(--color-white);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 32px;
    height: 32px;
    background: var(--color-white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

/* ==================== 底部导航栏 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    background: var(--color-white);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(196, 167, 125, 0.1);
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item.active .nav-icon {
    color: var(--color-primary);
}

.nav-icon {
    font-size: 24px;
    transition: var(--transition-fast);
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.card-subtitle {
    font-size: 13px;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* ==================== 模块卡片 ==================== */
.module-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 12px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition-normal);
    border: 2px solid transparent;
}

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

.module-card:active {
    transform: scale(0.98);
}

.module-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.module-card.locked:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.module-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.module-info {
    flex: 1;
    min-width: 0;
}

.module-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.module-desc {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.module-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.progress-text {
    font-size: 12px;
    color: var(--color-secondary);
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

.module-arrow {
    color: var(--color-text-muted);
    font-size: 20px;
}

/* ==================== 课程单元卡片 ==================== */
.course-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 12px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.course-card:hover {
    box-shadow: var(--shadow-md);
}

.course-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.course-card.completed {
    border-left: 3px solid var(--color-secondary);
}

.course-thumbnail {
    width: 80px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-border);
}

.course-thumbnail.video {
    position: relative;
}

.course-thumbnail.video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.course-info {
    flex: 1;
    min-width: 0;
}

.course-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-light);
}

.course-duration {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.course-status.completed {
    background: rgba(156, 175, 136, 0.15);
    color: var(--color-secondary);
}

.course-status.pending {
    background: rgba(196, 167, 125, 0.15);
    color: var(--color-primary);
}

.course-status.locked {
    background: var(--color-border);
    color: var(--color-text-muted);
}

/* ==================== 视频播放器 ==================== */
.video-container {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 16px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-play-btn {
    width: 36px;
    height: 36px;
    background: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.video-play-btn:hover {
    transform: scale(1.1);
}

.video-progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

.video-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 2px;
    width: 0%;
}

.video-time {
    font-size: 12px;
    color: white;
}

/* ==================== 阅读页面 ==================== */
.reading-container {
    padding: 20px;
}

.reading-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
    line-height: 1.4;
}

.reading-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-text);
}

.reading-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
    margin: 24px 0 12px;
}

.reading-content p {
    margin-bottom: 12px;
}

.reading-content ul,
.reading-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

.reading-content li {
    margin-bottom: 8px;
}

/* ==================== 测验页面 ==================== */
.quiz-container {
    padding: 20px;
}

.quiz-header {
    text-align: center;
    margin-bottom: 24px;
}

.quiz-progress {
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.quiz-question-num {
    font-size: 12px;
    color: var(--color-text-muted);
}

.quiz-question {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.question-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 20px;
}

.question-type {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(196, 167, 125, 0.15);
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 12px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    background: var(--color-background);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-item:hover {
    border-color: var(--color-primary);
    background: rgba(196, 167, 125, 0.05);
}

.option-item.selected {
    border-color: var(--color-primary);
    background: rgba(196, 167, 125, 0.1);
}

.option-item.correct {
    border-color: var(--color-secondary);
    background: rgba(156, 175, 136, 0.15);
}

.option-item.wrong {
    border-color: var(--color-error);
    background: rgba(231, 76, 60, 0.1);
}

.option-item.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.option-label {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-light);
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.option-item.selected .option-label {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.option-item.correct .option-label {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: white;
}

.option-item.wrong .option-label {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

.option-text {
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
}

/* ==================== 判断题选项 ==================== */
.judge-options {
    display: flex;
    gap: 16px;
}

.judge-option {
    flex: 1;
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.judge-icon {
    font-size: 32px;
}

.judge-text {
    font-size: 14px;
    font-weight: 500;
}

/* ==================== 考试计时器 ==================== */
.exam-timer {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 50;
}

.timer-icon {
    font-size: 18px;
    color: var(--color-primary);
}

.timer-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    font-family: 'SF Mono', 'Monaco', monospace;
}

.timer-text.warning {
    color: var(--color-warning);
}

.timer-text.danger {
    color: var(--color-error);
}

/* ==================== 结果页面 ==================== */
.result-container {
    padding: 20px;
    text-align: center;
}

.result-badge {
    width: 120px;
    height: 120px;
    margin: 20px auto;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.result-badge.pass {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #7A9A6A 100%);
    color: white;
}

.result-badge.fail {
    background: linear-gradient(135deg, var(--color-error) 0%, #C0392B 100%);
    color: white;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 4px;
}

.result-text {
    font-size: 14px;
    font-weight: 500;
}

.result-score {
    font-size: 48px;
    font-weight: 700;
    margin: 20px 0;
}

.result-score.pass {
    color: var(--color-secondary);
}

.result-score.fail {
    color: var(--color-error);
}

.result-message {
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 24px;
}

/* ==================== 雷达图容器 ==================== */
.chart-container {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 16px;
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.radar-chart {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #B8996E 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: rgba(196, 167, 125, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #7A9A6A 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-block {
    width: calc(100% - 32px);
    margin: 0 16px;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px;
}

/* ==================== 个人中心 ==================== */
.profile-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #B8996E 100%);
    padding: 40px 20px 30px;
    text-align: center;
    color: white;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: var(--shadow-md);
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.profile-status {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    font-size: 13px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px 16px;
    background: white;
    margin: -20px 16px 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* ==================== 预约页面 ==================== */
.booking-section {
    padding: 20px 16px;
}

.booking-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.date-item {
    padding: 16px 8px;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.date-item:hover {
    border-color: var(--color-primary);
}

.date-item.selected {
    border-color: var(--color-primary);
    background: rgba(196, 167, 125, 0.1);
}

.date-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.date-day {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.date-num {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.station-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.station-item {
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.station-item:hover {
    border-color: var(--color-primary);
}

.station-item.selected {
    border-color: var(--color-primary);
    background: rgba(196, 167, 125, 0.1);
}

.station-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.station-address {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.station-distance {
    font-size: 12px;
    color: var(--color-secondary);
}

/* ==================== 加载状态 ==================== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--color-text-light);
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--color-text-light);
}

/* ==================== 章节标题 ==================== */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    padding: 16px 16px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* ==================== 返回按钮 ==================== */
.back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    padding: 8px 0;
}

/* ==================== 知识点摘要 ==================== */
.summary-section {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    margin: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.summary-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-light);
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 0.3s ease;
}

/* ==================== 响应式调整 ==================== */
@media screen and (min-width: 375px) {
    html {
        font-size: 17px;
    }
}

@media screen and (min-width: 414px) {
    html {
        font-size: 18px;
    }
}
