
/* 全局重置与变量 */
:root {
    --primary-color: #6c5ce7; /* 柔和紫 */
    --secondary-color: #a29bfe;
    --accent-color: #fdcb6e; /* 活力黄 */
    --bg-color: #f9f9fc;
    --text-main: #2d3436;
    --text-light: #636e72;
    --white: #ffffff;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* 头部导航 */
.main-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-nav a {
    margin: 0 15px;
    font-weight: 600;
    color: var(--text-light);
}

.top-nav a:hover, .top-nav a.active {
    color: var(--primary-color);
}

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

.btn-login {
    padding: 8px 16px;
    color: var(--primary-color);
}

.btn-signup {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 20px;
}

.btn-signup:hover {
    background-color: #5649c0;
}

/* 欢迎横幅 */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.welcome-banner h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* 通用标题 */
.section-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-main);
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 5px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* 分类卡片 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 4rem;
}

.cat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.cat-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary-color);
}

.cat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.cat-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.cat-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 课程列表 */
.course-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 4rem;
}

.course-item {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.course-thumb {
    position: relative;
    height: 180px;
}

.course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.level-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.level-badge.beginner { background-color: #00b894; }
.level-badge.intermediate { background-color: #0984e3; }

.course-details {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.instructor {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #b2bec3;
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.btn-start {
    display: block;
    text-align: center;
    padding: 10px;
    background-color: var(--bg-color);
    color: var(--primary-color);
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.btn-start:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* 进度区域 */
.progress-section {
    margin-bottom: 4rem;
}

.progress-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.progress-text h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.progress-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.circle-chart {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-color) calc(var(--percent) * 1%), #eee 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.circle-chart::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
}

.percent-text {
    position: relative;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-main);
}

.week-label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* 页脚 */
.site-footer {
    background-color: #2d3436;
    color: #dfe6e9;
    padding: 4rem 0 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 3rem;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul li a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 15px;
}

.copyright-bar {
    background-color: #1e2223;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    color: #636e72;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }
    
    .top-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .top-nav a {
        margin: 0;
    }
    
    .welcome-banner h1 {
        font-size: 1.8rem;
    }
    
    .progress-card {
        flex-direction: column;
        text-align: center;
    }
}
