* { box-sizing: border-box; }
body { margin: 0; background: #f3f5f7; color: #182533; font: 1rem/1.6 system-ui, "Microsoft JhengHei", sans-serif; }
body.mobile-list-page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
body.mobile-list-page.has-player { padding-bottom: calc(148px + env(safe-area-inset-bottom)); }
a:focus-visible, button:focus-visible { outline: 2px solid #124b75; outline-offset: 3px; }
[hidden] { display: none !important; }
.music-list { max-width: 42rem; margin: 0 auto; padding: 16px; }
.music-summary { margin: 0 0 12px; color: #4a5865; font-size: .9rem; }
.music-row { margin-bottom: 8px; border: 1px solid #e0e5e9; border-radius: 10px; background: white; overflow: hidden; }
.music-song { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 12px; border: 0; background: transparent; color: #111; text-align: left; cursor: pointer; font: inherit; }
.music-song img { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 9px; }
.music-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 18px; font-weight: 700; }
.music-song:disabled { cursor: default; opacity: .65; }
.music-song.is-current { background: #edf4ff; }
.music-pages { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.music-pages a { min-height: 44px; padding: 8px 12px; color: #17486d; }
.music-player { position: fixed; z-index: 29; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; width: 100%; height: 64px; padding: 10px 16px; background: #10151d; color: #fff; }
.music-player img { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 8px; }
.music-player-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.music-player button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #fff; cursor: pointer; }
.music-player svg { width: 24px; height: 24px; fill: currentColor; }
.music-player .pause-icon { display: none; }
.music-player .is-playing { color: #ff405c; }
.music-player .is-playing .pause-icon { display: block; }
.music-player .is-playing .play-icon { display: none; }
.music-status { position: fixed; z-index: 32; left: 16px; right: 16px; bottom: calc(66px + env(safe-area-inset-bottom)); margin: 0; padding: 8px 12px; border-radius: 8px; background: #fff; color: #4a5865; font-size: .9rem; box-shadow: 0 2px 12px #0002; }
.has-player .music-status { bottom: calc(130px + env(safe-area-inset-bottom)); }
.music-status:empty { display: none; }
.has-player .list-panel { bottom: calc(122px + env(safe-area-inset-bottom)); }

.mobile-header {
    background: #fff;
    border-bottom: 1px solid #e0e5e9;
}

.mobile-header-inner {
    position: relative;
    max-width: 42rem;
    margin: 0 auto;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mobile-header h1 {
    margin: 0;
    font-size: 1.25rem;
}

.mobile-menu-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #e0e5e9;
    border-radius: .5rem;
    background: #fff;
    color: #111;
    font: 1.5rem/1 system-ui, sans-serif;
    cursor: pointer;
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid #124b75;
    outline-offset: 3px;
}

.mobile-menu {
    position: absolute;
    z-index: 1;
    top: 100%;
    right: 1rem;
    width: min(16rem, calc(100% - 2rem));
    overflow: hidden;
    border: 1px solid #e0e5e9;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 .25rem 1rem rgb(0 0 0 / 15%);
}

.mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: .5rem 1rem;
    color: #111;
    text-decoration: none;
}

.mobile-menu a + a { border-top: 1px solid #e0e5e9; }

.mobile-menu a:hover,
.mobile-menu a:focus-visible {
    background: #f3f5f7;
    outline-offset: -2px;
}

/* Bottom navigation is scoped to the article list. */
body.mobile-list-page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.list-toolbar {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(58px + env(safe-area-inset-bottom));
    padding: 0 16px env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid #e0e5e9;
}
.list-toolbar-group { display: flex; align-items: center; gap: 24px; }
.list-toolbar button, .list-toolbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #4a5865;
    cursor: pointer;
}
.list-toolbar svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.list-toolbar [aria-expanded="true"] { color: #1764c0; }
.list-panel {
    position: fixed;
    z-index: 31;
    left: 0;
    right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px 16px;
    border-top: 1px solid #e0e5e9;
    background: #fff;
    box-shadow: 0 -4px 16px rgb(0 0 0 / 8%);
}
.list-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.list-panel-close { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #4a5865; font: inherit; font-size: 24px; cursor: pointer; }
.list-search-form { display: flex; align-items: center; gap: 8px; }
.list-search-form input { flex: 1; min-width: 0; width: 100%; min-height: 44px; padding: 8px; border: 1px solid #a6b1bc; border-radius: 5px; font: inherit; }
.list-search-form button { flex: 0 0 auto; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 5px; background: #17486d; color: white; font: inherit; cursor: pointer; }
.list-category-links a { display: flex; align-items: center; min-height: 48px; padding: 8px 0; color: #182533; text-decoration: none; overflow-wrap: anywhere; }
.list-category-links a + a { border-top: 1px solid #e0e5e9; }


/* Full player, lyrics and comments share the existing audio element. */
body.music-player-open { overflow: hidden; }
.music-player { cursor: pointer; touch-action: pan-x; }
.music-player button { touch-action: manipulation; }
.music-full {
    position: fixed;
    z-index: 100;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background: #10151d;
    color: #fff;
    transform: translateY(100%);
    transition: transform .25s ease;
}
.music-full.is-open { transform: translateY(0); }
.music-full-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.music-full-header, .music-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
    padding: max(8px, env(safe-area-inset-top)) 16px 8px;
}
.music-full-header { touch-action: pan-x; }
.music-full button { color: inherit; font: inherit; cursor: pointer; }
.music-full-header button, .music-sub-header button { min-width: 44px; min-height: 44px; border: 0; background: transparent; }
.music-full svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.music-full-content { max-width: 32rem; width: 100%; margin: 0 auto; padding: 0 24px 16px; text-align: center; }
.music-meta { margin: 4px 0; color: #c7d0dc; font-size: .9rem; overflow-wrap: anywhere; }
.music-cover { display: block; width: min(66vw, 260px); max-width: 100%; height: auto; margin: 22px auto; border-radius: 18px; }
.music-full h2 { font-size: 1.25rem; margin: 8px 0 20px; overflow-wrap: anywhere; }
.music-full input[type="range"] { width: 100%; min-width: 0; height: 36px; accent-color: #ff405c; }
.music-time { display: flex; justify-content: space-between; color: #c7d0dc; font-size: .8rem; font-variant-numeric: tabular-nums; }
#full-toggle { display: grid; place-items: center; width: 68px; height: 68px; margin: 16px auto; border: 1px solid #ffffff55; border-radius: 50%; background: transparent; color: #fff; }
#full-toggle svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
#full-toggle .pause-icon { display: none; }
#full-toggle.is-playing { color: #ff405c; }
#full-toggle.is-playing .pause-icon { display: block; }
#full-toggle.is-playing .play-icon { display: none; }
.music-volume-row { display: flex; align-items: center; gap: 12px; }
.music-volume-row svg { flex: 0 0 22px; }
.music-device-volume { margin: 4px 0 12px; color: #c7d0dc; font-size: .75rem; }
.music-actions { display: flex; justify-content: flex-start; gap: 24px; margin-top: 18px; }
.music-actions button { display: grid; place-items: center; width: 24px; height: 44px; padding: 0; border: 0; background: transparent; }
.music-actions [aria-pressed="true"] { color: #ff405c; }
.music-lyrics, .music-comments {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom));
    background: #10151d;
    transform: translateX(100%);
    transition: transform .25s ease;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.music-lyrics.is-open, .music-comments.is-open { transform: translateX(0); }
.music-sub-header { position: sticky; top: 0; justify-content: flex-start; padding-left: 0; padding-right: 0; background: #10151d; }
.music-sub-header h2 { margin: 0; }
.music-lyrics-text, .music-comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.music-lyrics-text { padding: 12px 8px; line-height: 1.9; }
#music-comment-form { display: grid; gap: 12px; margin: 16px 0 24px; }
#music-comment-form label { display: grid; gap: 4px; }
#music-comment-form input, #music-comment-form textarea { width: 100%; min-width: 0; border: 1px solid #738095; border-radius: 5px; background: #fff; color: #182533; padding: 8px; font: inherit; }
#music-comment-form button { min-height: 44px; border: 0; border-radius: 5px; background: #17486d; color: #fff; }
.music-comment { padding: 14px 0; border-top: 1px solid #ffffff33; }
.music-comment h3 { margin: 0; font-size: 1rem; }
.music-comment small { color: #c7d0dc; }
.music-status { z-index: 140; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .music-full, .music-lyrics, .music-comments { transition: none; } }

.music-full-header #ak { position: absolute; left: 0; top: 0; }

.related-category-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    text-decoration: none;
    white-space: nowrap;
}
.music-actions .related-category-link { color: #fff; }
