/* =========================================================
   サイト全体の基本設定
========================================================= */
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: #f7f7f7;
    color: #333333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================
   ヘッダー・ナビゲーション
========================================================= */
.site-header {
    background-color: #ffffff;
    border-bottom: 3px solid #cc0000;
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.site-header h1 {
    margin: 0;
    font-size: 24px;
}

.site-header h1 a {
    color: #333333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-header h1 a:hover {
    color: #cc0000;
}

.site-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #666666;
}

.top-nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.top-nav-menu a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888888;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.top-nav-menu a:hover {
    color: #cc0000;
    text-decoration: underline;
}

.breadcrumb {
    font-size: 13px;
    color: #666666;
    margin-top: 10px;
}

.breadcrumb a {
    color: #cc0000;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* =========================================================
   メインコンテンツ・作品一覧
========================================================= */
.works-section {
    background-color: #ffffff;
    padding: 30px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.works-section h2 {
    margin-top: 0;
    border-left: 5px solid #333333;
    padding-left: 10px;
    font-size: 20px;
}

.works-section .work-heading,
.track-heading h2 {
    border-left-color: var(--work-accent, #bb332b);
}

.work-heading--th06 {
    --work-accent: #852f40;
}

.work-heading--th07 {
    --work-accent: #975275;
}

.work-heading--th08 {
    --work-accent: #39447b;
}

.work-heading--th09 {
    --work-accent: #806923;
}

.work-heading--th10 {
    --work-accent: #3f6234;
}

.work-heading--th11 {
    --work-accent: #a0472b;
}

.work-heading--th12 {
    --work-accent: #305e8d;
}

.work-heading--th13 {
    --work-accent: #6c5686;
}

.work-heading--th14 {
    --work-accent: #925131;
}

.work-heading--th15 {
    --work-accent: #504687;
}

.work-heading--th16 {
    --work-accent: #8a5b22;
}

.work-heading--th17 {
    --work-accent: #62504a;
}

.work-heading--th18 {
    --work-accent: #34675c;
}

.work-heading--th19 {
    --work-accent: #586629;
}

.work-heading--th20 {
    --work-accent: #286986;
}

.work-heading .work-heading-name {
    color: var(--work-accent, inherit);
    font-family: "Yu Mincho", YuMincho, "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS PMincho", serif;
    font-weight: 700;
}

.description {
    font-size: 14px;
    color: #555555;
    margin-bottom: 20px;
}

/* トップの検索と新着コメント */
.home-page {
    background-color: #f7f7f7;
}

.home-page .works-section {
    background-color: #ffffff;
    padding: 24px 26px;
    margin-bottom: 20px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    box-shadow: none;
}

.home-page .works-section h2 {
    border-left: 3px solid #bb332b;
    padding-left: 10px;
    font-size: 20px;
    margin-bottom: 16px;
}

.home-page .title-wrap h2 {
    margin-bottom: 0;
}

.home-about {
    margin-bottom: 6px;
}

.home-intro-note {
    margin: 0 0 20px;
    color: #666666;
    font-size: 13px;
}

.home-weekly {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid #e8cbc5;
}

.home-weekly-label {
    margin: 0 0 4px;
    color: #9d4c43;
    font-size: 12px;
    font-weight: bold;
}

.home-weekly-link {
    display: block;
    min-height: 44px;
    padding: 6px 0;
    color: #333333;
    text-decoration: none;
}

.home-weekly-title {
    display: block;
    font-size: 16px;
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-decoration-color: #b9837f;
    text-underline-offset: 3px;
}

.home-weekly-work {
    display: block;
    margin-top: 3px;
    color: #777777;
    font-size: 12px;
}

.home-weekly-link:hover .home-weekly-title {
    color: #a60000;
    text-decoration-color: currentColor;
}

.home-search label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
}

.home-search-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.home-search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 2px solid #dddddd;
    border-radius: 6px;
    font: inherit;
    font-size: 16px;
}

.home-search .submit-btn {
    flex-shrink: 0;
    font-size: 16px;
}

.home-work-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: #a60000;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    text-underline-offset: 3px;
}

.home-work-link::after {
    content: "";
    width: 5px;
    height: 5px;
    margin-top: -3px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
}

.home-work-link:hover {
    text-decoration: underline;
}

