:root {
    --bg-main: #f5f5f5;
    --bg-card: #ffffff;
    --text-main: #222222;
    --text-muted: #666666;
    --accent: #e84b65;
    --accent-hover: #d73554;
    --work-color: #2563eb;
    --char-color: #059669;
    --genre-color: #d97706;
    --line: #e7e7e7;
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 0;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}
.nav a {
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.2s;
}
.nav a:hover {
    color: var(--accent);
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.7rem;
    align-items: start;
    padding: 0.1rem 0 2rem;
}
.page-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.7rem;
    align-items: start;
}
.home-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.home-card {
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    overflow: hidden;
}
.home-card-image {
    display: block;
    padding: 0.55rem 0.55rem 0;
}
.home-card-image img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.home-card-body {
    padding: 0.55rem 0.65rem 0.8rem;
}
.home-card-body h2 {
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 0.35rem;
}
.home-card-body h2 a:hover {
    color: #0066cc;
    text-decoration: underline;
}
.home-card-body p {
    color: #333333;
    font-size: 0.84rem;
    line-height: 1.55;
}
.home-sidebar {
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    padding: 1rem;
}
.site-sidebar {
    align-self: start;
}
.home-widget {
    margin-bottom: 1.6rem;
}
.home-widget:last-child {
    margin-bottom: 0;
}
.home-widget h2 {
    background: #ff007a;
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1.35;
    padding: 0.7rem 0.75rem;
    margin-bottom: 0.65rem;
}
.home-recommend-link {
    color: #0066cc;
    font-weight: 800;
    line-height: 1.6;
    text-decoration: underline;
}
.home-popular-list {
    display: grid;
    gap: 0.65rem;
    list-style: none;
}
.home-popular-list a {
    position: relative;
    display: block;
    min-height: 128px;
    overflow: hidden;
    background: #111827;
}
.home-popular-list img {
    display: block;
    width: 100%;
    height: 128px;
    object-fit: cover;
    opacity: 0.78;
}
.home-popular-rank {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 1.65rem;
    height: 1.65rem;
    display: grid;
    place-items: center;
    background: #d6a51d;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: 0 0 8px 0;
}
.home-popular-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    color: #ffffff;
    padding: 1.6rem 0.65rem 0.55rem;
    font-weight: 800;
    line-height: 1.35;
    background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
}
.home-taxonomy-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.home-taxonomy-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    border: 1px solid #dddddd;
    border-radius: 4px;
    background: #fafafa;
    color: #222222;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 0.38rem 0.5rem;
}
.home-taxonomy-list a:hover {
    color: #0066cc;
    border-color: #b8cce8;
}
.home-taxonomy-list span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 0 2rem;
}
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.hero p {
    color: var(--text-muted);
}

/* Grid & Cards */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}
.card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: white;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    z-index: 10;
    font-size: 0.9rem;
}
.card-img-link {
    display: block;
    height: 300px;
    overflow: hidden;
}
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.card:hover .card-img {
    transform: scale(1.05);
}
.card-content {
    padding: 1rem;
}
.card-title {
    font-size: 1rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.card-title a:hover {
    color: var(--accent);
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
.meta-tag {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
    font-weight: 500;
}
.meta-tag.character {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}
.meta-price {
    font-weight: bold;
    color: var(--accent);
}

.content-body {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}
.content-body h2,
.content-body h3 {
    color: var(--text-main);
    margin: 2rem 0 0.8rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid var(--line);
}
.content-body h2:first-child {
    margin-top: 0;
}
.content-body p {
    margin-bottom: 1.1rem;
}
.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.95rem;
}
.content-body th,
.content-body td {
    border: 1px solid var(--line);
    padding: 0.6rem 0.7rem;
    vertical-align: top;
}
.content-body th {
    background: #fafafa;
    text-align: left;
}
.content-body ul {
    margin: 0 0 1.2rem 1.2rem;
}
.content-body li {
    margin-bottom: 0.35rem;
}

/* Single Page */
.single-container {
    padding: 2rem 0 3.5rem;
}
.single-title {
    font-size: 2.05rem;
    line-height: 1.35;
    margin: 0.3rem 0 0.9rem;
    letter-spacing: 0;
}
.info-group {
    margin-bottom: 1.5rem;
}
.info-group h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.price-big {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag {
    padding: 0.34rem 0.7rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}
.tag.genre { background: rgba(245, 158, 11, 0.1); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.2); }
.tag.work { background: rgba(59, 130, 246, 0.1); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.2); }
.tag.character { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }

.article-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.4rem;
    align-items: start;
    max-width: 1160px;
    margin: 1.5rem auto 0;
}
.article-shell {
    max-width: none;
    margin: 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 2rem;
}
.article-header {
    margin-bottom: 1.4rem;
}
.article-lead {
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.8;
    margin: 0 0 1.2rem;
}

