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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

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

.top-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
}

.top-banner p {
    animation: slide-text 20s linear infinite;
}

@keyframes slide-text {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.header {
    background: white;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.nav-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 800;
}

.logo {
    font-size: 32px;
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-container {
    display: flex;
    align-items: center;
    background: #f1f3f4;
    border-radius: 25px;
    padding: 8px 15px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    background: white;
    box-shadow: 0 0 0 2px #667eea;
}

.search-input {
    border: none;
    background: none;
    outline: none;
    padding: 8px 12px;
    width: 200px;
    font-size: 14px;
}

.search-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #667eea;
    color: white;
}

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

.login-btn, .register-btn {
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn {
    color: #667eea;
    border: 2px solid #667eea;
}

.login-btn:hover {
    background: #667eea;
    color: white;
}

.register-btn {
    background: #667eea;
    color: white;
}

.register-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.hero-section {
    padding: 30px 0;
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.hero-slider {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.slider-track {
    position: relative;
    height: 450px;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.slide.active {
    opacity: 1;
}

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

.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 50px 40px 40px;
}

.slide-overlay h2 {
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 700;
}

.slide-overlay p {
    font-size: 18px;
    margin-bottom: 25px;
    opacity: 0.9;
}

.read-now-btn {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-now-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.prev-btn, .next-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
}

.prev-btn:hover, .next-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.slider-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

.sidebar {
    display: flex;
    flex-direction: column;
}

.ranking-panel {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.panel-header h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.ranking-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    padding: 8px 18px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.ranking-item:last-child {
    border-bottom: none;
}

.rank-number {
    width: 28px;
    height: 28px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 15px;
}

.rank-number.top {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.ranking-item a {
    flex: 1;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.ranking-item a:hover {
    color: #667eea;
}

.trend {
    font-size: 16px;
    font-weight: bold;
}

.trend.up { color: #51cf66; }
.trend.down { color: #ff6b6b; }
.trend.stable { color: #868e96; }

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 28px;
    color: #2c3e50;
    font-weight: 700;
}

.view-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-more:hover {
    color: #5a6fd8;
    transform: translateX(5px);
}

.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.manga-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.manga-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.manga-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.manga-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.manga-item:hover .manga-cover img {
    transform: scale(1.1);
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.manga-item:hover .cover-overlay {
    opacity: 1;
}

.read-btn {
    background: #667eea;
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
}

.manga-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.manga-badge.hot {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.manga-badge.new {
    background: linear-gradient(135deg, #51cf66, #40c057);
}

.manga-title {
    padding: 20px 20px 10px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

.manga-meta {
    padding: 0 20px 20px;
    font-size: 13px;
    color: #868e96;
}

.category-section {
    padding: 50px 0;
    background: white;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.category-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.category-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 40px 25px 25px;
}

.category-info h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.category-info p {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 15px;
}

.category-btn {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.ranking-section {
    padding: 50px 0;
}

.ranking-tabs-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.ranking-tab {
    padding: 12px 30px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ranking-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.ranking-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.ranking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.ranking-column h4 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.ranking-item-card {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.rank-badge {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    margin-right: 15px;
    font-size: 16px;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.ranking-item-card img {
    width: 60px;
    height: 75px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.item-details h5 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.item-details p {
    font-size: 13px;
    color: #868e96;
    margin-bottom: 8px;
}

.rating {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.ranking-item-simple {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

.ranking-item-simple .rank-num {
    width: 25px;
    height: 25px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    margin-right: 15px;
}

.ranking-item-simple a {
    flex: 1;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.ranking-item-simple a:hover {
    color: #667eea;
}

.score {
    color: #667eea;
    font-weight: bold;
    font-size: 14px;
}

.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.footer-logo .logo {
    font-size: 28px;
    margin-right: 10px;
}

.footer-logo .brand-name {
    font-size: 24px;
    font-weight: 700;
}

.footer-desc {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.8;
    margin-bottom: 25px;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
    font-size: 14px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-right {
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
    }
    
    .search-input {
        width: 150px;
    }
    
    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .slider-track {
        height: 300px;
    }
    
    .slide-overlay {
        padding: 30px 20px 20px;
    }
    
    .slide-overlay h2 {
        font-size: 24px;
    }
    
    .slide-overlay p {
        font-size: 16px;
    }
    
    .manga-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .ranking-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-stats {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .section-title {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .section-title h2 {
        font-size: 24px;
    }
    
    .ranking-tabs-wrapper {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .ranking-tab {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .top-banner {
        font-size: 12px;
        padding: 8px 0;
    }
    
    .nav-brand a {
        font-size: 20px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .manga-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .ranking-panel {
        padding: 20px;
    }
    
    .slide-overlay {
        padding: 20px 15px 15px;
    }
    
    .slide-overlay h2 {
        font-size: 20px;
    }
    
    .ranking-content {
        padding: 25px 20px;
    }
    
    .footer-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 20px;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #5a6fd8;
    transform: translateY(-3px);
}
