*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Yu Gothic", sans-serif;
    background: #f5f5f5;
}

header {
    background: #2c3e50;
    color: white;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

h1 {
    margin: 0;
}

.search-box {
    margin: 30px 0;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="date"] {
    width: 50%;
    padding: 12px;
    font-size: 16px;
    box-sizing: border-box;
}

.tag {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 8px 15px;
    margin: 5px;
    border-radius: 20px;
}

.work-card {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.work-card h3 {
    margin-top: 0;
}

.tag-link {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 5px 10px;
    margin: 3px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 14px;
}

.tag-link:hover {
    opacity: 0.8;
}

.detail-button {
    display: inline-block;
    background: #2c3e50;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 10px;
}

.detail-button:hover {
    opacity: 0.8;
}

.work-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.work-card h3 a:hover {
    text-decoration: underline;
}

.search-box {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
}

.search-box button {
    padding: 12px 20px;
    border: none;
    background: #2c3e50;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

.search-box button:hover {
    opacity: 0.8;
}

.tag-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tag-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.tag-list {
    margin-top: 10px;
}

.site-nav {
    margin-top: 10px;
}

.site-nav a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    font-weight: bold;
}

.site-nav a:hover {
    text-decoration: underline;
}

.tag-checkbox {
    display: inline-block;
    margin: 6px 10px 6px 0;
    padding: 6px 10px;
    background: #f2f2f2;
    border-radius: 6px;
    cursor: pointer;
}

.tag-checkbox input {
    margin-right: 5px;
}

.work-cover {
    flex: 0 0 140px;
}

.work-cover img {
    width: 140px;
    max-height: 200px;
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    display: block;
}

.no-cover {
    width: 140px;
    height: 200px;
    background: #ddd;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.work-info {
    flex: 1;
}

.work-card h3 {
    margin-top: 0;
}

.work-detail-cover {
    margin: 20px 0;
}

.work-detail-cover img {
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    display: block;
}

@media (max-width: 600px) {
    .work-card {
        display: block;
    }

    .work-cover {
        margin-bottom: 15px;
    }
}

select,
textarea {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    box-sizing: border-box;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.admin-table th {
    background: #f2f2f2;
}

.delete-button {
    display: inline-block;
    background: #c0392b;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 10px;
    cursor: pointer;
}

.delete-button:hover {
    opacity: 0.8;
}

.admin-thumbnail {
    width: 60px;
    height: 85px;
    object-fit: contain;
    object-position: center;
    background: #fff;
    border-radius: 4px;
    display: block;
}

.admin-no-cover {
    width: 60px;
    height: 85px;
    background: #ddd;
    color: #777;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.admin-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.admin-menu .detail-button {
    margin-right: 8px;
    margin-bottom: 8px;
}

.message {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.admin-stats {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.admin-stat {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    text-align: center;
}

.admin-stat strong {
    display: block;
    font-size: 24px;
    margin-bottom: 5px;
}

.admin-stat span {
    color: #666;
}

.pagination {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 20px 0;
}

.pagination a {
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
}

.pagination span {
    color: #555;
}

.purchase-links {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box input[type="text"] {
    width: 320px;
    min-width: 260px;
    padding: 8px 10px;
}

.search-box select {
    width: 220px;
    padding: 8px 10px;
}

.search-box .detail-button {
    white-space: nowrap;
}

.search-box input[type="text"],
.search-box select,
.search-box button.detail-button {
    height: 40px;
    box-sizing: border-box;
}

.search-box button.detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    margin: 0;
    line-height: 1;
}

.admin-menu .work-card {
    display: flex;
    align-items: center;
    gap: 28px;
}

.admin-menu .work-card h3 {
    margin: 0;
    width: 80px;
    flex-shrink: 0;
    line-height: 1.4;
}

.admin-menu .work-card p {
    margin: 0;
    flex: 1;
}

.error-box {
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #e57373;
    background: #ffebee;
    color: #b71c1c;
    border-radius: 4px;
}

.error-box ul {
    margin: 0;
    padding-left: 20px;
}

.admin-count {
    margin: 12px 0;
    font-weight: bold;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.status-ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-missing {
    background: #fff3e0;
    color: #ef6c00;
}

.small-button {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background: #eeeeee;
    color: #333;
    text-decoration: none;
    font-size: 13px;
}

.small-button:hover {
    background: #dddddd;
}

.site-description {
    margin-bottom: 20px;
    line-height: 1.8;
    color: #555;
}

.top-hero {
    margin-top: 20px;
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border: 1px solid #ffd180;
}

.top-hero h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 22px;
}

.top-hero p {
    margin: 0 0 10px;
    line-height: 1.8;
    color: #444;
    font-size: 18px;
    font-weight: 600;
}

.top-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.tag-search-page {
    padding-bottom: 80px;
}

.episode-list {
    margin: 20px 0;
}

.episode-item {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.episode-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* 検索結果：作品カードと一致した収録話を一つの枠にまとめる */
.work-result-group {
    margin-bottom: 20px;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.work-result-group .work-card {
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
}

.matched-episodes {
    margin: 0;
    padding: 12px 20px 16px;
    background: #f4f7fa;
    border-top: 1px solid #dfe5eb;
    font-size: 0.95rem;
}

.matched-episode-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 6px;
}

.matched-episode {
    display: inline-block;
    margin: 0;
}

.matched-episode {
    display: inline-block;
    margin: 4px 6px 4px 0;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.purchase-button {
    font-size: 0.9rem;
}

.purchase-box {
    margin: 25px 0;
    padding: 18px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.purchase-box h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.purchase-note {
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
}

.purchase-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.purchase-main-button {
    font-weight: bold;
}

.top-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 28px;
}

.tag-search-guide {
    background: white;
    padding: 18px 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.tag-search-guide p {
    margin: 0 0 8px;
}

.tag-search-tip {
    color: #666;
    font-size: 0.95rem;
}

.tag-search-submit {
    background: white;
    padding: 18px 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selected-tag-count {
    margin: 0 0 10px;
    font-weight: bold;
}

.tag-results-summary {
    background: white;
    padding: 18px 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tag-results-summary h3 {
    margin-top: 0;
}

.selected-tags {
    margin: 10px 0;
}

.result-count {
    font-weight: bold;
    margin: 12px 0 8px;
}

.tag-results-note {
    color: #666;
    line-height: 1.7;
    margin-bottom: 0;
}

.no-results-box {
    background: white;
    padding: 18px 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}
.tags-page-guide {
    background: white;
    padding: 18px 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.tags-page-guide p {
    margin: 0 0 10px;
}

.tags-page-actions {
    margin-top: 12px;
}

.tags-page-summary {
    background: white;
    padding: 12px 16px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.tag-category-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
    margin-left: 8px;
}

.tag-detail-summary {
    background: white;
    padding: 18px 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.tag-detail-summary p {
    margin: 0 0 10px;
}

.tag-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.work-detail-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin: 20px 0;
}

.work-detail-info {
    flex: 1;
    min-width: 0;
    max-width: 760px;
    margin-top: 20px;
}

.work-info-box,
.work-summary-box {
    background: white;
    padding: 18px 20px;
    margin-bottom: 18px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.work-info-box h3,
.work-summary-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.work-info-box p,
.work-summary-box p {
    margin: 0 0 10px;
}

.work-tag-list {
    line-height: 1.8;
}

.episode-guide {
    background: white;
    padding: 14px 16px;
    margin: 10px 0 18px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #555;
    line-height: 1.8;
}

@media (max-width: 700px) {
    .work-detail-layout {
        margin-top: 0;
    }

    .work-detail-cover {
        margin-bottom: 18px;
    }
}
.single-episode-tags {
    line-height: 1.8;
    margin-top: 8px;
}
.episodes-section {
    margin: 28px 0;
}

.episode-list {
    display: grid;
    gap: 16px;
}

.episode-card {
    background: white;
    padding: 18px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.episode-card h4 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.episode-memo {
    background: #f8f8f8;
    padding: 12px 14px;
    margin: 10px 0;
    border-radius: 8px;
    line-height: 1.8;
    color: #444;
}

.episode-tags {
    line-height: 1.8;
    margin-top: 10px;
}

.episode-tags-label {
    font-weight: bold;
    margin-right: 4px;
}

.no-tags {
    color: #777;
}
.search-results-summary {
    background: white;
    padding: 18px 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.search-results-summary p {
    margin: 0 0 10px;
}

.search-results-summary p:last-child {
    margin-bottom: 0;
}

.search-results-note {
    color: #666;
    line-height: 1.7;
}

.author-detail-summary {
    background: white;
    padding: 18px 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.author-detail-summary p {
    margin: 0 0 10px;
}

.author-detail-note {
    color: #666;
    line-height: 1.7;
}

.author-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}
@media (max-width: 600px) {
    header {
        width: 100%;
    }

    header nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    header nav a {
        display: inline-block;
        margin: 0;
        font-size: 13px;
        line-height: 1.6;
    }

    .container {
        width: 100%;
        box-sizing: border-box;
    }

    .work-card {
        padding: 12px;
    }

    .work-card img,
    .work-cover,
    .cover-image {
        max-width: 100%;
        height: auto;
    }

    input[type="text"],
    input[type="search"],
    select,
    textarea {
        max-width: 100%;
        box-sizing: border-box;
    }
}
@media (max-width: 600px) {
    .work-detail,
    .work-detail-main,
    .work-main {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .work-detail img,
    .work-cover,
    .cover-image {
        width: 100%;
        max-width: 260px;
        height: auto;
        margin: 0 auto;
        display: block;
    }

    .work-info,
    .work-meta,
    .detail-card {
        width: 100%;
        box-sizing: border-box;
    }
}@media (max-width: 600px) {
    .work-detail-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .work-detail-cover {
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }

    .work-detail-cover img,
    .work-detail-cover .no-cover {
        width: 100%;
        max-width: 260px;
        height: auto;
        box-sizing: border-box;
    }

    .work-detail-info {
        width: 100%;
    }

    .work-info-box,
    .work-summary-box {
        width: 100%;
        box-sizing: border-box;
    }
}
img {
    max-width: 100%;
    height: auto;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.work-card,
.tag-section,
.purchase-box,
.tag-search-guide,
.tag-search-submit,
.tag-results-summary,
.no-results-box,
.tags-page-guide,
.tags-page-summary,
.tag-detail-summary,
.work-info-box,
.work-summary-box,
.episode-card,
.search-results-summary,
.author-detail-summary {
    max-width: 100%;
    overflow-wrap: break-word;
}
@media (max-width: 600px) {
    body {
        line-height: 1.7;
    }

    h2 {
        font-size: 1.35rem;
        line-height: 1.4;
    }

    h3 {
        font-size: 1.15rem;
        line-height: 1.4;
    }

    .container {
        padding: 0 12px;
    }

    .work-card,
    .tag-section,
    .purchase-box,
    .tag-search-guide,
    .tag-search-submit,
    .tag-results-summary,
    .no-results-box,
    .tags-page-guide,
    .tags-page-summary,
    .tag-detail-summary,
    .work-info-box,
    .work-summary-box,
    .episode-card,
    .search-results-summary,
    .author-detail-summary {
        padding: 14px;
    }

    .detail-button,
    .delete-button,
    .purchase-main-button {
        display: block;
        width: 100%;
        text-align: center;
        margin: 8px 0 0;
        padding: 11px 14px;
    }

    .card-actions,
    .purchase-links,
    .top-hero-actions,
    .top-search-actions,
    .tag-detail-actions,
    .author-detail-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .card-actions .detail-button,
    .card-actions .delete-button,
    .purchase-links .detail-button,
    .top-hero-actions .detail-button,
    .top-search-actions .detail-button,
    .tag-detail-actions .detail-button,
    .author-detail-actions .detail-button {
        width: 100%;
        margin: 0;
    }

    .search-box {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .search-box input[type="text"],
    .search-box select,
    .search-box button.detail-button {
        width: 100%;
        min-width: 0;
    }

    .tag-link {
        font-size: 13px;
        padding: 5px 9px;
        line-height: 1.5;
    }

    .tag-checkbox {
        display: block;
        margin: 8px 0;
        line-height: 1.6;
    }

    .pagination {
        justify-content: center;
    }
}
@media (max-width: 600px) {
    p,
    li {
        line-height: 1.8;
        font-size: 0.95rem;
    }

    .site-description,
    .top-hero p,
    .tag-search-guide,
    .tag-results-note,
    .tags-page-guide,
    .tag-detail-summary,
    .work-info-box,
    .work-summary-box,
    .episode-memo,
    .search-results-summary,
    .author-detail-summary {
        line-height: 1.8;
    }

    h2,
    h3,
    h4 {
        line-height: 1.45;
    }

    .top-hero p {
        font-size: 1rem;
    }
}
.work-tag-category {
    margin: 10px 0;
}

.work-tag-category-label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    color: #444;
    font-size: 0.95rem;
}

.work-tag-category .work-tag-list {
    line-height: 1.8;
}

@media (max-width: 600px) {
    .work-tag-category {
        margin: 12px 0;
    }

    .work-tag-category-label {
        font-size: 0.9rem;
    }
}

/* ==============================
   Design polish
   ============================== */

:root {
    --color-bg: #f6f7f9;
    --color-surface: #ffffff;
    --color-main: #253246;
    --color-main-light: #34495e;
    --color-accent: #2f80ed;
    --color-danger: #c0392b;
    --color-text: #222;
    --color-muted: #666;
    --color-border: #e5e7eb;

    --radius-card: 12px;
    --radius-button: 8px;

    --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.06);
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
}

header {
    background: var(--color-main);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

h2 {
    margin-top: 24px;
    margin-bottom: 18px;
    line-height: 1.4;
}

h3 {
    line-height: 1.4;
}

.work-card,
.tag-section,
.purchase-box,
.tag-search-guide,
.tag-search-submit,
.tag-results-summary,
.no-results-box,
.tags-page-guide,
.tags-page-summary,
.tag-detail-summary,
.work-info-box,
.work-summary-box,
.episode-card,
.search-results-summary,
.author-detail-summary,
.episode-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-main);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-button);
    text-decoration: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.detail-button:hover {
    opacity: 0.88;
    text-decoration: none;
}

.purchase-main-button {
    background: var(--color-accent);
    font-weight: 700;
}

.delete-button {
    background: var(--color-danger);
    border-radius: var(--radius-button);
    font-weight: 600;
}

.tag-link {
    background: #eef4ff;
    color: #2557a7;
    border: 1px solid #d6e4ff;
    font-weight: 600;
}

.tag-link:hover {
    opacity: 1;
    background: #dceaff;
    text-decoration: none;
}

.site-description,
.purchase-note,
.tag-search-tip,
.tag-results-note,
.author-detail-note,
.episode-guide {
    color: var(--color-muted);
}

.top-hero {
    border: 1px solid #f3d19c;
    box-shadow: var(--shadow-card);
}

.work-info-box h3,
.work-summary-box h3,
.purchase-box h3,
.episode-card h4,
.tag-section h3 {
    color: var(--color-main);
}

@media (max-width: 600px) {
    h2 {
        font-size: 1.35rem;
    }

    .work-card,
    .tag-section,
    .purchase-box,
    .tag-search-guide,
    .tag-search-submit,
    .tag-results-summary,
    .no-results-box,
    .tags-page-guide,
    .tags-page-summary,
    .tag-detail-summary,
    .work-info-box,
    .work-summary-box,
    .episode-card,
    .search-results-summary,
    .author-detail-summary,
    .episode-item {
        padding: 14px;
    }
}
.card-meta {
    margin: 6px 0;
    color: var(--color-muted);
}

.card-meta-label {
    font-weight: 700;
    color: var(--color-main);
}

.card-tags {
    margin: 10px 0 12px;
    line-height: 1.9;
}

.more-tags {
    display: inline-block;
    margin: 3px;
    padding: 5px 9px;
    color: var(--color-muted);
    font-size: 0.9rem;
}
/* ==============================
   Header and search polish
   ============================== */

header {
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1,
header .site-title {
    letter-spacing: 0.03em;
}

header a {
    color: #fff;
    text-decoration: none;
}

header nav a {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
}

header nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 14px;
    margin: 20px 0 28px;
}

.search-box input[type="text"] {
    flex: 1;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    font-size: 1rem;
    background: #fff;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

.search-box button {
    min-height: 44px;
    white-space: nowrap;
}

.top-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 22px;
}

.top-search-actions .detail-button {
    min-height: 42px;
}

.work-card {
    overflow: hidden;
}

.work-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.45;
}

.work-info h3 a {
    color: var(--color-main);
    text-decoration: none;
}

.work-info h3 a:hover {
    text-decoration: underline;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.card-actions .detail-button {
    min-height: 40px;
}

.card-actions .purchase-button {
    background: var(--color-accent);
}

@media (max-width: 600px) {
    header {
        position: static;
    }

    header nav a {
        padding: 6px 8px;
    }

    .search-box {
        display: block;
        padding: 12px;
    }

    .search-box input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
    }

    .search-box button {
        width: 100%;
    }

    .top-search-actions .detail-button,
    .card-actions .detail-button {
        width: 100%;
    }
}

/* ==============================
   Top hero polish
   ============================== */

.top-hero {
    position: relative;
    padding: 28px 30px;
    margin: 24px 0 18px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 58%, #eef4ff 100%);
    border-radius: 18px;
    border: 1px solid #f3d19c;
    overflow: hidden;
}

.top-hero::before {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 180px;
    height: 180px;
    background: rgba(47, 128, 237, 0.08);
    border-radius: 50%;
}

.top-hero h3 {
    position: relative;
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--color-main);
    font-size: 1.45rem;
    line-height: 1.45;
}

.top-hero p {
    position: relative;
    max-width: 760px;
    margin: 8px 0;
    color: #444;
}

.top-search-actions {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 14px;
}

.top-search-actions .detail-button:first-child {
    background: var(--color-accent);
}

@media (max-width: 600px) {
    .top-hero {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .top-hero h3 {
        font-size: 1.25rem;
    }

    .top-search-actions {
        padding: 12px;
    }
}
/* ==============================
   Tags page polish
   ============================== */

.tags-page-guide,
.tags-page-summary {
    padding: 18px 20px;
    margin: 18px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.tags-page-guide p,
.tags-page-summary p {
    margin: 8px 0;
    color: var(--color-muted);
}

.tag-section {
    padding: 18px 20px;
    margin: 22px 0;
}

.tag-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-main);
}

.tag-section h3::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 20px;
    background: var(--color-accent);
    border-radius: 999px;
}

.tag-section .tag-link {
    margin: 4px;
}

.tag-section p {
    line-height: 2;
}

@media (max-width: 600px) {
    .tags-page-guide,
    .tags-page-summary,
    .tag-section {
        padding: 14px;
        margin: 16px 0;
    }

    .tag-section h3 {
        font-size: 1.05rem;
    }

    .tag-section .tag-link {
        font-size: 0.9rem;
    }
}
/* ==============================
   Multi tag search polish
   ============================== */

.tag-search-guide,
.tag-search-submit {
    padding: 18px 20px;
    margin: 18px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.tag-search-guide p,
.tag-search-submit p {
    margin: 8px 0;
    color: var(--color-muted);
}

.tag-search-category {
    padding: 18px 20px;
    margin: 22px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.tag-search-category h3 {
    margin-top: 0;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-main);
}

.tag-checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
}

.tag-checkbox-item:hover {
    background: #eef4ff;
    border-color: #d6e4ff;
}

.tag-checkbox-item input {
    margin: 0;
}

.tag-search-submit {
    position: sticky;
    bottom: 12px;
    z-index: 50;
}

.tag-search-submit .detail-button {
    min-height: 44px;
    padding-left: 22px;
    padding-right: 22px;
}

@media (max-width: 600px) {
    .tag-search-guide,
    .tag-search-submit,
    .tag-search-category {
        padding: 14px;
        margin: 16px 0;
    }

    .tag-checkbox-list {
        gap: 7px;
    }

    .tag-checkbox-item {
        width: 100%;
        border-radius: var(--radius-button);
        padding: 9px 10px;
    }

    .tag-search-submit {
        bottom: 8px;
    }

    .tag-search-submit .detail-button {
        width: 100%;
    }
}
/* ==============================
   Multi tag search actual classes
   ============================== */

.tag-search-page .tag-section {
    padding: 18px 20px;
    margin: 22px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.tag-search-page .tag-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-main);
}

.tag-search-page .tag-section h3::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 20px;
    background: var(--color-accent);
    border-radius: 999px;
}

.tag-search-page .tag-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px;
    padding: 7px 11px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
}

.tag-search-page .tag-checkbox:hover {
    background: #eef4ff;
    border-color: #d6e4ff;
}

.tag-search-page .tag-checkbox input {
    margin: 0;
}

.tag-search-page .tag-checkbox:has(input:checked) {
    background: #eef4ff;
    border-color: var(--color-accent);
    color: #2557a7;
    font-weight: 700;
}

.tag-search-page .selected-tag-count {
    margin: 0 0 10px;
    font-weight: 700;
    color: var(--color-main);
}

.tag-search-page .tag-search-submit {
    padding: 16px 18px;
    margin: 24px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

@media (max-width: 600px) {
    .tag-search-page .tag-section {
        padding: 14px;
        margin: 16px 0;
    }

    .tag-search-page .tag-checkbox {
        display: flex;
        width: 100%;
        margin: 6px 0;
        padding: 10px 12px;
        border-radius: var(--radius-button);
    }

    .tag-search-page .tag-search-submit {
        padding: 14px;
    }

    .tag-search-page .tag-search-submit .detail-button {
        width: 100%;
    }
}
/* ==============================
   Tags page actual classes polish
   ============================== */

.tags-page-actions {
    margin-top: 14px;
}

.tags-page-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--color-main);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.8;
}

.tag-list .tag-link {
    margin: 0;
}

.tag-category-count {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 8px;
    background: #eef4ff;
    color: #2557a7;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

@media (max-width: 600px) {
    .tags-page-summary {
        display: block;
        line-height: 1.8;
    }

    .tag-list {
        gap: 7px;
    }

    .tag-category-count {
        margin-left: 6px;
        font-size: 0.75rem;
    }
}
/* ==============================
   Work detail purchase polish
   ============================== */

.purchase-box {
    padding: 22px 24px;
    margin: 28px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #dbeafe;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.purchase-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--color-main);
}

.purchase-note {
    margin: 8px 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.purchase-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 12px;
}

.purchase-links .purchase-main-button {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 10px;
}

.work-detail-layout {
    align-items: flex-start;
}

.work-detail-cover img,
.work-detail-cover .no-cover {
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.work-info-box,
.work-summary-box {
    padding: 18px 20px;
}

.work-info-box h3,
.work-summary-box h3 {
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.episodes-section {
    margin-top: 28px;
}

.episode-card {
    padding: 18px 20px;
    margin: 18px 0;
}

.episode-card h4 {
    margin-top: 0;
    margin-bottom: 12px;
}

.episode-memo {
    padding: 10px 12px;
    margin: 10px 0;
    background: #f8fafc;
   
    border-radius: 8px;
    color: #444;
}

@media (max-width: 600px) {
    .purchase-box {
        padding: 18px 16px;
        margin: 24px 0;
    }

    .purchase-links {
        display: block;
    }

    .purchase-links .purchase-main-button {
        width: 100%;
        margin: 6px 0;
    }

    .work-info-box,
    .work-summary-box,
    .episode-card {
        padding: 14px;
    }
}
/* ==============================
   Footer polish
   ============================== */

footer {
    margin-top: 40px;
    padding: 24px 16px;
    background: var(--color-main);
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    font-size: 0.9rem;
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer p {
    margin: 6px 0;
}

@media (max-width: 600px) {
    footer {
        margin-top: 32px;
        padding: 20px 12px;
        font-size: 0.85rem;
    }
}

/* ==============================
   Admin form polish
   ============================== */

.admin-form {
    max-width: 980px;
    margin: 20px 0 32px;
    padding: 22px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.admin-form p {
    margin: 0 0 18px;
}

.admin-form label {
    display: block;
    font-weight: 700;
    color: var(--color-main);
}

.admin-form input[type="text"],
.admin-form input[type="url"],
.admin-form input[type="date"],
.admin-form input[type="file"],
.admin-form select,
.admin-form textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: #fff;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
}

.admin-form textarea {
    min-height: 130px;
    resize: vertical;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

.admin-form-section-title {
    margin-top: 28px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-main);
}

.admin-form .tag-section {
    padding: 16px 18px;
    margin: 16px 0;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: none;
}

.admin-form .tag-section h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--color-main);
}

.admin-form .tag-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px;
    padding: 7px 11px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
}

.admin-form .tag-checkbox:hover {
    background: #eef4ff;
    border-color: #d6e4ff;
}

.admin-form .tag-checkbox input {
    margin: 0;
}

.admin-form .tag-checkbox:has(input:checked) {
    background: #eef4ff;
    border-color: var(--color-accent);
    color: #2557a7;
    font-weight: 700;
}

.admin-form-actions {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
}

.admin-form-actions .detail-button {
    min-height: 46px;
    padding-left: 24px;
    padding-right: 24px;
}

@media (max-width: 600px) {
    .admin-form {
        padding: 16px 14px;
    }

    .admin-form .tag-section {
        padding: 14px;
    }

    .admin-form .tag-checkbox {
        display: flex;
        width: 100%;
        margin: 6px 0;
        border-radius: var(--radius-button);
        padding: 10px 12px;
    }

    .admin-form-actions .detail-button {
        width: 100%;
    }
}
/* ==============================
   Admin edit work polish
   ============================== */

.admin-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.admin-help-box {
    padding: 14px 16px;
    margin: 14px 0 20px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-card);
    color: var(--color-muted);
}

.admin-help-box p {
    margin: 0;
}

.admin-cover-preview {
    margin: 0 0 18px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

.admin-cover-preview-title {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--color-main);
}

.admin-cover-preview img {
    display: block;
    max-width: 220px;
    height: auto;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.admin-cover-preview .no-cover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    min-height: 120px;
    background: #fff;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-card);
    color: var(--color-muted);
}

@media (max-width: 600px) {
    .admin-page-actions .detail-button {
        width: 100%;
    }

    .admin-cover-preview {
        padding: 14px;
    }

    .admin-cover-preview img {
        max-width: 100%;
    }
}
.admin-help-box {
    border-left: 1px solid var(--color-border);
}
/* ==============================
   Admin work episodes polish
   ============================== */

.admin-work-summary {
    padding: 16px 18px;
    margin: 16px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.admin-work-summary p {
    margin: 6px 0;
}

.admin-work-summary span {
    display: inline-block;
    min-width: 48px;
    margin-right: 8px;
    font-weight: 700;
    color: var(--color-main);
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0 28px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    background: var(--color-surface);
}

.admin-table-wrap .admin-table {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

.admin-episode-table th,
.admin-episode-table td {
    vertical-align: top;
}

.admin-episode-table td:nth-child(3) {
    min-width: 220px;
}

.admin-episode-table td:nth-child(4) {
    min-width: 220px;
    color: var(--color-muted);
}

.admin-inline-form {
    display: inline-block;
    margin-left: 6px;
}

.admin-episode-form {
    margin-top: 18px;
}

.admin-form input[type="number"] {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: #fff;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
}

.admin-form input[type="number"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

.admin-episode-form .tag-section {
    padding: 16px 18px;
    margin: 16px 0;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: none;
}

.admin-episode-form .tag-section h5 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--color-main);
    font-size: 1rem;
}

.admin-episode-form .tag-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px;
    padding: 7px 11px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
}

.admin-episode-form .tag-checkbox:hover {
    background: #eef4ff;
    border-color: #d6e4ff;
}

.admin-episode-form .tag-checkbox input {
    margin: 0;
}

.admin-episode-form .tag-checkbox:has(input:checked) {
    background: #eef4ff;
    border-color: var(--color-accent);
    color: #2557a7;
    font-weight: 700;
}

@media (max-width: 600px) {
    .admin-work-summary {
        padding: 14px;
    }

    .admin-work-summary span {
        display: block;
        margin-bottom: 2px;
    }

    .admin-inline-form {
        display: block;
        margin: 8px 0 0;
    }

    .admin-inline-form .delete-button,
    .admin-episode-table .detail-button {
        width: 100%;
    }

    .admin-episode-form .tag-section {
        padding: 14px;
    }

    .admin-episode-form .tag-checkbox {
        display: flex;
        width: 100%;
        margin: 6px 0;
        border-radius: var(--radius-button);
        padding: 10px 12px;
    }
}
/* Edit episode tag heading polish */
.admin-episode-form .tag-section h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--color-main);
    font-size: 1rem;
}

/* ==============================
   Admin works list polish
   ============================== */

.admin-filter-form {
    align-items: stretch;
}

.admin-filter-form select {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: #fff;
    font-size: 1rem;
    color: var(--color-text);
}

.admin-filter-form select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

.admin-count {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    margin: 12px 0;
    background: #eef4ff;
    color: #2557a7;
    border-radius: 999px;
    font-weight: 700;
}

.admin-works-table th,
.admin-works-table td {
    vertical-align: middle;
}

.admin-works-table td:nth-child(3) {
    min-width: 220px;
    font-weight: 700;
    color: var(--color-main);
}

.admin-works-table td:nth-child(4) {
    min-width: 120px;
}

.admin-works-table td:nth-child(5) {
    white-space: nowrap;
}

.admin-thumbnail {
    border-radius: 8px;
    box-shadow: var(--shadow-card);
}

.admin-no-cover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    min-height: 96px;
    padding: 6px;
    background: #f8fafc;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    color: var(--color-muted);
    font-size: 0.8rem;
    text-align: center;
}

.admin-works-table .small-button,
.admin-works-table .delete-button {
    white-space: nowrap;
}

@media (max-width: 600px) {
    .admin-filter-form {
        display: block;
    }

    .admin-filter-form input[type="text"],
    .admin-filter-form select,
    .admin-filter-form .detail-button {
        width: 100%;
        margin-bottom: 10px;
    }

    .admin-count {
        display: block;
        border-radius: var(--radius-button);
    }
}

/* ==============================
   Admin table buttons polish
   ============================== */

.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    background: var(--color-main);
    color: #fff;
    border-radius: var(--radius-button);
    text-decoration: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.small-button:hover {
    opacity: 0.88;
    text-decoration: none;
}

.admin-works-table .small-button {
    min-width: 58px;
}

.admin-works-table .delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: none;
    border-radius: var(--radius-button);
    background: var(--color-danger);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.admin-works-table .delete-button:hover {
    opacity: 0.88;
}

.admin-page-actions .detail-button {
    min-height: 42px;
}

/* ==============================
   Admin tags list polish
   ============================== */

.admin-tags-table th,
.admin-tags-table td {
    vertical-align: top;
}

.admin-tags-table td:nth-child(2) {
    min-width: 140px;
    font-weight: 700;
    color: var(--color-main);
}

.admin-tags-table td:nth-child(3) {
    min-width: 130px;
}

.admin-tags-table td:nth-child(5) {
    min-width: 260px;
    color: var(--color-muted);
    line-height: 1.6;
}

.admin-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    background: #eef4ff;
    color: #2557a7;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.admin-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-main);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.admin-tags-table .small-button,
.admin-tags-table .delete-button {
    white-space: nowrap;
}

.admin-tags-table .delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: none;
    border-radius: var(--radius-button);
    background: var(--color-danger);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.admin-tags-table .delete-button:hover {
    opacity: 0.88;
}

@media (max-width: 600px) {
    .admin-tags-table td:nth-child(5) {
        min-width: 220px;
    }
}

/* ==============================
   Admin authors list polish
   ============================== */

.admin-authors-table th,
.admin-authors-table td {
    vertical-align: middle;
}

.admin-authors-table td:nth-child(2) {
    min-width: 180px;
    font-weight: 700;
    color: var(--color-main);
}

.admin-authors-table .small-button,
.admin-authors-table .delete-button {
    white-space: nowrap;
}

.admin-authors-table .delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: none;
    border-radius: var(--radius-button);
    background: var(--color-danger);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.admin-authors-table .delete-button:hover {
    opacity: 0.88;
}
/* ==============================
   Admin dashboard polish
   ============================== */

.admin-dashboard .admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 18px 0 24px;
}

.admin-dashboard .admin-stat {
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.admin-dashboard .admin-stat strong {
    display: block;
    margin-bottom: 4px;
    color: var(--color-main);
    font-size: 1.6rem;
    line-height: 1.2;
}

.admin-dashboard .admin-stat span {
    color: var(--color-muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.admin-dashboard .admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 24px 0 30px;
}

.admin-dashboard .admin-menu-card {
    padding: 18px 20px;
}

.admin-dashboard .admin-menu-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--color-main);
}

.admin-dashboard .admin-menu-card p {
    color: var(--color-muted);
}

.admin-dashboard .admin-menu-card .detail-button {
    margin: 4px 6px 4px 0;
}

.admin-dashboard-section-title {
    margin-top: 32px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-main);
}

.admin-dashboard-table th,
.admin-dashboard-table td {
    vertical-align: middle;
}

.admin-dashboard-table td:nth-child(2) {
    min-width: 220px;
    font-weight: 700;
    color: var(--color-main);
}

.admin-dashboard-table .small-button {
    margin: 3px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .admin-dashboard .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-dashboard .admin-menu {
        grid-template-columns: 1fr;
    }

    .admin-dashboard .admin-menu-card .detail-button,
    .admin-page-actions .detail-button {
        width: 100%;
        margin: 5px 0;
    }
}
/* ==============================
   Admin dashboard menu fix
   ============================== */

.admin-dashboard .admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    align-items: stretch;
    margin-top: 24px;
}

.admin-dashboard .admin-menu .admin-menu-card {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 24px;
}

.admin-dashboard .admin-menu .admin-menu-card h3 {
    width: auto;
    margin: 0 0 12px;
    line-height: 1.4;
}

.admin-dashboard .admin-menu .admin-menu-card p {
    margin: 0 0 16px;
    line-height: 1.8;
    color: #4b5563;
}

.admin-dashboard .admin-menu .admin-menu-card .detail-button {
    display: inline-flex;
    width: auto;
    min-width: 0;
    white-space: nowrap;
    margin: 6px 8px 0 0;
}
.purchase-button.purchase-button-fanza {
    background: #b84545;
    color: #fff;
    border-color: #b84545;
}

.purchase-button.purchase-button-fanza:hover {
    background: #9f3434;
    border-color: #9f3434;
    color: #fff;
}

.purchase-button.purchase-button-dlsite {
    background: #1f3a5f;
    color: #fff;
    border-color: #1f3a5f;
}

.purchase-button.purchase-button-dlsite:hover {
    background: #162a46;
    border-color: #162a46;
    color: #fff;
}

/* タグ一覧・複数タグ検索ページの読みやすさ調整 */
.tag-list-page,
.tag-search-page {
    color: #222;
}

.tag-list-page p,
.tag-search-page p,
.tag-list-page li,
.tag-search-page li,
.tag-list-page label,
.tag-search-page label {
    color: #222;
    font-size: 16px;
    line-height: 1.7;
}

.tag-list-page h2,
.tag-search-page h2,
.tag-list-page h3,
.tag-search-page h3,
.tag-list-page h4,
.tag-search-page h4 {
    color: #111;
    font-weight: 700;
}

.tag-list-page .tag-description,
.tag-search-page .tag-description,
.tag-list-page .page-description,
.tag-search-page .page-description {
    color: #444;
    line-height: 1.7;
}

.tag-list-page .tag-section,
.tag-search-page .tag-section {
    color: #222;
}

.tag-list-page .tag-checkbox,
.tag-search-page .tag-checkbox {
    color: #222;
    font-weight: 500;
}

/* 作品詳細ページ：サンプル画像 */
.sample-images-section {
    margin-top: 0px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
}

.sample-images-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.sample-images-note {
    margin-bottom: 18px;
    color: #555;
    line-height: 1.7;
}

.sample-image-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
    gap: 16px;
    justify-content: start;
}