.home-search input:focus-visible,
.home-work-link:focus-visible,
.home-weekly-link:focus-visible,
.recent-comment-link:focus-visible,
.recent-retry:focus-visible {
    outline: 3px solid #cc0000;
    outline-offset: 3px;
}

.recent-comments-more:focus-visible,
.recent-comments-toggle:focus-visible {
    outline: 2px solid #b44747;
    outline-offset: 3px;
}

.home-recent .title-wrap {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.recent-comments-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-comments-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #666666;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.recent-comments-toggle::after {
    content: "";
    width: 5px;
    height: 5px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(225deg);
}

.recent-comments-toggle[aria-expanded="false"]::after {
    transform: rotate(45deg);
}

.recent-comments-toggle:hover {
    color: #a60000;
}

.recent-comments-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.recent-comments-list li + li {
    border-top: 1px solid #eeeeee;
}

.recent-comment-link {
    display: block;
    padding: 16px 8px;
    color: #333333;
    text-decoration: none;
    border-radius: 4px;
    overflow-wrap: anywhere;
}

.recent-comment-link:hover {
    background-color: #fdf5f5;
}

.recent-comment-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.recent-comment-track {
    display: block;
    flex: 1;
    min-width: 0;
    color: #a60000;
    font-size: 16px;
}

.recent-comment-date {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
    color: #666666;
}

.recent-comment-work {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #666666;
}

.recent-comment-text {
    margin: 8px 0 10px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
    overflow: hidden;
    max-height: 3.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recent-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 12px;
    color: #666666;
}

.recent-retry {
    border: 1px solid #cccccc;
    border-radius: 6px;
    padding: 8px 12px;
    background-color: #ffffff;
    color: #555555;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
}

.recent-comments-more {
    display: none;
    width: fit-content;
    margin: 4px 0 0 auto;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #a60000;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.recent-comments-more:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.works-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.works-list li {
    border-bottom: 1px solid #eeeeee;
}

.works-list a,
.works-list .work-unavailable {
    display: flex;
    align-items: center;
    padding: 15px 10px;
    text-decoration: none;
    color: #333333;
    transition: background-color 0.2s;
}

.works-list a:hover {
    background-color: #fdf5f5;
}

.works-list .work-unavailable {
    color: #777777;
    cursor: default;
}

.work-number {
    font-size: 13px;
    color: #888888;
    width: 100px;
    flex-shrink: 0;
}

.search-work-name {
    width: 120px;
}

.work-title {
    font-size: 16px;
    font-weight: bold;
}

/* 楽曲のしおり・コメント件数。作品一覧の行には適用しません。 */
.works-list .track-catalog-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.track-catalog-row > a {
    flex: 1;
    min-width: 0;
}

.track-catalog-row .work-title {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.comment-count {
    flex-shrink: 0;
    margin-left: 10px;
    color: #777777;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
}

.bookmark-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #777777;
    font: inherit;
    font-size: 14px;
    vertical-align: middle;
    cursor: pointer;
}

.bookmark-icon {
    display: block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.bookmark-button:hover {
    background: #fdf5f5;
}

.bookmark-button[aria-pressed="true"] {
    color: #b44747;
    background: #fff0ed;
    border-color: #edc9c1;
}

.bookmark-button-label {
    border-color: #dddddd;
    padding: 6px 12px;
    font-size: 14px;
}

.track-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.track-heading h2 {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.track-credits {
    margin: -8px 0 20px;
    color: #666666;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.video-status {
    margin: 0 0 24px;
    color: #666666;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.video-status a {
    margin-left: 0.5em;
    color: #a3293a;
    text-underline-offset: 3px;
}

.track-heading-bookmark {
    flex-shrink: 0;
}

.track-heading-bookmark .bookmark-button {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    padding: 0;
    line-height: 1;
}

.bookmark-button:focus-visible,
.bookmark-filter input:focus-visible {
    outline: 2px solid #b44747;
    outline-offset: 2px;
}

.catalog-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 12px 0;
    font-size: 14px;
}

.catalog-tools[hidden],
.track-credits[hidden],
.video-status[hidden],
.video-status a[hidden],
.track-heading-bookmark[hidden] {
    display: none;
}

.bookmark-filter {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 6px;
    cursor: pointer;
}

.bookmark-filter input {
    width: 18px;
    height: 18px;
    accent-color: #b44747;
}

.catalog-note {
    color: #777777;
    font-size: 12px;
}

.catalog-search-field {
    margin-bottom: 12px;
}

.catalog-empty {
    padding: 15px 10px;
    color: #777777;
}

.bookmark-status {
    color: #a13d3d;
    font-size: 13px;
}

.bookmark-status:empty {
    display: none;
}

.home-page .works-heading {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px 16px;
    margin-bottom: 12px;
}

.work-category-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 18px;
    margin-left: auto;
    font-size: 13px;
}

