/* ============================================
   数字教材服务平台 - 首页落地页样式
   基于参考图片还原：深蓝色科技背景 + 教材卡片展示
   ============================================ */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Source Han Sans CN", "思源黑体", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #0A1628;
    overflow-x: hidden;
}

a {
    color: #165DFF;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #4080FF;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 60px;
}

/* ============================================
   顶部导航栏
   ============================================ */
.header {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(22, 93, 255, 0.2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-name {
    font-size: 20px;
    font-weight: bold;
    color: #FFFFFF;
    letter-spacing: 2px;
    line-height: 1.2;
}

.site-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #FFFFFF;
}

.nav-link.active {
    color: #165DFF;
    font-weight: 600;
}

.btn-login {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #165DFF;
    color: #165DFF;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-left: 12px;
}

.btn-login:hover {
    background: #165DFF;
    color: white;
}

/* 用户头像样式 */
.nav-user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(22, 93, 255, 0.5);
    transition: all 0.3s ease;
}

.nav-user-profile:hover .nav-avatar {
    border-color: #165DFF;
    transform: scale(1.1);
}

.nav-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #165DFF 0%, #4080FF 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid rgba(22, 93, 255, 0.5);
    transition: all 0.3s ease;
}

.nav-user-profile:hover .nav-avatar-placeholder {
    border-color: #165DFF;
    transform: scale(1.1);
}

.nav-username {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   主横幅区 - 科技背景
   ============================================ */
.hero-banner {
    position: relative;
    height: 200px;
    margin-top: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tech-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(22, 93, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(22, 93, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #0A1628 0%, #1A2B4A 100%);
    overflow: hidden;
}

.tech-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(22, 93, 255, 0.03) 2px, rgba(22, 93, 255, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(22, 93, 255, 0.03) 2px, rgba(22, 93, 255, 0.03) 4px);
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: rgba(22, 93, 255, 0.2);
    border: 1px solid rgba(22, 93, 255, 0.4);
    padding: 16px 40px;
    border-radius: 3px;
    backdrop-filter: blur(10px);
}

.hero-badge svg {
    flex-shrink: 0;
}

.hero-badge span {
    font-size: 32px;
    font-weight: bold;
    color: #FFFFFF;
    letter-spacing: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   教材展示区
   ============================================ */
.books-showcase {
    position: relative;
    padding: 60px 0 100px;
    background: linear-gradient(180deg, #0A1628 0%, #0F1D35 100%);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.book-item {
    position: relative;
}

.book-link {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 150%; /* 宽高比 2:3，接近书本比例 */
    background: #FFFFFF;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-link:hover .book-cover-wrapper {
    transform: translateY(-12px) rotateX(3deg);
    box-shadow: 
        0 16px 48px rgba(22, 93, 255, 0.5),
        0 0 0 2px rgba(22, 93, 255, 0.4);
}

.book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F0F5FF;
}

.cover-placeholder svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   底部
   ============================================ */
.footer {
    background: #0A1628;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 0;
    border-top: 1px solid rgba(22, 93, 255, 0.2);
}

.footer-content {
    text-align: center;
}

.footer-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.copyright {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

.footer-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 1400px) {
    .container {
        padding: 0 40px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .hero-badge span {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-banner {
        min-height: 300px;
        padding: 40px 0;
    }
    
    .hero-badge span {
        font-size: 20px;
        letter-spacing: 1px;
    }
    
    .books-showcase {
        padding: 40px 0 60px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
    
    .header-container {
        height: 60px;
    }
    
    .site-name {
        font-size: 16px;
    }
    
    .site-subtitle {
        display: none;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .btn-login {
        padding: 6px 14px;
        font-size: 13px;
        margin-left: 8px;
    }
    
    .hero-banner {
        height: 150px;
        margin-top: 60px;
    }
    
    .hero-badge {
        padding: 12px 24px;
    }
    
    .hero-badge span {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .hero-badge svg {
        width: 32px;
        height: 32px;
    }
    
    .books-showcase {
        padding: 40px 0 60px;
    }
    
    .footer {
        padding: 30px 0;
    }
    
    .copyright {
        font-size: 12px;
    }
    
    .footer-info {
        font-size: 11px;
    }
}