.sample-image-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.sample-image-item img {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
}
/* サンプル画像：クリック拡大 */
.sample-image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
}

.sample-image-button img {
    display: block;
    width: 100%;
    height: auto;
}

.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.78);
    z-index: 9999;
}

.image-modal.is-open {
    display: flex;
}

.image-modal img {
    max-width: min(100%, 1000px);
    max-height: 90vh;
    width: auto;
    height: auto;
    background: #fff;
    border-radius: 8px;
}

.image-modal-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
/* サンプル画像モーダル：前後移動 */
.image-modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 72px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
}

.image-modal-prev {
    left: 20px;
}

.image-modal-next {
    right: 20px;
}

.image-modal-nav:hover {
    background: #fff;
}

@media (max-width: 600px) {
    .image-modal-nav {
        width: 40px;
        height: 56px;
        font-size: 36px;
    }

    .image-modal-prev {
        left: 8px;
    }

    .image-modal-next {
        right: 8px;
    }
}
/* 作品詳細ページ：表紙とサンプル画像の位置調整 */
.work-detail-layout {
    align-items: flex-start;
}

.work-detail-cover {
    box-sizing: border-box;
}

.work-detail-cover img {
    display: block;
    width: 100%;
    height: auto;
}

/* サンプル画像枠のズレ対策 */
.sample-images-section {
    box-sizing: border-box;
    width: 100%;
}

