/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo h1 {
    font-size: 24px;
    color: #2c3e50;
    text-decoration: none;
}

.logo a {
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    padding: 8px 16px;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #3498db;
}

.btn-login, .btn-register {
    padding: 8px 20px !important;
    border-radius: 4px;
}

.btn-register {
    background: #3498db;
    color: #fff !important;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #2c3e50;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 用户菜单 */
.user-menu {
    position: relative;
}

.user-menu > span {
    cursor: pointer;
    padding: 8px 16px;
    display: inline-block;
}

.user-menu .dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 8px;
}

.user-menu:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu .dropdown a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.user-menu .dropdown a:hover {
    background: #f5f5f5;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    opacity: 0.9;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary {
    background: #3498db;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-success {
    background: #27ae60;
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
    width: 100%;
}

/* 课程网格 */
.courses-section {
    margin: 40px 0;
}

.courses-section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.course-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.course-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #ecf0f1;
    position: relative;
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-info {
    padding: 20px;
}

.course-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.course-description {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 14px;
}

.course-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #7f8c8d;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.price {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
}

/* 课程详情页 */
.course-detail {
    background: white;
    border-radius: 8px;
    padding: 40px;
    margin: 40px 0;
}

.course-header h1 {
    font-size: 36px;
    margin-bottom: 20px;
}

.course-meta-large {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.badge {
    background: #ecf0f1;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.course-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.course-image img {
    width: 100%;
    border-radius: 8px;
}

.course-description h2 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.price-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    position: sticky;
    top: 100px;
}

.price-amount {
    font-size: 48px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 20px;
}

/* 认证表单 */
.auth-form {
    max-width: 500px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

.auth-link a {
    color: #3498db;
}

/* 提示消息 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #060;
    border: 1px solid #cfc;
}

/* 支付页面 */
.checkout-page {
    margin: 40px 0;
}

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.order-summary,
.payment-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #ecf0f1;
}

.order-total {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    font-size: 20px;
    font-weight: bold;
}

.stripe-card-element {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error-message {
    color: #e74c3c;
    margin: 10px 0;
}

.payment-security {
    text-align: center;
    margin-top: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

/* 视频播放页面 */
.watch-page {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    margin: 40px 0;
}

.video-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.video-player-wrapper {
    margin: 20px 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.course-sidebar-watch {
    background: white;
    padding: 30px;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.progress-bar-container {
    background: #ecf0f1;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    background: #27ae60;
    height: 100%;
    transition: width 0.3s;
}

/* 成功页面 */
.success-page {
    background: white;
    max-width: 600px;
    margin: 40px auto;
    padding: 60px 40px;
    border-radius: 8px;
    text-align: center;
}

.success-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.order-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: left;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
}

.empty-state p {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* 页脚 */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
}

.footer-section a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 移动端导航 */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: relative;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .nav-menu {
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
    }
    
    .nav-menu.active {
        max-height: 500px;
        opacity: 1;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        margin: 8px 0;
    }
    
    .nav-menu a {
        display: block;
        padding: 12px 16px !important;
        width: 100%;
    }
    
    .btn-login,
    .btn-register {
        display: block;
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
    
    .user-menu {
        border-top: 1px solid #eee;
        padding-top: 15px;
        margin-top: 10px;
    }
    
    .user-menu .dropdown {
        position: static;
        display: block;
        background: none;
        box-shadow: none;
        margin-top: 10px;
    }
    
    /* 其他移动端样式 */
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .course-content,
    .checkout-content,
    .watch-page {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero {
        padding: 50px 20px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .container {
        padding: 0 15px;
    }
}
