:root {
  color-scheme: dark;
  --bg: #111316;
  --panel: #191b1f;
  --panel-deep: #15171a;
  --line: #2a2d32;
  --text: #f4f3f0;
  --muted: #a9a9ad;
  --orange: #ff7447;
  --orange-text: #ff8b64;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-family: Inter, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--text);
  accent-color: var(--orange);
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .36; }
a { color: inherit; text-decoration: none; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
[hidden] { display: none !important; }
svg { width: 19px; height: 19px; display: block; }
:where([data-icon]) { display: inline-grid; place-items: center; flex: none; }
.sr-only, .skip-link:not(:focus) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip-link { position: absolute; z-index: 10; top: 8px; left: 8px; padding: .65rem 1rem; background: var(--orange); color: #16120f; }
.shell { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }

.masthead { background: #141619; border-bottom: 1px solid #282a2e; }
.header-inner { display: flex; align-items: center; gap: 42px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; white-space: nowrap; font-size: 1.02rem; font-weight: 800; letter-spacing: .045em; }
.brand img { display: block; }
.brand small, .footer small { display: block; margin-top: 3px; color: var(--muted); font: 600 .73rem/1 var(--mono); letter-spacing: .13em; }
.header-inner nav { display: flex; align-self: stretch; gap: 25px; align-items: stretch; }
.nav-link { display: inline-flex; align-items: center; position: relative; padding: 0; border: 0; background: none; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.nav-link:hover, .nav-link.current { color: var(--text); }
.nav-link.current::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--orange); }
.saved-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-inline-start: auto; padding: 7px 11px; min-height: 38px; border: 1px solid var(--line); border-radius: 7px; background: #1b1d21; color: #e2e1de; font-size: .88rem; white-space: nowrap; }
.saved-button:hover, .saved-button[aria-pressed="true"] { color: var(--orange-text); border-color: #79513f; }
.saved-button svg { width: 16px; height: 16px; }
.saved-count { color: var(--muted); font: .77rem var(--mono); }

.hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 356px; margin-top: 27px; overflow: hidden; border: 1px solid #3b302d; border-radius: 15px; background: #1a1718 radial-gradient(ellipse at 84% 59%, #693b2c 0%, #2d2422 30%, #191719 62%); }
.hero::before, .hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero::before { background: url('./hero.webp') center 57% / cover no-repeat; }
.hero::after { background: linear-gradient(90deg, rgba(17,17,20,.96) 0%, rgba(17,17,20,.85) 32%, rgba(17,17,20,.16) 68%, rgba(17,17,20,.18) 100%), linear-gradient(0deg, #131215ad, transparent 30%); }
.hero-copy { z-index: 1; padding: 35px 48px; }
.hero-kicker { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; color: var(--orange-text); font: 600 .81rem/1.3 var(--mono); letter-spacing: .13em; }
.hero-kicker span { width: 17px; height: 1px; background: currentColor; }
.hero h1 { margin: 0; font-size: clamp(2.85rem, 5.2vw, 4.9rem); line-height: 1.12; font-weight: 900; letter-spacing: -.045em; }
.hero h1 span { display: block; margin-top: 4px; color: var(--orange); }
.hero-description { max-width: 32rem; margin: 16px 0 23px; color: #e0dad8; font-size: 1rem; line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 14px; border: 1px solid transparent; border-radius: 7px; font-size: .9rem; font-weight: 750; white-space: nowrap; }
.primary { background: var(--orange); color: #18100c; }
.primary:hover { background: #ff916f; }
.secondary { border-color: #585057; background: #221f22c9; color: #efebe8; }
.secondary:hover { background: #30292c; border-color: #8d6e64; }
.primary svg, .secondary svg { width: 17px; height: 17px; }
.hero-wave { position: absolute; right: 3.8%; top: 21%; width: 54%; height: 55%; opacity: .83; pointer-events: none; }
.hero-spec { position: absolute; right: 23px; bottom: 19px; display: flex; gap: 7px; align-items: center; border: 1px solid #665049; background: #181518d9; border-radius: 5px; padding: 7px 9px; font: 600 .72rem var(--mono); letter-spacing: .03em; color: #f3e8e1; }
.hero-spec span { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.hero-spec b { color: #bdb0ad; font-weight: 400; }

.library { margin-top: 34px; scroll-margin-top: 18px; }
.library-top { display: flex; gap: 18px; justify-content: space-between; align-items: center; }
.library-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.library-heading h2 { margin: 0; font-size: 1.7rem; font-weight: 820; letter-spacing: .015em; }
.library-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.search { display: flex; gap: 8px; align-items: center; width: min(100%, 315px); padding: 0 11px; min-height: 40px; border: 1px solid #36393e; border-radius: 7px; background: var(--panel); color: #a2a4a9; }
.search:focus-within { border-color: var(--orange); }
.search input { border: 0; width: 100%; min-width: 0; height: 38px; outline: none; background: transparent; color: var(--text); font-size: .9rem; }
.search input::placeholder { color: #9c9da3; }
.search svg { width: 17px; height: 17px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 17px 0 16px; }
.filter { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: #d2d2d5; white-space: nowrap; font-size: .9rem; }
.filter:hover { border-color: #686971; }
.filter[aria-pressed="true"] { background: #3b2520; border-color: #95533e; color: #ffad91; }
.filter svg { width: 16px; height: 16px; }
.filter small { color: var(--muted); font: .75rem var(--mono); }
.filter[aria-pressed="true"] small { color: #f2b7a6; }

.catalog { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-deep); }
.track-grid { display: grid; grid-template-columns: 46px minmax(170px, 1.25fr) minmax(140px, 1fr) 66px 84px; align-items: center; gap: 12px; padding-inline: 16px; }
.catalog-head { min-height: 37px; border-bottom: 1px solid var(--line); background: #1c1e22; color: var(--muted); font-size: .82rem; letter-spacing: .035em; }
.track-label { grid-column: 2; }
.action-label { justify-self: end; padding-right: 10px; }
.length-label { justify-self: center; }
.tracks { margin: 0; padding: 0; list-style: none; }
.track { min-height: 68px; }
.track + .track { border-top: 1px solid #25282d; }
.track:hover, .track.is-current { background: #1d1e22; }
.track.is-current { box-shadow: inset 2px 0 var(--orange); }
.play-button, .icon-button { display: inline-grid; place-items: center; border-radius: 7px; padding: 0; }
.play-button { width: 37px; height: 37px; border: 1px solid #56372f; color: var(--orange-text); background: #322520; }
.play-button:hover, .play-button.active { background: var(--orange); color: #18100c; border-color: var(--orange); }
.play-button svg { width: 16px; height: 16px; }
.track-name { display: grid; gap: 4px; padding-block: 8px; min-width: 0; }
.track-name strong { font-size: .99rem; font-weight: 740; overflow-wrap: anywhere; }
.track-name small { display: flex; gap: 7px; align-items: baseline; color: var(--muted); font-size: .78rem; }
.track-name .track-en { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-name small span:first-child { white-space: nowrap; color: #f3a68c; }
.track-name small i { font-style: normal; color: #777981; }
.wave { display: block; width: 100%; max-width: 340px; height: 30px; }
.duration { justify-self: center; font: .83rem var(--mono); color: #ceced1; }
.actions { display: flex; justify-self: end; gap: 6px; }
.icon-button { width: 35px; height: 35px; border: 1px solid transparent; background: transparent; color: #b5b5bb; }
.icon-button:hover { color: var(--text); border-color: #3b3e44; background: #27292e; }
.icon-button[aria-pressed="true"] { color: var(--orange-text); }
.icon-button[aria-pressed="true"] svg { fill: currentColor; }
.download { background: #22242a; border-color: #34363e; }
.empty { min-height: 230px; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; }
.empty > span { color: var(--orange-text); }
.empty h3, .empty p { margin: 0; }
.empty p { color: var(--muted); }
.empty button { margin-top: 5px; }
.pages { display: flex; justify-content: center; gap: 6px; margin-top: 17px; }
.pages button { min-width: 36px; height: 36px; padding: 0 8px; font: .85rem var(--mono); border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.pages button:not(:disabled):hover, .pages button[aria-current="page"] { border-color: #95533e; color: var(--orange-text); background: #34241f; }
.pages button svg { margin: auto; width: 16px; height: 16px; }
.pages .page-overflow { display: grid; place-content: center; min-width: 25px; color: var(--muted); }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 40px; padding-block: 19px 29px; border-top: 1px solid var(--line); color: #d6d5d5; font-size: .89rem; }
body:has(.player:not([hidden])) .footer { padding-bottom: 102px; }

.player { position: fixed; z-index: 4; inset: auto 0 0; background: #1a1b20f5; border-top: 1px solid #51413e; box-shadow: 0 -8px 30px #0005; }
.player-inner { min-height: 66px; display: grid; grid-template-columns: 38px minmax(105px, .65fr) 37px minmax(60px, 2fr) 37px minmax(65px, 122px) 35px; align-items: center; gap: 12px; }
.now-playing { min-width: 0; }
.now-playing strong, .now-playing small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing strong { font-size: .9rem; }
.now-playing small { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.player-time { color: var(--muted); font: .78rem var(--mono); text-align: center; }
.player input { min-width: 0; width: 100%; cursor: pointer; margin: 0; }
.volume { display: flex; gap: 7px; align-items: center; color: var(--muted); }
.volume svg { width: 16px; height: 16px; }
.toast { position: fixed; z-index: 5; top: 82px; right: max(22px, calc((100% - 1200px) / 2)); max-width: min(90vw, 390px); padding: 11px 15px; border: 1px solid #665048; border-radius: 8px; background: #262026; box-shadow: 0 7px 24px #0006; }
dialog { width: min(450px, calc(100% - 34px)); border: 1px solid #51423d; border-radius: 13px; padding: 23px; background: #1d1f23; color: var(--text); }
dialog::backdrop { background: #08080bd1; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; }
.dialog-icon { width: 43px; height: 43px; color: var(--orange-text); background: #3d2822; border-radius: 9px; }
dialog h2 { margin: 17px 0 10px; font-size: 1.45rem; }
dialog p { color: #d4d3d5; line-height: 1.65; margin: 8px 0; }
dialog .dialog-meta { color: var(--muted); font-size: .85rem; margin: 15px 0; }

@media (max-width: 860px) {
  .shell { width: calc(100% - 44px); }
  .hero-copy { padding-inline: 34px; }
  .track-grid { grid-template-columns: 40px minmax(140px, 1.25fr) minmax(80px, .75fr) 50px 76px; gap: 9px; padding-inline: 11px; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 60px; gap: 13px; }
  .brand { font-size: .89rem; gap: 7px; }
  .brand img { width: 31px; height: 31px; }
  .brand small { font-size: .65rem; }
  .header-inner nav { margin-left: auto; gap: 9px; }
  .header-inner nav a { display: none; }
  .saved-button { margin-left: 0; min-height: 36px; gap: 5px; padding-inline: 7px; }
  .saved-button span:nth-child(2) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .hero { min-height: 350px; margin-top: 15px; }
  .hero::before { background-position: 61% 55%; }
  .hero::after { background: linear-gradient(90deg, #161519ed, #1915169c 67%, #1c12194d), linear-gradient(0deg, #131215bd, transparent 54%); }
  .hero-copy { padding: 25px 20px 49px; }
  .hero h1 { font-size: clamp(2.55rem, 10vw, 3.4rem); }
  .hero-description { margin: 12px 0 16px; }
  .hero-wave { right: 0; top: 9%; width: 80%; height: 49%; opacity: .43; }
  .hero-spec { right: 11px; bottom: 10px; }
  .library { margin-top: 25px; }
  .library-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .search { width: 100%; }
  .filters { gap: 6px; margin: 12px 0; }
  .filter { min-height: 35px; gap: 5px; padding: 5px 7px; font-size: .82rem; }
  .filter svg { width: 14px; height: 14px; }
  .track-grid { grid-template-columns: 34px minmax(0, 1fr) 42px 66px; gap: 7px; padding-inline: 8px; }
  .wave, .wave-label { display: none; }
  .catalog-head { min-height: 32px; }
  .track { min-height: 62px; }
  .play-button { width: 33px; height: 34px; }
  .track-name strong { font-size: .91rem; }
  .track-name small { font-size: .72rem; gap: 5px; }
  .track-name .track-en, .track-name small i { display: none; }
  .track .icon-button { width: 31px; height: 33px; }
  .actions { gap: 4px; }
  .duration { font-size: .72rem; }
  .player-inner { grid-template-columns: 34px minmax(0, 1fr) 34px 72px 32px; gap: 7px; min-height: 60px; padding: 7px 0; }
  .player #elapsed, .player #total-time { display: none; }
  .player-close { width: 31px; }
}
@media (max-width: 360px) {
  .hero-copy { padding-inline: 13px; }
  .hero-actions { gap: 6px; }
  .hero-actions > * { padding-inline: 8px; }
  .player-inner { grid-template-columns: 34px minmax(0, 1fr) 40px 52px 32px; }
}
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }
