:root {
    --bg:          #0f0f11;
    --surface:     #1a1a1f;
    --surface2:    #222229;
    --border:      #2e2e38;
    --ink:         #e8e8f0;
    --sub:         #9090a8;
    --muted:       #55556a;
    --accent:      #7c6af7;
    --accent-deep: #6254e0;
    --accent-soft: #7c6af718;
    --ok:          #4caf80;
    --warn:        #f0a555;
    --danger:      #f05555;
    --radius:      8px;
}

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ===== HEADER ===== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-title {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--ink);
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    gap: .35rem;
}

.search-box input {
    flex: 1;
    min-width: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .4rem .75rem;
    color: var(--ink);
    font-size: .9rem;
    outline: none;
}
.search-box input:focus { border-color: var(--accent); }

.search-btn {
    padding: .4rem .9rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.search-btn:hover { background: var(--accent-deep); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: .75rem; }

.count-badge { font-size: .8rem; color: var(--sub); white-space: nowrap; }

.btn-import {
    padding: .35rem 1rem;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-size: .85rem;
    white-space: nowrap;
}
.btn-import:hover { background: var(--accent-deep); text-decoration: none; }

.btn-review-cta {
    padding: .35rem 1rem;
    background: rgba(240,165,85,.08);
    color: var(--warn);
    border: 1px solid var(--warn);
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}
.btn-review-cta:hover {
    background: var(--warn);
    color: #1a1a1f;
    text-decoration: none;
}

/* ===== GALLERY TOOLBAR (search + count) ===== */
.gallery-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem 0;
}
.gallery-toolbar .search-box { flex: 1; max-width: 480px; }
.gallery-toolbar .count-badge { margin-left: auto; }

@media (max-width: 600px) {
    .gallery-toolbar { flex-wrap: wrap; padding: .75rem 1rem 0; gap: .5rem; }
    .gallery-toolbar .search-box { order: 2; flex-basis: 100%; max-width: none; }
    .gallery-toolbar .count-badge { order: 1; margin-left: 0; }
}