.sample-image-list {
    align-items: start;
}

.sample-image-item {
    box-sizing: border-box;
}

.sample-image-button {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    line-height: 0;
}

.sample-image-button img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}

/* 作品詳細ページ：収録話ガイド文 */
.episode-guide {
    color: #333;
    font-weight: 600;
    line-height: 1.8;
}
/* 管理画面：編集ボタンと削除ボタンの位置揃え */
.admin-inline-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    vertical-align: middle;
}

.admin-inline-form .delete-button {
    margin: 0;
    vertical-align: middle;
}

.admin-table .detail-button,
.admin-table .delete-button {
    vertical-align: middle;
}
/* 管理画面トップ：カード内ボタン位置を揃える */
.admin-dashboard .admin-menu {
    align-items: stretch;
}

.admin-dashboard .admin-menu .work-card {
    display: flex;
    flex-direction: column;
}

.admin-dashboard .admin-menu .work-card p:last-child {
    margin-top: auto;
}

.admin-dashboard .admin-menu .work-card .detail-button {
    align-self: flex-start;
}

/* 管理画面トップ：カード説明文を読みやすくする */
.admin-dashboard .admin-menu .work-card p {
    color: #222;
    font-weight: 600;
    line-height: 1.7;
}
/* ==============================
   複数タグ検索：タグ絞り込み
   ============================== */

