:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-soft: #fafafa;
    --text: #30343b;
    --muted: #737984;
    --line: #dde1e6;
    --accent: #ffad8f;
    --accent-strong: #f48761;
    --accent-soft: #fff0e9;
    --accent-yellow: #ffe3a6;
    --danger: #c75252;
    --success: #3e7a58;
    --shadow: 0 10px 30px rgba(44, 47, 54, .07);
    --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    line-height: 1.75;
}
a { color: #b85b3b; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
.site-shell { width: min(92%, 880px); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.site-logo { color: var(--text); font-weight: 800; font-size: 1.25rem; letter-spacing: .04em; }
.global-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.global-nav a { color: var(--text); font-size: .94rem; }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 12px; }
.main-content { padding: 34px 0 70px; min-height: calc(100vh - 150px); }
.site-footer { background: #e8eaed; border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { padding: 28px 0; text-align: center; font-size: .9rem; }
.footer-inner nav { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.hero, .panel, .card, .form-card, .profile-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero { padding: 34px; margin-bottom: 26px; background: linear-gradient(135deg, #fff 0%, #fff4ee 100%); }
.hero h1 { margin: 0 0 10px; line-height: 1.35; font-size: clamp(1.7rem, 4vw, 2.45rem); }
.hero p { margin: 0; color: var(--muted); }
.panel { padding: 26px; margin-bottom: 24px; }
.panel h1, .panel h2, .panel h3 { margin-top: 0; line-height: 1.45; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 34px 0 14px; }
.section-title h2 { margin: 0; font-size: 1.35rem; }
.card-list { display: grid; gap: 14px; }
.card { padding: 20px; }
.card h2, .card h3 { margin: 0 0 8px; line-height: 1.45; }
.card p { margin: 6px 0; }
.meta { color: var(--muted); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; background: var(--accent-soft); color: #9e4e32; font-size: .82rem; font-weight: 700; }
.badge.type-NL { background: #ffe8dc; }
.badge.type-BL { background: #e7e5ff; color: #5f57a6; }
.badge.type-GL { background: #ffe0ee; color: #9e476c; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; margin: 3px 4px 3px 0; border-radius: 999px; background: #f0f1f3; color: #555d68; font-size: .86rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.button, button.button {
    display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 9px 18px;
    border: 1px solid transparent; border-radius: 12px; background: var(--accent); color: #4d2a1e; font-weight: 700; cursor: pointer;
}
.button:hover { background: var(--accent-strong); color: white; text-decoration: none; }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.button.danger { background: #fff0f0; color: var(--danger); border-color: #efc7c7; }
.button.small { min-height: 34px; padding: 5px 11px; font-size: .85rem; }
.form-card { padding: 26px; }
.form-row { margin-bottom: 20px; }
.form-row label, .field-title { display: block; font-weight: 700; margin-bottom: 7px; }
.required { color: var(--danger); margin-left: 4px; font-size: .85em; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], select, textarea {
    width: 100%; border: 1px solid #cfd4da; border-radius: 12px; padding: 12px 13px; background: #fff; color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(255,173,143,.28); border-color: var(--accent-strong); }
.help { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.checkbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.checkbox-item { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.flash { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; }
.flash-success { background: #eef8f1; border-color: #b7d7c2; color: var(--success); }
.flash-error { background: #fff0f0; border-color: #e8bcbc; color: var(--danger); }
.flash-info { background: #fff8e8; border-color: #ead39a; color: #795f22; }
.comment { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .84rem; margin-bottom: 8px; }
.comment-text { font-size: 1rem; margin: 0 0 8px; overflow-wrap: anywhere; }
.user-list { display: flex; flex-wrap: wrap; gap: 8px; }
.user-chip { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: #fff2eb; border: 1px solid #ffd3bf; }
.profile-grid { display: grid; gap: 14px; }
.profile-card { padding: 24px; }
.empty { padding: 24px; text-align: center; color: var(--muted); background: #f8f8f9; border-radius: 14px; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; padding: 7px 10px; text-align: center; border-radius: 9px; background: #fff; border: 1px solid var(--line); }
.pagination .current { background: var(--accent); border-color: var(--accent); font-weight: 700; }
.notice { padding: 14px 16px; background: #fff9e9; border: 1px solid #ead7a7; border-radius: 12px; }
.admin-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f6f6f7; font-size: .88rem; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-nav a { background: #fff; border: 1px solid var(--line); padding: 8px 11px; border-radius: 9px; }
.stat-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.stat { padding: 18px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.stat strong { display: block; font-size: 1.6rem; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 760px) {
    .site-shell { width: min(94%, 880px); }
    .header-inner { flex-wrap: wrap; padding: 12px 0; }
    .nav-toggle { display: block; }
    .global-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 4px; }
    .global-nav.is-open { display: flex; }
    .global-nav a { padding: 10px 4px; border-top: 1px solid var(--line); }
    .hero, .panel, .form-card, .profile-card { padding: 20px; border-radius: 15px; }
    .main-content { padding-top: 22px; }
    .checkbox-list { grid-template-columns: 1fr; }
    .stat-list { grid-template-columns: 1fr; }
    .actions .button { width: 100%; }
    .comment-head { flex-direction: column; gap: 2px; }
}

/* 2026-07 追加仕様 */
.reading {
    margin: -4px 0 8px;
    color: var(--muted);
    font-size: .88rem;
    letter-spacing: .03em;
}
.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}
.gojuon-index {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 22px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.gojuon-index a {
    display: inline-flex;
    min-width: 42px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--text);
}
.gojuon-index a.current {
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
}
.comment-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 7px;
    font-size: .8rem;
}
.subtle-link {
    color: #8b8f96;
    font-size: .82rem;
    text-decoration: underline;
    text-decoration-color: #c9ccd1;
    text-underline-offset: 3px;
}
.text-button {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.danger-text { color: var(--danger); }
.comment-accordion {
    margin-bottom: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.comment-accordion summary {
    padding: 20px 26px;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 750;
    list-style-position: inside;
}
.comment-accordion[open] summary {
    border-bottom: 1px solid var(--line);
    background: var(--accent-soft);
}
.accordion-body { padding: 22px 26px 26px; }
textarea.comment-textarea {
    min-height: 0;
    height: calc(2em * 1.75 + 26px);
    resize: vertical;
}
.report-area {
    padding: 8px 4px 0;
    text-align: right;
}
.message-box {
    padding: 16px;
    margin: 14px 0 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    white-space: normal;
    overflow-wrap: anywhere;
}
.admin-contact h2 { margin-bottom: 4px; }

@media (max-width: 760px) {
    .search-form { grid-template-columns: 1fr; }
    .search-form .button { width: 100%; }
    .gojuon-index { padding: 10px; gap: 5px; }
    .gojuon-index a { min-width: 38px; padding: 4px 8px; }
    .comment-accordion summary { padding: 18px 20px; }
    .accordion-body { padding: 18px 20px 22px; }
}

/* コメント投稿者表示 */
.radio-list { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-item { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.comment-author-link { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .radio-list { flex-direction: column; } }


/* 追加修正 */
.global-nav .nav-mypage {
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--accent);
    color: #4d2a1e;
    font-weight: 800;
    border: 1px solid #f4bda7;
}
.global-nav .nav-mypage:hover {
    background: var(--accent-strong);
    color: #fff;
    text-decoration: none;
}
.couple-type-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}
.couple-type-filter a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
}
.couple-type-filter a.current {
    background: var(--accent);
    border-color: var(--accent);
}
.character-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--text);
}
.character-card:hover,
.character-card.selected {
    border-color: var(--accent-strong);
    background: #fff7f2;
    text-decoration: none;
}
.faq-list {
    display: grid;
    gap: 12px;
}
.faq-list details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.faq-list summary {
    padding: 18px 22px;
    cursor: pointer;
    font-weight: 750;
}
.faq-list details[open] summary {
    background: var(--accent-soft);
    border-bottom: 1px solid var(--line);
}
.faq-list details p {
    margin: 0;
    padding: 18px 22px 22px;
    line-height: 1.9;
}
@media (max-width: 760px) {
    .global-nav .nav-mypage {
        margin: 6px 0;
        text-align: center;
        border-top: 0;
    }
    .couple-type-filter a { flex: 1 1 calc(50% - 8px); }
}

/* 見出し装飾・ランキング・タブ・マイページコメント */
.panel > h1,
.panel > h2,
.form-card > h1,
.form-card > h2,
.profile-card > h1,
.profile-card > h2,
.section-title h2 {
    position: relative;
    padding-left: 16px;
}
.panel > h1::before,
.panel > h2::before,
.form-card > h1::before,
.form-card > h2::before,
.profile-card > h1::before,
.profile-card > h2::before,
.section-title h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: .18em;
    bottom: .18em;
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--accent-yellow));
}
.section-title h2::after,
.panel > h2::after,
.form-card > h2::after,
.profile-card > h2::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    margin-top: 7px;
    border-radius: 999px;
    background: var(--accent-soft);
}
.section-note {
    color: var(--muted);
    font-size: .85rem;
}
.stat-list-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-stats-panel .stat { text-align: center; }
.site-stats-panel .stat span { color: var(--muted); }
.content-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 20px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.content-tabs a {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    text-align: center;
    font-weight: 700;
}
.content-tabs a.current {
    background: var(--accent);
    color: #4d2a1e;
}
.ranking-list {
    display: grid;
    gap: 10px;
}
.ranking-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.ranking-body h3 { margin: 0; }
.ranking-body .reading { margin: 3px 0 0; }
.rank-number {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent));
    color: #70402f;
    font-weight: 800;
}
.small-rank {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
}
.ranking-count { color: #a75639; white-space: nowrap; }
.work-list-card {
    display: flex;
    gap: 14px;
    align-items: center;
}
.work-card-body { min-width: 0; flex: 1; }
.latest-comments-panel { padding-top: 8px; padding-bottom: 8px; }
.latest-comment .meta { margin-bottom: 0; }
.my-comment-list { display: grid; gap: 12px; }
.my-comment-card {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
}
.my-comment-card .comment-text { margin-top: 10px; }
.status-badge { margin-left: 6px; }
.status-public { background: #e8f6ed; color: #38704f; }
.status-pending { background: #fff3d5; color: #7b6227; }
.status-hidden,
.status-deleted_by_admin { background: #f1f1f3; color: #666b73; }
.status-deleted_by_user { background: #f6eaea; color: #8a5555; }
.comment[id] { scroll-margin-top: 90px; }

@media (max-width: 760px) {
    .content-tabs { grid-template-columns: 1fr; }
    .ranking-row { grid-template-columns: auto minmax(0, 1fr); }
    .ranking-count { grid-column: 2; }
    .stat-list-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 管理画面：未処理・追加・公開画面リンク */
.admin-pending-panel { border-color: #efcdbf; }
.admin-pending-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.admin-pending-card {
    display: block;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
}
.admin-pending-card:hover {
    border-color: var(--accent-strong);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.admin-pending-card span,
.admin-pending-card small { display: block; }
.admin-pending-card strong {
    display: block;
    margin: 4px 0;
    font-size: 2rem;
    line-height: 1.2;
}
.admin-pending-card small { color: var(--muted); }
.pending-report { background: #fff7f2; }
.pending-delete { background: #fff9e9; }
.pending-contact { background: #f5f3ff; }
.admin-nav a.admin-nav-add {
    background: var(--accent-soft);
    border-color: #f2c9b9;
    font-weight: 700;
}
.admin-heading-actions {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-heading-actions .actions { margin-top: 0; }
.admin-search-form { flex: 1 1 420px; }
.admin-public-link {
    display: inline-block;
    white-space: nowrap;
    font-size: .86rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
@media (max-width: 760px) {
    .admin-pending-grid { grid-template-columns: 1fr; }
    .admin-heading-actions { align-items: stretch; }
    .admin-heading-actions > .button { width: 100%; }
}

/* 大規模メンテナンス：一般ユーザー操作停止 */
.maintenance-public-notice {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0 0 20px;
    padding: 14px 18px;
    border: 1px solid #e5bcae;
    border-radius: 13px;
    background: #fff3ed;
    color: #6f3c2d;
}
.maintenance-public-notice strong { white-space: nowrap; }
.nav-maintenance-disabled {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #ece9e7;
    color: #77716e;
    font-weight: 700;
    cursor: not-allowed;
}
.maintenance-disabled-form {
    opacity: .7;
}
.maintenance-disabled-form input:disabled,
.maintenance-disabled-form textarea:disabled,
.maintenance-disabled-form select:disabled {
    background: #f0eeee;
    color: #847e7a;
    cursor: not-allowed;
}
.button.maintenance-stopped-button,
.maintenance-stopped-button,
.maintenance-stopped-button:disabled {
    border-color: #d7d2cf;
    background: #d7d2cf;
    color: #6f6b68;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}
.maintenance-disabled-link {
    pointer-events: none;
    border-color: #d7d2cf !important;
    background: #d7d2cf !important;
    color: #6f6b68 !important;
    text-decoration: none !important;
    cursor: not-allowed;
}
.admin-maintenance-strip {
    margin: 0 0 10px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .9rem;
}
.admin-maintenance-strip.is-open {
    background: #edf8f1;
    color: #35684a;
    border-color: #bcdcc7;
}
.admin-maintenance-strip.is-stopped {
    background: #fff0ea;
    color: #82452f;
    border-color: #e7bcae;
}
.admin-maintenance-control {
    border-width: 2px;
}
.admin-maintenance-control.is-open {
    border-color: #bcdcc7;
    background: #f8fdf9;
}
.admin-maintenance-control.is-stopped {
    border-color: #e7bcae;
    background: #fff8f5;
}
.admin-maintenance-control-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.admin-maintenance-current {
    flex: 0 0 auto;
    padding: 9px 13px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
}
.button.danger {
    background: #bb5b43;
    border-color: #a84e39;
    color: #fff;
}
.button.danger:hover { background: #9f4936; }
tr[id^="character-"] { scroll-margin-top: 90px; }
tr[id^="character-"]:target td { background: #fff4dc; }

@media (max-width: 760px) {
    .maintenance-public-notice,
    .admin-maintenance-control-head {
        align-items: stretch;
        flex-direction: column;
    }
    .maintenance-public-notice strong { white-space: normal; }
    .admin-maintenance-current { align-self: flex-start; }
}


/* 管理画面：状態表示 */
.admin-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}
.admin-status-badge.is-public {
    color: #2e6a48;
    background: #e9f7ee;
    border-color: #b9ddc7;
}
.admin-status-badge.is-pending {
    color: #7a5c17;
    background: #fff4d4;
    border-color: #ead395;
}
.admin-status-badge.is-hidden {
    color: #5e6268;
    background: #f0f1f3;
    border-color: #d6d8dc;
}
.admin-status-badge.is-deleted {
    color: #87493f;
    background: #f9eae7;
    border-color: #e7c0ba;
}
.admin-status-badge.is-neutral {
    color: #5c5963;
    background: #f2eff7;
    border-color: #d9d2e5;
}
.admin-comments-table .admin-comment-row.is-public td:first-child { border-left: 5px solid #73b58a; }
.admin-comments-table .admin-comment-row.is-pending td:first-child { border-left: 5px solid #d6ad46; }
.admin-comments-table .admin-comment-row.is-hidden td:first-child { border-left: 5px solid #a7abb1; }
.admin-comments-table .admin-comment-row.is-deleted td:first-child { border-left: 5px solid #c78378; }
.admin-comments-table .admin-comment-row.is-hidden,
.admin-comments-table .admin-comment-row.is-deleted { background: #fbfaf9; }
.admin-comment-text { min-width: 240px; max-width: 440px; line-height: 1.65; }
.admin-status-form select { min-width: 126px; }
.admin-public-unavailable { color: var(--muted); font-size: .84rem; white-space: nowrap; }
tr[id^="comment-"] { scroll-margin-top: 90px; }
tr[id^="comment-"]:target td { background: #fff4dc; }


/* =========================================================
   推しカプ図鑑 ビジュアルテーマ
   /img/top.png, img1.png, img2.png, img3.png を使用
========================================================= */
:root {
    --bg: #faf7fc;
    --surface: rgba(255, 255, 255, .94);
    --surface-soft: rgba(252, 249, 255, .92);
    --text: #4b4257;
    --muted: #80768d;
    --line: #e7dced;
    --accent: #dca6c8;
    --accent-strong: #bb78a7;
    --accent-soft: #f8ebf4;
    --accent-yellow: #f8e9c8;
    --danger: #b9566c;
    --success: #5d8b75;
    --shadow: 0 14px 38px rgba(91, 67, 105, .10);
    --radius: 20px;
}
body {
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(252, 249, 255, .82), rgba(252, 249, 255, .92)),
        url("../img/img3.png");
    background-position: center 68px;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
}
body.page-index {
    background-image:
        linear-gradient(rgba(252, 249, 255, .83), rgba(252, 249, 255, .94)),
        url("../img/img2.png");
}
body.page-work,
body.page-couple,
body.page-profile,
body.page-mypage {
    background-image:
        linear-gradient(rgba(252, 249, 255, .80), rgba(252, 249, 255, .94)),
        url("../img/img1.png");
}
body.page-admin,
body.page-admin-login,
body.page-admin-setup {
    background-image:
        linear-gradient(rgba(250, 248, 252, .93), rgba(250, 248, 252, .97)),
        url("../img/img3.png");
}
a { color: #9d5f8c; }
a:hover { color: #7d456d; }
.site-shell { width: min(94%, 920px); }
.site-header {
    background: rgba(255, 252, 255, .94);
    border-bottom-color: rgba(215, 191, 222, .78);
    box-shadow: 0 5px 20px rgba(92, 67, 106, .06);
}
.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #72577f;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: 1.34rem;
    letter-spacing: .08em;
}
.site-logo:hover { color: #9b628c; text-decoration: none; }
.site-logo-mark {
    display: inline-grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border: 1px solid #ddbdd5;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, #f3ddea);
    color: #c77eae;
    font-family: sans-serif;
    line-height: 1;
}
.global-nav a { color: #5e5269; }
.global-nav a:hover { color: #a15f8e; text-decoration: none; }
.main-content { padding-top: 28px; }
.hero, .panel, .card, .form-card, .profile-card {
    background: var(--surface);
    border-color: rgba(220, 202, 227, .9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(7px);
}
.panel, .card, .form-card, .profile-card { position: relative; overflow: hidden; }
.panel::after, .form-card::after, .profile-card::after {
    content: "";
    position: absolute;
    right: -32px;
    top: -38px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(231, 190, 216, .18), transparent 67%);
    pointer-events: none;
}
.button, button.button {
    border-color: #cfa2c1;
    background: linear-gradient(135deg, #dba5c8, #c88ab5);
    color: #fff;
    box-shadow: 0 7px 16px rgba(173, 105, 151, .16);
}
.button:hover { background: linear-gradient(135deg, #c98eb7, #b875a4); }
.button.secondary {
    background: rgba(255,255,255,.88);
    border-color: #dbc9e1;
    color: #6c5b76;
    box-shadow: none;
}
.badge { border-color: rgba(196, 156, 190, .75); }
.section-title h2,
.panel > h1,
.panel > h2,
.form-card > h1,
.form-card > h2,
.profile-card > h1,
.profile-card > h2 {
    color: #685273;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    letter-spacing: .035em;
}
.section-title h2::before,
.panel > h1::before,
.panel > h2::before,
.form-card > h1::before,
.form-card > h2::before,
.profile-card > h1::before,
.profile-card > h2::before {
    background: linear-gradient(180deg, #dc9fc6, #bfa4dc);
    box-shadow: 0 0 0 4px rgba(222, 184, 212, .16);
}
.section-title h2::after,
.panel > h2::after,
.form-card > h2::after,
.profile-card > h2::after {
    background: linear-gradient(90deg, #d79cc2, #c5b0e2, transparent);
}
.site-footer {
    position: relative;
    overflow: hidden;
    border-top-color: #ddcfe4;
    background:
        linear-gradient(rgba(250, 246, 252, .91), rgba(242, 234, 247, .95)),
        url("../img/img2.png") center 64% / cover no-repeat;
    color: #73677d;
}
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,.18), transparent, rgba(255,255,255,.16));
    pointer-events: none;
}
.footer-inner { position: relative; z-index: 1; }

/* トップページのメイン画像 */
.home-visual {
    margin: 0 0 18px;
    overflow: hidden;
    border: 1px solid rgba(214, 190, 222, .85);
    border-radius: 24px;
    background: #f7edf6;
    box-shadow: 0 18px 48px rgba(88, 63, 102, .13);
}
.home-visual img {
    display: block;
    width: 100%;
    height: auto;
}
.home-intro {
    padding: 24px 28px;
    text-align: center;
    background: rgba(255, 253, 255, .93);
}
.home-intro p { margin: 5px 0; }
.home-intro-lead {
    color: #72577d;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: clamp(1.08rem, 2.7vw, 1.34rem);
    font-weight: 700;
    letter-spacing: .03em;
}
.home-intro .actions { justify-content: center; }
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 通報対象 */
.report-target-box {
    display: grid;
    gap: 3px;
    margin: 0 0 22px;
    padding: 16px 18px;
    border: 1px solid #dfcde5;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(250,239,247,.94), rgba(246,242,252,.94));
}
.report-target-box span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}
.report-target-box strong {
    color: #634e70;
    font-size: 1.08rem;
}
.report-target-box small { color: var(--muted); }

@media (max-width: 760px) {
    body {
        background-attachment: scroll;
        background-size: auto 720px;
    }
    .site-shell { width: min(94%, 920px); }
    .home-visual { border-radius: 16px; }
    .home-intro { padding: 20px 18px; }
    .site-logo { font-size: 1.16rem; }
}


/* =========================================================
   ページ別背景画像を確実に表示する固定レイヤー
========================================================= */
body {
    --page-bg-image: url("../img/img3.png");
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background: #faf7fc;
    background-image: none !important;
}
body.page-index { --page-bg-image: url("../img/img2.png"); }
body.page-work,
body.page-couple,
body.page-profile,
body.page-mypage { --page-bg-image: url("../img/img1.png"); }
body.page-admin,
body.page-admin-login,
body.page-admin-setup { --page-bg-image: url("../img/img3.png"); }
body::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 68px 0 0;
    background-image:
        linear-gradient(180deg, rgba(255, 252, 255, .20), rgba(250, 246, 252, .50)),
        var(--page-bg-image);
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    filter: saturate(1.08) contrast(1.03);
    pointer-events: none;
}
body.page-index::before {
    background-image:
        linear-gradient(180deg, rgba(255, 252, 255, .14), rgba(250, 246, 252, .48)),
        var(--page-bg-image);
    background-position: center 28%;
}
body.page-work::before,
body.page-couple::before,
body.page-profile::before,
body.page-mypage::before {
    background-position: center 32%;
}
body.page-admin::before {
    background-image:
        linear-gradient(180deg, rgba(255, 252, 255, .56), rgba(250, 246, 252, .72)),
        var(--page-bg-image);
}
.main-content { position: relative; }

/* 広告インクルード。中身が空ならHTML自体が出力されません。 */
.ad-slot {
    width: 100%;
    margin: 20px auto 26px;
    text-align: center;
    overflow: hidden;
}
.ad-slot img,
.ad-slot iframe {
    max-width: 100%;
}
.ad-slot-above-content { margin-top: 0; }
.ad-slot-below-content { margin-top: 34px; margin-bottom: 0; }

@media (max-width: 760px) {
    body::before {
        inset: 62px 0 0;
        background-size: auto 760px;
        background-position: center top;
    }
    body.page-index::before,
    body.page-work::before,
    body.page-couple::before,
    body.page-profile::before,
    body.page-mypage::before {
        background-position: center top;
    }
}


/* =========================================================
   トップページ：新規作品・会員登録
========================================================= */
.new-work-list {
    display: grid;
    gap: 12px;
}
.new-work-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 20px;
    border: 1px solid rgba(214, 198, 224, .9);
    border-radius: 16px;
    background: rgba(255, 253, 255, .91);
    box-shadow: 0 8px 24px rgba(81, 61, 96, .06);
}
.new-work-main { min-width: 0; }
.new-work-main h3 { margin: 0 0 3px; font-size: 1.05rem; }
.new-work-main .reading { margin: 0; }
.new-work-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 12px;
    color: var(--muted);
    font-size: .84rem;
    white-space: nowrap;
}
.new-work-meta span {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(241, 233, 247, .82);
}
.new-work-meta time { align-self: center; }
.member-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
    margin-top: 36px;
    padding: 30px 34px;
    border-color: rgba(214, 177, 207, .92);
    background:
        linear-gradient(135deg, rgba(255, 251, 254, .96), rgba(246, 239, 251, .94));
}
.member-cta-kicker {
    margin: 0 0 4px;
    color: #aa6e98;
    font-size: .83rem;
    font-weight: 800;
    letter-spacing: .08em;
}
.member-cta h2 { margin-top: 0; }
.member-cta-lead {
    margin: 8px 0 15px;
    color: #66566e;
    font-weight: 700;
}
.member-benefit-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.member-benefit-list li {
    position: relative;
    padding-left: 1.45em;
}
.member-benefit-list li::before {
    content: "♥";
    position: absolute;
    left: 0;
    color: #d28caf;
    font-size: .88em;
}
.member-cta-side {
    display: grid;
    gap: 18px;
    min-width: 240px;
}
.member-cta-action {
    min-width: 220px;
    text-align: center;
}
.new-members-box {
    padding: 16px 17px;
    border: 1px solid rgba(214, 193, 223, .9);
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
}
.new-members-box h3 {
    margin: 0 0 10px;
    color: #765c80;
    font-size: .98rem;
    text-align: center;
}
.new-member-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.new-member-list li {
    min-width: 0;
    padding: 6px 9px;
    border-radius: 10px;
    background: rgba(246, 238, 249, .86);
    text-align: center;
}
.new-member-list a {
    display: block;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.member-register-button {
    width: 100%;
    padding: 14px 22px;
    font-size: 1.03rem;
}
.member-cta-action .help {
    max-width: 240px;
    margin: 9px auto 0;
}

/* =========================================================
   作品ページ：カップル並び替え
========================================================= */
.couple-sort-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(215, 202, 225, .9);
    border-radius: 14px;
    background: rgba(255, 253, 255, .78);
}
.couple-sort-label {
    margin-right: 3px;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 800;
}
.couple-sort-filter a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid #d9cbe2;
    border-radius: 999px;
    background: #fff;
    color: #6f5b78;
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
}
.couple-sort-filter a:hover,
.couple-sort-filter a.current {
    border-color: #c58fb5;
    background: linear-gradient(135deg, #efd8e8, #e6dcf3);
    color: #65446c;
}
.couple-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
}

@media (max-width: 760px) {
    .new-work-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }
    .new-work-meta {
        justify-content: flex-start;
        white-space: normal;
    }
    .member-cta {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 24px 20px;
    }
    .member-cta-side,
    .member-cta-action { min-width: 0; }
    .new-members-box { padding: 15px; }
    .couple-sort-filter {
        align-items: stretch;
    }
    .couple-sort-label {
        width: 100%;
    }
    .couple-sort-filter a {
        justify-content: center;
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }
}


/* =========================================================
   会員案内・利用フロー・登録フォーム・共有ボタン
========================================================= */
.site-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0 8px;
    text-align: left;
}
.site-flow-step {
    position: relative;
    min-width: 0;
    padding: 17px 14px 15px;
    border: 1px solid rgba(214, 193, 223, .88);
    border-radius: 15px;
    background: rgba(255,255,255,.78);
}
.site-flow-step > span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dca6c8, #bfa4dc);
    color: #fff;
    font-weight: 800;
}
.site-flow-step strong,
.site-flow-step small { display: block; }
.site-flow-step strong { color: #66516f; }
.site-flow-step small { margin-top: 4px; color: var(--muted); line-height: 1.55; }

.member-benefit-banner {
    position: fixed;
    z-index: 60;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 56px;
    padding: 10px 58px 10px 20px;
    border-top: 1px solid rgba(202, 159, 192, .95);
    background: linear-gradient(90deg, rgba(112, 78, 121, .97), rgba(166, 95, 142, .97));
    box-shadow: 0 -8px 24px rgba(68, 46, 75, .18);
    color: #fff;
}
.member-benefit-banner[hidden] { display: none !important; }
.member-benefit-banner-link {
    color: #fff;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.member-benefit-banner-link:hover { color: #fff; }
.member-benefit-banner-close {
    position: absolute;
    right: 16px;
    top: 50%;
    width: 34px;
    height: 34px;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.field-note-inline {
    margin-left: 6px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 400;
}
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 52px; }
.password-toggle {
    position: absolute;
    right: 7px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #74677d;
    cursor: pointer;
}
.password-toggle:hover,
.password-toggle.is-visible { background: #f3eaf5; color: #9c5e8a; }
.password-eye { font-size: 1rem; letter-spacing: -.18em; }

.profile-inline-links {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed rgba(205, 184, 215, .9);
}
.profile-inline-links p { margin: 6px 0; }

.section-bottom-action {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px;
}
.couple-work-name {
    margin: 8px 0 14px;
    color: var(--muted);
    font-size: 1.08rem;
    font-weight: 700;
}
.couple-work-name a { font-size: 1.18rem; }
.couple-work-name span { font-size: .92rem; font-weight: 400; }
.x-share-button {
    border-color: #111 !important;
    background: #111 !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(0,0,0,.18) !important;
}
.x-share-button:hover { background: #303030 !important; }
.note-write-button {
    border-color: #2e9f69 !important;
    background: linear-gradient(135deg, #41b883, #27945f) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(39,148,95,.18) !important;
}
.note-write-button:hover { background: linear-gradient(135deg, #319f70, #237f55) !important; }

@media (max-width: 760px) {
    .site-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .member-benefit-banner { justify-content: flex-start; padding-left: 16px; font-size: .94rem; }
    .field-note-inline { display: inline; margin-left: 3px; }
    .couple-header .actions .button { flex: 1 1 calc(50% - 8px); }
}
@media (max-width: 420px) {
    .site-flow { grid-template-columns: 1fr; }
    .couple-header .actions .button { flex-basis: 100%; }
}
