/* 学员H5端 - 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; font-size: 14px; color: #333; background: #f5f7fa; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* 顶部标题栏 */
.h5-header {
    position: sticky; top: 0; z-index: 100;
    height: 48px; line-height: 48px;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: #fff; text-align: center; font-size: 17px; font-weight: 500;
    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.25);
}
.h5-header .back {
    position: absolute; left: 12px; top: 0; width: 40px; height: 48px;
    font-size: 22px; line-height: 48px; text-align: center;
}
.h5-header .right {
    position: absolute; right: 12px; top: 0; font-size: 14px;
    line-height: 48px; opacity: 0.9;
}

/* 主容器 */
.h5-container { padding: 12px; padding-bottom: 80px; }

/* 卡片样式 */
.card {
    background: #fff; border-radius: 10px; padding: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04); margin-bottom: 12px;
}

/* 按钮 */
.btn {
    display: inline-block; padding: 10px 20px; border-radius: 8px;
    font-size: 15px; text-align: center; transition: all 0.2s;
}
.btn-primary { background: #1890ff; color: #fff; width: 100%; padding: 12px; font-size: 16px; }
.btn-primary:active { background: #096dd9; }
.btn-primary:disabled { background: #bbb; }
.btn-success { background: #52c41a; color: #fff; }
.btn-warn { background: #faad14; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-default { background: #f0f0f0; color: #333; }

/* 表单 */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; color: #666; font-size: 14px; }
.form-item input, .form-item textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 15px; background: #fafafa;
}
.form-item input:focus, .form-item textarea:focus {
    border-color: #1890ff; background: #fff;
}

/* 登录页 */
.login-wrap {
    min-height: 100vh; padding: 60px 24px 40px;
    background: linear-gradient(180deg, #e6f4ff 0%, #f5f7fa 40%);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo .icon {
    width: 72px; height: 72px; margin: 0 auto 16px;
    background: linear-gradient(135deg, #1890ff, #096dd9);
    border-radius: 20px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 36px; font-weight: bold;
    box-shadow: 0 6px 16px rgba(24, 144, 255, 0.3);
}
.login-logo h1 { font-size: 20px; color: #1890ff; }
.login-logo p { color: #999; margin-top: 6px; font-size: 13px; }
.login-card { background: #fff; border-radius: 14px; padding: 24px 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

/* Tab导航 */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: #fff; border-top: 1px solid #eee;
    display: flex; height: 56px; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #999; font-size: 11px;
}
.tabbar .tab .icon { font-size: 22px; margin-bottom: 2px; }
.tabbar .tab.active { color: #1890ff; }

/* 学习列表 */
.material-item {
    background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.material-item .cover {
    width: 72px; height: 72px; border-radius: 8px;
    background: linear-gradient(135deg, #e6f4ff, #bae0ff);
    display: flex; align-items: center; justify-content: center;
    color: #1890ff; font-size: 24px; flex-shrink: 0;
}
.material-item .info { flex: 1; min-width: 0; }
.material-item .title {
    font-size: 15px; font-weight: 500; color: #333;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-bottom: 6px;
}
.material-item .meta { font-size: 12px; color: #999; }
.material-item .meta .tag {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    font-size: 11px; margin-right: 6px;
}
.material-item .meta .tag-text { background: #e6f4ff; color: #1890ff; }
.material-item .meta .tag-ppt { background: #fff7e6; color: #fa8c16; }
.material-item .status {
    font-size: 12px; padding: 3px 8px; border-radius: 4px; flex-shrink: 0;
}
.material-item .status-0 { background: #f0f0f0; color: #999; }
.material-item .status-1 { background: #e6f7ff; color: #1890ff; }
.material-item .status-2 { background: #f6ffed; color: #52c41a; }

/* 进度条 */
.progress-wrap { margin-top: 10px; }
.progress-bar {
    height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden;
}
.progress-bar .fill {
    height: 100%; background: linear-gradient(90deg, #1890ff, #52c41a);
    border-radius: 4px; transition: width 0.3s;
}
.progress-text {
    display: flex; justify-content: space-between;
    font-size: 12px; color: #999; margin-top: 4px;
}

/* 学习详情-内容区 */
.learn-content {
    background: #fff; border-radius: 10px; padding: 16px;
    min-height: 300px; line-height: 1.8; font-size: 15px; color: #444;
}
.learn-content h3 { margin: 16px 0 10px; color: #1890ff; font-size: 17px; }
.learn-content p { margin-bottom: 10px; }
.learn-content ul { margin: 10px 0; padding-left: 20px; }
.learn-content ul li { list-style: disc; margin-bottom: 6px; }

/* PPT页面 */
.ppt-page {
    background: #fff; border-radius: 10px; padding: 8px;
    min-height: 400px; display: flex; flex-direction: column;
}
.ppt-page .img-wrap {
    flex: 1; border-radius: 8px; background: #f5f5f5;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.ppt-page .placeholder {
    width: 100%; height: 300px;
    background: linear-gradient(135deg, #e6f4ff 0%, #bae0ff 100%);
    display: flex; align-items: center; justify-content: center;
    color: #1890ff; font-size: 32px;
}
.ppt-page img { width: 100%; }
.ppt-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 12px; padding: 0 4px;
}
.ppt-nav .page-info { color: #666; font-size: 14px; }
.ppt-nav button {
    padding: 8px 16px; border-radius: 6px; font-size: 14px;
    background: #1890ff; color: #fff;
}
.ppt-nav button:disabled { background: #d9d9d9; }

/* 顶部翻页控制栏（固定在图片上方） */
.ppt-nav-top {
    background: #fff; border-radius: 10px; padding: 10px 12px;
    margin: 10px 0; gap: 8px; flex-wrap: wrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky; top: 0; z-index: 10;
}
.ppt-nav-top .page-info { flex: 1; text-align: center; }

/* 自动/手动翻页开关 */
.flip-mode-switch {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: #666; cursor: pointer; user-select: none;
}
.flip-mode-switch input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 36px; height: 20px; border-radius: 10px;
    background: #d9d9d9; position: relative; cursor: pointer;
    transition: background 0.2s; margin: 0; border: none;
}
.flip-mode-switch input[type="checkbox"]::before {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.flip-mode-switch input[type="checkbox"]:checked {
    background: #1890ff;
}
.flip-mode-switch input[type="checkbox"]:checked::before {
    transform: translateX(16px);
}
.flip-mode-label { white-space: nowrap; }

/* 学习控制区 */
.learn-control {
    position: sticky; bottom: 0; padding: 12px;
    background: #fff; border-top: 1px solid #eee;
    border-radius: 14px 14px 0 0;
}
.learn-timer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: #666; margin-bottom: 8px;
}
.learn-timer .time { color: #1890ff; font-weight: 500; font-size: 15px; }

/* 考试列表 */
.exam-item {
    background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 12px;
    border-left: 4px solid #1890ff;
}
.exam-item .title { font-size: 16px; font-weight: 500; color: #333; margin-bottom: 8px; }
.exam-item .desc { font-size: 13px; color: #888; margin-bottom: 8px; line-height: 1.6; }
.exam-item .meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: 12px; color: #888; margin-bottom: 10px;
}
.exam-item .meta span { display: flex; align-items: center; gap: 3px; }
.exam-item .score-tag {
    padding: 4px 10px; border-radius: 20px; font-size: 13px;
    background: #f6ffed; color: #52c41a;
}
.exam-item .score-tag.no-pass { background: #fff1f0; color: #ff4d4f; }

/* 考试答题页 */
.exam-header {
    position: sticky; top: 0; background: #fff; z-index: 10;
    padding: 12px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.exam-header .info { font-size: 13px; color: #666; }
.exam-header .countdown { color: #ff4d4f; font-weight: bold; font-size: 15px; }
.question-card {
    background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 12px;
}
.question-card .q-header {
    display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start;
}
.question-card .q-index {
    background: #1890ff; color: #fff; border-radius: 4px;
    padding: 2px 8px; font-size: 12px; flex-shrink: 0;
}
.question-card .q-type {
    background: #f0f5ff; color: #2f54eb; border-radius: 4px;
    padding: 2px 8px; font-size: 12px; flex-shrink: 0;
}
.question-card .q-text {
    font-size: 15px; line-height: 1.7; color: #333; flex: 1;
}
.options-list .opt {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 8px;
    background: #fafafa; border: 1px solid transparent;
    transition: all 0.2s;
}
.options-list .opt.selected {
    background: #e6f4ff; border-color: #1890ff;
}
.options-list .opt .opt-key {
    width: 24px; height: 24px; line-height: 22px; text-align: center;
    border: 1px solid #ddd; border-radius: 50%; flex-shrink: 0;
    font-size: 13px; background: #fff;
}
.options-list .opt.selected .opt-key {
    background: #1890ff; color: #fff; border-color: #1890ff;
}
.options-list .opt .opt-text { flex: 1; line-height: 1.6; padding-top: 2px; }

/* 考试结果页 */
.result-card {
    background: #fff; border-radius: 14px; padding: 20px; text-align: center;
    margin-bottom: 14px;
}
.result-card .score-circle {
    width: 140px; height: 140px; border-radius: 50%;
    margin: 0 auto 16px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border: 8px solid #52c41a;
}
.result-card .score-circle.no-pass { border-color: #ff4d4f; }
.result-card .score-num { font-size: 36px; font-weight: bold; color: #333; }
.result-card .score-unit { font-size: 14px; color: #888; }
.result-card .pass-tag {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    background: #f6ffed; color: #52c41a; font-size: 14px; margin-top: 8px;
}
.result-card .pass-tag.no-pass { background: #fff1f0; color: #ff4d4f; }
.result-stats {
    display: flex; justify-content: space-around;
    padding: 14px 0; background: #fafafa; border-radius: 8px;
    margin-bottom: 14px;
}
.result-stats .stat-item { text-align: center; }
.result-stats .stat-num { font-size: 20px; font-weight: bold; color: #1890ff; }
.result-stats .stat-label { font-size: 12px; color: #888; margin-top: 4px; }

/* 题目解析（错题） */
.analysis-card {
    background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 12px;
}
.analysis-card.wrong { border-left: 4px solid #ff4d4f; }
.analysis-card.right { border-left: 4px solid #52c41a; }
.answer-result { padding: 8px 0; font-size: 13px; }
.answer-result .row { margin-bottom: 6px; }
.answer-result .label { color: #888; display: inline-block; width: 68px; }
.answer-result .user { color: #ff4d4f; }
.answer-result .correct { color: #52c41a; }
.analysis-text {
    background: #fffbe6; padding: 10px; border-radius: 6px;
    font-size: 13px; color: #874d00; line-height: 1.7;
}

/* 用户中心 */
.user-info-card {
    background: linear-gradient(135deg, #1890ff, #096dd9);
    border-radius: 14px; padding: 20px; color: #fff; margin-bottom: 14px;
    display: flex; align-items: center; gap: 14px;
}
.user-info-card .avatar {
    width: 60px; height: 60px; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center;
    color: #1890ff; font-size: 24px; font-weight: bold;
}
.user-info-card .name { font-size: 18px; font-weight: 500; margin-bottom: 4px; }
.user-info-card .phone { font-size: 13px; opacity: 0.85; }

.stat-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    margin-bottom: 14px;
}
.stat-grid .stat {
    background: #fff; border-radius: 10px; padding: 14px 8px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-grid .stat .num { font-size: 20px; font-weight: bold; color: #1890ff; }
.stat-grid .stat .lbl { font-size: 12px; color: #888; margin-top: 4px; }

.menu-list { background: #fff; border-radius: 10px; overflow: hidden; }
.menu-list .item {
    display: flex; align-items: center; padding: 14px 16px;
    border-bottom: 1px solid #f5f5f5;
}
.menu-list .item:last-child { border-bottom: none; }
.menu-list .item .icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: #e6f4ff; color: #1890ff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; margin-right: 12px;
}
.menu-list .item .text { flex: 1; font-size: 15px; }
.menu-list .item .arrow { color: #ccc; }

/* Toast提示 */
.toast {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75); color: #fff; padding: 10px 20px;
    border-radius: 8px; font-size: 14px; z-index: 9999;
    max-width: 80%; text-align: center;
}

/* 加载 */
.loading { text-align: center; padding: 40px 0; color: #999; }
.empty { text-align: center; padding: 60px 0; color: #bbb; }
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
