/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 顶部导航 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left .logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.series-nav {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.series-nav::-webkit-scrollbar {
    display: none;
}

.series-nav .nav-item {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.series-nav .nav-item:hover {
    background-color: #e0e0e0;
}

.series-nav .nav-item.active {
    background-color: #3498db;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right .search-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-right .search-btn:hover {
    background-color: #f5f5f5;
}

/* 用户菜单 */
.user-menu {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.user-menu .user-nickname {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.user-menu .btn-logout {
    padding: 4px 12px;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    background-color: #fff;
    color: #e74c3c;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu .btn-logout:hover {
    background-color: #e74c3c;
    color: #fff;
}

/* 登录按钮 */
.header-right .btn-login {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-right .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 登录弹窗遮罩 */
.login-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.login-modal-overlay.show {
    display: flex;
}

/* 登录弹窗 */
.login-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 0;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.login-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.login-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal-close:hover {
    background-color: #e5e5e5;
    color: #333;
}

.login-modal form {
    padding: 24px;
}

.login-form-group {
    margin-bottom: 16px;
}

.login-form-group label {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.login-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login-modal {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 8px;
}

.btn-login-modal:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-login-modal:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-error-msg {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

.login-modal-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 主内容区 */
.main-content {
    display: flex;
    gap: 24px;
    padding: 24px;
    max-width: 1440px;
    margin: 0 auto;
}

/* 左侧系列网格 */
.sidebar {
    width: 200px;
    flex-shrink: 0;
}

.sidebar .section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 3px solid #3498db;
}

.series-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.series-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.series-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.series-item .series-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.series-item .series-info {
    flex: 1;
    min-width: 0;
}

.series-item .series-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.series-item .series-desc {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* 主内容区域 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 轮播区 */
.carousel-section {
    background-color: #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.carousel-section .section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: 100%;
    position: relative;
}

.carousel-item .carousel-cover {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.carousel-item .carousel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

.carousel-item .carousel-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.carousel-item .carousel-desc {
    font-size: 14px;
    opacity: 0.9;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background-color: #3498db;
    transform: scale(1.3);
}

/* 精选推荐区 */
.featured-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.featured-section .section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.featured-item {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.featured-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.featured-item .featured-cover {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.featured-item .featured-info {
    padding: 12px;
}

.featured-item .featured-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-item .featured-desc {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 24px;
    background-color: #2c3e50;
    color: #fff;
    margin-top: 40px;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-circle {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .series-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .series-item {
        width: calc(50% - 4px);
    }
}