/* ============================================
   修学堂 · 汽车电子学习小程序
   移动端优先 · 深色实战风
   2026-08-14
   ============================================ */

:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-card2: #1c2333;
    --border: #2d333b;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #f0883e;       /* 修车橙 */
    --accent2: #4ecdc4;      /* 信号绿 */
    --danger: #ff6b6b;
    --gold: #f5c518;
}

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

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.8;
    font-size: 16px;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 40px;
    -webkit-font-smoothing: antialiased;
}

/* ====== 顶部导航 ====== */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13,17,23,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-brand {
    font-size: 18px;
    font-weight: 700;
}
.brand-icon { margin-right: 4px; }
.nav-tabs {
    display: flex;
    gap: 4px;
}
.nav-tab {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.nav-tab.active {
    background: rgba(240,136,62,0.15);
    color: var(--accent);
    font-weight: 600;
}

.page { padding: 12px; }

/* ====== 卡片 ====== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-action {
    font-size: 14px;
    color: var(--accent);
    cursor: pointer;
    font-weight: 400;
}

/* ====== 个人卡片 ====== */
.profile-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1c2333 0%, #16203a 100%);
}
.profile-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(240,136,62,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.profile-name { font-size: 17px; font-weight: 700; }
.profile-sub { font-size: 13px; color: var(--text-secondary); }
.profile-stats {
    display: flex;
    gap: 14px;
}
.stat-item { text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-secondary); }

/* ====== 周进度 ====== */
.week-badge {
    background: rgba(240,136,62,0.15);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}
.week-progress {
    height: 8px;
    background: var(--bg-card2);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}
.week-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s;
}
.week-info { font-size: 14px; color: var(--text-secondary); }

