/* 响应式样式框架 - 适配手机和PC */

/* CSS变量 */
:root {
    --primary-color: #ff700a;
    --primary-hover: #e66509;
    --text-color: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border-color: #eee;
    --bg-color: #f5f7fa;
    --card-bg: #fff;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --header-height: 60px;
    --footer-height: 60px;
    --max-width: 1200px;
    --content-padding: 20px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* 主容器 */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部导航 */
.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo img {
    height: 40px;
    width: auto;
}

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

/* 导航菜单 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu a {
    font-size: 15px;
    color: var(--text-secondary);
    transition: color 0.3s;
    padding: 8px 0;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* 搜索框 */
.search-box {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 20px;
    padding: 6px 15px;
    width: 200px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 14px;
}

.search-box button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-light);
}

/* 用户区域 */
.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-login {
    padding: 6px 20px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    transition: all 0.3s;
}

.btn-login:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 汉堡按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s;
}

/* 主导内容区 */
.main-content {
    flex: 1;
    padding: 20px 0;
}

/* 轮播图 */
.banner {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.banner-slides {
    display: flex;
    transition: transform 0.5s ease;
}

.banner-slide {
    min-width: 100%;
    position: relative;
}

.banner-slide img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.banner-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.banner-dots span.active {
    background: #fff;
}

/* 快捷入口 */
.quick-entries {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 12px;
    padding: 25px 20px;
    box-shadow: var(--shadow);
}

.quick-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.quick-entry:hover {
    transform: translateY(-5px);
}

.quick-entry-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a56 0%, #ff700a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.quick-entry-icon img {
    width: 30px;
    height: 30px;
}

.quick-entry-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 内容区块 */
.content-section {
    margin-bottom: 30px;
}

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

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.section-more {
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.section-more:hover {
    color: var(--primary-color);
}

/* 课程卡片网格 */
.course-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.course-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.course-cover {
    position: relative;
    width: 100%;
    padding-top: 56%;
    overflow: hidden;
}

.course-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.course-card:hover .course-cover img {
    transform: scale(1.05);
}

.course-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.course-info {
    padding: 15px;
}

.course-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 42px;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
}

.course-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

.course-free {
    color: #52c41a;
}

.course-vip {
    color: #faad14;
}

.course-stats {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 文章列表 */
.article-list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.article-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
    cursor: pointer;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item:hover {
    background: #fafafa;
}

.article-thumb {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 20px;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-title {
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    gap: 15px;
}

.article-download {
    align-self: center;
    padding: 6px 16px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.article-download:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 底部 */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 30px 0 20px;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    text-align: center;
}

.footer-text {
    color: var(--text-light);
    font-size: 13px;
    line-height: 2;
}

.footer-text a {
    color: var(--text-light);
    transition: color 0.3s;
}

.footer-text a:hover {
    color: var(--primary-color);
}

/* 移动端底部导航 */
.mobile-footer-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-footer-nav-inner {
    display: flex;
    height: var(--footer-height);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-light);
    transition: color 0.3s;
}

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

.nav-item img {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 11px;
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 列表页样式 */
.list-page {
    padding: 0;
}

.page-header {
    background: #fff;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.page-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.page-search {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    margin-bottom: 20px;
}

.page-search input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.page-search input:focus {
    border-color: var(--primary-color);
}

/* 详情页样式 */
.detail-page {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-header {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

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

.detail-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-light);
}

.detail-content {
    padding: 30px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

.detail-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 8px;
}

.detail-content p {
    margin-bottom: 15px;
}

.related-section {
    margin-top: 30px;
    padding: 30px;
    border-top: 1px solid var(--border-color);
}

.related-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.related-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.3s;
    cursor: pointer;
}

.related-item:hover {
    background: #f5f7fa;
}

.related-item img {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.related-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-item-title {
    font-size: 13px;
    color: var(--text-color);
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-item-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-bottom: 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.3s;
    cursor: pointer;
}

.pagination a:hover,
.pagination .current {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
}

.load-more:hover {
    text-decoration: underline;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 14px;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 50px;
        --footer-height: 60px;
        --content-padding: 15px;
    }

    .container {
        padding: 0;
    }

    .header-inner {
        padding: 0 15px;
    }

    .logo img {
        height: 32px;
    }

    .logo-text {
        font-size: 15px;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        transition: transform 0.3s;
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    .nav-menu a {
        font-size: 16px;
        padding: 10px 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .search-box {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .quick-entries {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        padding: 20px 15px;
    }

    .quick-entry-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .quick-entry-icon img {
        width: 25px;
        height: 25px;
    }

    .quick-entry-text {
        font-size: 12px;
    }

    .course-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .section-title {
        font-size: 17px;
    }

    .article-item {
        padding: 15px;
    }

    .article-thumb {
        width: 100px;
        height: 70px;
        margin-right: 15px;
    }

    .article-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .page-header {
        padding: 15px 0;
    }

    .page-header-inner {
        padding: 0 15px;
    }

    .detail-header {
        padding: 20px 15px;
    }

    .detail-title {
        font-size: 18px;
    }

    .detail-content {
        padding: 20px 15px;
        font-size: 15px;
    }

    .related-list {
        grid-template-columns: 1fr;
    }

    .mobile-footer-nav {
        display: flex;
    }

    .site-footer {
        padding-bottom: calc(var(--footer-height) + 30px);
    }

    .back-to-top {
        right: 15px;
        bottom: calc(var(--footer-height) + 15px);
    }

    .banner-slide img {
        height: 200px;
    }

    .user-area .btn-login {
        display: none;
    }
}

/* 平板适配 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    :root {
        --max-width: 900px;
    }

    .quick-entries {
        grid-template-columns: repeat(6, 1fr);
    }

    .course-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .related-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 大屏幕适配 */
@media screen and (min-width: 1440px) {
    :root {
        --max-width: 1400px;
    }

    .quick-entries {
        grid-template-columns: repeat(8, 1fr);
    }

    .course-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 打印样式 */
@media print {
    .site-header,
    .site-footer,
    .mobile-footer-nav,
    .back-to-top {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }
}
