* { box-sizing: border-box; }
body { margin: 0; background: #f3f5f7; color: #182533; font: 1rem/1.6 system-ui,"Microsoft JhengHei",sans-serif; }
button,input,textarea { font: inherit; }
button { cursor: pointer; }
a:focus-visible,button:focus-visible { outline: 2px solid #124b75; outline-offset: 3px; }
[hidden] { display: none !important; }
.video-list { width: 100%; max-width: 42rem; margin: auto; padding: 16px; }
.video-summary,.video-meta { color: #4a5865; font-size: .85rem; }
.video-card { width: 100%; min-width: 0; margin-bottom: 24px; }
.video-thumb { display: block; position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 10px; background: #141b25; }
.video-thumb img,.video-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-thumb video { position: absolute; inset: 0; pointer-events: none; }
.video-card h2 { margin: 8px 0 4px; font-size: 1.125rem; line-height: 1.5; overflow-wrap: anywhere; }
.video-card h2 a { color: #111; text-decoration: none; }
.video-meta { margin: 0; overflow-wrap: anywhere; }
.video-pages { display: flex; justify-content: space-between; gap: 16px; }
.video-pages a { min-height: 44px; padding: 8px; color: #17486d; }
.video-detail { --player-height: 56.25vw; height: 100vh; height: 100dvh; overflow: hidden; }
.video-player-shell { position: fixed; z-index: 50; top: 0; left: 0; right: 0; width: 100%; aspect-ratio: 16/9; padding-top: env(safe-area-inset-top); background: #000; }
.video-player-shell.has-embed { min-height: 200px; }
#video-stage { width: 100%; height: 100%; }
#video-stage video,#video-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
#video-stage video:fullscreen { width: 100vw; height: 100vh; object-fit: contain; }
.video-player-message { display: grid; align-content: center; justify-items: center; gap: 8px; height: 100%; padding: 16px; color: #fff; text-align: center; }
.video-player-message a { color: #fff; }
#video-play-prompt { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); min-height: 44px; padding: 8px 20px; border: 0; border-radius: 24px; background: #fff; color: #111; }
.video-detail-content { position: fixed; top: var(--player-height); bottom: 0; left: 0; right: 0; width: 100%; overflow-y: auto; overflow-x: hidden; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.video-detail-inner { width: 100%; max-width: 42rem; margin: auto; }
.video-detail h1 { margin: 12px 0 6px; font-size: 1.3rem; line-height: 1.5; overflow-wrap: anywhere; }
.video-list-back { display: inline-flex; min-height: 44px; align-items: center; color: #17486d; text-decoration: none; }
.video-actions { display: flex; align-items: center; gap: 24px; margin: 12px 0; }
.video-actions button { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0; border: 0; background: transparent; color: #4a5865; }
.video-actions svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.video-actions [aria-pressed="true"] { color: #1764c0; }
.video-comment-preview { display: block; width: 100%; border: 0; border-radius: 12px; padding: 12px; margin-bottom: 24px; background: #e9edf1; color: #182533; text-align: left; }
.video-comment-preview strong { font-size: 1rem; }
.video-comment-preview .preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#video-comment-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; overflow-wrap: anywhere; }
.video-comments { position: fixed; z-index: 60; top: var(--player-height); left: 0; right: 0; bottom: var(--keyboard-inset,0px); width: 100%; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: #fff; transform: translateY(100%); transition: transform .25s ease; }
.video-comments.is-open { transform: translateY(0); }
.video-comments header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; padding: 8px 16px; border-bottom: 1px solid #e0e5e9; }
.video-comments h2 { margin: 0; font-size: 1.1rem; }
.video-comments header button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 24px; }
#video-comments-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px; overscroll-behavior: contain; }
.video-comment { padding: 14px 0; border-bottom: 1px solid #e0e5e9; overflow-wrap: anywhere; }
.video-comment h3 { margin: 0; font-size: 1rem; }
.video-comment small { color: #4a5865; }
.video-comment p { margin: 6px 0; white-space: pre-wrap; }
#video-comment-form { flex: 0 0 auto; max-height: 55%; overflow-y: auto; display: grid; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #e0e5e9; background: #fff; }
#video-comment-form label { display: grid; gap: 4px; }
#video-comment-form input,#video-comment-form textarea { width: 100%; min-width: 0; padding: 8px; border: 1px solid #a6b1bc; border-radius: 5px; }
#video-comment-form button { min-height: 44px; border: 0; border-radius: 5px; background: #17486d; color: #fff; }
.video-comments-status { flex: 0 0 auto; margin: 0; padding: 0 16px; color: #4a5865; font-size: .85rem; }
#video-status { margin: 4px 0; color: #4a5865; font-size: .85rem; overflow-wrap: anywhere; }
@media(prefers-reduced-motion:reduce) { .video-comments { transition: none; } }

.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; }

.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;
}
.video-category-results { width: 100%; padding: 0; }
