/* ===== 行者孙Python H5 移动端样式（仿小程序界面） ===== */
:root {
    --primary: #008ADF;
    --primary-light: #00A3E8;
    --bg: #f6f6f6;
    --card-bg: #fff;
    --text: #333;
    --text-light: #999;
}

* { 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;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    max-width: 100%;
}

a { text-decoration: none; color: inherit; }

/* ---------- 顶部导航栏 ---------- */
.h5-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 44px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.h5-header-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.h5-header-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: cover;
}

/* ---------- 页面主体（留出顶栏和底栏空间） ---------- */
.h5-body {
    padding: 44px 0 0;
    min-height: 100vh;
}
.h5-bottom-space { height: 56px; }

/* ---------- 底部 tabBar（仿小程序） ---------- */
.h5-tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 52px;
    background: #fff;
    display: flex;
    z-index: 100;
    border-top: 1px solid #eee;
    padding-bottom: env(safe-area-inset-bottom);
}
.h5-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    gap: 2px;
}
.h5-tab-icon { font-size: 20px; line-height: 1; }
.h5-tab-text { font-size: 10px; }
.h5-tab.active { color: var(--primary); }

/* ---------- 轮播图 ---------- */
.h5-swiper {
    position: relative;
    margin: 10px 12px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #e9ecef;
}
.h5-swiper-track {
    display: flex;
    transition: transform .4s ease;
}
.h5-swiper-slide { flex: 0 0 100%; position: relative; }
.h5-swiper-slide img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.h5-swiper-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 20px 12px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,.5));
    color: #fff;
    font-size: 13px;
}
.h5-swiper-dots {
    position: absolute;
    right: 10px; bottom: 8px;
    display: flex;
    gap: 4px;
}
.h5-swiper-dots .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
}
.h5-swiper-dots .dot.on { background: #fff; width: 12px; border-radius: 3px; }

/* ---------- 通知栏 ---------- */
.h5-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 12px 0;
    padding: 8px 12px;
    background: #EAF6FE;
    border-radius: 8px;
    color: #2c7bb6;
    font-size: 12px;
}
.h5-notice-icon { font-size: 14px; }
.h5-notice-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ---------- 数据统计 ---------- */
.h5-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 10px 12px 0;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 14px 0;
}
.h5-stat-item { text-align: center; }
.h5-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.h5-stat-label { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ---------- 区块 ---------- */
.h5-section { margin: 14px 12px 0; }
.h5-section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1c2b3a;
}

/* ---------- 采集能力 ---------- */
.h5-ability-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.h5-ability-item {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 12px 6px;
    text-align: center;
}
.h5-ability-icon { font-size: 24px; }
.h5-ability-title { font-size: 13px; font-weight: 600; margin-top: 4px; }
.h5-ability-desc { font-size: 10px; color: var(--text-light); margin-top: 2px; line-height: 1.4; }

/* ---------- 列表卡片 ---------- */
.h5-list-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    transition: transform .1s ease;
}
.h5-list-card:active { transform: scale(.985); }

.h5-card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.h5-card-main { flex: 1; min-width: 0; }
.h5-card-title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.h5-card-desc {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.h5-card-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.h5-tag {
    font-size: 10px;
    color: #fff;
    border-radius: 4px;
    padding: 1px 6px;
}
.h5-card-meta { font-size: 10px; color: var(--text-light); }
.h5-card-arrow { color: #ccc; font-size: 18px; flex-shrink: 0; }

/* ---------- 分类 tab ---------- */
.h5-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 12px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.h5-tabs::-webkit-scrollbar { display: none; }
.h5-tab-item {
    flex-shrink: 0;
    padding: 5px 14px;
    background: #eee;
    border-radius: 16px;
    font-size: 12px;
    color: #666;
}
.h5-tab-item.on {
    background: var(--primary);
    color: #fff;
}

/* ---------- 搜索框 ---------- */
.h5-search { padding: 10px 12px 0; }
.h5-search-input {
    width: 100%;
    height: 34px;
    border: none;
    border-radius: 17px;
    background: #fff;
    padding: 0 14px;
    font-size: 13px;
    outline: none;
    box-shadow: inset 0 0 0 1px #e5e5e5;
}

/* ---------- 课程信息头 ---------- */
.h5-course-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 12px 0;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 14px;
}
.h5-course-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.h5-course-info { flex: 1; min-width: 0; }
.h5-course-name { font-size: 16px; font-weight: 700; }
.h5-course-desc {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ---------- 文章序号 ---------- */
.h5-article-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #EAF6FE;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------- 文章正文 ---------- */
.h5-article {
    margin: 10px 12px 0;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 16px 14px;
}
.h5-article-title { font-size: 18px; font-weight: 700; line-height: 1.4; }
.h5-article-meta {
    font-size: 11px;
    color: var(--text-light);
    margin: 6px 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.h5-article-content {
    font-size: 15px;
    line-height: 1.8;
    word-break: break-word;
}
.h5-article-content img { max-width: 100%; height: auto; border-radius: 8px; }
.h5-article-content pre {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
}
.h5-article-content blockquote {
    border-left: 4px solid var(--primary);
    background: #f0f8fe;
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    margin: 10px 0;
}
.h5-article-content a { color: var(--primary); }
.h5-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}
.h5-article-content td,
.h5-article-content th {
    border: 1px solid #e5e5e5;
    padding: 6px 8px;
}

/* ---------- 资源详情 ---------- */
.h5-resource-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 12px 0;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 16px 14px;
}
.h5-resource-big { width: 56px; height: 56px; font-size: 28px; }
.h5-resource-info { flex: 1; min-width: 0; }
.h5-resource-title { font-size: 16px; font-weight: 700; }
.h5-resource-desc {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 3px;
}

/* ---------- 下载按钮 ---------- */
.h5-download-bar { margin: 14px 12px 0; text-align: center; }
.h5-download-btn {
    display: block;
    height: 44px;
    line-height: 44px;
    border-radius: 22px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.h5-download-notice { font-size: 11px; color: var(--text-light); margin-top: 6px; }

/* ---------- 返回栏 ---------- */
.h5-back-bar { margin: 16px 12px 0; }
.h5-back-btn {
    display: inline-block;
    font-size: 13px;
    color: var(--primary);
    padding: 6px 0;
}

/* ---------- 关于我 ---------- */
.h5-about {
    margin: 10px 12px 0;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
}
.h5-about-logo {
    width: 84px; height: 84px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0,138,223,.25);
}
.h5-about-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: #EAF6FE;
}
.h5-about-name { font-size: 18px; font-weight: 700; margin-top: 12px; }
.h5-about-updated { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.h5-about-content {
    margin-top: 14px;
    text-align: left;
    font-size: 14px;
    line-height: 1.8;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}
.h5-about-content img { max-width: 100%; border-radius: 8px; }
.h5-about-contact { margin-top: 18px; }
.h5-contact-btn {
    display: block;
    height: 40px;
    line-height: 40px;
    border-radius: 20px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.h5-contact-tip { font-size: 11px; color: var(--text-light); margin-top: 8px; }

/* ---------- 空状态 ---------- */
.h5-empty {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
    font-size: 13px;
}