.work-category-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    min-height: 36px;
    color: #666666;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.work-category-nav a:hover {
    color: #a60000;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.work-category-nav a::after {
    content: "";
    flex-shrink: 0;
    width: 4px;
    height: 4px;
    margin-top: -3px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.6;
}

.work-category-nav a:focus-visible {
    outline: 2px solid #b44747;
    outline-offset: 3px;
}

.home-page .category-title {
    scroll-margin-top: 16px;
}

.category-title {
    margin-top: 40px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    font-size: 18px;
    color: #333333;
    border-bottom: 2px solid #dddddd;
}

.works-section .category-title:first-of-type {
    margin-top: 20px;
}

.work-info {
    background-color: #fdfdfd;
    border: 1px solid #eeeeee;
    padding: 15px 20px;
    margin-top: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.work-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.work-info li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.work-info li:last-child {
    margin-bottom: 0;
}

.work-info-label {
    font-weight: bold;
    color: #cc0000;
    width: 120px;
    flex-shrink: 0;
}

/* =========================================================
   Music Room（ZUNコメント）
========================================================= */
.zun-comment {
    background-color: #fdfdfd;
    border-left: 4px solid #cc0000;
    padding: 15px 20px;
    margin-top: 10px;
    margin-bottom: 30px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.zun-comment::before {
    content: "Music Room Comment";
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: #cc0000;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.zun-comment p {
    font-size: 14px;
    color: #555555;
    margin: 0;
    white-space: pre-wrap;
}

/* =========================================================
   メディアコンテナ（動画プレイヤー）
========================================================= */
.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    margin-bottom: 20px;
}

.video-container iframe,
.video-container div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-container.ratio-4-3 {
    padding-top: 75%;
}

.video-container.ratio-1-1 {
    padding-top: 0;
    aspect-ratio: 1 / 1;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================
   コメントエリア全般
========================================================= */
.comment-area {
    margin-top: 40px;
    border-top: 1px solid #dddddd;
    padding-top: 20px;
}

.comments-heading {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
    gap: 8px 16px;
}

.more-replies-btn {
    margin-top: 10px;
    margin-left: 40px;
}

.comment-name-input,
.comment-form textarea,
.reply-form-container textarea {
    display: block;
    box-sizing: border-box;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid #cccccc;
    background-color: #ffffff;
    color: #333333;
    font: inherit;
    font-size: 13px;
    line-height: normal;
}

.comment-name-input {
    width: 200px;
    padding: 5px;
    margin: 0 0 10px;
}

.reply-form-container .comment-name-input {
    width: 150px;
    margin-bottom: 5px;
}

.comment-name-input:read-only {
    background-color: #f7f7f7;
    color: #555555;
}

.comment-form textarea,
.reply-form-container textarea {
    width: 100%;
    margin: 0 0 10px;
    resize: none; 
    overflow-y: hidden; 
    min-height: 80px;
}

.reply-form-container textarea {
    min-height: 60px;
    padding: 8px;
    margin-bottom: 5px;
}

.comment-name-input:focus-visible,
.comment-form textarea:focus-visible,
.reply-form-container textarea:focus-visible,
.comment-form .submit-btn:focus-visible,
.reply-form-container .submit-btn:focus-visible {
    outline: 2px solid #b44747;
    outline-offset: 2px;
}

.comment-form-feedback {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #666666;
}

.draft-status {
    flex: 1 1 180px;
}

.comment-counter {
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.comment-counter.is-over-limit {
    color: #b00000;
    font-weight: bold;
}

.comment-form textarea[aria-invalid="true"],
.reply-form-container textarea[aria-invalid="true"] {
    border-color: #b00000;
}

.submit-btn {
    background-color: #cc0000;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}

.submit-btn:hover {
    opacity: 0.8;
}

.comment-form .submit-btn,
.reply-form-container .submit-btn {
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 20px;
    font: inherit;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
}

.comment-item {
    background-color: transparent;
    padding: 20px 0;
    border: none;
    border-bottom: 1px solid #dddddd;
    border-radius: 0;
    margin-bottom: 0; 
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-meta {
    font-size: 12px;
    color: #888888;
    margin-bottom: 5px;
}

.comment-text {
    font-size: 14px;
    color: #333333;
    white-space: pre-wrap;
}

/* =========================================================
   コメントアクション用ボタン（いいね・返信・削除）
========================================================= */
.like-btn {
    background-color: transparent;
    border: none;
    color: #888888;
    padding: 0;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.like-btn:hover:not(.liked) {
    color: #ff9999;
}

.like-btn.liked {
    color: #cc0000;
    cursor: default;
}

.like-btn .heart {
    font-size: 20px;
    font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif;
    line-height: 1;
}

.delete-btn {
    background-color: #f0f0f0;
    border: 1px solid #dddddd;
    color: #888888;
    cursor: pointer;
    font-size: 11px;
    margin-left: 15px;
    padding: 2px 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background-color: #fff0f0;
    border-color: #ffcccc;
    color: #cc0000;
}

.reply-btn {
    background-color: transparent;
    border: none;
    color: #888888;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.reply-btn:hover {
    color: #065fd4;
}

/* =========================================================
   返信レイアウト（スレッド階層化）
========================================================= */
.reply-form-container {
    display: none;
    margin-top: 15px;
    margin-left: 20px;
    border-left: 2px solid #dddddd;
    padding-left: 15px;
}

.reply-item {
    margin-left: 40px; 
    margin-top: 10px;
    padding: 10px 0 10px 15px;
    background-color: transparent;
    border-bottom: none;
    border-left: 2px solid #eeeeee;
}

.toggle-replies-btn {
    background: transparent;
    border: none;
    color: #065fd4; 
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s;
}

.toggle-replies-btn:hover {
    text-decoration: underline;
}

.load-more-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.load-more-btn {
    background-color: #ffffff;
    border: 1px solid #cccccc;
    color: #333333;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background-color: #f7f7f7;
    border-color: #999999;
}

/* =========================================================
   汎用クラス・ユーティリティ
========================================================= */
.d-none {
    display: none !important;
}

.timestamp-link {
    color: #065fd4;
    text-decoration: none;
    cursor: pointer;
}

.timestamp-link:hover {
    text-decoration: underline;
}

.title-wrap {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px;
}

.title-wrap h2,
.title-wrap h3 {
    margin-bottom: 0; 
    margin-top: 0;
}

/* サブタイトル用のインラインブロック設定 */
.track-subtitle {
    display: inline-block;
    margin-left: 0px;
}

/* =========================================================
   SNSシェアボタン
========================================================= */
.x-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background-color: transparent;
    color: #292b33;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.x-share-btn:hover {
    background-color: #f8f8fa;
    color: #a3293a;
}

.x-share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}

/* =========================================================
   カスタムドロップダウン（ソート機能）
========================================================= */
.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 160px;
}

.dropdown-selected {
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 20px;
    padding: 6px 35px 6px 15px;
    font-size: 13px;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    user-select: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M7%2010L12%2015L17%2010%22%20stroke%3D%22%23333333%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.dropdown-selected:hover,
.custom-dropdown.active .dropdown-selected {
    border-color: #cc0000;
    box-shadow: 0 2px 5px rgba(204,0,0,0.1);
}

.dropdown-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    overflow: hidden;
}

.custom-dropdown.active .dropdown-options {
    display: block; 
    animation: fadeInDown 0.2s ease-out;
}

.dropdown-option {
    padding: 10px 15px;
    font-size: 13px;
    color: #333333;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-option:hover {
    background-color: #fff9f9;
    color: #cc0000;
}

.dropdown-option.selected {
    font-weight: bold;
    color: #cc0000;
    background-color: #fff0f0;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   管理者用特別デザイン・お知らせ欄
========================================================= */
.admin-name {
    color: #cc0000 !important;
    font-weight: bold;
    background-color: #fff0f0;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #ffcccc;
    margin-right: 5px;
    display: inline-block;
}

.admin-message-simple {
    text-align: right;
    font-size: 12px;
    color: #999999;
    margin-top: 50px;
    padding-top: 10px;
    border-top: 1px dashed #dddddd;
}

.admin-message-simple span {
    font-weight: bold;
}

/* =========================================================
   カスタムUI（トースト通知・モーダル）
========================================================= */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.custom-toast {
    background-color: #fff9f9;
    border-left: 5px solid #cc0000;
    color: #333;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
}

.custom-modal-overlay.d-none {
    display: none !important;
}

.custom-modal {
    background-color: #fff;
    padding: 25px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 90%;
    width: 320px;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
    border-top: 5px solid #cc0000;
}

.custom-modal-overlay.show .custom-modal {
    transform: translateY(0);
}

.custom-modal p {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
    font-size: 15px;
    font-weight: bold;
}

.custom-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.custom-modal-buttons button {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
    font-weight: bold;
}

.custom-modal-buttons button:hover {
    opacity: 0.8;
}

.custom-modal-buttons .cancel-btn {
    background-color: #e0e0e0;
    color: #555;
}

.custom-modal-buttons .ok-btn {
    background-color: #cc0000;
    color: #fff;
}

/* =========================================================
   楽曲移動用ナビゲーションボタン
========================================================= */
.track-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
    margin-bottom: 24px;
}

.track-media .video-container {
    grid-area: 1 / 1;
    margin-bottom: 0;
}

.track-media .zun-comment {
    grid-area: 2 / 1;
    margin: 0;
}

.track-navigation {
    grid-area: 1 / 1;
    align-self: stretch;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    width: 100%;
    max-width: 608px;
    margin: 0 auto;
    pointer-events: none;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    background: transparent;
    color: #555555;
    text-decoration: none;
    border-radius: 6px;
    border: 0;
    transition: color 0.2s ease;
    min-width: 0;
    pointer-events: auto;
}

.nav-btn:hover {
    color: #cc0000;
    background: #f7f7f7;
}

#prev-track-btn {
    grid-column: 1;
}

#next-track-btn {
    grid-column: 3;
}

.nav-btn.disabled {
    display: none;
}

.track-media--no-video .zun-comment {
    grid-area: 1 / 1;
}

.track-media--no-video .track-navigation {
    grid-area: 2 / 1;
    min-height: 44px;
    max-width: none;
}

.track-media--no-video.track-media--no-comment .track-navigation {
    grid-area: 1 / 1;
}

@media (max-width: 720px) {
    .track-media {
        row-gap: 8px;
    }

    .track-media:not(.track-media--no-video) .track-navigation {
        grid-area: 2 / 1;
        max-width: 480px;
        min-height: 44px;
    }

    .track-media:not(.track-media--no-video) .zun-comment {
        grid-area: 3 / 1;
    }
}

/* =========================================================
   作品楽曲一覧（ドロワー）のデザイン
========================================================= */
/* 狭い画面では、曲を探す入口を右上に固定します。 */
.track-list-toggle {
    position: fixed;
    right: 16px;
    top: 16px;
    top: calc(16px + env(safe-area-inset-top, 0px));
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #cccccc;
    border-radius: 6px;
    background: #ffffff;
    appearance: none;
    color: #555555;
    font: inherit;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
    cursor: pointer;
}

.track-list-toggle[hidden] {
    display: none;
}

.track-list-toggle::after {
    content: "";
    width: 5px;
    height: 5px;
    margin: -3px 2px 0 4px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
}

.track-list-toggle[aria-expanded="true"]::after {
    margin-top: 3px;
    transform: rotate(225deg);
}

.track-list-toggle:hover {
    color: #cc0000;
}

.track-list-toggle:hover span {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.track-list-toggle:focus-visible,
.nav-btn:focus-visible {
    outline: 2px solid #cc0000;
    outline-offset: 3px;
}

/* 楽曲ページから、別の曲へ移動するためのパネル */
.track-discovery {
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 2001;
    box-sizing: border-box;
    width: min(92vw, 400px);
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    min-width: 0;
    margin: 0;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border: 0;
    border-left: 1px solid #dddddd;
    border-radius: 0;
    box-shadow: none;
}

.track-discovery[data-open="true"] {
    display: block;
}

.track-discovery-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.36);
    cursor: pointer;
}

