* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f6 100%);
    color: #1e293b;
    line-height: 1.5;
    padding: 0 1rem; /* 两侧留白 */
    box-shadow: 0 0 0 3px #3b82f6; /* 蓝色外边框 */
}
/* 顶栏 - 深蓝色主题 */
.header {
    background: rgba(30, 58, 138, 0.9); /* 深蓝色半透明 */
    /* 刻意不加 backdrop-filter：吸顶栏带模糊时，任何滚到它后面的内容都会让它
       背后整片重画（实测每帧多花约 3ms）。背景 90% 不透明，模糊看不出来 */
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid rgba(59,130,246,0.3);
    margin: 0 -1rem; /* 抵消 body 内边距 */
}
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #fff, #93c5fd);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.logo i {
    font-size: 1.6rem;
    background: linear-gradient(135deg, #fff, #93c5fd);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.logo img {
    height: 32px;
    width: auto;
    vertical-align: middle;
}
.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}
.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: #f0f9ff;
    transition: color 0.2s;
}
.nav-links a:hover {
    color: #93c5fd;
}
.search-wrapper {
    background: rgba(255,255,255,0.2);
    border-radius: 40px;
    padding: 0.4rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.3);
}
.search-wrapper:focus-within {
    background: rgba(255,255,255,0.3);
    box-shadow: 0 0 0 2px #3b82f6;
}
.search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    width: 180px;
    color: white;
}
.search-wrapper input::placeholder {
    color: #cbd5e1;
}
.search-wrapper button {
    background: transparent;
    border: none;
    color: #f0f9ff;
    cursor: pointer;
}
.user-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.auth-btn {
    background: transparent;
    border: 1px solid #f0f9ff;
    border-radius: 40px;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #f0f9ff;
}
.auth-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: #93c5fd;
}
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    background: #3b82f6;
}
.avatar:hover {
    transform: scale(1.02);
}
.gray-avatar {
    background: #3b82f6;
    color: white;
}
/* 轮播图 */
.carousel-section {
    margin-bottom: 3rem;
    border-radius: 0; /* 方角 */
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}
.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}
.carousel-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}
.slide {
    flex: 0 0 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}
.slide::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}
.slide-content {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    /* 刻意不加 backdrop-filter：它会要求浏览器把"按钮背后的一切"单独渲染一遍，
       轮播图片一切换/一滑动，这一小块就得重新采样（首页以后要放数字人浮窗，
       那更是动画内容）。背景 70% 不透明 + hover 变纯白，够用了 */
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
    transition: all 0.2s;
}
.carousel-btn:hover {
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.btn-left { left: 1rem; }
.btn-right { right: 1rem; }
.dots {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
}
.dot.active {
    background: white;
    width: 26px;
    border-radius: 8px;
}
/* 推荐模块 */
.recommend-section {
    margin-top: 3rem;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
}
.section-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0f172a, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.section-header a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}
.course-card {
    background: white;
    border-radius: 1rem; /* 减小圆角 */
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #eef2ff;
}
.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px -12px rgba(0,0,0,0.15);
}
.card-img {
    height: 200px; /* 增加图片高度 */
    background-size: cover;
    position: relative;
}
.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}
.card-content {
    padding: 1.2rem;
}
.card-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #f1f5f9;
}
.teacher { color: #3b82f6; font-size: 0.8rem; }
.duration { color: #64748b; font-size: 0.8rem; }
/* 底页 - 深蓝色 */
.footer {
    text-align: center;
    padding: 2rem;
    background: #1e3a8a; /* 深蓝色 */
    color: #f0f9ff;
    border-top: 1px solid #3b82f6;
    margin-top: 3rem;
    margin-left: -1rem;
    margin-right: -1rem;
    font-size: 0.8rem;
}
@media (max-width: 860px) {
    .header {
        margin: 0 -1rem;
    }
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-links {
        justify-content: center;
    }
    .search-wrapper input {
        width: 100%;
    }
}
@media (max-width: 600px) {
    .main-content { padding: 1rem; }
    .carousel-container { height: 260px; }
    .section-header h2 { font-size: 1.3rem; }
    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}