.ranking-sidebar {
    position: sticky;
    top: 5rem;
}
.ranking-sidebar-inner {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1rem;
}
.ranking-sidebar h2 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--line);
}
.sidebar-ranking-list {
    display: grid;
    gap: 0.35rem;
    list-style: none;
}
.sidebar-ranking-list a {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 0.55rem;
    align-items: start;
    border-radius: 4px;
    padding: 0.55rem;
}
.sidebar-ranking-list a:hover,
.sidebar-ranking-list a.is-current {
    background: #fff3f5;
}
.sidebar-rank {
    color: var(--accent);
    font-weight: 800;
}
.sidebar-title {
    font-size: 0.86rem;
    line-height: 1.45;
}
.top-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.top-fact {
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    background: #fffafa;
    padding: 0.8rem 0.9rem;
    min-width: 0;
}
.top-fact.work {
    border-left-color: var(--work-color);
    background: #f7fbff;
}
.top-fact.character {
    border-left-color: var(--char-color);
    background: #f7fffb;
}
.fact-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.top-fact strong,
.fact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 800;
    min-width: 0;
}
.fact-links a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-main-visual {
    margin: 1.5rem 0;
    text-align: center;
}
.article-main-visual img {
    display: block;
    width: min(100%, 720px);
    max-height: 760px;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 4px;
}
.article-cta {
    display: grid;
    justify-items: center;
    margin: 1.4rem 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.article-cta-primary {
    margin-top: 1rem;
    margin-bottom: 1.7rem;
}
.article-cta-secondary {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}
.fanza-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.18rem;
    position: relative;
    width: min(100%, 460px);
    min-height: 3.65rem;
    border-radius: 8px;
    padding: 0.78rem 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    letter-spacing: 0;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.fanza-button:hover {
    transform: translateY(-2px);
}
.fanza-button-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #e84b65 0%, #f05f4f 52%, #f59e0b 100%);
    box-shadow: 0 12px 28px rgba(232, 75, 101, 0.28);
}
.fanza-button-primary:hover {
    box-shadow: 0 16px 34px rgba(232, 75, 101, 0.36);
}
.fanza-button-secondary {
    color: var(--accent-hover);
    background: #ffffff;
    border: 1px solid rgba(232, 75, 101, 0.34);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}
.fanza-button-secondary:hover {
    border-color: rgba(232, 75, 101, 0.52);
    background: #fff8f9;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
}
.button-main {
    font-size: 1.15rem;
}
.overview-block {
    margin: 1.3rem 0;
}
.overview-block blockquote {
    margin: 0;
    padding: 1rem 1.1rem;
    border-left: 4px solid var(--accent);
    background: #fff8f9;
    color: var(--text);
}
.overview-block p {
    margin: 0;
}
.article-meta-box {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fafafa;
    padding: 1.1rem;
    margin: 1.4rem 0 1.8rem;
}
.article-meta-box h2 {
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}
.data-list {
    display: grid;
    gap: 0.65rem;
}
.data-list div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 1rem;
    align-items: start;
}
.data-list dt {
    color: var(--text-muted);
    font-weight: 800;
}
.data-list dd {
    min-width: 0;
}
.meta-link-list {
    display: grid;
    justify-items: start;
    gap: 0.35rem;
}
.meta-link-list a {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    line-height: 1.6;
}
.article-meta-box .tags {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.5rem;
}
.article-meta-box .tag {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 2.5rem;
}

.sample-gallery {
    margin: 1.4rem 0;
}
.gallery-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
.gallery-stack img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--line);
}

.related-section,
.taxonomy-panel {
    margin-top: 2.5rem;
}
.related-section h2,
.taxonomy-panel h2 {
    margin-bottom: 1rem;
}
.compact-list {
    display: grid;
    gap: 0.75rem;
}
.compact-item {
    display: grid;
    grid-template-columns: 4rem 1fr auto;
    gap: 0.75rem;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}
.compact-item:hover {
    border-color: rgba(239, 68, 68, 0.35);
}
.compact-rank {
    color: var(--accent);
    font-weight: 800;
}
.compact-title {
    font-weight: 700;
}
.compact-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.taxonomy-header {
    padding: 3rem 0 1rem;
}
.taxonomy-kicker {
    color: var(--accent);
    font-weight: 800;
    margin-bottom: 0.4rem;
}
.taxonomy-header h1 {
    font-size: 2.3rem;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}
.taxonomy-header p {
    color: var(--text-muted);
}
.taxonomy-tags {
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .home-layout,
    .page-with-sidebar {
        grid-template-columns: 1fr;
    }
    .home-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 0.85rem;
    }
    .home-card-grid {
        grid-template-columns: 1fr;
    }
    .home-card-image img {
        aspect-ratio: 16 / 10;
    }
    .header .container {
        align-items: flex-start;
        gap: 0.7rem;
        flex-direction: column;
    }
    .logo {
        font-size: 1rem;
    }
    .article-with-sidebar {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 0.9rem;
    }
    .article-shell {
        margin-top: 0;
        padding: 1rem;
        border-radius: 0;
    }
    .ranking-sidebar {
        position: static;
    }
    .single-title {
        font-size: 1.35rem;
    }
    .top-facts {
        grid-template-columns: 1fr;
    }
    .article-main-visual img {
        max-height: none;
        width: 100%;
    }
    .data-list div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    .content-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .gallery-stack {
        gap: 0.9rem;
    }
    .compact-item {
        grid-template-columns: 3.5rem 1fr;
    }
    .compact-meta {
        grid-column: 2;
    }
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 0.5rem;
    padding: 2rem 0;
    margin: 0;
}
.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: 6px;
    transition: background 0.2s;
}
.page-item.active .page-link, .page-item .page-link:hover {
    background: var(--accent);
    color: white;
}

@media (max-width: 640px) {
    .pagination {
        gap: 0.35rem;
        padding: 1.4rem 0 1.8rem;
    }
    .page-item .page-link {
        min-width: 2.35rem;
        min-height: 2.35rem;
        padding: 0.35rem 0.55rem;
        font-size: 0.95rem;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    color: var(--text-muted);
}
