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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 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 .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 14px;
    opacity: 0.9;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

/* 轮播横幅 */
.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    background-image: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=1920&h=600&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.7);
}

.banner-content {
    position: relative;
    z-index: 1;
}

.banner h2 {
    font-size: 42px;
    margin-bottom: 20px;
}

.banner p {
    font-size: 20px;
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* 课程展示区 */
.courses-section {
    padding: 80px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: #333;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.course-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.course-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;
}

.course-image:hover {
    transform: scale(1.05);
}

.course-info {
    padding: 20px;
}

.course-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.course-desc {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.price {
    font-size: 24px;
    color: #e74c3c;
    font-weight: bold;
}

.students {
    color: #999;
    font-size: 14px;
}

.btn-course {
    display: block;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: opacity 0.3s;
}

.btn-course:hover {
    opacity: 0.9;
}

/* 关于我们 */
.about-section {
    padding: 80px 0;
    background: #f9f9f9;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.8;
    color: #555;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 详情页 */
.detail-section {
    padding: 40px 0;
    background: white;
}

.detail-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.detail-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.thumbnail-images {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #667eea;
}

.detail-info h1 {
    font-size: 32px;
    margin-bottom: 15px;
}

.course-rating {
    margin-bottom: 20px;
}

.stars {
    color: #ffc107;
    font-size: 20px;
}

.rating-text {
    color: #666;
    margin-left: 10px;
}

.course-price {
    margin-bottom: 30px;
}

.current-price {
    font-size: 36px;
    color: #e74c3c;
    font-weight: bold;
    margin-right: 15px;
}

.original-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
    margin-right: 15px;
}

.discount {
    background: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}

.course-features {
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
}

.feature-icon {
    font-size: 20px;
    margin-right: 10px;
}

.course-actions {
    display: flex;
    gap: 15px;
}

.btn-purchase {
    flex: 1;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: opacity 0.3s;
}

.btn-purchase:hover {
    opacity: 0.9;
}

.btn-favorite {
    padding: 15px 30px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-favorite:hover {
    background: #667eea;
    color: white;
}

.detail-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 15px 30px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 10px;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.tab-content h4 {
    font-size: 20px;
    margin: 20px 0 10px;
}

.tab-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.tab-content li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.outline-item {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 5px;
}

.review-item {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 5px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.reviewer-name {
    font-weight: bold;
}

.review-stars {
    color: #ffc107;
}

.review-date {
    color: #999;
    font-size: 14px;
}

.review-content {
    color: #555;
    line-height: 1.8;
}

/* 购买页面 */
.purchase-section {
    padding: 40px 0;
    background: #f5f5f5;
}

.purchase-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.purchase-header h1 {
    font-size: 36px;
    color: #333;
    margin-bottom: 10px;
}

.purchase-header p {
    font-size: 18px;
    color: #666;
}

.purchase-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

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

.course-selection-header h2 {
    font-size: 24px;
    margin: 0;
}

.selection-actions {
    display: flex;
    gap: 10px;
}

.btn-select-all,
.btn-clear-all {
    padding: 8px 20px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-select-all:hover,
.btn-clear-all:hover {
    background: #667eea;
    color: white;
}

.course-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.select-course-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
}

.select-course-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.select-course-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.course-checkbox {
    display: flex;
    align-items: center;
}

.course-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.course-image-link {
    display: block;
    flex-shrink: 0;
}

.select-course-item img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    transition: transform 0.3s;
}

.select-course-item:hover img {
    transform: scale(1.05);
}

.select-course-info {
    flex: 1;
}

.select-course-info h3 {
    margin-bottom: 5px;
    font-size: 18px;
}

.select-course-info p {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.course-price-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.select-price {
    font-size: 20px;
    color: #e74c3c;
    font-weight: bold;
}

.original-price-small {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.purchase-right {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: stretch;
}

.purchase-right > * {
    flex-shrink: 0;
}

.order-summary {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
    margin-bottom: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    z-index: 10;
}

.order-summary::-webkit-scrollbar {
    width: 6px;
}

.order-summary::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.order-summary::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.order-summary::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.order-header h2 {
    margin: 0;
    font-size: 24px;
}

.course-count {
    font-size: 14px;
    color: #667eea;
    font-weight: bold;
}

.order-items {
    margin-bottom: 25px;
    min-height: 120px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.order-items::-webkit-scrollbar {
    width: 6px;
}

.order-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.order-items::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.order-items::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.empty-cart {
    color: #999;
    text-align: center;
    padding: 40px 0;
}

.empty-cart p:first-child {
    font-size: 48px;
    margin-bottom: 10px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

.order-item:hover {
    background: #f9f9f9;
    padding-left: 10px;
    padding-right: 10px;
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 5px;
}

.order-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.order-item-name {
    flex: 1;
    margin-right: 15px;
}

.order-item-price {
    color: #e74c3c;
    font-weight: bold;
    margin-right: 10px;
}

.btn-remove-course {
    width: 28px;
    height: 28px;
    border: none;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-remove-course:hover {
    background: #ee5a6f;
    transform: scale(1.1);
}

.order-total {
    margin-bottom: 25px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.total-row.total-final {
    font-size: 20px;
    font-weight: bold;
    color: #e74c3c;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.discount-amount {
    color: #27ae60;
}

.btn-submit-order {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit-order:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-submit-order:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.payment-info {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 0;
    position: relative;
}

.payment-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px 10px 0 0;
}

.payment-info h3 {
    margin-bottom: 20px;
    font-size: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-method:hover {
    border-color: #667eea;
}

.payment-method input[type="radio"] {
    width: 20px;
    height: 20px;
}

.payment-icon {
    font-size: 32px;
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-method img {
    width: 60px;
    height: 40px;
    object-fit: contain;
}

.contact-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 0;
    position: relative;
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px 10px 0 0;
}

.contact-form h3 {
    margin-bottom: 20px;
    font-size: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

.required {
    color: #e74c3c;
    margin-left: 3px;
}

.error-message {
    display: none;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

.form-group input:invalid:not(:placeholder-shown) + .error-message {
    display: block;
}

/* 侧边在线客服 */
.customer-service {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 999;
}

.service-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.service-btn:hover {
    transform: scale(1.1);
}

.service-panel {
    position: absolute;
    right: 0;
    bottom: 80px;
    width: 320px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: none;
    overflow: hidden;
}

.service-panel.active {
    display: block;
}

.service-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-header h3 {
    font-size: 18px;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.service-content {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.service-content p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

.service-form {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.service-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.service-form button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.service-form button:hover {
    opacity: 0.9;
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 110px;
    width: 50px;
    height: 50px;
    background: rgba(102, 126, 234, 0.8);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 998;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.back-to-top.show {
    display: flex;
}

.back-to-top:hover {
    background: rgba(102, 126, 234, 1);
    transform: translateY(-3px);
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section p {
    margin-bottom: 10px;
    color: #bbb;
    font-size: 14px;
}

.footer-section a {
    display: block;
    color: #bbb;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
}

.footer-bottom p {
    margin-bottom: 10px;
    color: #bbb;
    font-size: 14px;
}

.footer-bottom a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-bottom a:hover {
    color: white;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: fadeIn 0.6s ease-out;
}

.course-card:nth-child(1) { animation-delay: 0.1s; }
.course-card:nth-child(2) { animation-delay: 0.2s; }
.course-card:nth-child(3) { animation-delay: 0.3s; }
.course-card:nth-child(4) { animation-delay: 0.4s; }
.course-card:nth-child(5) { animation-delay: 0.5s; }
.course-card:nth-child(6) { animation-delay: 0.6s; }

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .banner h2 {
        font-size: 28px;
    }
    
    .banner p {
        font-size: 16px;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .detail-main {
        grid-template-columns: 1fr;
    }
    
    .purchase-header h1 {
        font-size: 28px;
    }
    
    .purchase-header p {
        font-size: 16px;
    }
    
    .course-selection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .selection-actions {
        width: 100%;
    }
    
    .btn-select-all,
    .btn-clear-all {
        flex: 1;
    }
    
    .select-course-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .select-course-item img {
        width: 100%;
        height: 200px;
    }
    
    .course-checkbox {
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 10;
    }
    
    .purchase-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .purchase-right {
        gap: 20px;
    }
    
    .order-summary {
        position: static;
        margin-bottom: 0;
    }
    
    .payment-info {
        margin-top: 0;
    }
    
    .contact-form {
        margin-top: 0;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-item-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .order-items {
        max-height: 300px;
    }
    
    .service-panel {
        width: 280px;
        right: -10px;
    }
    
    .customer-service {
        right: 15px;
        bottom: 15px;
    }
    
    .back-to-top {
        right: 15px;
        bottom: 85px;
    }
}