.tag-filter-panel {
    padding: 18px 20px;
    margin: 20px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.tag-filter-label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-main);
    font-weight: 700;
}

.tag-filter-controls {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.tag-filter-input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: #fff;
    color: #222;
    font: inherit;
}

.tag-filter-input:focus {
    border-color: var(--color-accent);
    outline: 3px solid rgba(66, 133, 244, 0.15);
}

.tag-filter-clear-button {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: #f8fafc;
    color: #333;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tag-filter-clear-button:hover:not(:disabled) {
    background: #eef4ff;
    border-color: var(--color-accent);
}

.tag-filter-clear-button:disabled {
    cursor: default;
    opacity: 0.5;
}

.tag-filter-status {
    margin: 10px 0 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.tag-filter-empty {
    padding: 18px;
    margin: 20px 0;
    background: #fff8e8;
    border: 1px solid #ead7a4;
    border-radius: var(--radius-card);
    color: #654f1f;
    text-align: center;
}

.tag-search-page [hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    .tag-filter-panel {
        padding: 14px;
        margin: 16px 0;
    }

    .tag-filter-controls {
        display: block;
    }

    .tag-filter-input {
        width: 100%;
    }

    .tag-filter-clear-button {
        width: 100%;
        margin-top: 8px;
    }
}
/* ==============================
   複数タグ検索：カテゴリー開閉
   ============================== */

.tag-section-title {
    margin: 0;
}

.tag-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.tag-section-toggle::after {
    content: "＋";
    flex-shrink: 0;
    margin-left: 12px;
    font-size: 1.2rem;
    line-height: 1;
}

.tag-section-toggle[aria-expanded="true"]::after {
    content: "−";
}

.tag-section-toggle:hover {
    opacity: 0.75;
}

.tag-section-toggle:focus-visible {
    border-radius: 6px;
    outline: 3px solid rgba(66, 133, 244, 0.25);
    outline-offset: -3px;
}

.tag-section-content {
    padding: 4px 16px 16px;
}

.tag-section.is-open .tag-section-title {
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .tag-section-toggle {
        min-height: 48px;
        padding: 12px;
    }

    .tag-section-content {
        padding: 2px 12px 14px;
    }
}

/* ==============================
   複数タグ検索：選択中タグ
   ============================== */

.selected-tags-panel {
    padding: 16px 18px;
    margin: 0 0 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

.selected-tags-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.selected-tags-title {
    margin: 0;
    font-weight: 700;
}

.clear-selected-tags-button {
    padding: 7px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: #fff;
    color: #444;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.clear-selected-tags-button:hover:not(:disabled) {
    border-color: var(--color-accent);
    background: #f4f7ff;
}

.clear-selected-tags-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.selected-tags-empty {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.selected-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 6px 10px 6px 12px;
    border: 1px solid var(--color-accent);
    border-radius: 999px;
    background: #fff;
    color: var(--color-main);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.selected-tag-chip:hover {
    background: #f4f7ff;
}

.selected-tag-chip:focus-visible {
    outline: 3px solid rgba(66, 133, 244, 0.25);
    outline-offset: 2px;
}

.selected-tag-chip-remove {
    font-size: 1.1rem;
    line-height: 1;
}

@media (max-width: 600px) {
    .selected-tags-panel {
        padding: 14px;
    }

    .selected-tags-header {
        align-items: flex-start;
    }

    .clear-selected-tags-button {
        flex-shrink: 0;
    }

    .selected-tag-chip {
        min-height: 40px;
    }
}
/* ==============================
   複数タグ検索：タグ使用作品数
   ============================== */

.tag-checkbox-name {
    font-weight: 600;
}

.tag-work-count {
    margin-left: 3px;
    color: var(--color-muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.tag-checkbox:hover .tag-work-count {
    color: inherit;
}

@media (max-width: 600px) {
    .tag-work-count {
        font-size: 0.8rem;
    }
}
/* ==============================
   複数タグ検索：画面下部固定アクション
   ============================== */

.tag-search-sticky-actions {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 1000;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;

    max-width: 1160px;
    max-height: 220px;
    padding: 14px;
    margin: 0 auto;

    overflow-y: auto;

    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.tag-search-sticky-actions .selected-tags-panel {
    min-width: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.tag-search-sticky-actions .selected-tags-header {
    margin-bottom: 8px;
}

.tag-search-sticky-actions .selected-tags-list {
    max-height: 100px;
    overflow-y: auto;
    padding: 2px 2px 2px 0;
}

.tag-search-sticky-submit {
    min-width: 210px;
    min-height: 48px;
    margin: 0;
}

/*
 * 固定欄によってページ下部が隠れないように余白を確保
 */
.tag-search-page {
    padding-bottom: 260px;
}

@media (max-width: 700px) {
    .tag-search-sticky-actions {
        right: 0;
        bottom: 0;
        left: 0;

        grid-template-columns: 1fr;
        gap: 10px;

        max-height: 240px;
        padding: 12px;

        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 14px 14px 0 0;
    }

    .tag-search-sticky-actions .selected-tags-list {
        max-height: 72px;
    }

    .tag-search-sticky-submit {
        width: 100%;
        min-width: 0;
    }

    .tag-search-page {
        padding-bottom: 280px;
    }
}
/* ==============================
   タグ一覧：絞り込み・カテゴリー開閉
   ============================== */

.tag-list-page [hidden] {
    display: none !important;
}

.tag-list-page .tag-section-content {
    padding: 4px 16px 16px;
}

.tag-list-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.tag-list-item-name {
    font-weight: 600;
}

.tag-list-page .tag-work-count {
    margin-left: 2px;
    color: var(--color-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.tag-list-page .tag-link:hover .tag-work-count {
    color: inherit;
}

.tag-list-page .tag-category-count {
    margin-left: 6px;
    font-size: 0.86rem;
    font-weight: 400;
    opacity: 0.75;
}

@media (max-width: 600px) {
    .tag-list-page .tag-section-content {
        padding: 2px 12px 14px;
    }

    .tag-list-page .tag-work-count {
        font-size: 0.78rem;
    }
}
/* ==============================
   作品詳細：関連作品
   ============================== */

.related-works-section {
    margin-top: 42px;
    margin-bottom: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border);
}

.related-works-section > h3 {
    margin: 0 0 8px;
}

.related-works-guide {
    margin: 0 0 20px;
    color: var(--color-muted);
}

.related-works-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

/*
 * 作品カードと共通タグをまとめる外側の枠
 */
.related-work-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

/*
 * 外側に枠を付けたので、
 * 内側の作品カード自身の枠と影は消す
 */
.related-work-item .work-card {
    height: auto;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

/*
 * 共通タグを作品カード下部の補足欄にする
 */
.related-work-common-tags {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 16px 16px;
    background: #f8fafc;
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
}

.related-work-common-tags-title {
    margin: 0 0 8px;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.related-work-common-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.related-common-tag {
    font-size: 0.85rem;
}

.related-common-tag-more {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    color: var(--color-muted);
    font-size: 0.84rem;
}

.related-work-reason {
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 800px) {
    .related-works-list {
        grid-template-columns: 1fr;
    }
}
/* ==============================
   作品詳細：サンプルと作品紹介の配置
   ============================== */

.work-detail-sample-section {
    width: 100%;
    box-sizing: border-box;
    margin-top: 28px;
}

.work-detail-summary-section {
    width: 100%;
    box-sizing: border-box;
    margin-top: 24px;
}

@media (max-width: 700px) {
    .work-detail-sample-section {
        margin-top: 22px;
    }

    .work-detail-summary-section {
        margin-top: 18px;
    }
}
/* ==============================
   このサイトについて
   ============================== */

.about-page {
    color: #262626;
    font-family:
        "Meiryo",
        "メイリオ",
        "Yu Gothic UI",
        "Yu Gothic",
        sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 2;
}

.about-page h2 {
    color: #181818;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 28px;
}

.about-page h3 {
    color: #202020;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
    margin-top: 38px;
    margin-bottom: 16px;
}

.about-page p,
.about-page li {
    color: #303030;
    font-size: 1.08rem;
    font-weight: 600;
}

.about-page p {
    margin-bottom: 20px;
}

.about-page ul,
.about-page ol {
    padding-left: 1.6em;
    margin-bottom: 24px;
}

.about-page li {
    margin-bottom: 10px;
}

.about-page a {
    font-size: 1.08rem;
    font-weight: 700;
}

@media (max-width: 700px) {
    .about-page {
        font-size: 1.05rem;
        line-height: 1.9;
    }

    .about-page h2 {
        font-size: 1.65rem;
    }

    .about-page h3 {
        font-size: 1.25rem;
    }

    .about-page p,
    .about-page li,
    .about-page a {
        font-size: 1.03rem;
    }
}
/* ==============================
   管理画面：作品一覧をコンパクト表示
   ============================== */

.admin-filter-form {
    display: grid;
    grid-template-columns:
        minmax(240px, 2fr)
        repeat(3, minmax(150px, 1fr))
        auto
        auto;
    gap: 10px;
    align-items: center;
}

.admin-filter-form input,
.admin-filter-form select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.admin-works-compact-wrap {
    overflow-x: visible;
}

.admin-works-compact-table {
    width: 100%;
    table-layout: fixed;
}

.admin-works-compact-table th:nth-child(1) {
    width: 52%;
}

.admin-works-compact-table th:nth-child(2) {
    width: 18%;
}

.admin-works-compact-table th:nth-child(3) {
    width: 15%;
}

.admin-works-compact-table th:nth-child(4) {
    width: 15%;
}

.admin-work-summary {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
}

.admin-work-summary-cover {
    width: 72px;
}

.admin-work-summary .admin-thumbnail,
.admin-work-summary .admin-no-cover {
    width: 72px;
    height: 96px;
    box-sizing: border-box;
    object-fit: contain;
}

.admin-work-summary-info {
    min-width: 0;
}

.admin-work-summary-title {
    display: block;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.admin-work-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.admin-work-visibility-stack,
.admin-work-sales-status,
.admin-work-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.admin-work-visibility-stack {
    flex-direction: column;
}

.admin-work-sales-status {
    flex-direction: column;
}

.admin-work-sales-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.admin-work-sales-label {
    min-width: 52px;
    font-size: 0.85rem;
    font-weight: 700;
}

.admin-work-actions {
    align-items: center;
}

.admin-work-visibility-stack .admin-inline-form,
.admin-work-actions .admin-inline-form {
    margin: 0;
}

.admin-mobile-label {
    display: none;
}

@media (max-width: 1100px) {
    .admin-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .admin-filter-form {
        grid-template-columns: 1fr;
    }

    .admin-works-compact-table,
    .admin-works-compact-table tbody,
    .admin-works-compact-table tr,
    .admin-works-compact-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .admin-works-compact-table thead {
        display: none;
    }

    .admin-works-compact-table tr {
        margin-bottom: 16px;
        padding: 12px;
        border: 1px solid var(--color-border, #dddddd);
        border-radius: var(--radius-card, 10px);
        background: var(--color-surface, #ffffff);
    }

    .admin-works-compact-table td {
        padding: 8px 0;
        border: 0;
    }

    .admin-work-summary-cell {
        padding-top: 0;
    }

    .admin-mobile-label {
        display: block;
        margin-bottom: 7px;
        font-size: 0.85rem;
        font-weight: 700;
    }

    .admin-work-visibility-stack {
        flex-direction: row;
        align-items: center;
    }

    .admin-work-sales-status {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .admin-work-summary {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 10px;
    }

    .admin-work-summary-cover {
        width: 58px;
    }

    .admin-work-summary .admin-thumbnail,
    .admin-work-summary .admin-no-cover {
        width: 58px;
        height: 78px;
    }

    .admin-work-summary-meta {
        display: grid;
        gap: 3px;
    }
}
/* ==============================
   非公開作品：管理者プレビュー
   ============================== */

.admin-preview-banner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 18px;
    border: 2px solid #b7791f;
    border-radius: var(--radius-card, 10px);
    background: #fff8e6;
    color: #4a3200;
}

.admin-preview-banner strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.05rem;
}

.admin-preview-banner p {
    margin: 0;
    line-height: 1.7;
}

.admin-preview-banner .detail-button {
    flex: 0 0 auto;
}

@media (max-width: 700px) {
    .admin-preview-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-preview-banner .detail-button {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}
/* ==============================
   管理画面：検索できる選択欄
   ============================== */

.admin-searchable-select {
    margin: 0 0 20px;
}

.admin-searchable-select > label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

.admin-searchable-select-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-searchable-select-search input,
.admin-searchable-select select {
    width: 100%;
    box-sizing: border-box;
}

.admin-select-search-clear {
    white-space: nowrap;
}

.admin-select-search-result {
    min-height: 1.4em;
    margin: 6px 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555555;
}

@media (max-width: 480px) {
    .admin-searchable-select-search {
        grid-template-columns: 1fr;
    }

    .admin-select-search-clear {
        width: 100%;
    }
}
/* ==============================
   作品詳細：管理者用編集リンク
   ============================== */

.work-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.work-title-row h2 {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.work-admin-edit-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .work-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .work-admin-edit-button {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}
/* ==============================
   収録話管理：作品情報欄
   ============================== */

.admin-episode-work-summary {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px 18px;
    border: 1px solid var(--color-border, #dddddd);
    border-radius: var(--radius-card, 10px);
    background: var(--color-surface, #ffffff);
}

.admin-episode-work-summary p {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
    margin: 0;
}

.admin-episode-work-summary p > span {
    font-weight: 700;
    white-space: nowrap;
}

.admin-episode-work-summary strong {
    display: block;
    min-width: 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 480px) {
    .admin-episode-work-summary {
        padding: 14px;
    }

    .admin-episode-work-summary p {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 8px;
    }
}
/* ==============================
   作品詳細：複数話作品の主なタグ
   ============================== */

.work-summary-tags {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border, #dddddd);
}

.work-summary-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.work-summary-tag-more {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eeeeee;
    font-size: 0.85rem;
    line-height: 1.3;
}

.work-summary-tags-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 700;
}

#episode-tags {
    scroll-margin-top: 24px;
}
/* ==============================
   作品詳細：上部のタグ欄
   ============================== */

.work-top-tags-section {
    margin: 24px 0;
    padding: 18px 20px;
    border: 1px solid var(--color-border, #dddddd);
    border-radius: var(--radius-card, 10px);
    background: var(--color-surface, #ffffff);
}

.work-top-tags-section h3 {
    margin: 0 0 14px;
}

.work-top-tags-section .work-tag-category {
    margin-bottom: 12px;
}

.work-top-tags-section .work-tag-category:last-child {
    margin-bottom: 0;
}

.work-top-tags-section .work-summary-tag-list {
    margin-top: 0;
}

.work-top-tags-section .work-summary-tags-link {
    margin-top: 12px;
}

@media (max-width: 700px) {
    .work-top-tags-section {
        padding: 16px;
    }
}
/* 収録話管理：編集・削除ボタンのサイズを統一 */
.admin-episode-table td:last-child {
    white-space: nowrap;
}

.admin-episode-table td:last-child .detail-button,
.admin-episode-table td:last-child .delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 38px;
    margin: 0;
    padding: 0 12px;
    box-sizing: border-box;
    font: inherit;
    line-height: 1;
}

.admin-episode-table td:last-child .admin-inline-form {
    display: inline-flex;
    margin: 0 0 0 6px;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .admin-episode-table td:last-child {
        white-space: normal;
    }

    .admin-episode-table td:last-child .detail-button,
    .admin-episode-table td:last-child .delete-button {
        width: 100%;
        height: auto;
        min-height: 42px;
        padding: 11px 14px;
    }

    .admin-episode-table td:last-child .admin-inline-form {
        display: block;
        width: 100%;
        margin: 8px 0 0;
    }
}
/* 収録話管理：話数を縦に折り返さない */
.admin-episode-table th:first-child,
.admin-episode-table td:first-child {
    min-width: 72px;
    white-space: nowrap;
    text-align: center;
}
.admin-empty-text {
    color: #777;
    font-size: 0.9em;
}

/* ==============================
   Pagination
   ============================== */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 28px 0;
}

.pagination a,
.pagination .current-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: var(--radius-button);
    font-weight: 700;
    text-decoration: none;
}

.pagination a {
    background: var(--color-surface);
    color: var(--color-main);
    border: 1px solid var(--color-border);
}

.pagination a:hover {
    background: #eef4ff;
    border-color: #d6e4ff;
    text-decoration: none;
}

.pagination .current-page {
    background: var(--color-main);
    color: #fff;
    border: 1px solid var(--color-main);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: var(--color-muted);
}

@media (max-width: 600px) {
    .pagination {
        gap: 6px;
    }

    .pagination a,
    .pagination .current-page {
        min-width: 36px;
        min-height: 36px;
        padding: 7px 10px;
        font-size: 0.9rem;
    }
}
.episode-memo-label {
    margin-bottom: 6px;
    color: var(--color-main);
    font-weight: 700;
}

.episode-memo-text {
    line-height: 1.8;
}
/* ==============================
   管理画面：おすすめ特集
   ============================== */

.admin-table-description {
    margin-top: 6px;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.recommendation-items-form textarea {
    width: 100%;
    min-width: 260px;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    resize: vertical;
}

.recommendation-items-form input[type="number"] {
    width: 90px;
    padding: 9px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
}

.recommendation-items-form .delete-button {
    margin: 6px 0 0;
}

@media (max-width: 600px) {
    .recommendation-items-form textarea {
        min-width: 220px;
    }
}
/* ==============================
   公開ページ：おすすめ特集
   ============================== */

.recommendations-guide,
.recommendation-detail-header {
    padding: 18px 20px;
    margin: 20px 0 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    line-height: 1.8;
}

.recommendations-guide p,
.recommendation-detail-description {
    margin: 0 0 10px;
    color: var(--color-muted);
}

.recommendation-list {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 20px;
    margin-bottom: 32px;
}

.recommendation-card {
    padding: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.recommendation-card h3 {
    margin: 0 0 12px;
}

.recommendation-card h3 a {
    color: var(--color-main);
    text-decoration: none;
}

.recommendation-card h3 a:hover {
    text-decoration: underline;
}

.recommendation-description {
    margin-bottom: 14px;
    color: var(--color-muted);
    line-height: 1.8;
}

.recommendation-work-count {
    margin: 12px 0;
    font-weight: 700;
    color: var(--color-main);
}

.recommendation-detail-header h2 {
    margin-top: 0;
}

.recommendation-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.recommendation-work-list {
    display: grid;
    gap: 22px;
}

.recommendation-work-group {
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.recommendation-work-group .work-card {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.recommendation-comment {
    padding: 14px 18px 18px;
    background: #f8fafc;
    border-top: 1px solid var(--color-border);
}

.recommendation-comment-label {
    margin-bottom: 6px;
    color: var(--color-main);
    font-weight: 700;
}

.recommendation-comment-text {
    color: #444;
    line-height: 1.8;
}

@media (max-width: 700px) {
    .recommendation-list {
        grid-template-columns: 1fr;
    }

    .recommendation-detail-actions {
        display: block;
    }

    .recommendation-detail-actions .detail-button {
        width: 100%;
        margin: 6px 0;
    }

    .recommendation-comment {
        padding: 12px 14px 16px;
    }
}
/* おすすめ特集：作品カードとコメントを1つの枠にまとめる */
.recommendation-work-group {
    display: block;
    width: 100%;
    margin: 0 0 22px;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.recommendation-work-group > .work-card {
    width: 100%;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent;
}

.recommendation-work-group > .recommendation-comment {
    width: 100%;
    margin: 0;
    padding: 14px 18px 18px;
    background: #f8fafc;
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
}

.recommendation-comment-label {
    margin: 0 0 6px;
    color: var(--color-main);
    font-weight: 700;
}

.recommendation-comment-text {
    margin: 0;
    color: #444;
    line-height: 1.8;
}
/* おすすめ特集一覧：表紙サムネイル */
.recommendation-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.recommendation-card-thumbnail {
    display: block;
    flex: 0 0 120px;
    width: 120px;
    text-decoration: none;
}

.recommendation-card-thumbnail img,
.recommendation-thumbnail-placeholder {
    display: block;
    width: 120px;
    aspect-ratio: 7 / 10;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
}

.recommendation-card-thumbnail img {
    height: auto;
    object-fit: contain;
}

.recommendation-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    font-size: 0.85rem;
    text-align: center;
}

.recommendation-card-body {
    flex: 1;
    min-width: 0;
}

@media (max-width: 600px) {
    .recommendation-card {
        display: block;
    }

    .recommendation-card-thumbnail {
        width: 140px;
        margin: 0 auto 16px;
    }

    .recommendation-card-thumbnail img,
    .recommendation-thumbnail-placeholder {
        width: 140px;
    }
}
/* ==============================
   管理画面：収録話編集の作品概要
   ============================== */

.admin-episode-work-summary {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 16px 18px;
    margin: 16px 0 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.admin-episode-work-cover {
    display: block;
    flex: 0 0 100px;
    width: 100px;
    text-decoration: none;
}

.admin-episode-work-cover img,
.admin-episode-work-cover-placeholder {
    display: block;
    width: 100px;
    aspect-ratio: 7 / 10;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
}

.admin-episode-work-cover img {
    height: auto;
    object-fit: contain;
}

.admin-episode-work-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    font-size: 0.8rem;
    text-align: center;
}

.admin-episode-work-info {
    flex: 1;
    min-width: 0;
}

.admin-episode-work-label {
    margin-bottom: 5px;
    color: var(--color-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.admin-episode-work-info h3 {
    margin: 0 0 12px;
    overflow-wrap: anywhere;
}

.admin-episode-work-info p {
    margin: 0 0 14px;
}

.admin-episode-work-info p span {
    display: inline-block;
    margin-right: 8px;
    color: var(--color-muted);
    font-weight: 700;
}

@media (max-width: 600px) {
    .admin-episode-work-summary {
        gap: 14px;
        padding: 14px;
    }

    .admin-episode-work-cover {
        flex-basis: 82px;
        width: 82px;
    }

    .admin-episode-work-cover img,
    .admin-episode-work-cover-placeholder {
        width: 82px;
    }

    .admin-episode-work-info h3 {
        font-size: 1rem;
    }
}
/* ==============================
   トップページ：おすすめ特集
   ============================== */

.top-recommendation-section {
    margin: 32px 0;
}

.top-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.top-section-heading h2 {
    margin: 0 0 6px;
}

.top-section-heading p {
    margin: 0;
    color: var(--color-muted);
    line-height: 1.7;
}

.top-recommendation-list {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 20px;
}

.top-recommendation-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 18px;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.top-recommendation-thumbnail {
    display: block;
    flex: 0 0 120px;
    width: 120px;
    text-decoration: none;
}

.top-recommendation-thumbnail img,
.top-recommendation-placeholder {
    display: block;
    width: 120px;
    aspect-ratio: 7 / 10;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
}

.top-recommendation-thumbnail img {
    height: auto;
    object-fit: contain;
}

.top-recommendation-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    font-size: 0.85rem;
    text-align: center;
}

.top-recommendation-body {
    flex: 1;
    min-width: 0;
}

.top-recommendation-body h3 {
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.top-recommendation-body h3 a {
    color: var(--color-main);
    text-decoration: none;
}

.top-recommendation-body h3 a:hover {
    text-decoration: underline;
}

.top-recommendation-description {
    display: -webkit-box;
    margin-bottom: 12px;
    overflow: hidden;
    color: var(--color-muted);
    line-height: 1.7;
    -webkit-box-orient: vertical;

    line-clamp: 3;
    -webkit-line-clamp: 3;
}

@media (max-width: 800px) {
    .top-recommendation-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .top-section-heading {
        display: block;
    }

    .top-section-heading .small-button {
        display: inline-block;
        margin-top: 12px;
    }

    .top-recommendation-card {
        gap: 14px;
        padding: 14px;
    }

    .top-recommendation-thumbnail {
        flex-basis: 90px;
        width: 90px;
    }

    .top-recommendation-thumbnail img,
    .top-recommendation-placeholder {
        width: 90px;
    }

    .top-recommendation-body h3 {
        font-size: 1rem;
    }
    

   .top-recommendation-description {
        line-clamp: 2;
        -webkit-line-clamp: 2;
    }
}
.recommendation-target-select {
    width: 100%;
    min-width: 200px;
    padding: 9px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: #fff;
}
/* おすすめ特集：おすすめ対象話 */
.recommendation-target {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.recommendation-target-label {
    margin-bottom: 6px;
    color: var(--color-main);
    font-weight: 700;
}

.recommendation-target-link {
    display: inline-block;
    font-weight: 700;
    line-height: 1.6;
}

/* 該当話へのページ内移動 */
.episode-card {
    scroll-margin-top: 90px;
}

.episode-card:target {
    outline: 2px solid var(--color-main);
    outline-offset: 3px;
}
/* ==============================
   年齢確認オーバーレイ
   ============================== */

body.age-gate-active {
    overflow: hidden;
}

.age-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 16px;
    overflow-y: auto;
    background: #f5f5f5;
}

.age-gate-panel {
    width: min(100%, 520px);
    padding: 32px;
    text-align: center;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-card, 12px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.age-gate-label {
    display: inline-block;
    margin: 0 0 14px;
    padding: 5px 12px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--color-danger, #c0392b);
    border-radius: 999px;
}

.age-gate-panel h2 {
    margin: 0 0 18px;
}

.age-gate-panel p {
    margin: 0 0 14px;
}

.age-gate-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.age-gate-form .detail-button,
.age-gate-form .delete-button {
    width: 100%;
    min-height: 48px;
    margin: 0;
}

@media (max-width: 600px) {
    .age-gate-overlay {
        align-items: start;
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .age-gate-panel {
        padding: 24px 18px;
    }

    .age-gate-form {
        grid-template-columns: 1fr;
    }
}