body.track-drawer-open {
    overflow: hidden;
}

.track-drawer-open .track-list-toggle {
    visibility: hidden;
}

.track-discovery[hidden],
.track-discovery-group[hidden],
.track-discovery-control[hidden],
.track-discovery-full-list[hidden],
.track-discovery-list[hidden],
.track-discovery-list li[hidden],
.track-discovery-backdrop[hidden] {
    display: none;
}

.track-discovery-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    background: #ffffff;
}

.track-discovery h2 {
    margin: 0;
    border-left: 3px solid #bb332b;
    font-size: 18px;
}

.track-discovery-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.track-discovery-control {
    min-height: 44px;
    min-width: 44px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #a60000;
    font: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.track-discovery-control:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.track-discovery-full-list {
    position: relative;
    max-height: min(40vh, 300px);
    max-height: min(40dvh, 300px);
    overflow-y: auto;
}

.track-discovery h3 {
    margin: 0 0 4px;
    color: #666666;
    font-size: 13px;
    font-weight: bold;
}

.track-discovery-group:not([hidden]) + .track-discovery-group:not([hidden]) {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #dddddd;
}

.track-discovery-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.track-discovery-list li + li {
    border-top: 1px solid #eeeeee;
}

.track-discovery-list a,
.track-discovery-current {
    display: block;
    min-height: 44px;
    box-sizing: border-box;
    padding: 12px 0;
    color: #333333;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.track-discovery-current {
    padding-right: 8px;
    padding-left: 8px;
    border-left: 3px solid #bb332b;
    background: #fff4f4;
}

.track-discovery-current-label {
    display: block;
    margin-top: 3px;
    color: #a60000;
    font-size: 12px;
    font-weight: bold;
}

.track-discovery-song {
    display: block;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.6;
}

.track-discovery-meta {
    display: block;
    margin-top: 3px;
    color: #666666;
    font-size: 12px;
    line-height: 1.6;
}

.track-discovery-list a:hover .track-discovery-song {
    color: #a60000;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.track-discovery a:focus-visible,
.track-discovery-control:focus-visible {
    outline: 2px solid #b44747;
    outline-offset: 3px;
}

@media (min-width: 1200px) {
    .track-page-with-discovery .container {
        max-width: 1124px;
    }

    .track-page-with-discovery .track-layout {
        display: grid;
        grid-template-columns: minmax(0, 800px) 300px;
        gap: 24px;
        align-items: start;
    }

    .track-layout > .works-section {
        min-width: 0;
    }

    .track-discovery {
        display: block;
        position: sticky;
        inset: auto;
        top: 20px;
        z-index: auto;
        width: auto;
        height: auto;
        max-height: calc(100vh - 40px);
        padding: 20px;
        border: 1px solid #dddddd;
        border-radius: 6px;
        overscroll-behavior: auto;
    }

    .track-discovery-full-list {
        max-height: 300px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .track-discovery-backdrop {
        display: none;
    }

    .track-list-toggle {
        display: none;
    }
}

@media (max-width: 1199px) {
    .track-layout > .track-discovery {
        padding-top: 0;
    }

    .track-discovery-header {
        padding-top: 16px;
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
    }
}

/* =========================================================
   フッター
========================================================= */
.site-footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    font-size: 12px;
    color: #888888;
}

/* 本文の幅を保てる画面では、新着コメントを右側に配置します。 */
@media (min-width: 1200px) {
    .home-page .container {
        max-width: 1124px;
    }

    .home-page .home-layout {
        display: grid;
        grid-template-columns: minmax(0, 800px) 300px;
        grid-template-areas:
            "search recent"
            "works recent";
        gap: 20px 24px;
        align-items: start;
    }

    .home-page .home-layout > .works-section {
        min-width: 0;
        margin-bottom: 0;
    }

    .home-page .home-intro {
        grid-area: search;
    }

    .home-page .home-recent {
        grid-area: recent;
        padding: 20px;
    }

    .home-page #works {
        grid-area: works;
    }

    .home-page .home-recent .recent-comment-link {
        padding: 12px 0;
    }

    .home-page .home-recent .recent-comment-heading {
        gap: 8px;
    }
}

/* 狭い画面では本文の幅と、指で押せる操作領域を確保します。 */
@media (max-width: 600px) {
    .container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .site-header {
        padding: 14px 0;
        margin-bottom: 20px;
    }

    .site-header h1 {
        font-size: 22px;
    }

    .header-inner {
        gap: 6px;
    }

    .top-nav-menu {
        flex-wrap: wrap;
        gap: 4px 16px;
    }

    .top-nav-menu a {
        min-height: 44px;
        font-size: 14px;
        color: #666666;
    }

    .works-section {
        padding: 20px 16px;
    }

    .works-section h2,
    .work-title,
    .comment-text,
    .comment-meta,
    .breadcrumb {
        overflow-wrap: anywhere;
    }

    .description,
    .recent-comment-text {
        font-size: 15px;
    }

    .home-page .works-section {
        padding: 20px 16px;
        margin-bottom: 16px;
    }

    .home-search-row {
        gap: 8px;
    }

    .home-search .submit-btn {
        padding: 10px 14px;
    }

    .work-category-nav {
        order: 1;
        flex-basis: 100%;
        gap: 0 16px;
        margin-left: 0;
    }

    .work-category-nav a {
        min-height: 44px;
    }

    .works-heading .x-share-btn {
        margin-left: auto;
    }

    .recent-comment-link {
        padding: 16px 0;
    }

    .recent-retry {
        min-height: 44px;
    }

    .home-recent[data-collapsed="true"] #recent-comments-content,
    .home-recent[data-collapsed="true"] .recent-retry {
        display: none;
    }

    .home-recent[data-collapsed="true"] .title-wrap {
        margin-bottom: 0;
    }

    .recent-comments-toggle:not([hidden]) {
        display: inline-flex;
    }

    .recent-comments-list[data-expanded="false"] > li:nth-child(n+3) {
        display: none;
    }

    .recent-comments-more:not([hidden]) {
        display: block;
        min-height: 44px;
    }

    .works-list a,
    .works-list .work-unavailable {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 14px 4px;
    }

    .work-number {
        width: auto;
        max-width: 100%;
        font-size: 13px;
        color: #666666;
    }

    .work-title {
        min-width: 0;
    }

    .track-catalog-row > a {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 8px;
    }

    .track-catalog-row .work-number {
        grid-column: 1;
    }

    .track-catalog-row .work-title {
        grid-column: 1 / -1;
    }

    .track-catalog-row .comment-count {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
    }

    .work-info {
        padding: 12px;
    }

    .work-info li {
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .work-info-label {
        width: auto;
    }

    .comment-form input,
    .reply-form-container input,
    .comment-form textarea,
    .reply-form-container textarea {
        box-sizing: border-box;
        max-width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    .comment-form textarea,
    .reply-form-container textarea {
        min-height: 96px;
        line-height: 1.6;
    }

    .comment-text {
        font-size: 16px;
        line-height: 1.8;
    }

    .comment-meta {
        font-size: 13px;
    }

    .submit-btn,
    .like-btn,
    .reply-btn,
    .delete-btn,
    .toggle-replies-btn {
        box-sizing: border-box;
        min-height: 44px;
        min-width: 44px;
    }

    .submit-btn,
    .comment-form .submit-btn,
    .reply-form-container .submit-btn {
        font-size: 16px;
        padding: 10px 16px;
    }

    .like-btn,
    .reply-btn {
        font-size: 14px;
    }

    .delete-btn {
        font-size: 13px;
        margin-left: 8px;
    }

    .reply-item {
        margin-left: 12px;
        padding-left: 10px;
    }

    .reply-form-container {
        margin-left: 8px;
        padding-left: 10px;
    }

    .more-replies-btn {
        margin-left: 12px;
    }

    .dropdown-selected {
        box-sizing: border-box;
        min-height: 44px;
        padding-top: 11px;
        padding-bottom: 11px;
    }

    .dropdown-option {
        box-sizing: border-box;
        min-height: 44px;
    }

    .track-list-toggle {
        min-height: 44px;
    }

    .x-share-btn {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }

    .custom-modal {
        box-sizing: border-box;
        max-width: calc(100% - 24px);
    }

    #toast-container {
        left: 12px;
        right: 12px;
    }

    .custom-toast {
        overflow-wrap: anywhere;
    }
}