/* ===== FILTER BAR ===== */
.filter-bar {
    padding: .5rem 1.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.filter-label { font-size: .8rem; color: var(--muted); }
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.filter-chip {
    padding: .25rem .7rem;
    border-radius: 14px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: .8rem;
}
.filter-clear {
    margin-left: auto;
    padding: .2rem .7rem;
    border-radius: 20px;
    border: 1px solid var(--danger);
    background: transparent;
    color: var(--danger);
    font-size: .78rem;
    cursor: pointer;
}
.filter-clear:hover { background: #f0555520; }

/* ===== GALLERY GRID ===== */
/* 汎用ギャラリー（レビュー募集ページなど）。カード幅ベースで自動フィル。 */
.gallery {
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

/* トップページ専用: 横8列×縦2行 = 16件/ページ。狭い画面では列数を減らして行数が増える。 */
.gallery--index { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .gallery--index { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width:  760px) { .gallery--index { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width:  520px) { .gallery--index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== PRODUCT CARD ===== */
.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.card-link:hover { text-decoration: none; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .15s, transform .15s;
    cursor: pointer;
    height: 100%;
}
.card-link:hover .card { border-color: var(--accent); transform: translateY(-2px); }

.card-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: var(--surface2);
}

.card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 2rem;
}

.card-body { padding: .6rem .75rem .75rem; }

.card-code { font-size: .7rem; color: var(--muted); margin-bottom: .15rem; }

.card-title {
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .3rem;
}

.card-circle { font-size: .75rem; color: var(--sub); margin-bottom: .35rem; }

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
}

.rating { font-size: .78rem; color: #f5c542; }
.review-count { font-size: .72rem; color: var(--muted); }
.price { font-size: .78rem; color: var(--sub); flex-basis: 100%; }
.price-strike   { text-decoration: line-through; color: var(--muted); margin-right: .35em; }
.price-sale     { /* 親 .price と同じ見た目にする（区切り識別用class） */ }
.price-deadline { color: var(--muted); font-size: .7rem; margin-left: .4em; }

.card-tags { display: flex; flex-wrap: wrap; gap: .25rem; }

.tag-pill {
    font-size: .65rem;
    padding: .1rem .45rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--sub);
    text-decoration: none;
    display: inline-block;
}
a.tag-pill:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== EMPTY STATE ===== */
.empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
}
.empty p { margin-top: .5rem; font-size: .9rem; }

/* ===== DLSITE BLOG PARTS ===== */
.dlsite-blogparts-wrap {
    padding: 1.5rem 1.5rem 0;
    max-width: 1200px;
    margin: 0 auto;
}
.dlsite-blogparts-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 .75rem;
    text-align: center;
}
.dlsite-blogparts {
    display: flex;
    justify-content: center;
}
.dlsite-blogparts > [id^="DLsite_blog_parts_"] {
    max-width: 100%;
}
@media (max-width: 640px) {
    .dlsite-blogparts-wrap { padding: 1rem 1rem 0; }
}

/* PC/スマホでブログパーツ切り替え（document.write制約で両方staticに書いて表示制御） */
.dlsite-blogparts--sp { display: none; }
@media (max-width: 640px) {
    .dlsite-blogparts--pc { display: none; }
    .dlsite-blogparts--sp { display: flex; }
}

/* 作品詳細ページ内では、親の.detail-sectionが余白を持つので自前paddingは消す */
.dlsite-blogparts--in-section { padding: 0; }

/* DLsite公式CSSはあとから注入されるため、包含セレクタで特異性を上げて上書きする */
.dlsite-blogparts .DLsite_bp_body,
.dlsite-blogparts .DLsite_bp_inner,
.dlsite-blogparts .DLsite_bp_title_wrap {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--ink) !important;
}
.dlsite-blogparts .DLsite_bp_title,
.dlsite-blogparts .DLsite_bp_work_name,
.dlsite-blogparts .DLsite_bp_work_name a,
.dlsite-blogparts .DLsite_bp_maker_name,
.dlsite-blogparts .DLsite_bp_maker_name a,
.dlsite-blogparts .DLsite_bp_price,
.dlsite-blogparts dl,
.dlsite-blogparts dt,
.dlsite-blogparts dd,
.dlsite-blogparts li {
    color: var(--ink) !important;
    background: transparent !important;
}
.dlsite-blogparts .DLsite_bp_circle_name,
.dlsite-blogparts .DLsite_bp_circle_name a {
    color: var(--muted) !important;
}
.dlsite-blogparts .DLsite_bp_work_name a:hover,
.dlsite-blogparts .DLsite_bp_maker_name a:hover,
.dlsite-blogparts .DLsite_bp_circle_name a:hover {
    color: #7aa2ff !important;
}
.dlsite-blogparts .DLsite_bp_logo a {
    color: var(--muted) !important;
}
.dlsite-blogparts .DLsite_bp_btn_prev,
.dlsite-blogparts .DLsite_bp_btn_next {
    filter: invert(0.85) hue-rotate(180deg);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    padding: 1rem 1.5rem 2rem;
}
.page-btn, .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font-size: .85rem;
    text-decoration: none;
    transition: border-color .15s, background .15s, color .15s;
}
.page-btn:hover, a.page-num:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
}
.page-num.is-current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
}
.page-btn.is-disabled {
    color: var(--muted);
    background: transparent;
    pointer-events: none;
    opacity: .5;
}
.page-ellipsis {
    color: var(--muted);
    padding: 0 .35rem;
    user-select: none;
}

/* ===== DETAIL PAGE ===== */
.back-link {
    color: var(--sub);
    font-size: .9rem;
    margin-right: .5rem;
    white-space: nowrap;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.detail-code {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 400;
    font-family: monospace;
    margin-top: -.75rem;
}

.detail-wrap {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.main-image-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}
.main-image-placeholder {
    font-size: 4rem;
    color: var(--muted);
}

.thumb-strip {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    margin-top: .75rem;
    padding-bottom: .5rem;
}
.thumb {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    background: var(--surface2);
    transition: border-color .15s, transform .15s;
}
.thumb:hover { border-color: var(--accent); }
.thumb.active { border-color: var(--accent); transform: scale(1.05); }

.detail-right { display: flex; flex-direction: column; gap: 1rem; }

.detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink);
}

