:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #101014;
  color: #faf9fb;
  --accent: #f34e58;
  --muted: #b0aeb8;
  --line: #2c2c35;
  --surface: #1a1a21;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 2px solid #ff9a9f; outline-offset: 4px; }
.shell { width: min(calc(100% - 72px), 1280px); margin-inline: auto; }
.site-header { border-bottom: 1px solid #24242c; background: #141419; }
.mast-nav { min-height: 72px; display: flex; gap: 38px; align-items: center; }
.wordmark { display: inline-flex; gap: 10px; align-items: center; font-size: 1.3rem; font-weight: 850; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: white; background: var(--accent); }
.mark::after, .play-icon { content: ""; display: inline-block; width: 0; height: 0; border-block: 6px solid transparent; border-left: 9px solid currentColor; margin-left: 2px; }
.mast-nav nav { display: flex; gap: 26px; font-size: .93rem; align-items: center; white-space: nowrap; }
.mast-nav nav a { color: var(--muted); }
.mast-nav nav a:hover, .mast-nav nav [aria-current] { color: #fff; }
.mast-nav nav [aria-current] { position: relative; font-weight: 700; }
.mast-nav nav [aria-current]::after { content: ""; position: absolute; height: 3px; background: var(--accent); border-radius: 3px; inset: auto 0 -25px; }
.primary, .secondary { display: inline-flex; gap: 10px; align-items: center; justify-content: center; min-height: 44px; border-radius: 9px; padding: 10px 17px; font-weight: 730; font-size: .95rem; }
.primary { color: #15090b; background: #ff6870; border: 1px solid transparent; }
.primary:hover { background: #ff8087; }
.secondary { background: #25242d; border: 1px solid #45444d; color: #fff; }
.secondary:hover { background: #363541; }
.shade-night { background: radial-gradient(ellipse at 78% 28%, #55323f, #141922 68%); }
.shade-sea { background: radial-gradient(ellipse at 78% 28%, #366b70, #18252b 68%); }
.bottom-nav { display: none; }
@media (max-width: 720px) {
  .bottom-nav { display: flex; position: fixed; inset: auto 0 0; z-index: 5; background: #18181ef5; border-top: 1px solid var(--line); align-items: center; justify-content: space-evenly; padding: 5px 8px max(5px,env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 1px; min-width: 64px; min-height: 43px; background: transparent; border: 0; color: var(--muted); font-size: .78rem; padding: 3px 9px; }
  .bottom-nav [aria-current] { color: #ff9da4; }
  .bottom-nav span { font-size: 1.14rem; line-height: 1.1; }
  body:has(.bottom-nav) { padding-bottom: max(48px,calc(48px + env(safe-area-inset-bottom))); }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 32px); }
  .mast-nav { gap: 18px; min-height: 58px; }
  .mast-nav nav { gap: 16px; font-size: .88rem; }
  .mast-nav nav [aria-current]::after { inset-block-end: -18px; }
  .wordmark { font-size: 1.1rem; gap: 8px; }
  .mark { width: 28px; height: 28px; }
}

.viewer-entry {
  margin-inline-start: auto;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  background: #211f28;
  color: #f9ecf2;
}

.discovery .viewer-entry,
.utility + .viewer-entry {
  margin-inline-start: 0;
}

.viewer-dialog {
  width: min(100% - 28px, 420px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1d1b23;
  color: #fff;
}

.viewer-dialog::backdrop { background: #08060bb8; }
.viewer-dialog-heading, .viewer-actions { display: flex; justify-content: space-between; align-items: center; gap: 9px; flex-wrap: wrap; }
.viewer-dialog-heading h2 { margin: 0; font-size: 1.2rem; }
.viewer-dialog label { display: grid; gap: 6px; margin: 14px 0; }
.viewer-dialog input { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 7px; color: inherit; background: #111017; }
.viewer-hint { color: var(--muted); font-size: .86rem; }
#viewer-notice { color: #ffb3b8; }

@media (max-width: 720px) {
  .utility + .viewer-entry { margin-inline-start: auto; }
}

.recharge-dialog { width: min(100% - 28px, 500px); }
.recharge-balance { font-weight: 700; color: #ffc0c7; margin: 15px 0 0; }
.recharge-offers { display: grid; gap: 9px; }
.recharge-offer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: start; padding: 12px 14px; color: #fff; background: #28242e; border: 1px solid #47404e; border-radius: 9px; }
.recharge-offer:hover { background: #362a38; border-color: #c26976; }
.recharge-offer small { color: #d4cbd8; }
.recharge-offer span { text-align: end; font-weight: 700; }
.recharge-order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#recharge-order-id { overflow-wrap: anywhere; }
#recharge-notice { color: #ffd2d7; }
#recharge-notice:empty { display: none; }
#recharge-history { margin-top: 16px; color: #e2d7e4; }
#recharge-history ul { padding-inline-start: 20px; }

.history-dialog { width: min(100% - 28px, 600px); }
.history-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.history-tabs .secondary, .history-play { padding: 7px 11px; min-height: 36px; }
.history-tabs [aria-pressed=true] { border-color: var(--accent); color: #ffc0c7; }
.history-records { display: grid; gap: 8px; padding: 0; list-style: none; }
.history-records li { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.history-records small { color: var(--muted); grid-column: 1 / -1; }
.history-records .history-id { overflow-wrap: anywhere; }
.history-value { grid-column: 2; grid-row: 1; }
.history-credit { color: #96e1b2; }
.history-play { justify-self: start; }

.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  grid-column: 1 / -1;
  align-items: center;
}
