 /* 课程页面样式 */

/* 页面头部 */
.page-header {
    height: 400px;
    background: linear-gradient(135deg, var(--primary-50, #eff6ff) 0%, var(--primary-100, #dbeafe) 100%);
    border-bottom: 1px solid var(--border-primary, rgba(59, 130, 246, 0.2));
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

[data-theme="dark"] .page-header {
    background: linear-gradient(135deg, var(--gray-800, #1f2937) 0%, var(--gray-700, #374151) 100%);
}

/* 背景装饰元素 */
.header-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.bg-circles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    animation: float 6s ease-in-out infinite;
}

[data-theme="dark"] .circle {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(147, 51, 234, 0.05));
}

.circle-1 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -50px;
    animation-delay: 0s;
}

.circle-2 {
    width: 150px;
    height: 150px;
    bottom: -30px;
    left: -30px;
    animation-delay: 2s;
}

.circle-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 20%;
    animation-delay: 4s;
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: 0 0, 0 0;
    animation: gridMove 20s linear infinite;
}

[data-theme="dark"] .bg-grid {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.02) 1px, transparent 1px);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

/* 浮动装饰图标 */
.floating-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    color: var(--primary-300, rgba(59, 130, 246, 0.4));
    font-size: 1.2rem;
    opacity: 0.6;
    animation: floatIcon 8s ease-in-out infinite;
}

[data-theme="dark"] .floating-icon {
    color: var(--primary-700, rgba(59, 130, 246, 0.3));
    opacity: 0.3;
}

.icon-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.icon-2 {
    top: 60%;
    right: 15%;
    animation-delay: 1.5s;
}

.icon-3 {
    bottom: 30%;
    left: 5%;
    animation-delay: 3s;
}

.icon-4 {
    top: 30%;
    right: 5%;
    animation-delay: 4.5s;
}

.icon-5 {
    bottom: 20%;
    right: 30%;
    animation-delay: 6s;
}

@keyframes floatIcon {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
    }
    25% { 
        transform: translateY(-10px) rotate(5deg);
    }
    50% { 
        transform: translateY(-20px) rotate(-5deg);
    }
    75% { 
        transform: translateY(-5px) rotate(3deg);
    }
}

@keyframes expandAccent {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: 60px;
        opacity: 1;
    }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-30px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.header-content {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    position: relative;
    z-index: 2;
}

@media (min-width: 768px) {
    .header-content {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

.title-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.title-accent {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-600, #2563eb), var(--primary-400, #60a5fa));
    border-radius: 2px;
    animation: expandAccent 1s ease-out 0.5s both;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.welcome-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    color: var(--primary-700, #1d4ed8);
    font-weight: 500;
    font-size: 0.875rem;
    animation: slideInLeft 0.8s ease-out 0.3s both;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .welcome-message {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.15);
    color: var(--primary-300, #93c5fd);
}

.welcome-message i {
    font-size: 1rem;
    color: var(--primary-500, #3b82f6);
}

.stats-grid {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .stats-grid {
        justify-content: flex-end;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 120px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .stat-card {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(59, 130, 246, 0.4);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-100, #dbeafe), var(--primary-200, #bfdbfe));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-600, #2563eb);
}

[data-theme="dark"] .stat-icon {
    background: linear-gradient(135deg, var(--primary-900, #1e3a8a), var(--primary-800, #1e40af));
    color: var(--primary-300, #93c5fd);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary, #1f2937);
}

[data-theme="dark"] .stat-number {
    color: var(--text-primary, #f9fafb);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
    opacity: 0.8;
}

/* 课程筛选 */
.course-filters {
    background: linear-gradient(135deg, var(--surface-color), rgba(79, 70, 229, 0.02));
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(79, 70, 229, 0.1);
    backdrop-filter: blur(10px);
}

.course-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% 100%;
    animation: gradientFlow 3s ease-in-out infinite;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.filter-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.filter-tab {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.filter-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.filter-tab:hover::before {
    left: 100%;
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-tab.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(147, 51, 234, 0.1));
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.2);
}

.filter-tab.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.filter-tab i {
    font-size: 0.85rem;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.difficulty-filter {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 110px;
    transition: all 0.3s ease;
}

.difficulty-filter:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.difficulty-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-color);
}

.view-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.view-btn:hover {
    background: var(--surface-color);
    color: var(--text-color);
}

.view-btn.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(147, 51, 234, 0.1));
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
    border-color: var(--primary-color);
}

/* 课程网格 */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}

.courses-grid.list-view {
    grid-template-columns: 1fr;
}

.courses-grid.list-view .course-card {
    display: flex;
    max-width: none;
}

.courses-grid.list-view .course-thumbnail {
    width: 200px;
    flex-shrink: 0;
}

.courses-grid.list-view .course-content {
    flex: 1;
    padding: 1.5rem;
}

/* 课程卡片 */
.course-card {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    max-width: 290px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(147, 51, 234, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.course-card:hover::before {
    opacity: 1;
}

.course-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15);
    border-color: rgba(79, 70, 229, 0.2);
}

.course-card:nth-child(odd) {
    animation: floatUp 6s ease-in-out infinite;
}

.course-card:nth-child(even) {
    animation: floatDown 6s ease-in-out infinite;
    animation-delay: 3s;
}

@keyframes floatUp {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

@keyframes floatDown {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(5px); }
}

.course-thumbnail {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover .course-thumbnail img {
    transform: scale(1.05);
}

.course-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.course-card:hover .course-overlay {
    opacity: 1;
}

.play-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.1);
    background: var(--accent-color);
}

.completion-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
}

.course-content {
    padding: 1rem;
}

.course-header {
    margin-bottom: 0.6rem;
}

.course-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.course-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.3;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.course-instructor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--warning-color);
}

.course-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.6rem;
}

.tag {
    background: var(--primary-color-light);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 35px;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-price {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.badge {
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-color-light);
    color: var(--success-color);
}

.badge-warning {
    background: var(--warning-color-light);
    color: var(--warning-color);
}

.badge-danger {
    background: var(--danger-color-light);
    color: var(--danger-color);
}

.course-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.course-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .filter-tabs {
        justify-content: center;
        order: 2;
    }
    
    .filter-actions {
        flex-wrap: wrap;
        justify-content: center;
        order: 1;
        gap: 0.75rem;
    }
    
    .difficulty-filter {
        min-width: 100px;
    }
    
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .course-card {
        max-width: none;
    }
    
    .courses-grid.list-view .course-card {
        flex-direction: column;
    }
    
    .courses-grid.list-view .course-thumbnail {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header {
        height: 320px;
    }
    
    .page-title {
        font-size: 1.75rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
        min-width: 100px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .course-filters {
        padding: 1rem;
    }
    
    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .course-content {
        padding: 1rem;
    }
    
    .course-title {
        font-size: 1.1rem;
    }
}

/* 黑暗主题适配 */
[data-theme="dark"] .course-card {
    background: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .course-card:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] .difficulty-filter {
    background: var(--surface-color);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .view-btn {
    background: var(--surface-color);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .view-btn.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(147, 51, 234, 0.15));
    color: var(--primary-300);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    border-color: var(--primary-400);
}

[data-theme="dark"] .course-filters {
    background: linear-gradient(135deg, var(--surface-color), rgba(147, 51, 234, 0.05));
    border-color: rgba(147, 51, 234, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .filter-tab.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(147, 51, 234, 0.15));
    border-color: var(--primary-color);
    color: var(--primary-300);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}