.detail-circle {
    font-size: 1rem;
    color: var(--sub);
}
.circle-pill {
    display: inline-block;
    padding: .2rem .75rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--sub);
    text-decoration: none;
    font-size: .9rem;
}
.circle-pill:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.meta-chip {
    font-size: .85rem;
    color: var(--sub);
}
.meta-chip + .meta-chip::before {
    content: '·';
    margin-right: .4rem;
    color: var(--muted);
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.detail-rating .stars { font-size: 1rem; color: #f5c542; }
.rating-num { font-size: .9rem; color: var(--sub); }

.price-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.price-label { font-size: .75rem; color: var(--muted); margin-bottom: .25rem; }
.price-base {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: .75rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .25rem .5rem;
}
.price-strike-detail   { text-decoration: line-through; color: var(--muted); font-size: 1rem; font-weight: 500; }
.price-sale-detail     { color: var(--accent); font-size: 1.4rem; font-weight: 700; }
.price-deadline-detail { color: var(--sub); font-size: .8rem; font-weight: 400; }

.coupon-box {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    font-size: .9rem;
}
.coupon-box label { color: var(--sub); }
.coupon-box select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink);
    padding: .3rem .5rem;
    font-size: .85rem;
    cursor: pointer;
    outline: none;
}
.coupon-box select:focus { border-color: var(--accent); }
.discounted-arrow { color: var(--muted); }
.discounted-price {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.05rem;
}

.btn-dlsite {
    display: inline-block;
    padding: .6rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    align-self: flex-start;
}
.btn-dlsite:hover { background: var(--accent-deep); text-decoration: none; }

.detail-section {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
}
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .75rem;
}

