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

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: #1d1d1f;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: none;
}

.header {
    background: #ffffff;
    border-bottom: 1px solid #d2d2d7;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1d1d1f;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li {
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #1d1d1f;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    line-height: 1.5rem;
}

.nav-links a:hover {
    color: #007aff;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 300px;
}

.search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #ffffff;
    color: #1d1d1f;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-input::placeholder {
    color: #86868b;
}

.search-clear {
    background: none;
    border: none;
    color: #86868b;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
}

.search-clear:hover {
    color: #1d1d1f;
}

.search-clear.visible {
    display: flex;
}

footer {
    border-top: 1px solid #d2d2d7;
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    color: #86868b;
    font-size: 0.875rem;
}

footer p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

footer a {
    color: #007aff;
    text-decoration: none;
    margin: 0 0.5rem;
}

footer a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.book-header {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 4rem;
    align-items: start;
}

.book-cover-section {
    position: sticky;
    top: 100px;
}

.book-main-cover {
    width: 100%;
    max-width: 400px;
    height: 600px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
}

.book-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.book-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.book-gallery img:hover {
    opacity: 0.7;
}

.book-info {
    padding-top: 2rem;
}

.book-title {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1d1d1f;
    letter-spacing: -0.02em;
}

.book-author {
    font-size: 1.25rem;
    color: #86868b;
    margin-bottom: 2rem;
}

.book-price {
    font-size: 2.5rem;
    font-weight: 600;
    color: #007aff;
    margin-bottom: 2rem;
}

.btn-purchase {
    display: inline-block;
    background: #007aff;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.125rem;
    transition: background 0.2s;
    margin-bottom: 2rem;
}

.btn-purchase:hover {
    background: #0051d5;
    color: white;
}

.book-description {
    margin-top: 3rem;
}

.book-description h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1d1d1f;
}

.book-description-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #1d1d1f;
    white-space: pre-wrap;
}

.book-features {
    margin-top: 3rem;
}

.book-features h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1d1d1f;
}

.features-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.features-list li {
    padding: 1rem;
    background: #f5f5f7;
    border-radius: 8px;
    font-size: 1rem;
}

.features-list li:before {
    content: "✓ ";
    color: #34c759;
    font-weight: 600;
    margin-right: 0.5rem;
}

@media (max-width: 968px) {
    .book-header {
        grid-template-columns: 1fr;
    }

    .book-cover-section {
        position: static;
    }

    .header-content {
        flex-wrap: wrap;
        padding: 0 1rem;
        gap: 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    nav {
        flex: 1 1 100%;
        gap: 1rem;
        order: 2;
    }

    .search-container {
        max-width: none;
        flex: 1;
        min-width: 0;
    }

    .search-input {
        min-width: 0;
        flex: 1;
    }

    .nav-links {
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .header-content {
        padding: 0 0.75rem;
    }

    .logo {
        font-size: 1.125rem;
    }

    nav {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        width: 100%;
    }
}
