/* CSS变量定义 */
:root {
    --primary-gradient: linear-gradient(135deg, #0D8ABC 0%, #0a6a8f 100%);
    --primary-color: #0D8ABC;
    --primary-dark: #0a6a8f;
    --accent-color: #28a745;
    --accent-gradient: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    --card-bg: #ffffff;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --border-color: #e8eaf0;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-gradient);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #0D8ABC 0%, #0a6a8f 100%);
    box-shadow: 0 4px 20px rgba(13, 138, 188, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(90deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 35px;
}

.nav-menu a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    padding: 8px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #fff;
    transition: width 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #fff;
    transform: translateY(-2px);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* 主要内容 */
.main-content {
    padding: 50px 0;
}

/* 会员状态 */
.membership-status-section {
    margin-bottom: 50px;
}

.status-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.status-card:hover {
    box-shadow: var(--card-hover-shadow);
}

.member-status {
    font-size: 22px;
    font-weight: 700;
}

.member-status.active {
    color: var(--success-color);
}

.member-status.inactive {
    color: var(--text-secondary);
}

.member-expiry {
    color: var(--text-secondary);
    margin-left: 15px;
    font-size: 16px;
}

.auto-renew-action {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-renew-action .btn {
    padding: 10px 20px;
    font-size: 14px;
}

.auto-renew-status {
    font-size: 15px;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.auto-renew-status.inactive {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
}

/* 订阅套餐 */
.subscription-packages {
    margin-bottom: 50px;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.package-card {
    background: var(--card-bg);
    padding: 35px 30px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.package-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
}

.package-card:hover::before {
    opacity: 1;
}

.package-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 700;
}

.price {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.duration {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
}

.features {
    list-style: none;
    margin-bottom: 30px;
    text-align: left;
}

.features li {
    margin-bottom: 12px;
    color: var(--text-primary);
    padding-left: 24px;
    position: relative;
    font-size: 15px;
}

.features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: 700;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(13, 138, 188, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* 我的课程 */
.my-courses {
    margin-bottom: 50px;
}

.course-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.course-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sort-select {
    padding: 10px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: var(--card-bg);
    min-width: 160px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 138, 188, 0.1);
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(13, 138, 188, 0.3);
}

.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.course-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
    position: relative;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
}

.course-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.vip-badge,
.premium-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.vip-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.premium-badge {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #333;
}

.course-info {
    padding: 20px;
}

.course-title {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    transition: color 0.3s;
}

.course-card:hover .course-title {
    color: var(--primary-color);
}

.course-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(13, 138, 188, 0.1);
    border-radius: 20px;
    font-size: 13px;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 500;
}

.course-instructor {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.course-instructor::before {
    content: '👤';
    font-size: 16px;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.course-rating .star {
    color: #ffc107;
    font-size: 16px;
}

.course-rating .score {
    color: var(--text-primary);
    font-weight: 600;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
    font-weight: 500;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 540px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body h4 {
    margin: 15px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.modal-body ul {
    margin: 15px 0 15px 25px;
}

.modal-body p {
    margin: 12px 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal-body ul {
    color: var(--text-secondary);
}

.modal-body ul li {
    margin-bottom: 10px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 0 0 16px 16px;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 12px;
    color: #fff;
    z-index: 3000;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.toast-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.toast-info {
    background: var(--primary-gradient);
}

/* 续费提醒 */
.renewal-notification {
    position: fixed;
    top: 90px;
    right: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    max-width: 380px;
    border: 2px solid rgba(220, 53, 69, 0.2);
    animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-content h3 {
    margin-bottom: 12px;
    color: var(--error-color);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-content h3::before {
    content: '⚠️';
}

.notification-content p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.notification-content .btn {
    margin-right: 10px;
}

/* 课程详情图片 */
.course-detail-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

/* 协议内容样式 */
.protocol-content {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 10px;
}

.protocol-content::-webkit-scrollbar {
    width: 6px;
}

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

.protocol-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.protocol-content h4 {
    color: var(--text-primary);
    margin: 20px 0 12px 0;
    font-size: 17px;
    font-weight: 600;
}

.protocol-content p {
    color: var(--text-secondary);
    margin: 12px 0;
    line-height: 1.8;
    font-size: 14px;
}

.protocol-content ul {
    margin: 12px 0 12px 25px;
    color: var(--text-secondary);
}

.protocol-content li {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.7;
}

/* 响应式设计 */
/* 课程搜索框 */
.course-search {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 250px;
    flex: 1;
}

.search-input:focus {
    outline: none;
    border-color: #0D8ABC;
}

.search-btn {
    padding: 10px 20px;
    background-color: #0D8ABC;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.search-btn:hover {
    background-color: #0a7199;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
    }

    .logo a {
        font-size: 22px;
    }

    .nav-menu {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-menu li {
        margin: 8px 12px;
    }

    .nav-menu a {
        font-size: 14px;
    }

    .packages-grid {
        grid-template-columns: 1fr;
    }

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

    .notification-content {
        text-align: center;
    }

    .status-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .member-expiry {
        margin-left: 0;
    }

    .auto-renew-action {
        width: 100%;
        justify-content: center;
    }

    .auto-renew-action .btn {
        width: 100%;
    }

    .course-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .course-search {
        width: 100%;
    }

    .search-input {
        min-width: 100%;
    }

    .sort-select {
        min-width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .toast {
        right: 20px;
        left: 20px;
        top: 20px;
    }

    .renewal-notification {
        left: 20px;
        right: 20px;
        top: auto;
        bottom: 20px;
        max-width: none;
    }

    .main-content {
        padding: 30px 0;
    }
}