.description {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    line-height: 1.8;
    color: var(--ink);
    font-size: .9rem;
    word-wrap: break-word;
}
.description img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: .5rem 0;
}
.description a { color: var(--accent); }
.description p { margin: .5rem 0; }
.description h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 .5rem;
    color: var(--ink);
}
.description .work_parts { margin: 1rem 0; }
.description .work_parts_multitype {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
}
.description .work_parts_multitype.type_left {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
@media (max-width: 600px) {
    .description .work_parts_multitype.type_left {
        grid-template-columns: minmax(0, 1fr);
    }
}

.credits {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1.25rem;
    row-gap: .5rem;
    align-items: baseline;
}
.credits dt { color: var(--sub); font-size: .85rem; white-space: nowrap; }
.credits dd { color: var(--ink); font-size: .9rem; }

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.detail-tags-inline {
    margin-top: .5rem;
    align-items: center;
}
.detail-tags-label {
    font-size: .75rem;
    color: var(--sub);
    margin-right: .25rem;
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid var(--border);
}
.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: .75rem;
    line-height: 1.4;
}
.hero-desc {
    color: var(--sub);
    font-size: .9rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: .8rem;
    color: var(--ink);
}
.stat-badge.stat-total {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.hero-notice {
    font-size: .78rem;
    color: var(--muted);
    border-left: 3px solid var(--danger);
    padding-left: .75rem;
    margin-top: .5rem;
}
.site-title-link { color: inherit; text-decoration: none; }
.site-title-link:hover { text-decoration: none; }

/* ===== STATIC PAGES (about/privacy/contact) ===== */
.static-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    color: var(--ink);
    line-height: 1.8;
}
.static-page h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--ink);
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.static-page h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: .75rem;
    color: var(--ink);
}
.static-page p { margin-bottom: 1rem; color: var(--sub); font-size: .92rem; }
.static-page ul { margin: 0 0 1rem 1.5rem; color: var(--sub); font-size: .92rem; }
.static-page ul li { margin-bottom: .35rem; }
.static-page a { color: var(--accent); }
/* ボタン見た目のリンクは上のリンク色より優先させる（accent背景にaccent文字で潰れるため） */
.static-page a.btn-primary { color: #fff; }
.static-page a.btn-secondary { color: var(--ink); }
.notice-box {
    padding: .85rem 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-size: .9rem;
}
.notice-warn {
    background: rgba(240,85,85,.08);
    border: 1px solid var(--danger);
    color: #ffb4b4;
}
.notice-ok {
    background: rgba(76,175,128,.08);
    border: 1px solid var(--ok);
    color: #b4f0d0;
}
.notice-info {
    background: rgba(124,106,247,.08);
    border: 1px solid var(--accent);
    color: #cec4ff;
}
.pr-badge {
    display: inline-block;
    padding: .05rem .35rem;
    margin: 0 .3rem;
    font-size: .7rem;
    font-weight: bold;
    line-height: 1.3;
    color: var(--warn);
    border: 1px solid var(--warn);
    border-radius: 3px;
    letter-spacing: .05em;
    vertical-align: middle;
}
.meta-sub { color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }

/* ===== CONTACT / EDIT FORM ===== */
.contact-form { display: flex; flex-direction: column; gap: 1rem; max-width: 600px; }
.form-row { display: flex; flex-direction: column; gap: .35rem; }
.form-row label, .form-label {
    font-size: .85rem;
    color: var(--sub);
    font-weight: 500;
}
.form-row .required { color: var(--danger); }
.form-row input[type=text],
.form-row input[type=email],
.form-row textarea,
.contact-form input[type=text],
.contact-form input[type=email],
.contact-form textarea {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink);
    padding: .55rem .75rem;
    font-size: .9rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.form-actions { display: flex; align-items: center; gap: .75rem; }
.btn-primary {
    padding: .55rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .9rem;
    cursor: pointer;
    font-weight: 600;
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-secondary {
    padding: .55rem 1.25rem;
    background: var(--surface2);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; }
.btn-danger {
    padding: .45rem 1rem;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .85rem;
    cursor: pointer;
}

/* ハニーポット（非表示・タブ移動も無効） */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ===== MY REVIEW ===== */
.my-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.my-review-head .section-title { margin-bottom: 0; }
.my-review-edit-link {
    font-size: .8rem;
    color: var(--sub);
    padding: .25rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.my-review-edit-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.my-review {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    line-height: 1.8;
    color: var(--ink);
    font-size: .9rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.my-review-empty { color: var(--muted); font-style: italic; }

/* ===== RATING UI ===== */
.rating-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.rating-avg-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .85rem;
    flex-wrap: wrap;
}
.rating-avg-stars { color: #f5c542; font-size: 1.1rem; }
.rating-avg-num { font-weight: 700; color: var(--ink); }
.rating-count, .rating-empty { color: var(--muted); font-size: .85rem; }
.rating-input { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.rating-input-label { color: var(--sub); font-size: .85rem; margin-right: .35rem; }
.star-row {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}
.star-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: .1rem .15rem;
    transition: color .1s;
}
.star-btn.active { color: #f5c542; }
.star-row:hover .star-btn { color: var(--muted); }
.star-row .star-btn:hover,
.star-row .star-btn:hover ~ .star-btn { color: #f5c542; }
.rating-msg { font-size: .8rem; color: var(--sub); margin-left: .5rem; }

/* ===== COMMENT UI ===== */
.comment-count { color: var(--muted); font-weight: 400; font-size: .85rem; }
.comment-form {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.comment-form input[type=text],
.comment-form textarea {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink);
    padding: .55rem .75rem;
    font-size: .9rem;
    font-family: inherit;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form-msg { font-size: .82rem; color: var(--sub); }

.comment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.comment-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem 1rem;
}
.comment-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .35rem;
}
.comment-name { font-weight: 600; font-size: .85rem; color: var(--ink); }
.comment-time { font-size: .75rem; color: var(--muted); }
.comment-report-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: .72rem;
    padding: .15rem .55rem;
    border-radius: 4px;
    cursor: pointer;
}
.comment-report-btn:hover { border-color: var(--danger); color: var(--danger); }
.comment-body { color: var(--ink); font-size: .9rem; line-height: 1.7; word-wrap: break-word; }
.comment-empty { color: var(--muted); font-style: italic; text-align: center; padding: 2rem; }

.review-empty-cta {
    background: var(--accent-soft);
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
}
.review-empty-cta-title {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.review-empty-cta-body {
    color: var(--sub);
    font-size: .88rem;
    line-height: 1.6;
    margin-bottom: .75rem;
}
.review-empty-cta-arrow {
    color: var(--accent);
    font-size: .88rem;
    font-weight: 600;
}

/* ===== ADMIN PANEL ===== */
.admin-comment-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.hidden-comment {
    background: var(--surface);
    border: 1px solid var(--danger);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.hidden-meta { margin-bottom: .5rem; display: flex; flex-direction: column; gap: .25rem; }
.hidden-body { color: var(--sub); font-size: .9rem; line-height: 1.7; margin-bottom: .75rem; padding: .5rem .75rem; background: var(--surface2); border-radius: 4px; overflow-wrap: anywhere; word-break: break-word; }
.hidden-actions { display: flex; gap: .5rem; }

/* ===== ADMIN PRODUCT LIST ===== */
.admin-search-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 1rem 0 .5rem; }
.admin-search-input {
    flex: 1; min-width: 12rem; max-width: 24rem;
    padding: .5rem .75rem; font-size: .9rem;
    background: var(--surface2); color: var(--ink);
    border: 1px solid var(--border); border-radius: 6px;
}
.admin-search-input:focus { border-color: var(--accent); outline: none; }
.admin-search-btn { padding: .5rem 1.25rem; }
.admin-search-clear { font-size: .85rem; color: var(--sub); }
.static-page a.admin-search-clear { color: var(--sub); }
.static-page a.admin-search-clear:hover { color: var(--accent); }
.admin-search-term { font-weight: normal; color: var(--sub); font-size: .9em; }

.admin-product-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
.admin-product-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: .75rem 1rem;
}
.admin-product-row.is-public  { border-left-color: #22c55e; }
.admin-product-row.is-private { border-left-color: var(--sub); }
.admin-product-thumb { flex-shrink: 0; width: 96px; }
.admin-product-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 4px; display: block; }
.admin-product-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.admin-product-badges { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.admin-product-meta a { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-product-meta a:hover { color: var(--accent); }
.admin-product-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 3px;
    width: fit-content;
}
.is-public  .admin-product-badge { background: #dcfce7; color: #15803d; }
.is-private .admin-product-badge { background: var(--surface2); color: var(--sub); }
.admin-product-sub { font-size: .8rem; color: var(--sub); }
.admin-product-actions { flex-shrink: 0; }

/* ===== ADMIN GENRE TABLE ===== */
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.genre-sort-hint { font-size: .8rem; color: var(--sub); margin: .25rem 0 .5rem; }
.genre-sort-hint kbd {
    font-family: monospace; font-size: .95em;
    border: 1px solid var(--border); border-radius: 3px;
    padding: 0 .3rem; background: var(--surface2);
}
.genre-sort-status { font-size: .8rem; min-height: 1.2em; margin-bottom: .35rem; color: var(--sub); }
.genre-sort-status.is-ok    { color: var(--ok); }
.genre-sort-status.is-error { color: var(--danger); }

.genre-admin-table { width: 100%; border-collapse: collapse; margin-top: .5rem; table-layout: fixed; }
.genre-admin-table th {
    text-align: left; padding: .5rem; font-size: .8rem; color: var(--sub);
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
.genre-admin-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.genre-admin-table tr.is-dragging { background: var(--accent-soft); opacity: .85; }
.genre-admin-table tbody.is-sorting { cursor: grabbing; user-select: none; }

/* 列幅を固定して、タグ名やスラッグが途中で折り返されないようにする */
.gcol-handle  { width: 4.5rem; }
.gcol-slug    { width: 10rem; }
.gcol-tags    { width: 12rem; }
.gcol-state   { width: 5.5rem; }
.gcol-actions { width: 10rem; }

/* td は table-cell のまま保つ（flex にすると列幅の計算から外れて崩れる） */
.genre-handle-cell { white-space: nowrap; }
.genre-drag-handle {
    background: none; border: none; color: var(--sub);
    font-size: 1rem; line-height: 1; padding: .2rem .1rem;
    margin-right: .2rem; vertical-align: middle;
    cursor: grab; touch-action: none; /* タッチのスクロールに奪われないようにする */
}
.genre-drag-handle:hover  { color: var(--ink); }
.genre-drag-handle:focus  { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.genre-drag-handle:active { cursor: grabbing; }
.genre-order { font-family: monospace; font-size: .8rem; color: var(--sub); vertical-align: middle; }

/* 名前と説明を1行ずつに抑える。全文は title 属性のホバーで読む */
.genre-name-cell { min-width: 0; }
.genre-name-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.genre-short {
    display: block; font-size: .78rem; color: var(--sub);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.genre-slug-link {
    font-family: monospace; font-size: .85rem;
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.genre-tags-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.genre-tags-cell .tag-pill { margin-right: .25rem; }

.genre-inline-form { margin: 0; display: inline; }
.genre-state-toggle {
    font-size: .75rem; font-weight: 600; white-space: nowrap;
    padding: .2rem .5rem; border-radius: 999px;
    background: none; cursor: pointer;
}
.genre-state-toggle.is-on  { color: var(--ok);  border: 1px solid var(--ok); }
.genre-state-toggle.is-off { color: var(--sub); border: 1px solid var(--border); }
.genre-state-toggle:hover  { border-color: var(--accent); color: var(--accent); }

.genre-actions-cell { white-space: nowrap; }
.genre-actions-cell > a { margin-right: .35rem; }
.genre-btn-sm { font-size: .8rem; padding: .3rem .6rem; vertical-align: middle; }

.genre-btn-danger { color: var(--danger); border-color: var(--danger); }
.genre-btn-danger:hover { border-color: var(--danger); background: var(--danger); color: #fff; }

/* 狭い画面では6列が入りきらないので、スラッグ・対象タグを畳む。
   どちらも編集画面で確認・変更できる。 */
@media (max-width: 768px) {
    .genre-admin-table th:nth-child(3), .genre-admin-table td:nth-child(3),
    .genre-admin-table th:nth-child(4), .genre-admin-table td:nth-child(4) { display: none; }
    .gcol-handle  { width: 3.75rem; }
    .gcol-state   { width: 5rem; }
    .gcol-actions { width: 8.5rem; }
    .genre-btn-sm { padding: .3rem .45rem; }
}

/* ===== SITE FOOTER ===== */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.footer-nav a {
    color: var(--sub);
    font-size: .85rem;
}
.footer-nav a:hover { color: var(--accent); text-decoration: none; }
.footer-copy { color: var(--muted); font-size: .78rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; padding: 1rem; }
    .site-header { padding: 0 1rem; }
    .filter-bar { padding: .5rem 1rem; }
    .detail-wrap { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding: 1rem; }
    .detail-right { min-width: 0; }
    .detail-left { min-width: 0; }
    .detail-section { padding: 1.25rem 1rem; }
    .detail-title { font-size: 1.15rem; }
    .main-image-box { aspect-ratio: auto; max-height: 60vh; }
    .main-image { max-width: 100%; max-height: 60vh; width: auto; height: auto; }
    .description { padding: 1rem; }
    .description table { max-width: 100%; display: block; overflow-x: auto; }
    .hero { padding: 1.5rem 1rem; }
    .hero-title { font-size: 1.15rem; }
    .hero-desc { font-size: .85rem; }
    .static-page { padding: 1.5rem 1rem 2rem; }
    .static-page h1 { font-size: 1.3rem; }

    /* --- 管理画面 --- */
    /* ヘッダー：高さ固定を解除し、ナビを2段目に折り返す */
    .admin-header { height: auto; flex-wrap: wrap; padding: .5rem 1rem; row-gap: .5rem; }
    .admin-header .admin-nav { order: 3; flex-basis: 100%; flex-wrap: wrap; }
    .admin-header .admin-nav-link { padding: .35rem .6rem; }
    /* 作品管理：行を折り返し、操作ボタンを下段フル幅に */
    .admin-product-row { flex-wrap: wrap; }
    .admin-product-actions { flex-basis: 100%; display: flex; gap: .5rem; }
    .admin-product-actions button { flex: 1; }
    /* フィルタ・ファイル入力のはみ出し対策 */
    .admin-filter-bar { flex-wrap: wrap; }
    .contact-form input[type=file] { max-width: 100%; }
}
/* ===== ADMIN ===== */
.admin-title { color: var(--sub); }

.admin-nav {
    display: flex;
    gap: .25rem;
    flex: 1;
}
.admin-nav-link {
    padding: .3rem .75rem;
    border-radius: 6px;
    font-size: .9rem;
    color: var(--sub);
    transition: background .15s, color .15s;
}
.admin-nav-link:hover {
    background: var(--surface2);
    color: var(--ink);
    text-decoration: none;
}
.admin-site-link {
    font-size: .85rem;
    padding: .3rem .75rem;
}
.admin-logout-link {
    font-size: .85rem;
    color: var(--danger);
    margin-left: .25rem;
}
.admin-logout-link:hover { text-decoration: underline; }

.admin-login {
    max-width: 400px;
    margin: 80px auto;
    padding: 0 1rem;
}
.admin-login h1 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}
.admin-login .back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.import-results { margin-top: 1.5rem; }
.import-results-ok { font-size: 1rem; margin-bottom: .5rem; color: var(--ok); }
.import-results-ng { font-size: 1rem; margin-bottom: .5rem; margin-top: 1rem; color: var(--danger); }
.import-results-list { list-style: none; padding: 0; }
.import-results-list li { padding: .3rem 0; font-size: .9rem; border-bottom: 1px solid var(--border); }
.ok { color: var(--ok); }
.ng { color: var(--danger); }

html, body { overflow-x: hidden; }
@media (max-width: 480px) {
    .gallery { grid-template-columns: repeat(2, 1fr); }
}

.genre-intro {
    max-width: 780px;
    line-height: 1.9;
}

.hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.hamburger:hover {
    background: var(--surface);
    border-color: var(--accent);
}
.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 200;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
}
body.drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.site-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 201;
    transform: translateX(-100%);
    transition: transform .25s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
body.drawer-open .site-drawer {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .4);
}

.drawer-inner {
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.drawer-close {
    align-self: flex-end;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s;
}
.drawer-close:hover { background: var(--surface2); }

.drawer-section {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.drawer-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--sub);
    letter-spacing: .05em;
    margin: 0;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.drawer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.drawer-item {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .65rem .75rem;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    transition: background .15s;
}
.drawer-item:hover {
    background: var(--accent-soft);
    text-decoration: none;
}
.drawer-item-name { font-size: 1rem; font-weight: 600; }
.drawer-item-short { font-size: .75rem; color: var(--sub); }

.drawer-cta { margin-top: .5rem; }
.drawer-cta .btn-review-cta { width: 100%; text-align: center; }

@media (min-width: 1024px) {
    .hamburger,
    .drawer-close,
    .drawer-backdrop {
        display: none !important;
    }
    .site-drawer {
        transform: translateX(0) !important;
        width: 260px;
        z-index: 50;
        box-shadow: none;
    }
    body {
        padding-left: 260px;
    }
    body.drawer-open {
        overflow: auto;
    }
}

.btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1.5rem;
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 14px rgba(124, 106, 247, .35);
    transition: transform .1s, box-shadow .2s, background .2s;
    line-height: 1.3;
    text-decoration: none;
}
.btn-buy:hover {
    background: linear-gradient(180deg, var(--accent-deep), var(--accent-deep));
    box-shadow: 0 6px 18px rgba(124, 106, 247, .5);
    text-decoration: none;
    transform: translateY(-1px);
}
.btn-buy:active { transform: translateY(0); }
.btn-buy-lead { font-size: 1rem; }
.btn-buy-price { font-size: 1.15rem; font-weight: 800; letter-spacing: .02em; }
.btn-buy-arrow { font-size: 1.1rem; }
.btn-buy-note {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .5rem;
    text-align: center;
}

.btn-buy--top {
    width: 100%;
    align-self: stretch;
    margin-top: .25rem;
}

.highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.highlight {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--sub);
    border-radius: 6px;
    flex-wrap: wrap;
    line-height: 1.5;
}
.highlight-label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--surface2);
    padding: .15rem .55rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}
.highlight-text {
    font-size: .9rem;
    color: var(--ink);
    word-break: break-word;
}
.highlight--sale   { border-left-color: var(--danger); }
.highlight--sale   .highlight-label { color: var(--danger); }
.highlight--rating { border-left-color: var(--warn); }
.highlight--rating .highlight-label { color: var(--warn); }
.highlight--new    { border-left-color: var(--accent); }
.highlight--new    .highlight-label { color: var(--accent); }
.highlight--tags   { border-left-color: var(--sub); }
.highlight--tags   .highlight-text { color: var(--sub); font-size: .85rem; }

.sticky-cta-mobile {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 100;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .95rem 1rem;
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .35), 0 2px 6px rgba(124, 106, 247, .5);
    text-decoration: none;
    line-height: 1.3;
}
.sticky-cta-mobile:hover { text-decoration: none; }
.sticky-cta-lead { font-size: .95rem; }
.sticky-cta-price { font-size: 1.1rem; font-weight: 800; }
.sticky-cta-arrow { font-size: 1.05rem; }

@media (max-width: 768px) {
    .sticky-cta-mobile { display: inline-flex; }
    body { padding-bottom: 80px; }
}
