:root {
    color-scheme: light;
    --bg: #f6f6f6;
    --surface: #ffffff;
    --text: #1c1c1f;
    --muted: #666b73;
    --line: #d9d9de;
    --accent: #b42335;
    --accent-strong: #8f1726;
    --star: #d79b00;
    --shadow: 0 8px 24px rgba(20, 20, 24, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header,
.site-footer,
.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

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

.site-logo {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0;
}

.site-nav,
.footer-nav,
.text-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.site-nav a,
.footer-nav a {
    color: var(--muted);
    font-weight: 600;
}

.hero,
.page-title,
.search-panel,
.empty-state,
.text-page {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero,
.page-title,
.empty-state,
.text-page {
    padding: clamp(24px, 4vw, 44px);
}

.hero h1,
.page-title h1,
.text-page h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.15;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.primary-button,
.secondary-button,
.official-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 800;
}

button.primary-button,
button.secondary-button {
    font: inherit;
    cursor: pointer;
}

.primary-button,
.official-link {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.secondary-button {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.section-heading,
.result-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 28px 0 16px;
}

.section-heading h2 {
    margin: 0;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.item-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.item-media {
    position: relative;
    aspect-ratio: 3 / 4;
    background: #e9e9ed;
}

.slider-frame,
.slider-image {
    width: 100%;
    height: 100%;
}

.slider-frame {
    position: relative;
}

.slider-image {
    display: none;
}

.slider-image.is-active {
    display: block;
}

.item-media img,
.gallery-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--muted);
    min-height: 100%;
    padding: 16px;
    text-align: center;
}

.slider-controls {
    position: absolute;
    inset: auto 10px 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.slider-button {
    min-width: 48px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    background: rgba(28, 28, 31, 0.72);
    color: #ffffff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    pointer-events: auto;
}

.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
}

.item-body {
    display: grid;
    gap: 10px;
    padding: 14px;
    flex: 1;
    align-content: start;
}

.item-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
}

.item-title a {
    color: var(--text);
}

.product-card .item-title {
    min-height: 2.9em;
}

.product-card .rating-row,
.product-card .price-row {
    min-height: 30px;
}

.product-card .official-link {
    width: 100%;
    margin-top: auto;
    text-align: center;
}

.rating-row,
.price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.stars {
    display: inline-flex;
    gap: 1px;
}

.star {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
    line-height: 1;
    overflow: hidden;
}

.star-empty {
    color: #c9c9cf;
}

.star-filled {
    position: absolute;
    inset: 0 auto 0 0;
    overflow: hidden;
    color: var(--star);
    white-space: nowrap;
}

.rating-text,
.price {
    font-weight: 800;
}

.sale-price {
    color: var(--accent-strong);
    font-size: 1.08rem;
}

.price-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.list-price {
    color: var(--muted);
    font-size: 0.88rem;
    text-decoration: line-through;
}

.sale-end {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 0.84rem;
}

.sample-label {
    width: fit-content;
    margin: 0;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--accent-strong);
    background: #fff7f8;
    font-size: 0.82rem;
    font-weight: 800;
}

.review-count,
.price-type,
.help-text {
    color: var(--muted);
    font-size: 0.92rem;
}

.gallery summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 700;
}

.gallery-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 42%);
    gap: 8px;
    overflow-x: auto;
    margin-top: 8px;
    padding-bottom: 4px;
}

.gallery-track img {
    aspect-ratio: 3 / 4;
    border-radius: 6px;
}

.icon-button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--accent);
    cursor: pointer;
}

.search-panel {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.field-row {
    display: grid;
    gap: 6px;
}

.field-row input,
.field-row select {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.genre-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.genre-option,
.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.genre-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}

.selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.chip {
    padding: 6px 10px;
    color: var(--accent-strong);
    font-weight: 700;
}

.form-actions,
.age-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

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

.disabled {
    color: var(--muted);
    opacity: 0.6;
}

.site-footer {
    display: grid;
    gap: 10px;
    padding: 34px 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.dmm-credit {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.age-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}

.age-panel {
    width: min(620px, 100%);
    padding: clamp(24px, 5vw, 44px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.text-page {
    display: grid;
    gap: 14px;
}

.text-page h2 {
    margin: 16px 0 0;
}

.text-page p {
    margin: 0;
}

@media (max-width: 640px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .item-grid {
        grid-template-columns: 1fr;
    }
}
