/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* 搜索栏样式 */
.search-bar {
    margin: 10px;
    background: white;
    border-radius: 20px;
    padding: 8px 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-bar input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

/* 轮播图样式 */
.banner {
    margin: 10px;
    border-radius: 10px;
    overflow: hidden;
    height: 150px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

/* 滚动播报样式 */
.announcement-container {
    display: flex;
    align-items: center;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 10px;
    margin: 10px;
    overflow: hidden;
}

.announcement-icon {
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
    color: #856404;
    height: 24px;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
}

.announcement-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 24px;
    display: inline-block;
}

.announcement-content {
    width: 100%;
    height: 100%;
}

.announcement-text {
    font-size: 14px;
    color: #856404;
    white-space: nowrap;
}

/* 确保li中的文字不换行 */
.txtMarquee-left .bd ul {
    list-style: none;
    padding: 0;
    margin: 0;
    white-space: nowrap;
}

.txtMarquee-left .bd ul li {
    display: inline-block;
    white-space: nowrap;
    padding-right: 50px;
}

/* 分类网格样式 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 10px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-item {
    text-align: center;
}

.category-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.category-name {
    font-size: 12px;
    color: #666;
}

/* 最近更新区域样式 */
.recent-update-section {
    margin: 20px 10px;
}

.recent-update-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 10px;
}

.recent-update-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    align-items: center;
}

.recent-update-item:hover {
    background-color: rgba(248, 248, 248, 0.7);
}

.recent-update-item:last-child {
    border-bottom: none;
}

.recent-update-image {
    width: 80px;
    height: 60px;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    border-radius: 6px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.recent-update-info {
    flex: 1;
}

.recent-update-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: 39.2px; /* 2行文字的高度 */
}

.recent-update-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recent-update-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recent-update-price {
    color: #ff6b6b;
    font-size: 16px;
    font-weight: bold;
}

.recent-update-students {
    font-size: 12px;
    color: #999;
}

/* 商品区域样式 */
.product-section {
    margin: 20px 10px;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    padding-left: 10px;
    border-left: 4px solid #ff6b6b;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-image {
    height: 120px;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.product-info {
    padding: 10px;
}

.product-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    color: #ff6b6b;
    font-size: 16px;
    font-weight: bold;
}

/* 主内容区域样式 - 用于顶部没有导航栏的页面 */
.main-content-no-header {
    padding-bottom: 80px; /* 为底部导航预留空间 */
}

/* 底部导航样式 */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: white;
    display: flex;
    border-top: 1px solid #eee;
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.nav-item.active {
    color: #ff6b6b;
}

.nav-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

/* 新闻页面特定样式 */
.recent-update-title a:hover {
    color: #ff6b6b;
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    padding: 0 10px 30px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.pagination a {
    background: white;
    border: 1px solid #ddd;
    color: #333;
}

.pagination a:hover {
    background: #f5f5f5;
    color: #ff6b6b;
}

.pagination .current {
    background: #ff6b6b;
    color: white;
    border: 1px solid #ff6b6b;
}

/* 详情页样式 */
.main-content {
    padding: 10px;
    padding-bottom: 70px; /* 为底部导航预留空间 */
}

.detail-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 15px;
}

/* 封面轮播图 */
.cover-carousel {
    margin-bottom: 25px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.cover-slider {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cover-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.cover-slider:hover img {
    transform: scale(1.05);
}

/* 装饰元素 */
.cover-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

/* 轮播图指示器 */
.cover-carousel .carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 2;
}

.cover-carousel .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cover-carousel .indicator.active {
    background-color: white;
    width: 20px;
    border-radius: 4px;
}

/* 资料头部信息 */
.detail-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
    line-height: 1.4;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #666;
}

.detail-meta span {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 12px;
}

/* 文件信息 */
.file-info {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-info h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.file-info p {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

/* 资料内容 */
.detail-content {
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 15px;
    color: #333;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 6px;
}

.detail-content p {
    margin-bottom: 15px;
}

.detail-content h1, 
.detail-content h2, 
.detail-content h3, 
.detail-content h4, 
.detail-content h5, 
.detail-content h6 {
    margin: 20px 0 10px;
    color: #333;
}

.detail-content ul, 
.detail-content ol {
    padding-left: 25px;
    margin-bottom: 15px;
}

.detail-content li {
    margin-bottom: 5px;
}

.detail-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
}

.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.detail-content th, 
.detail-content td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.detail-content th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* 空内容状态 */
.empty-content {
    text-align: center;
    padding: 30px 0;
    color: #999;
}

.empty-content-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* 操作按钮 */
.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-large {
    flex: 1;
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
}

.btn-download {
    background-color: #ff6b6b;
    color: white;
}

.btn-download:hover {
    background-color: #ff5252;
}

.btn-back {
    background-color: #f0f0f0;
    color: #666;
}

.btn-back:hover {
    background-color: #e0e0e0;
}

/* 顶部导航栏 */
.header-nav {
    position: sticky;
    top: 0;
    background: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    z-index: 100;
}

.back-btn {
    display: flex;
    align-items: center;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    padding: 6px 0;
    gap: 4px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #ff6b6b;
}

.back-btn svg {
    transition: transform 0.2s;
}

.back-btn:hover svg {
    transform: translateX(-2px);
}

.header-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    flex: 1;
    text-align: center;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-placeholder {
    width: 60px; /* 与返回按钮宽度相同，保持标题居中 */
}

/* 用户页面样式 */
.user-center {
    padding-bottom: 70px; /* 为底部导航预留空间 */
}

/* 用户头部信息 */
.user-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 25px 15px;
    color: white;
    display: flex;
    align-items: center;
    position: relative;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.user-level {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 12px;
}

/* 退出按钮样式 */
.logout-btn-top {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.logout-btn-top:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 升级会员卡片样式 */
.upgrade-card {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    border-radius: 10px;
    margin: 15px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    color: #333;
}

.upgrade-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.upgrade-icon {
    font-size: 36px;
    margin-right: 15px;
}

.upgrade-info {
    flex: 1;
}

.upgrade-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.upgrade-desc {
    font-size: 14px;
    color: #666;
}

.upgrade-btn {
    background: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.upgrade-btn:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 用户菜单样式 */
.user-menu {
    background: white;
    margin: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f8f8f8;
}

.menu-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
    color: #666;
}

.menu-label {
    font-size: 15px;
    font-weight: 500;
}

.menu-arrow {
    margin-left: auto;
    color: #ccc;
}

/* 功能菜单中的退出按钮样式 */
.logout-item {
    background: #ff4d4f;
    color: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-item:hover {
    background: #ff7875;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 77, 79, 0.3);
}

.logout-item .menu-icon {
    color: white;
}

.logout-item .menu-label {
    color: white;
    font-weight: bold;
}

/* 用户中心菜单网格样式 */
.menu-grid {
    background: white;
}