/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器居中 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* 主要内容区域 */
main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

/* 页面标题 */
.page-title {
    text-align: center;
    font-size: 36px;
    color: #333;
    margin-bottom: 50px;
    position: relative;
}

.page-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 20px auto;
    border-radius: 2px;
}

/* 课程卡片网格 */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.course-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    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.15);
}

.course-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.course-info {
    padding: 20px;
}

.course-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.course-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.course-price {
    font-size: 24px;
    color: #667eea;
    font-weight: bold;
}

.course-price .original {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-right: 10px;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* 课程详情页 */
.course-detail {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.course-detail-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.course-detail-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.course-detail-info h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 20px;
}

.course-detail-info .price-section {
    margin: 30px 0;
}

.course-detail-info .price {
    font-size: 36px;
    color: #667eea;
    font-weight: bold;
}

.course-detail-info .original-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
    margin-left: 15px;
}

.course-detail-info .btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 16px;
}

.course-content {
    margin-top: 40px;
}

.course-content h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.course-content p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
}

.course-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.feature-item h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.feature-item p {
    color: #666;
    font-size: 14px;
}

/* 购买下单页 */
.purchase-container {
    max-width: 800px;
    margin: 0 auto;
}

.order-summary {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.order-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.order-item-info {
    flex: 1;
}

.order-item-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.order-item-price {
    font-size: 20px;
    color: #667eea;
    font-weight: bold;
}

.order-total {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total-label {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.order-total-price {
    font-size: 28px;
    color: #667eea;
    font-weight: bold;
}

.payment-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
    margin-top: 20px;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* 页脚 */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    margin: 10px 0;
    font-size: 14px;
}

footer a {
    color: #cccccc;
    text-decoration: none;
}

footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* 侧边在线客服 */
.online-service {
    position: fixed;
    right: 0;
    top: 40%;
    z-index: 998;
    font-size: 14px;
}

.online-service-tab {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 12px 10px;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.online-service-panel {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    width: 240px;
    background: #ffffff;
    color: #333333;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    padding: 18px 16px;
    display: none;
}

.online-service-panel h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333333;
}

.online-service-panel p {
    font-size: 13px;
    margin: 4px 0;
    color: #555555;
}

.online-service-panel p strong {
    color: #333333;
}

.online-service.open .online-service-panel {
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    nav ul {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .course-detail-header {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 28px;
    }

    .course-detail-info h1 {
        font-size: 24px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .online-service {
        top: auto;
        bottom: 120px;
    }

    .online-service-panel {
        right: 70px;
        top: 50%;
        transform: translateY(-50%);
        width: 210px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .course-detail {
        padding: 20px;
    }

    .order-item {
        flex-direction: column;
    }

    .order-item-image {
        width: 100%;
        height: 150px;
    }
}

/* 评价样式 */
.reviews-container {
    margin-top: 20px;
}

.review-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.reviewer-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.review-rating {
    color: #ffa500;
    font-size: 18px;
}

.review-content {
    color: #666;
    line-height: 1.8;
    margin-bottom: 10px;
}

.review-time {
    color: #999;
    font-size: 14px;
    text-align: right;
}

.review-form-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

