:root {
    --primary-color: #f86442;
    --text-color: #333;
    --text-light: #999;
    --bg-color: #f8f8f8;
    --white: #fff;
    --container-width: 1200px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-color);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo img {
    height: 50px;
    display: block;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
    position: relative;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    outline: none;
}

.search-bar button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0 20px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}

.header-actions a {
    margin-left: 20px;
    font-size: 14px;
}

.action-btn {
    border: 1px solid #ddd;
    padding: 5px 15px;
    border-radius: 20px;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.main-nav {
    border-top: 1px solid #eee;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
}

.main-nav li a {
    display: block;
    padding: 15px 20px;
    font-weight: 500;
}

.main-nav li a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Banner */
.banner-section {
    padding: 20px 0;
}

.banner-slider {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 15px;
}

.banner-slider::-webkit-scrollbar {
    display: none;
}

.banner-slider .slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.banner-slider .slide a {
    display: block;
}

.banner-slider img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

/* Section Common */
.section {
    padding: 20px 0;
    background: var(--white);
    margin-bottom: 20px;
    border-radius: 8px;
}

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

.section-header h2 {
    font-size: 20px;
    font-weight: bold;
}

.more-link {
    font-size: 14px;
    color: var(--text-light);
}

/* Book Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.book-card {
    transition: transform 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
}

.book-cover {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    aspect-ratio: 1 / 1;
}

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

.play-count {
    position: absolute;
    bottom: 5px;
    left: 5px;
    color: var(--white);
    font-size: 12px;
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 10px;
}

.book-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-author {
    font-size: 12px;
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background: #fff;
    padding: 40px 0;
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid #eee;
}

.footer-links a {
    margin: 0 10px;
    color: #666;
}

.footer-copyright {
    margin-top: 20px;
    color: #999;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 992px) {
    .book-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        max-width: none;
        margin: 10px 0;
    }

    .header-actions {
        display: none; /* Hide standard actions on mobile for now, maybe show in menu */
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none; /* Toggle via JS */
    }

    .main-nav ul {
        flex-direction: column;
    }

    .main-nav li a {
        padding: 10px 0;
    }

    .book-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
