@charset "UTF-8";
:root {
  --text-size: 14px; --title-size: 16px;
  --purple: #602f75; --purple-deep: #49225b; --pink: #ea3457;
  --ink: #303038; --muted: #6b6b76; --line: #e8e8ed; --bg: #fafafb;
  --radius: 12px; --font: "Segoe UI", system-ui, sans-serif;
  font-family: var(--font); color: var(--ink); color-scheme: light; font-synthesis: none;
}
:root:lang(zh-CN) { --font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
:root:lang(zh-TW) { --font: "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
:root:lang(ja) { --font: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif; }
:root:lang(ko) { --font: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); font-size: var(--text-size); line-height: 20px; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .4; }
a { color: inherit; text-decoration: none; }
button, a, summary { transition: background .15s, color .15s, border-color .15s; }
button:hover:not(:disabled), a:hover { color: var(--purple); }
:where(button, a, input, select, summary):focus-visible { outline: 2px solid #9971ac; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2, h3 { font-size: var(--title-size); line-height: 24px; font-weight: 500; }
small { font-size: inherit; }
input { min-width: 0; }
input::placeholder { color: #777781; }
[hidden] { display: none !important; }
.icon { display: inline-block; width: 16px; height: 16px; line-height: 1; font-size: 16px; text-align: center; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 999; background: white; padding: 10px; }
.skip-link:focus { top: 10px; }
/* One page grid, restrained utility controls, original brand artwork. */
.site-header, main, .site-footer { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 80px; border-bottom: 1px solid var(--line); }
.brand-heading { line-height: 0; }
.brand { display: inline-flex; align-items: center; gap: 3px; direction: ltr; }
.brand img { display: block; flex-shrink: 0; }
.brand-word { font-size: 24px; line-height: 28px; font-weight: 400; color: var(--purple); white-space: nowrap; transform: translateY(2px); }
.brand img { width: auto; height: 48px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.help-button, .language-menu summary { min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.help-button:hover, .language-menu summary:hover { background: #f0edf3; color: var(--purple); }
.language-menu { position: relative; }
.language-menu summary { list-style: none; cursor: pointer; }
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu .fa-chevron-down { font-size: 10px; width: 10px; height: 10px; }
.language-options { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 200px; max-height: min(520px, calc(100svh - 90px)); overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 28px #30303812; }
.language-options a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 6px; }
.language-options a:hover, .language-options a[aria-current] { color: var(--purple); background: #f4eff7; }
main { flex: 1; padding-block: 24px 40px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 20px; align-items: start; scroll-margin-top: 20px; }
.workspace:not(.has-source) { grid-template-columns: 1fr; }
.watch-column { min-width: 0; }
.source-card, .history-panel, .player-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.source-card { padding: 16px; margin-bottom: 20px; }
.source-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.source-tabs { display: flex; gap: 8px; }
.source-tab, .history-tabs button { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.source-tab.active, .history-tabs button.active { color: var(--purple); background: #f4eff7; }
.url-row { display: flex; gap: 12px; }
.url-input-wrap { display: flex; align-items: center; gap: 12px; border: 1px solid #dcdce3; border-radius: 8px; background: white; flex: 1; padding: 0 12px; min-width: 0; height: 44px; color: var(--muted); }
.url-input-wrap:focus-within { border-color: #9971ac; box-shadow: 0 0 0 3px #602f750c; }
.url-input-wrap input { width: 100%; height: 42px; border: 0; background: transparent; color: var(--ink); font-size: var(--title-size); line-height: 24px; outline: none; }
.url-input-wrap:has(input[aria-invalid=true]) { border-color: var(--pink); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; background: var(--purple); color: white; border-radius: 8px; padding: 12px 20px; font-size: var(--text-size); line-height: 20px; font-weight: 400; white-space: nowrap; }
.primary-button:hover:not(:disabled) { background: var(--purple-deep); color: white; }
.text-button { display: inline-flex; align-items: center; gap: 8px; color: var(--purple); padding: 8px; border-radius: 8px; white-space: nowrap; }
.text-button.muted { color: var(--muted); }
#source-message { margin-top: 12px; color: #b12040; overflow-wrap: anywhere; }
.advanced-options { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.advanced-options label { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.advanced-options input:not([type=checkbox]), .advanced-options select { background: white; border: 1px solid #dcdce3; padding: 8px; border-radius: 8px; max-width: 240px; color: var(--ink); }
.check-label input { accent-color: var(--purple); }
.local-drop { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px dashed #cecad3; border-radius: 8px; text-align: left; }
.local-drop > .icon { color: var(--muted); }
.local-drop strong { font-size: var(--title-size); line-height: 24px; font-weight: 400; display: block; }
.choose-file { margin-left: auto; color: var(--purple); white-space: nowrap; }
.dragging .source-card { outline: 2px dashed var(--purple); outline-offset: 4px; }
/* The video becomes the primary surface after a source is selected. */
.player-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #202025; color: #c7c7ce; padding: 10px 16px; border-radius: 11px 11px 0 0; }
.screen-label { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; background: #aaaab3; border-radius: 50%; flex-shrink: 0; }
.status-dot.playing { background: #75d6b0; }
.status-dot.error { background: var(--pink); }
#stream-format { white-space: nowrap; }
.stage { container-type: inline-size; position: relative; aspect-ratio: 16/9; background: #151519; isolation: isolate; }
.stage #player { width: 100%; height: 100%; position: absolute; inset: 0; }
.now-playing { display: flex; align-items: center; justify-content: space-between; padding: 16px; gap: 12px; }
.now-title, .now-title > div { min-width: 0; }
.now-icon { display: none; }
.now-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-title p { color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 8px; width: 32px; height: 32px; flex-shrink: 0; padding: 8px; }
.icon-button:hover:not(:disabled) { background: #f4eff7; }
.icon-button[aria-pressed=true] { color: var(--purple); }
.icon-button[aria-pressed=true] .fa-star { font-weight: 900; }
.player-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--line); gap: 8px 16px; }
.tool-group { display: flex; gap: 16px; flex-wrap: wrap; }
.tool-button, .keyboard-button { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); min-height: 36px; padding: 8px 0; white-space: nowrap; }
.tool-button[aria-pressed=true] { color: var(--purple); }
.stream-tools { display: flex; gap: 12px 16px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); }
.stream-tools label { display: flex; gap: 8px; align-items: center; max-width: 100%; }
.stream-tools select { color: var(--ink); background: white; border: 1px solid #dcdce3; border-radius: 8px; padding: 6px 8px; min-width: 0; max-width: 210px; }
.player-error { position: absolute; z-index: 9; inset: 0; background: #202025f5; color: white; display: flex; align-items: center; justify-content: safe center; flex-direction: column; text-align: center; padding: 20px; overflow-y: auto; }
.error-mark { display: block; color: #e09ba9; margin-bottom: 12px; }
.player-error p { max-width: 460px; color: #cdcdd4; margin: 8px 0 16px; overflow-wrap: anywhere; }
.theater .workspace { grid-template-columns: 1fr; }
.theater .history-panel { display: none; }
.theater .stage { max-height: 74vh; aspect-ratio: auto; height: min(675px, calc((100vw - 64px) * .5625)); }
#player .art-video-player { font-family: var(--font); font-size: var(--text-size); }
#player .art-icon { display: inline-flex; align-items: center; justify-content: center; }
#player .art-icon .icon { width: 20px; }
#player .art-state .art-icon .icon { font-size: 32px; width: 40px; height: 32px; }
#player .art-loading .art-icon .icon { font-size: 24px; width: 24px; height: 24px; }
#player :is(.art-control-time,.art-setting-item,.art-setting-item-right,.art-notice,.art-progress-tip,.art-selector-item,.art-volume-panel,.art-info,.art-contextmenus) { font-size: var(--text-size) !important; }
#player .art-controls-left, #player .art-controls-right { flex: 0 0 auto; min-width: 0; }
#player .art-control-time { white-space: nowrap; }
#player .art-settings { max-height: 70% !important; }
#player .art-video { outline: none; }
#player [class*=hint--]:after { font-family: var(--font) !important; font-size: var(--text-size) !important; line-height: 20px !important; }
.stage:focus-within { outline: 2px solid #9971ac; outline-offset: 2px; }
/* Empty history contains only a heading and its state. */
.history-panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: 16px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; min-height: 52px; }
.history-heading h2 { display: flex; gap: 8px; align-items: center; }
.history-heading h2 > .icon { color: var(--muted); }
.history-heading h2 > span { font-size: var(--text-size); line-height: 20px; color: var(--muted); font-weight: 400; }
.history-tabs { display: flex; gap: 4px; padding: 0 16px; flex-wrap: wrap; }
.history-search { margin: 12px 16px 4px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; padding: 8px 10px; gap: 8px; color: var(--muted); }
.history-search:focus-within { outline: 2px solid #9971ac; outline-offset: 2px; }
.history-search input { border: 0; outline: none; background: none; width: 100%; color: var(--ink); }
#history-list { padding: 12px 16px; min-height: 0; max-height: 480px; overflow-y: auto; }
.history-empty { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 64px; color: var(--muted); }
.is-empty #history-list { padding-top: 0; }
.workspace:not(.has-source) #history-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 16px; }
.workspace:not(.has-source) .history-empty { grid-column: 1/-1; }
.workspace:not(.has-source) .history-search { max-width: 360px; }
.history-item { border: 1px solid transparent; border-radius: 8px; padding: 8px 4px; margin-bottom: 4px; }
.history-item:hover { background: #f8f8fa; }
.history-item.current { border-color: #e3d8eb; background: #faf7fc; }
.history-item-top { display: flex; gap: 8px; align-items: center; }
.history-open { display: flex; text-align: left; gap: 10px; flex: 1; min-width: 0; align-items: center; padding: 0; }
.history-thumb { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 40px; border-radius: 8px; background: #f1eff4; color: #84728e; }
.history-info { min-width: 0; flex: 1; }
.history-info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.history-info small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.history-actions { display: flex; flex-direction: column; }
.history-actions .icon-button { width: 28px; height: 28px; padding: 6px; }
.history-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-variant-numeric: tabular-nums; margin: 8px 0 0 42px; }
.progress-track { height: 2px; background: #eeebf1; border-radius: 2px; margin: 6px 0 0 42px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: #9971ac; }
/* Footer stays quiet and shares the page alignment. */
.site-footer { color: var(--muted); padding-bottom: 16px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.footer-actions :is(button, a) { display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #303038f5; color: white; border-radius: 8px; padding: 12px 16px; z-index: 10000; max-width: min(90vw,540px); overflow-wrap: anywhere; }
.app-dialog { font: inherit; border: 1px solid var(--line); border-radius: 12px; width: min(640px,calc(100vw - 32px)); max-height: 85vh; padding: 24px; color: var(--ink); box-shadow: 0 20px 80px #20202520; }
.app-dialog::backdrop { background: #20202570; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dialog-content > #demo-button { margin-top: 16px; padding-left: 0; }
.dialog-content h3 { margin: 24px 0 8px; }
.dialog-content p, .compact-dialog > p { color: var(--muted); line-height: 24px; overflow-wrap: anywhere; }
.dialog-content .small-note { margin-top: 24px; }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; color: var(--muted); margin-top: 16px; }
kbd { display: inline-block; padding: 1px 6px; min-width: 24px; border: 1px solid #dedee5; border-radius: 4px; color: var(--ink); background: #fafafb; text-align: center; margin-right: 4px; font: inherit; }
.compact-dialog { max-width: 440px; }
.compact-dialog > p { margin: 16px 0; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.secondary-button { border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 11px 16px; }
.noscript { text-align: center; padding: 20px; }
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 1fr; }
  #history-list { max-height: 400px; }
  .workspace:not(.has-source) #history-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .site-header, main, .site-footer { width: calc(100% - 32px); }
  .site-header { min-height: 68px; gap: 8px; }
  .brand img { height: 40px; }
  .brand-word { font-size: 20px; line-height: 24px; }
  .header-actions { gap: 4px; }
  .help-label { display: none; }
  .language-menu summary { gap: 6px; }
  .language-current { display: none; }
  main { padding-block: 16px 32px; }
  .source-card { padding: 12px; margin-bottom: 16px; }
  .source-top { gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
  .source-tabs { gap: 4px; }
  .source-tab { padding-inline: 8px; gap: 6px; }
  .source-top > .text-button { margin-left: auto; }
  .url-row { flex-direction: column; gap: 12px; }
  .url-input-wrap { flex: 0 0 44px; gap: 8px; }
  .url-row > .primary-button { width: 100%; }
  .advanced-options { align-items: stretch; flex-direction: column; }
  .advanced-options label { justify-content: space-between; }
  .advanced-options .check-label { justify-content: flex-start; }
  .advanced-options input:not([type=checkbox]), .advanced-options select { max-width: 65%; font-size: 16px; }
  .history-search input { font-size: 16px; line-height: 24px; }
  .local-drop { padding: 12px; }
  .choose-file { display: none; }
  .stage { aspect-ratio: 1.6; }
  .player-topline, .now-playing { padding: 12px; }
  .player-tools, .stream-tools { padding: 8px 12px; gap: 8px 12px; }
  .tool-group { gap: 12px; }
  .keyboard-button { margin-left: auto; }
  .stream-tools select { max-width: min(190px,55vw); }
  .workspace:not(.has-source) #history-list { grid-template-columns: 1fr; }
  .theater .stage { height: calc((100vw - 32px) * .625); }
  .shortcut-grid { grid-template-columns: 1fr; }
  .app-dialog { padding: 20px; }
  .player-error { padding: 12px; }
  .error-mark { display: none; }
}
@container (max-width: 420px) {
  #player .art-video-player { --art-control-height: 36px; --art-control-icon-size: 30px; }
  #player .art-controls { height: auto; min-height: 36px; flex-wrap: wrap; }
  #player .art-controls-left, #player .art-controls-right { flex: 0 0 auto; height: 36px; }
}
@container (max-width: 350px) {
  #player .art-video-player { --art-bottom-height: 140px; }
  #player .art-controls-left, #player .art-controls-right { width: 100%; }
  #player .art-controls-right { justify-content: flex-end; }
  #player .art-settings { bottom: 86px; max-height: calc(100% - 90px) !important; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { transition: none !important; scroll-behavior: auto !important; } }

/* Direction-aware chrome; the media timeline always advances left to right. */
:root:lang(ar) { --font: "Segoe UI", Tahoma, Arial, sans-serif; }
:root:lang(hi) { --font: "Nirmala UI", "Mangal", system-ui, sans-serif; }
:root:lang(th) { --font: "Leelawadee UI", Tahoma, system-ui, sans-serif; }
[dir=rtl] .language-options { right: auto; left: 0; }
[dir=rtl] .local-drop, [dir=rtl] .history-open { text-align: right; }
[dir=rtl] .choose-file { margin-left: 0; margin-right: auto; }
[dir=rtl] .history-meta, [dir=rtl] .progress-track { margin-left: 0; margin-right: 42px; }
#player .art-video-player, .history-meta, #stream-format { direction: ltr; }
.history-info small, #video-detail { unicode-bidi: plaintext; }
@media (max-width: 600px) {
  [dir=rtl] .source-top > .text-button, [dir=rtl] .keyboard-button { margin-left: 0; margin-right: auto; }
}

.footer-copyright { direction: ltr; unicode-bidi: isolate; }

/* One English policy, available as a focused dialog and a crawlable full page. */
.privacy-dialog, .privacy-page { font-family: "Segoe UI", system-ui, sans-serif; }
.privacy-dialog { width: min(720px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.privacy-dialog[open] { display: flex; flex-direction: column; }
.privacy-dialog .dialog-header { padding: 16px 24px; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.privacy-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 24px; }
.privacy-copy { color: var(--muted); line-height: 24px; overflow-wrap: anywhere; }
.privacy-copy p { margin-top: 12px; }
.privacy-copy :is(h2, h3) { color: var(--ink); margin: 24px 0 8px; font-size: 16px; line-height: 24px; }
.privacy-copy ul { padding-inline-start: 24px; margin: 12px 0; }
.privacy-copy li + li { margin-top: 12px; }
.privacy-copy strong { color: var(--ink); font-weight: 500; }
.privacy-copy a, .privacy-dialog-footer a { color: var(--purple); text-decoration: underline; text-underline-offset: 3px; }
.policy-updated { font-size: 14px; }
.privacy-dialog-footer { padding: 12px 24px; border-top: 1px solid var(--line); flex-shrink: 0; }
.privacy-dialog-footer a { display: inline-flex; align-items: center; gap: 8px; }
.privacy-page { width: min(760px, calc(100% - 32px)); padding-block: 32px 48px; }
.privacy-page h1 { font-size: 20px; line-height: 28px; font-weight: 500; }
@media (max-width: 600px) {
 .privacy-dialog .dialog-header { padding: 12px 16px; }
 .privacy-scroll { padding: 0 16px 20px; }
 .privacy-dialog-footer { padding: 12px 16px; }
}

#privacy-title:focus { outline: none; }
@media (max-width: 360px) {
  .brand img { height: 36px; }
  .brand-word { font-size: 18px; }
}
