:root {
    --primary-color: #8B5A3C;
    --primary-light: #A2704E;
    --primary-dark: #6F442A;
    --primary-soft: rgba(139, 90, 60, 0.08);
    --background-color: #FFFFFF;
    --surface-color: #F8F6F2;
    --surface-elevated: #FFFFFF;
    --border-color: #EBE3DA;
    --border-light: #F0EAE3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 12px 28px -8px rgba(100, 70, 40, 0.12);
    --text-primary: #2C241A;
    --text-secondary: #6B5A4A;
    --text-tertiary: #9B8B7A;
    --transition-default: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.book-list {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 24px;
}

.book-list h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 16px;
}

.book-list h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.search-filter {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.search-form input[type="text"],
.search-form select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    font-family: inherit;
    font-size: 0.85rem;
    transition: var(--transition-default);
    background-color: var(--background-color);
    color: var(--text-primary);
}

.search-form input[type="text"]:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.search-form select {
    min-width: 130px;
    cursor: pointer;
}

.search-form button {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-default);
}

.search-form button:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

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

.book-item {
    background: var(--surface-elevated);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-default);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.book-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--surface-color);
}

.book-item h3 {
    font-size: 1rem;
    font-weight: 650;
    color: var(--primary-color);
    margin-bottom: 4px;
    line-height: 1.4;
}

.book-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-default);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    background: var(--surface-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination span {
    background: transparent;
    color: var(--text-tertiary);
}

.book-detail {
    max-width: 900px;
    margin: 32px auto;
    padding: 32px 36px;
    background: var(--surface-elevated);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.book-header {
    display: flex;
    align-items: flex-start;
    gap: 36px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.book-cover-large {
    width: 240px;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    background: var(--surface-color);
}

.book-info {
    flex: 1;
    min-width: 260px;
}

.book-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.book-info h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 16px;
    font-weight: 600;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.book-meta span {
    background: var(--surface-color);
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.book-genres {
    margin-top: 8px;
}

.genre-tag {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 4px 4px 0;
    background: var(--surface-color);
    border-radius: 40px;
    font-size: 0.75rem;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.book-description {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.book-description h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.book-description p {
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: justify;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.download-section {
    margin-top: 32px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.download-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 12px 32px;
    border-radius: 40px;
    text-decoration: none;
    transition: var(--transition-default);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--primary-color);
}

.download-button:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.loading {
    text-align: center;
    font-size: 1.1rem;
    padding: 60px;
    color: var(--text-tertiary);
}

@media (max-width: 768px) {
    .book-list {
        padding: 0 16px;
        margin: 24px auto;
    }

    .book-list h2 {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .search-filter {
        padding: 16px;
    }

    .search-form {
        flex-direction: column;
        width: 100%;
    }

    .search-form input[type="text"],
    .search-form select,
    .search-form button {
        width: 100%;
        min-width: unset;
    }

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

    .book-item {
        padding: 12px;
    }

    .book-item h3 {
        font-size: 0.9rem;
    }

    .book-header {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .book-info {
        text-align: center;
    }

    .book-meta {
        justify-content: center;
    }

    .book-detail {
        margin: 20px 16px;
        padding: 24px 20px;
    }

    .book-info h2 {
        font-size: 24px;
    }

    .book-cover-large {
        width: 200px;
    }

    .pagination {
        gap: 12px;
    }

    .pagination a,
    .pagination span {
        padding: 6px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .book-list {
        padding: 0 12px;
        margin: 16px auto;
    }

    .book-list h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

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

    .book-item {
        padding: 10px;
    }

    .book-item h3 {
        font-size: 0.85rem;
    }

    .book-item p {
        font-size: 0.7rem;
    }

    .book-cover {
        margin-bottom: 8px;
    }

    .book-detail {
        margin: 12px;
        padding: 20px 16px;
    }

    .book-info h2 {
        font-size: 20px;
    }

    .book-info h3 {
        font-size: 1rem;
    }

    .book-cover-large {
        width: 160px;
    }

    .book-description p {
        font-size: 0.85rem;
    }

    .download-button {
        padding: 10px 24px;
        font-size: 0.85rem;
    }

    .pagination {
        gap: 8px;
    }

    .pagination a,
    .pagination span {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
}

@media (max-width: 380px) {
    .book-grid {
        gap: 10px;
    }

    .book-item {
        padding: 8px;
    }

    .book-item h3 {
        font-size: 0.8rem;
    }
}