/* ====== 今日任务 ====== */
.today-card {
    border: 1px solid rgba(240,136,62,0.4);
    background: linear-gradient(135deg, #1a1f2e 0%, #1c2333 100%);
}
.day-badge {
    background: rgba(78,205,196,0.15);
    color: var(--accent2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}
.today-task {
    font-size: 17px;
    font-weight: 600;
    margin: 10px 0 6px;
    line-height: 1.7;
}
.today-type {
    display: inline-block;
    font-size: 13px;
    color: var(--accent2);
    background: rgba(78,205,196,0.1);
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 6px;
}
.today-output {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ====== 按钮 ====== */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--accent), #e0743a);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity 0.2s;
}
.btn-primary:active { opacity: 0.85; }
.btn-primary.done {
    background: rgba(78,205,196,0.15);
    color: var(--accent2);
    font-weight: 600;
}
.checkin-status {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ====== 学习清单 ====== */
.learn-list { display: flex; flex-direction: column; gap: 6px; }
.learn-item {
    font-size: 14px;
    padding: 8px 12px;
    background: var(--bg-card2);
    border-radius: 8px;
    color: var(--text-primary);
}

/* ====== 学习路径（7阶段路线） ====== */
.path-progress {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}
.path-list { display: flex; flex-direction: column; gap: 10px; }
.path-item {
    background: var(--bg-card2);
    border-radius: 10px;
    padding: 12px;
    border-left: 3px solid var(--accent);
    cursor: pointer;
    transition: all .2s;
}
.path-item.done {
    border-left-color: #2ecc71;
    opacity: .75;
}
.path-item.done .path-title { text-decoration: line-through; }
.path-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.path-no {
    font-size: 11px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    border-radius: 20px;
    padding: 2px 8px;
    flex-shrink: 0;
}
.path-item.done .path-no { background: #2ecc71; }
.path-title { font-size: 14px; font-weight: 600; color: var(--text-primary); flex: 1; }
.path-check {
    width: 22px; height: 22px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #fff; flex-shrink: 0;
}
.path-item.done .path-check { background: #2ecc71; border-color: #2ecc71; }
.path-why {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}
.path-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.path-kb {
    font-size: 11px;
    background: rgba(240, 136, 62, .15);
    color: var(--accent);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
}
.path-milestone {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: 4px;
    padding: 2px 8px;
}


/* ====== 里程碑 ====== */
.milestone-item {
    font-size: 14px;
    padding: 10px 12px;
    background: rgba(245,197,24,0.08);
    border: 1px solid rgba(245,197,24,0.25);
    border-radius: 8px;
    color: var(--gold);
}

/* ====== 修板列表 ====== */
.board-list { display: flex; flex-direction: column; gap: 8px; }
.board-item {
    padding: 12px;
    background: var(--bg-card2);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.board-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.board-name { font-size: 15px; font-weight: 600; }
.board-date { font-size: 12px; color: var(--text-muted); }
.board-progress {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.mini-bar {
    height: 5px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}
.mini-bar div {
    height: 100%;
    background: var(--accent2);
    border-radius: 3px;
}
.board-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 6px;
}
.link-btn {
    font-size: 14px;
    color: var(--accent2);
    cursor: pointer;
}
.link-btn.danger { color: var(--danger); }

/* ====== 空状态 ====== */
.empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px 12px;
    font-size: 14px;
    line-height: 1.9;
}

/* ====== 搜索 ====== */
.search-bar { margin-bottom: 10px; }
.search-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }

/* ====== 知识库 ====== */
.kb-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.kb-tab {
    padding: 7px 16px;
    border-radius: 16px;
    font-size: 14px;
    background: var(--bg-card2);
    color: var(--text-secondary);
    cursor: pointer;
    border: 1px solid var(--border);
}
.kb-tab.active {
    background: rgba(240,136,62,0.15);
    color: var(--accent);
    border-color: rgba(240,136,62,0.4);
    font-weight: 600;
}
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.kb-item:active { border-color: var(--accent); }
.kb-item-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: rgba(240,136,62,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.kb-item-body { flex: 1; }
.kb-item-name { font-size: 15px; font-weight: 600; }
.kb-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.kb-item-arrow { color: var(--text-muted); font-size: 18px; }

/* ====== 案例库 ====== */
.case-list { display: flex; flex-direction: column; gap: 8px; }
.case-item {
    padding: 14px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.case-item:active { border-color: var(--accent); }
.case-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.case-item-title { font-size: 15px; font-weight: 600; }
.case-diff { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.case-item-sys { font-size: 12px; color: var(--accent2); margin-bottom: 4px; }
.case-item-phen {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ====== 波形基准库 ====== */
.wave-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}
.wave-list { display: flex; flex-direction: column; gap: 8px; }
.wave-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.wave-item:active { border-color: var(--accent); }
.wave-thumb {
    width: 64px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--border);
}
.wave-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.wave-item-body { flex: 1; }
.wave-item-name { font-size: 14px; font-weight: 600; }
.wave-item-sub { font-size: 12px; color: var(--text-secondary); }

/* ====== 讲解录音 ====== */
.audio-list { display: flex; flex-direction: column; gap: 8px; }
.audio-item {
    padding: 10px 12px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.audio-item-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.audio-item audio { width: 100%; height: 36px; }

/* ====== 弹窗 ====== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    overflow-y: auto;
}
.modal-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-close {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
}

/* ====== 表单 ====== */
.form-item { margin-bottom: 12px; }
.form-item label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
}
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.7;
    outline: none;
}
.form-textarea:focus { border-color: var(--accent); }

/* ====== 案例详情 ====== */
.case-diff-row {
    font-size: 14px;
    color: var(--gold);
    margin-bottom: 12px;
}
.case-field {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: var(--bg-card2);
    border-radius: 8px;
}
.case-field-label {
    font-size: 13px;
    color: var(--accent2);
    font-weight: 600;
    margin-bottom: 4px;
}
.case-field-val {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ====== 滚动条 ====== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ====== 引脚明细表（芯片维修必读） ====== */
.pin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 11px;
}
.pin-table th {
    background: var(--accent);
    color: #fff;
    padding: 5px 4px;
    font-weight: 600;
    position: sticky;
    top: 0;
}
.pin-table td {
    padding: 5px 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: top;
    line-height: 1.4;
}
.pin-table tr:nth-child(even) { background: rgba(255,255,255,.03); }
.pin-table td b { color: var(--accent); }
/* 移动端横向滚动 */
.pin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ====== 学习路径使用建议 ====== */
.path-tip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.path-tip b { color: var(--text-primary); }

/* ====== 学习路径展开细节 ====== */
.path-arrow {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 4px;
    transition: transform .2s;
}
.path-detail {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.path-learn { display: flex; flex-direction: column; gap: 5px; }
.path-learn-item {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    padding-left: 4px;
}
.path-practice {
    font-size: 13px;
    color: var(--accent);
    background: rgba(240, 136, 62, .1);
    border-radius: 6px;
    padding: 8px 10px;
    line-height: 1.5;
}
