:root {
  color-scheme: dark;
  --background: #15251f;
  --surface: #20332b;
  --edge: #3c5146;
  --text: #f6f3e8;
  --muted: #c1cbbc;
  --accent: #dbe7c9;
  --serif: 'Instrument Serif', 'Songti SC', 'Noto Serif CJK SC', serif;
  --sans: 'Instrument Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font: 400 16px/1.5 var(--sans);
  background: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select, input[type="range"] { cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #f2d8a1; outline-offset: 4px; }
button { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1110px, calc(100% - 30px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mast { min-height: 69px; padding-top: env(safe-area-inset-top, 0); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mast-actions, .player-actions { display: flex; align-items: center; gap: 6px; }
.brand { display: flex; align-items: center; gap: 0.52rem; color: var(--text); text-decoration: none; font: 400 1.62rem/1 var(--serif); }
.brand img { width: 35px; height: 35px; border-radius: 9px; }
.utility, .light-button, .glass-button { min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 0.43rem 0.8rem; font-size: 0.89rem; white-space: nowrap; }
.utility { color: var(--muted); border-color: var(--edge); background: #1b2d25; }
.light-button { color: #20372b; background: #ecf0dc; font-weight: 600; }
.light-button span { padding-right: 0.28rem; font-size: 0.77rem; }
.glass-button { background: #172922e8; color: var(--text); border-color: #c4d4ba44; }
.featured { position: relative; width: 100%; min-height: 290px; max-height: 525px; aspect-ratio: 2.1; isolation: isolate; overflow: hidden; display: flex; align-items: end; border: 1px solid var(--edge); border-radius: 14px; background: var(--surface); }
.featured > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.featured::after { position: absolute; inset: 0; content: ''; background: linear-gradient(0deg, #0b1513e3, #0f201c40 63%, transparent); z-index: -1; }
.featured-content { min-width: 0; padding: clamp(19px, 4vw, 46px); overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 0.35rem; font-size: 0.84rem; letter-spacing: 0.07em; color: #d8e2d3; }
#featured-title { margin: 0; font: 500 clamp(2.08rem, 6vw, 4.8rem)/1.1 var(--serif); letter-spacing: 0.07em; }
#featured-description { margin: 0.63rem 0 0.96rem; color: #eff0e4; font-size: 0.92rem; }
.library-heading { margin-top: 1.55rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.library-heading h2 { font: 500 1.52rem/1.35 var(--serif); margin: 0; letter-spacing: 0.04em; }
#scene-count { color: var(--muted); font-size: 0.84rem; }
.regions { margin: 0.72rem 0 1rem; padding-bottom: 4px; display: flex; gap: 7px; overflow: auto; scrollbar-width: thin; }
.regions button { min-height: 44px; padding: 0.4rem 0.86rem; border-radius: 7px; border: 1px solid var(--edge); background: transparent; color: var(--muted); white-space: nowrap; font-size: 0.88rem; }
.regions button[aria-pressed="true"] { background: var(--accent); color: #21372b; border-color: var(--accent); }
.scene-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 2vw, 20px); padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px)); }
.scene { display: block; min-width: 0; width: 100%; overflow: hidden; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--edge); border-radius: 9px; text-align: left; text-decoration: none; }
.scene:hover { border-color: #859b80; }
.scene img { display: block; width: 100%; height: auto; aspect-ratio: 1.57; object-fit: cover; background: #32483b; }
.scene strong, .scene small { display: block; overflow-wrap: anywhere; padding-inline: 10px; }
.scene strong { padding-top: 8px; font-size: 0.96rem; font-weight: 600; }
.scene small { padding-bottom: 9px; color: var(--muted); font-size: 0.81rem; }

body[data-playing-view] { overflow: hidden; }
#player { position: fixed; inset: 0; padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); height: 100vh; height: 100dvh; isolation: isolate; overflow: auto; display: flex; flex-direction: column; justify-content: space-between; color: var(--text); background: #0f1f18; }
.player-landscape, .player-image { position: fixed; inset: 0; width: 100%; height: 100%; }
#scene-motion { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
#scene-footage { position: fixed; inset: auto 0 0 auto; width: 2px; height: 2px; opacity: 0.001; z-index: -4; pointer-events: none; }
.player-landscape { z-index: -3; background-size: cover; background-position: center; filter: blur(24px) brightness(0.73); transform: scale(1.15); }
.player-image { z-index: -2; object-fit: cover; }
#player[data-custom-video-playing] #scene-footage { inset: 0; width: 100%; height: 100%; opacity: 1; z-index: -2; object-fit: cover; }
#player[data-custom-video-playing][data-quiet] #scene-footage { object-fit: contain; }
#player::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, #0b1613bf, transparent 25%), linear-gradient(0deg, #081410f5, #0d1a16aa 25%, transparent 55%); }
.player-top, .player-bottom { width: min(100%, 725px); margin-inline: auto; padding-inline: clamp(14px, 4vw, 30px); }
.player-top { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.player-bottom { padding-block: 14px 12px; }
.player-title { display: flex; align-items: center; justify-content: space-between; gap: 0.55rem; }
.player-title > div { min-width: 0; overflow-wrap: anywhere; }
.player-title h2 { margin: 0; font: 500 clamp(2.03rem, 7vw, 3.56rem)/1.13 var(--serif); letter-spacing: 0.05em; }
.player-mood { margin: 0.4rem 0 0; color: #d8e2d3; font-size: 0.9rem; overflow-wrap: anywhere; }
.play-button { display: inline-grid; place-items: center; flex: none; width: 56px; height: 56px; border: 1px solid #f4f5e0; border-radius: 50%; background: #ecf0dc; color: #23382a; }
#play-icon { font-size: 1.1rem; line-height: 1; }
.player-status { min-height: 1.3em; margin: 0.42rem 0 0.55rem; color: #d6e1d3; font-size: 0.83rem; }
.mix-card { min-width: 0; margin: 0; padding: 1px 10px; background: #132a21ef; border: 1px solid #94b09a5c; border-radius: 10px; }
.mix-row { display: grid; grid-template-columns: 3.5rem minmax(116px, 1fr) minmax(65px, 1fr); gap: 0.42rem; align-items: center; min-height: 53px; }
.mix-row + .mix-row { border-top: 1px solid #819c873e; }
.mix-row label, #detail-label { color: var(--muted); font-size: 0.83rem; }
.mix-track-count { display: block; color: var(--muted); font-size: 0.7rem; }
.mix-row select { appearance: none; min-width: 0; min-height: 44px; padding: 0.25rem 1.05rem 0.25rem 0.23rem; color: var(--text); border: none; background: linear-gradient(45deg, transparent 50%, #c1cbbc 50%) right 8px center/4px 4px no-repeat, linear-gradient(135deg, #c1cbbc 50%, transparent 50%) right 4px center/4px 4px no-repeat; font-size: 0.9rem; }
.mix-row input { width: 100%; min-height: 44px; margin: 0; accent-color: var(--accent); }
.detail-buttons { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 0.35rem; padding-block: 4px; }
.detail-buttons button { min-height: 44px; padding: 0.38rem 0.64rem; border: 1px solid #8fa9916e; border-radius: 6px; background: #254239; color: var(--text); font-size: 0.87rem; white-space: nowrap; }
.detail-buttons button[aria-pressed="true"] { color: #192f25; background: var(--accent); border-color: var(--accent); }
.mix-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.48rem; }
.scene-notes { min-width: 0; }
.tuning-note { margin: 0; color: #c7d1c4; font-size: 0.75rem; }
#footage-credit { display: inline-block; margin-top: 4px; text-underline-offset: 0.22em; }
#music-preview[aria-pressed="true"] { color: #192f25; background: var(--accent); border-color: var(--accent); }
#restore-controls { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); top: calc(10px + env(safe-area-inset-top, 0px)); }
#player[data-quiet]::after { background: none; }
#player[data-quiet] .player-top, #player[data-quiet] .player-bottom { display: none; }
#player[data-quiet] .player-image { object-fit: contain; }
.jz-healing-return { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; padding-top: 8px; }
.jz-healing-return > nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.jz-healing-return a, .jz-healing-language a { display: inline-flex; align-items: center; min-height: 44px; color: #d8e2d3; font-size: 14px; text-decoration: none; }
.jz-healing-return a:hover, .jz-healing-language a:hover { text-decoration: underline; }
.jz-healing-language { margin-left: auto; }
.jz-healing-language .jz-language-switch { display: flex; gap: 8px; align-items: center; }
.jz-healing-language [aria-current="page"] { color: var(--accent); font-weight: 650; }
.jz-healing-player-language { padding: 0 8px; border-radius: 8px; background: #172922e8; }
.player-top { align-items: flex-start; gap: 6px; }
.player-top .player-actions { justify-content: flex-end; flex-wrap: wrap; }
#player[data-quiet] .jz-healing-player-language { display: none; }

dialog { width: min(390px, calc(100% - 28px)); padding: 19px; border: 1px solid var(--edge); border-radius: 12px; color: var(--text); background: var(--surface); }
dialog::backdrop { background: #0b1712b8; }
dialog h2 { margin: 0; font-size: 1.3rem; }
dialog p { color: var(--muted); min-height: 2.4em; }
progress { display: block; width: 100%; accent-color: var(--accent); }
.dialog-actions { display: flex; gap: 8px; justify-content: end; margin-top: 14px; }
#sound-dialog { width: min(570px, calc(100% - 22px)); max-height: min(710px, calc(100dvh - 26px)); }
.sound-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sound-heading p, #sounds-count { margin: 0.25rem 0 0.6rem; min-height: 0; font-size: 0.86rem; }
.sound-filters { display: grid; grid-template-columns: 0.9fr 1.45fr; gap: 0.4rem; }
.sound-filters select, .sound-filters input { width: 100%; min-width: 0; min-height: 44px; padding: 0.5rem; background: #172a21; border: 1px solid var(--edge); border-radius: 6px; color: var(--text); }
.sound-list { padding: 0; margin: 0; list-style: none; max-height: min(460px, 60dvh); overflow-y: auto; }
.sound-track { width: 100%; display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--edge); padding: 0.65rem 0.35rem; text-align: start; }
.sound-track:hover { background: #30463a; }
.sound-track strong, .sound-track small { display: block; }
.sound-track small { color: var(--muted); font-size: 0.8rem; }
.track-play { flex: none; color: var(--accent); font-size: 0.85rem; }
@media (max-width: 400px) {
  .mast-actions .utility { padding-inline: 0.45rem; }
  .player-actions .glass-button { padding-inline: 0.48rem; }
  .mix-footer .scene-notes { max-width: 48%; }
}
@media (max-width: 350px) {
  .brand { gap: 0.35rem; font-size: 1.25rem; }
  .brand img { width: 28px; height: 28px; }
}

@media (max-width: 660px) {
  .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { aspect-ratio: 1.2; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .player-bottom { padding-top: 5px; }
  .mix-card { max-width: 450px; }
  .mix-row { min-height: 46px; }
  .player-title h2 { font-size: 2rem; }
}

.sound-discovery { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 20px 22px; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); }
.sound-discovery h2 { margin: 0; font: 500 1.35rem/1.45 var(--serif); }
.sound-discovery p { margin: 6px 0 0; color: var(--muted); font-size: 1rem; }
.sound-discovery button { flex: none; }
.music-only-hint { margin: 8px 0 0; color: var(--accent); font-size: 0.875rem; line-height: 1.6; }
.music-style-details { margin-top: 9px; color: var(--text); border: 1px solid #94b09a5c; border-radius: 8px; background: #132a21ed; font-size: 0.875rem; }
.music-style-details summary { min-height: 44px; padding: 11px 13px; cursor: pointer; color: var(--accent); }
.music-style-details summary:focus-visible { outline: 2px solid #f2d8a1; outline-offset: 3px; }
.music-style-content { padding: 0 13px 12px; max-height: min(230px, 32dvh); overflow-y: auto; overflow-wrap: anywhere; }
.music-style-content dl { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 7px 12px; margin: 0; line-height: 1.7; }
.music-style-content dt { color: var(--muted); }
.music-style-content dd { margin: 0; min-width: 0; }
.music-style-content p { margin: 0; line-height: 1.7; }
.music-style-content .music-sources-title { margin-top: 12px; color: var(--muted); }
.music-source-links { margin: 3px 0 0; padding-left: 1.2rem; }
.music-source-links a { display: inline-block; padding-block: 7px; color: var(--accent); text-underline-offset: 3px; }
#sound-dialog { display: flex; flex-direction: column; padding: 20px; overflow: hidden; }
#sound-dialog:not([open]) { display: none; }
.sound-heading, .sound-filters, .sound-options, #sounds-count { flex: none; }
.sound-heading h2 { font-size: 1.4rem; }
.sound-heading p, #sounds-count { font-size: 0.875rem; }
.sound-options { display: flex; flex-wrap: wrap; column-gap: 22px; row-gap: 0; margin-top: 8px; font-size: 0.875rem; color: var(--muted); }
.sound-options label { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.sound-options input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.sound-list { min-height: 0; max-height: none; overscroll-behavior: contain; }
.sound-track { align-items: flex-start; gap: 12px; padding: 16px 4px; }
.track-information { display: block; min-width: 0; overflow-wrap: anywhere; }
.sound-track strong { font-size: 1rem; line-height: 1.55; }
.sound-track small { margin-top: 3px; font-size: 0.875rem; line-height: 1.65; }
.sound-track .track-origin { color: var(--text); }
.sound-track .track-arrangement, .sound-track .track-production { margin-top: 6px; }
.track-play { padding-top: 2px; font-size: 0.875rem; }
.mix-footer { flex-wrap: wrap; }
.mix-footer .scene-notes { flex: 1 1 200px; max-width: none; }
.mix-footer .player-actions { margin-left: auto; flex: none; }
.tuning-note { font-size: 0.875rem; line-height: 1.65; }

@media (max-width: 480px) {
  .sound-discovery { display: block; padding: 18px; }
  .sound-discovery button { margin-top: 14px; }
  #sound-dialog { padding: 16px; }
  .sound-filters { grid-template-columns: 1fr; }
  .sound-options { column-gap: 14px; }
  .sound-track { gap: 9px; }
  .music-style-content dl { grid-template-columns: 3.7rem minmax(0, 1fr); gap: 7px 9px; }
  .player-top .glass-button, .mix-footer .glass-button, .mast .utility,
  .sound-discovery button, #featured-open { white-space: normal; overflow-wrap: anywhere; }
  .mix-footer .player-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
  .mast .brand { min-width: 0; flex-shrink: 1; overflow-wrap: anywhere; }
}
